]> git.saurik.com Git - bison.git/blame - ChangeLog
More fixes related to last two patches.
[bison.git] / ChangeLog
CommitLineData
d5eb0826
JD
12009-08-25 Joel E. Denny <jdenny@clemson.edu>
2
3 More fixes related to last two patches.
4 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
5 defined.
6 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix
7 yytable comments: zero indicates syntax error not default
8 action.
9 * data/glr.c (yyis_pact_ninf): Rename to...
10 (yypact_value_is_default): ... this.
11 (yyisDefaultedState): Update for rename.
12 (yyis_table_ninf): Rename to...
13 (yytable_value_is_error): ... this, and check for value zero
14 besides just YYTABLE_NINF.
15 (yygetLRActions): Check for default value from yypact. It
16 appears that this check is always performed before this function
17 is invoked, and so adding the check here is probably redundant.
18 However, the code may evolve after this subtlety is forgotten.
19 Also, update for rename to yytable_value_is_error. Because that
20 macro now checks for zero, a different but equivalent branch of
21 the if-then-else here is evaluated.
22 (yyreportSyntaxError): Update for rename to
23 yytable_value_is_error. The zero condition was mishandled
24 before.
25 (yyrecoverSyntaxError): Update for renames. No behavioral
26 changes.
27 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
28 New function.
29 (yy_table_value_is_error_): New function.
30 (parse): Use new functions where possible. No behavioral
31 changes.
32 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
33 The zero condition was mishandled before.
34 * data/yacc.c (yyis_pact_ninf): Rename to...
35 (yypact_value_is_default): ... this.
36 (yyis_table_ninf): Rename to...
37 (yytable_value_is_error): ... this, and check for value zero
38 besides just YYTABLE_NINF.
39 (yysyntax_error): Update for rename to yytable_value_is_error.
40 The zero condition was mishandled before.
41 (yyparse): Update for renames. No behavioral changes.
42 * src/tables.h: Improve comments about yypact, yytable, etc.
43 more. Most importantly, say yytable value of zero means syntax
44 error not default action.
45
1fa30307
JD
462009-08-25 Joel E. Denny <jdenny@clemson.edu>
47
48 Fix %error-verbose for conflicts resolved by %nonassoc.
49 * NEWS (2.5): Document.
50 * data/glr.c (yyreportSyntaxError): Fix this by checking
51 yyis_table_ninf.
52 * data/yacc.c (yysyntax_error): Likewise.
53 * data/lalr1.cc (yysyntax_error_): Fix this by checking
54 yytable_ninf_.
55 * data/lalr1.java (yysyntax_error): Likewise.
56 * tests/conflicts.at (%nonassoc and eof): Update expected output
57 and remove FIXME.
58
77373efa
JD
592009-08-25 Joel E. Denny <jdenny@clemson.edu>
60
61 Some code and documentation improvements.
62 * data/c.m4 (b4_table_value_equals): New macro to capture
63 some repeated code.
64 * data/glr.c (yyis_pact_ninf): Use it here.
65 (yyis_table_ninf): Likewise.
66 (yyreportSyntaxError): Improve internal comments.
67 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
68 Use it everywhere possible.
69 (yyis_table_ninf): Likewise.
70 (yysyntax_error): Improve internal comments.
71 * data/lalr1.cc (yysyntax_error_): Likewise.
72 * data/lalr1.java (yysyntax_error): Likewise.
73 * src/tables.h: Improve comments about yypact, yytable, etc.
74
890ab17c
JD
752009-08-21 Joel E. Denny <jdenny@clemson.edu>
76
77 Use locale when quoting.
78 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
79 quote rather than implementing quoting here.
80
c5196098
EB
812009-08-20 Eric Blake <ebb9@byu.net>
82
aa50ba7b
EB
83 Make previous patch more robust.
84 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
85 argmatch.h.
86 (output_skeleton): Use it.
87 Suggested by Akim Demaille.
88
c5196098
EB
89 Import latest m4/m4.m4.
90 * submodules/autoconf: Update to autoconf 2.64.
91 * configure.ac (M4_GNU_OPTION): New define.
92 * src/output.c (output_skeleton): Use it to resolve FIXME.
93 * NEWS: Mention this.
94
39fb7e62
JD
952009-08-19 Joel E. Denny <jdenny@clemson.edu>
96
97 Fix complaints about escape sequences.
98 Discussed starting at
99 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
100 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
101 For a \0 and similar escape sequences meaning the null
102 character, report an invalid escape sequence instead of an
103 invalid null character because the latter does not actually
104 appear in the user's input.
105 In all escape sequence complaints, don't escape the initial
106 backslash, and don't quote when the sequence appears at the end
107 of the complaint line unless there's whitespace that quotearg
108 won't escape.
109 Consistently say "invalid" not "unrecognized".
110 Consistently prefer "empty character literal" over "extra
111 characters in character literal" warning for invalid escape
112 sequences; that is, consistently discard those sequences.
113 * tests/input.at (Bad escapes in literals): New.
114
c33bc800
AD
1152009-08-19 Akim Demaille <demaille@gostai.com>
116
117 doc: fixes.
118 * doc/bison.texinfo: Fix minor Texinfo errors.
119
8fbbeba2
AD
1202009-08-19 Akim Demaille <demaille@gostai.com>
121
122 doc: %initial-action to initialize yylloc.
123 Reported by Bill Allombert.
124 * doc/bison.texinfo: Set fill-column to 76.
125 (Location Type): Document the use of %initial-action to initialize
126 yylloc.
127
1874a474
JD
1282009-08-18 Joel E. Denny <jdenny@clemson.edu>
129
130 maint: update for gnulib's recent update-copyright changes
131 * gnulib: Update.
132 * .x-update-copyright (COPYING): Add as it's no longer implied
133 when .x-update-copyright is present.
134 * cfg.mk (update-copyright-local): Remove, now ignored.
135 (update-copyright): Declare update-b4-copyright as a dependency.
136
f4bfd5a9
AD
1372009-08-17 Akim Demaille <demaille@gostai.com>
138
139 build: require gettext 0.17.
140
141 Suggested by Bruno Haible.
142 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
143 * configure.ac: require gettext 0.17 to ensure compatibility with
144 gnulib.
145
2509eba6
AD
1462009-08-17 Akim Demaille <demaille@gostai.com>
147
148 build: lower gettext requirements.
149
150 Bison was uselessly requiring the formatstring macros from
151 gettext, which resulted in mo files not being installed on systems
152 that perfectly supported Bison mo files. Lower the requirement.
153 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
154
aa50ba7b
EB
155 * configure.ac: Require need-ngettext instead of
156 need-formatstring-macros.
157 Reported by Martin Jabocs.
158 Suggested by Bruno Haible.
159 * INSTALL: Restructure.
160 (Internationalization): New.
2509eba6 161
314542f9
JD
1622009-08-14 Joel E. Denny <jdenny@clemson.edu>
163
164 maint: fix use of copyright year intervals.
165 * gnulib: Update.
166 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
167 as now recommended in gnulib/NEWS.
168 * build-aux/update-b4-copyright: Fix.
169 * cfg.mk (update-copyright-env): Configure update-copyright.
170
24985964
JD
1712009-08-13 Joel E. Denny <jdenny@clemson.edu>
172
173 Make it easier to write deterministic tests.
174 Continues Akim's work from his 2009-06-10 commits.
175 * src/reader.c (check_and_convert_grammar): Don't add any
176 symbols after the first symbols_do invocation.
177 * src/symtab.c (symbols_sorted): New static global.
178 (user_token_number_redeclaration): Update comments.
179 (symbol_from_uniqstr): If a new symbol is being created, assert
180 that symbols_sorted hasn't been allocated yet.
181 (symbols_free): Free symbols_sorted.
182 (symbols_cmp, symbols_cmp_qsort): New functions.
183 (symbols_do): Sort symbol_table into symbols_sorted on first
184 invocation.
185 * tests/input.at (Numbered tokens): Recombine tests now that the
186 output should be deterministic across multiple numbers.
187
47076da5
AD
1882009-08-12 Akim Demaille <demaille@gostai.com>
189
190 distcheck: fix.
191
aa50ba7b 192 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
47076da5 193
36dfe466
JD
1942009-08-10 Joel E. Denny <jdenny@clemson.edu>
195
196 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
197
07c0db18
JD
1982009-08-10 Joel E. Denny <jdenny@clemson.edu>
199
200 Miscellaneous code readability improvements.
201
202 * src/reader.c (reader): Move %define front-end variable
203 defaults and checking into...
204 (prepare_percent_define_front_end_variables): ... this new
205 function.
206
207 * src/scan-gram.l (INITIAL): For consistency with string
208 literals, don't store open quote on character literal. It's
209 discarded before returning anyway.
210 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
211 Make length test more readable, and make the character stored
212 for an empty literal more obvious while consistent with the
213 previous behavior.
214
215 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
216 USER_NUMBER_HAS_STRING_ALIAS throughout.
217 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
218 that is repeated in symtab.h. Improve argument names to make it
219 clear which side of the symbol-string alias pair is which.
220 (symbol_check_alias_consistency): Improve local variable names
221 for the same purpose.
222 * src/symtab.h (struct symbol): Make comments about aliases
223 clearer.
224 (symbol_make_alias): Improve comments and argument name.
225 * src/output.c (token_definitions_output): Update for rename to
226 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
227
1a323c2f
AR
2282009-08-08 Alex Rozenman <rozenman@gmail.com>
229
230 Convert "misleading reference" messages to warnings.
231 * src/scan-code.l: New function 'show_sub_messages', more
232 factoring.
233 * tests/named-ref.at: Adjust tests.
234
38609c34
JD
2352009-08-06 Joel E. Denny <jdenny@clemson.edu>
236
237 maint: run "make update-copyright"
238
642f240e
JD
2392009-08-06 Joel E. Denny <jdenny@clemson.edu>
240
241 maint: make update-b4-copyright easier to use
242 * build-aux/update-b4-copyright: In warnings, report line
243 numbers rather than character positions.
244 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
245 that update-copyright runs it.
246 * gnulib: Update.
247
d0caad01
JD
2482009-08-05 Joel E. Denny <jdenny@clemson.edu>
249
250 maint: clean up update-b4-copyright code
251 * build-aux/update-b4-copyright: Do not accept 2-digit
252 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
253 Don't accept a `[' in a b4_copyright argument.
254 Format code more consistently.
255 Don't assume b4*copyright never occurs.
256
ac2def56
JD
2572009-08-04 Joel E. Denny <jdenny@clemson.edu>
258
259 maint: automate b4_copyright updates.
260 * Makefile.am (update-b4-copyright): New target rule.
261 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
262 * build-aux/update-b4-copyright: New.
263 * data/yacc.c: Remove stray characters around b4_copyright
264 invocations.
265
dbbb64f0
JD
2662009-08-04 Joel E. Denny <jdenny@clemson.edu>
267
268 maint: automate annual package-wide copyright-year update.
269 * .x-update-copyright: New.
270 * Makefile.am (EXTRA_DIST): Remove maint.mk.
271 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
272 update-copyright. Remove gnumakefile, which is implied by
273 maintainer-makefile.
274 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
275 * gnulib: Update.
276 * maint.mk: Remove, now copied from gnulib.
277 * examples/extexi: Add missing "(C)" in copyright statement so
278 update-copyright can recognize it.
279 * src/LR0.h: Likewise.
280 * src/print.h: Likewise.
281 * src/print_graph.h: Likewise.
282 * src/gram.c: Add missing comma in copyright statement.
283 * src/gram.h: Likewise.
284
bfa018d4
JD
2852009-08-04 Joel E. Denny <jdenny@clemson.edu>
286
287 Fix "make distcheck".
288 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
289 of just calc.stamp.
290
4521fcdf
JD
2912009-08-01 Joel E. Denny <jdenny@clemson.edu>
292
293 Pacify "gcc -Wunused" for the input function from Flex.
294 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
295 and later.
296 * src/scan-code.l: Add "%option noinput", which I cannot find in
297 the Flex manual, but which Flex has supported since at least as
298 far back as 2.5.4. However, if any of our developers still use
299 Flex 2.5.4, they'll need to stop configuring with
300 --enable-gcc-warnings because "%option noinput" didn't work
301 correctly until Flex 2.5.6.
302 * src/scan-gram.l: Likewise.
303 * src/scan-skel.l: Likewise.
304
992e874a
AR
3052009-07-31 Alex Rozenman <rozenman@gmail.com>
306
307 Fix --enable-gcc-warnings problems.
308 * src/reader.c: Adjust variable names.
309 * src/scan-code.l: Fix prototypes and adjust names.
310 * src/named-ref.c: Remove redundant "if".
311
a1ed2b71
JD
3122009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
313
314 Fix a --enable-gcc-warnings problem.
315 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
316 variable.
317
cbc6a70e 3182009-07-24 Alex Rozenman <rozenman@gmail.com>
1e20ad11
AR
319
320 Fix some memory leaks.
321 * src/named-ref.c: Add a pointer check (named_ref_free).
322 * src/scan-code.l: New function (variant_table_free). Called in
323 code_scanner_free.
324 * src/symlist.c: Call to named_ref_free (symbol_list_free).
325
ac9b0e95
JD
3262009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
327
328 Warn about character literals not of length one.
329 * NEWS (2.5): Document.
330 * src/scan-gram.l (INITIAL): Remove comment that we don't check
331 the length.
332 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
333 * tests/input.at (Bad character literals): New test group.
334
2de160e1
JD
3352009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
336
337 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
338
cba97506
JD
3392009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
340
341 Some M4 cleanup in the testsuite.
342 Suggested by Eric Blake at
343 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
344 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
345 complicate the code by distinguishing between a missing value
346 and an empty string value for an optional argument. This fix is
347 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
348 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
349 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
350 arguments are not needed because of the following changes.
351 Fix stale comments.
352 Bison developers should use GNU M4 and should not use
353 POSIXLY_CORRECT when building the test suite, so do not
354 complicate the code by avoiding $10 and above.
355 Do not quote an empty string value for an optional argument, and
356 do not distinguish between a missing value and an empty string
357 value.
358
62eb2d1b
JD
3592009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
360
361 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
362
620b2e36
JD
3632009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
364
365 Revert unnecessary column realignment in --help output.
366 Reported by Akim Demaille at
367 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
368 * src/getargs.c (usage): Here.
369
cbc6a70e 3702009-07-04 Alex Rozenman <rozenman@gmail.com>
dad6544d
AR
371
372 Alphabetical order in src/Makefile.am.
373 * src/Makefile.am: Adjust.
374
cbc6a70e 3752009-07-04 Alex Rozenman <rozenman@gmail.com>
d5e8574b
AR
376
377 Style changes and factoring.
378 * src/named-ref.h: Add comments.
379 * src/parse-gram.y: Readability and style changes.
380 * src/reader.c: Factoring: assign_named_ref function.
381 * src/scan-code.l: Factoring and style changes. Rename
382 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
383 Use "unsigned" type for variant index. Improve readablity.
384 * src/scan-gram.l: Change error messages and add comments.
385 * src/symlist.h: symbol_list_null: New function decl.
386 * src/symlist.c: symbol_list_null: Implement here.
387 * tests/named-refs.at: Adjust for new error messages.
388
ae09ec85
EB
3892009-06-29 Eric Blake <ebb9@byu.net>
390
391 scan-code: avoid compiler warnings
392 * src/scan-code.l (parse_named_ref): Use correct specifiers.
393
80d653fd
AD
3942009-06-29 Akim Demaille <demaille@gostai.com>
395
396 build: avoid concurrent extraction of calc++.
397 * examples/calc++/Makefile.am (calc.stamp): New.
398 Depend on it to create the sources of calc++ so that concurrent
399 builds don't launch several "extexi" in parallel.
400 Not only this is inefficient, this also builds incorrect sources
401 with several extractions mixed together.
402
7685e2f7
AR
4032009-06-27 Alex Rozenman <rozenman@gmail.com>
404
405 Implement support for named symbol references.
406 * src/parse-gram.y: Add new syntax (named_ref.opt).
407 * src/reader.c: Store named refs in symbol lists.
408 * src/reader.h: New argument for symbol_append and
409 action_append functions.
410 * src/scan-code.h: Add new field (named_ref) into
411 code_props data structure. Keeps named ref of midrule
412 actions.
413 * src/scan-code.l: Support for named refs in semantic
414 action code. New function 'parse_named_ref'.
415 * src/scan-gram.l: Support bracketed id.
416 * src/symlist.c: Store named refs in symbol lists.
417 * src/symlist.h: New field in symbol list: named_ref.
418 * src/named-ref.h: New file, a struct for named_ref.
419 * src/named-ref.cp: New file, named_ref_new function.
420 * src/local.mk: Add two new files.
421 * tests/testsuite.at: Include new test group:
422 * tests/named-refs.at: this new file.
423
67f8cf51
AD
4242009-06-25 Akim Demaille <demaille@gostai.com>
425
426 hash: check insertion for memory exhaustion.
427 * src/uniqstr.c (uniqstr_new): New.
428
83b66ddd
AD
4292009-06-11 Akim Demaille <demaille@gostai.com>
430
431 style changes.
432 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
433 * src/print-xml.c: Style changes.
434 * tests/conflicts.at: Comment changes.
435
517cb0ad
AD
4362009-06-11 Akim Demaille <demaille@gostai.com>
437
438 xml: beware of user strings used to give a %prec to rules.
439 * tests/conflicts.at (%prec with user strings): New.
440 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
441 XML output.
442
75c7a52a
AD
4432009-06-11 Akim Demaille <demaille@gostai.com>
444
445 hash: check insertion for memory exhaustion.
446 * src/muscle-tab.c (muscle_insert, muscle_grow)
447 * src/state.c (state_hash_insert): Check the return value of
448 hash_insert.
449
66ed9753
AD
4502009-06-10 Akim Demaille <demaille@gostai.com>
451
452 deterministic test suite.
453 Some consistency checks on symbols are performed after all the
454 symbols were read, by an iteration over the symbol table. This
455 traversal is nondeterministic, which can be a problem for test
456 cases.
457 Avoid this.
458 Addresses another form of nondeterminism reported by Joel E. Denny.
459 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
460
461 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
462 test in two.
463 Use different file names for the three tests to make the
464 maintenance easier.
465
ed15d907
AD
4662009-06-10 Akim Demaille <demaille@gostai.com>
467
95d176ff
AD
468 deterministic user-token-number redeclaration errors.
469 Address nondeterminism reported by Joel E. Denny.
470 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
471
472 * src/uniqstr.h: Comment changes.
473 * src/location.h (boundary_cmp, location_cmp): New.
474 * src/symtab.c (user_token_number_redeclaration): New.
475 (symbol_translation): Use it.
476 * tests/input.at (Numbered tokens): Adjust the expected output.
477
4782009-05-25 Akim Demaille <demaille@gostai.com>
479
ed15d907 480 gnulib: update.
aa50ba7b
EB
481 * gnulib: Update to latest.
482 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
483 * m4/.gitignore: Regen.
484 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
485 Call xalloc_die on hash_insert failures.
486 Requested by the new __warn_unused_result__ attribute of
487 hash_insert.
ed15d907 488
e3a33f7c
JD
4892009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
490
491 Convert multiple variable definition warnings to complaints.
492 * NEWS (2.5): Add a new entry for that change.
493 * doc/bison.texinfo (Decl Summary): Update %define entry.
494 (Bison Options): Update -D/--define/-F/--force-define entry.
495 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
496 * src/muscle_tab.h (muscle_percent_define_insert): Update
497 comments.
498 * tests/input.at (`%define errors'): Update.
499 (`%define, --define, --force-define'): Update.
500
34d41938
JD
5012009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
502
503 -F/--force-define and relative %define/-D/--define priorities.
504 * NEWS (2.5): Add documentation to -D/--define entry.
505 * build-aux/cross-options.pl: Hard-code association of
506 --force-define with %define.
507 * doc/bison.texinfo (Decl Summary): In %define entry,
508 cross-reference command-line options.
509 (Bison Options): Add documentation to -D/--define entry.
510 (Option Cross Key): Widen column for --force-define row.
511 * src/getargs.c (usage): Document -F/--force-define. Realign
512 options in output.
513 (short_options, long_options, getargs): Parse -F/--force-define,
514 and update muscle_percent_define_insert invocation.
515 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
516 (muscle_percent_define_insert): Add argument with that type.
517 * src/muscle_tab.c (muscle_percent_define_insert): Implement
518 -F/--force-define behavior and priorities.
519 * src/parse-gram.y (prologue_declaration): Update
520 muscle_percent_define_insert invocations.
521 * tests/input.at (`%define, --define'): Rename to...
522 (`%define, --define, --force-define'): ... this and extend.
523
246c4efa
JD
5242009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
525
526 Update some comments to make sense for -D.
527 * data/bison.m4 (b4_check_user_names): In header comments, say
528 "user occurrence" instead of "grammar occurrence".
529 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
530 (muscle_percent_code_grow): Likewise just for consistency.
531
531683e7
JD
5322009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
533
534 * data/c++.m4: Update copyright year.
535
e7bfa8b7
JD
5362009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
537
538 * data/c++.m4 (b4_namespace_close): Simplify slightly.
539
8c221795
JD
5402009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
541
542 Handle a trailing `:' in a user-supplied C++ namespace better.
543 * data/c++.m4 (b4_namespace_close): Don't let it be printed
544 among the closing braces here. This fix might make the
545 generated code easier to debug, but otherwise it should be
546 insignificant because a trailing `:' is a C++ error already.
547
c8bf65f0
AD
5482009-05-19 Akim Demaille <demaille@gostai.com>
549
550 remove useless variable.
551 * src/getargs.c (skeleton_arg): Remove now useless variable.
552 Should help the compiler see that this printf-like call is sane.
553
7ac45a46
AD
5542009-05-11 Akim Demaille <demaille@gostai.com>
555
556 doc: use C++ headers.
557 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
558 headers.
559
601bdfab
AD
5602009-05-05 Akim Demaille <demaille@gostai.com>
561
562 fix hexadecimal token number support.
563 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
564
d19123e6
AD
5652009-05-05 Akim Demaille <demaille@gostai.com>
566
567 tests: check token numbers.
568 * tests/input.at (Numbered tokens): New.
569
ecdfea9a
AD
5702009-05-04 Akim Demaille <demaille@gostai.com>
571
572 bison: catch bad symbol names.
573 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
574 * tests/input.at: Adjust.
575
43e6aea5
AD
5762009-05-04 Akim Demaille <demaille@gostai.com>
577
578 space changes.
579 * src/scan-gram.l: Untabify to be robust to zealous editors.
580
c046698e
AD
5812009-05-04 Akim Demaille <demaille@gostai.com>
582
583 identifiers: dashes are letters.
584 Dashes can now start identifiers (symbols and directives).
b10dd689 585
c046698e
AD
586 * src/scan-gram.l ({letter}): Add dash.
587 ({id}): Remove it.
588 * tests/input.at (Symbols): Adjust.
589 Remove stray comment.
590 * tests/regression.at (Invalid inputs): Adjust error message.
591 * doc/bison.texinfo (Symbols): Update.
592
966aba65
JD
5932009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
594
595 Declare %code to be a permanent feature.
596 * NEWS (2.4.2): Here.
597 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
598 experimental.
599 (Decl Summary): Likewise.
600
812775a0
JD
6012009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
602
603 Convert underscores to dashes in some %define variable names.
604 For now, just api.push-pull and lr.keep-unreachable-states.
605 Maintain old names for backward compatibility.
606 * NEWS (2.5): Document.
607 * data/c.m4 (b4_identification): Update comment.
608 * data/yacc.c: Update access.
609 * doc/bison.texinfo: Update.
610 * etc/bench.pl.in (bench_grammar): Update use.
611 * src/files.c (tr): Move to...
612 * src/getargs.c, src/getargs.h (tr): ... here because I can't
613 think of a better place to expose it. My logic is that, for all
614 uses of tr so far, command-line arguments can be involved, and
615 getargs.h is already included.
616 * src/main.c (main): Update access.
617 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
618 variable names to new variable names before assigning value.
619 * src/reader.c (reader): Update setting default.
620 * tests/calc.at: Update uses.
621 * tests/conflicts.at (Unreachable States After Conflict
622 Resolution): Update use.
623 * tests/input.at (%define enum variables): Update use.
624 (%define backward compatibility): New test group.
625 * tests/push.at: Update uses.
626 * tests/reduce.at: Update uses.
627 * tests/torture.at: Update uses.
628
1c4aa81d
JD
6292009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
630
631 Set all front-end %define defaults in one place.
632 * src/main.c (main): Move lr.keep_unreachable_states default...
633 * src/reader.c (reader): ... to here.
634
1d0f55cc
JD
6352009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
636
637 Rename lr.default_reductions to lr.default-reductions.
638 * NEWS (2.5): Here.
639 * doc/bison.texinfo: Here.
640 * src/lalr.c (initialize_LA): Here.
641 * src/print.c (print_reductions): Here.
642 * src/reader.c (reader): Here.
643 * src/tables.c (action_row): Here.
644 * tests/input.at (%define enum variables): Here.
645 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
646
0b593457
JD
6472009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
648
649 Pacify ./configure --enable-gcc-warnings.
650 * tests/input.at (Symbols): Prototype yyerror and yylex.
651
0939aa2d
AD
6522009-04-21 Akim Demaille <demaille@gostai.com>
653
654 tests: check the use of dashes and periods in symbols.
655 * tests/input.at (Symbol): New test group.
656
0b593457 6572009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
ae618dcc
JD
658
659 Document how `%define "var" "value"' is not M4-friendly.
660 * src/parse-gram.y (variable): In comments here.
661
0b593457 6622009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
6789b8bd
JD
663
664 Add copyright updates missed during previous cherry pick.
665 * src/output.c: Here.
666 * src/parse-gram.y: Here.
667 * src/scan-gram.l: Here.
668
663ce7bb
AD
6692009-04-20 Akim Demaille <demaille@gostai.com>
670
671 variables: accept dashes.
672 * src/scan-gram.l ({id}): Also accept dashes after the initial
673 letter.
674 ({directive}): Use {id}.
675 * src/parse-gram.y: Comment and formatting changes.
676 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
677 symbols.
678 * src/complain.h, src/complain.c (yacc_at): New.
679 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
680 symbol names.
681 * src/output.c (token_definitions_output): Do not #define token
682 names with dashes.
683
379261b3
JD
6842009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
685
686 Clean up recent patches a little.
687 Reported by Akim Demaille.
688 * doc/bison.texinfo (Understanding): Fix typos.
689 * src/print.c (print_reductions): Don't use negated variable.
690
25029e16
JD
6912009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
692
693 List accepted values for a %define enum variable with an invalid value.
694 Suggested by Akim Demaille at
695 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
696 * data/bison.m4 (_b4_percent_define_check_values): Implement.
697 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
698 * tests/input.at (%define lr.default_reductions invalid values): Merge
699 into...
700 (%define enum variables): ... here, and update output.
701
620b5727
JD
7022009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
703
704 Rename "default rule" to "default reduction".
705 This includes changing variable names in code, changing
706 comments, and renaming %define lr.default_rules to %define
707 lr.default_reductions.
708 * NEWS (2.5): Update IELR documentation.
709 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
710 Adjust YYDEFACT and yydefact_ documentation.
711 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
712 and lr.type documentation. Make some other wording
713 improvements.
714 (Glossary): Adjust cross-references and Default Reduction
715 definition.
716 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
717 Remove a confusing comment pointed out by Akim Demaille.
718 (initialize_LA): Adjust code.
719 * src/print-xml.c (print_reductions): Adjust code.
720 * src/print.c (print_reductions): Adjust code.
721 * src/reader.c (reader): Adjust code.
722 * src/tables.c (action_row): Adjust code.
723 (token_actions): Adjust code.
724 * src/tables.h: Adjust YYDEFACT documentation.
725 * tests/input.at (%define lr.default_rules invalid values):
726 Rename test group to...
727 (%define lr.default_reductions invalid values): ... this, and
728 update grammar file and expected output.
729 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
730 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
731
34a6c2d1
JD
7322009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
733
734 Document %define lr.type and lr.default_rules.
735 * NEWS (2.5): Add an entry.
736 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
737 besides just LALR(1) and GLR(1).
738 * doc/bison.texinfo (Introduction): Likewise.
739 (Language and Grammar): Bison is no longer limited to LALR(1)
740 restrictions.
741 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
742 when trying to distinguish from GLR. Talk about LR(1) grammars
743 rather than LALR(1) grammars.
744 (Decl Summary): In %define api.push_pull entry, say it applies
745 to deterministic parsers in C rather than LALR(1) parsers in C.
746 Add lr.default_rules entry.
747 Add lr.type entry.
748 (Mystery Conflicts): Bison is no longer limited to LALR(1)
749 restrictions.
750 (Generalized LR Parsing): Same changes as for the previous GLR
751 section.
752 (Memory Management): Say deterministic rather than LALR(1).
753 (Understanding): Correct some bison output.
754 Index discussion of "accepting state".
755 Say deterministic rather than LALR(1).
756 (Bison Options): In --yacc entry, say deterministic rather than
757 LALR(1).
758 In --report, --graph, and --xml entries, just don't mention
759 LALR(1).
760 (C++ Parsers): Say deterministic rather than LALR(1).
761 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
762 (Glossary): Add Accepting State, Consistent State, Default Rule,
763 and IELR(1) definitions.
764 In Generalized LR (GLR) definition, make same changes as in
765 previous GLR sections.
766 In LALR(1) definition, say Bison uses LALR(1) by default rather
767 than implying Bison is limited to LALR(1).
768 (LocalWords): Add IELR.
769
f805dfcb
JD
7702009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
771
772 Finish implementing %define lr.type.
773 Its value can be "LALR", "IELR", or "canonical LR".
774 * lib/timevar.def (TV_IELR_PHASE1): New var.
775 (TV_IELR_PHASE2): New var.
776 (TV_IELR_PHASE3): New var.
777 (TV_IELR_PHASE4): New var.
778 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
779 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
780 Sbitset.h, ielr.h, and ielr.c.
781 * src/getargs.h, src/getargs.c (enum trace, trace_args,
782 trace_types): Add trace_ielr.
783 * src/lalr.h, src/lalr.c (ngotos): Export it.
784 (F): Rename to...
785 (goto_follows): ... this, update all uses, and export it.
786 (set_goto_map): Export it.
787 (map_goto): Export it.
788 (compute_lookahead_tokens): Don't free goto_follows yet. Now
789 handled in ielr.
790 (initialize_LA): Export it. Move lookback allocation to...
791 (lalr): ... here because, for canonical LR, initialize_LA must
792 be invoked but lookback and much of the rest of LALR isn't
793 needed.
794 * main.c (main): Instead of lalr, invoke ielr, which invokes
795 lalr.
796 * src/reader.c (reader): Default lr.type to "LALR".
797 Default lr.default_rules to "accepting" if lr.type is "canonical
798 LR". Leave the default as "all" otherwise.
799 Check for a valid lr.type value.
800 * src/state.h, src/state.c (struct state_list): Add state_list
801 member.
802 (state_new): Initialize state_list member to NULL.
803 (state_new_isocore): New function, exported.
804 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
805 exercises all values of lr.type.
806 (GNU AWK Grammar): Rename test group to...
807 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
808 AT_TEST_EXISTING_GRAMMAR.
809 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
810 (GNU pic Grammar): Rename test group to...
811 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
812 AT_TEST_EXISTING_GRAMMAR.
813 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
814 all values of lr.type.
815 (Single State Split): New test groups using AT_TEST_LR_TYPE.
816 (Lane Split): Likewise.
817 (Complex Lane Split): Likewise.
818 (Split During Added Lookahead Propagation): Likewise.
819
166366b2
JD
8202009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
821
822 Add new files for IELR and canonical LR implementation.
823 * src/AnnotationList.c: New.
824 * src/AnnotationList.h: New.
825 * src/InadequacyList.c: New.
826 * src/InadequacyList.h: New.
827 * src/Sbitset.c: New.
828 * src/Sbitset.h: New.
829 * src/ielr.c: New.
830 * src/ielr.h: New.
831
03c07b03
JD
8322009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
833
834 Implement %define lr.default_rules.
835 Its value describes the states that are permitted to contain
836 default rules: "all", "consistent", or "accepting".
837 * src/reader.c (reader): Default lr.default_rules to "all".
838 Check for a valid lr.default_rules value.
839 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
840 is "accepting", then only mark the accepting state as
841 consistent.
842 (initialize_LA): Tell state_lookahead_tokens_count whether
843 lr.default_rules is "accepting".
844 * src/tables.c (action_row): If lr.default_rules is not "all",
845 then disable default rules in inconsistent states.
846 * src/print.c (print_reductions): Use this opportunity to
847 perform some assertions about whether lr.default_rules was
848 obeyed correctly.
849 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
850 helps with checking the parser tables for a grammar.
851 * tests/input.at (%define lr.default_rules invalid values): New
852 test group.
853 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
854 AT_TEST_TABLES_AND_PARSE.
855 (`no %define lr.default_rules'): New test group generated by
856 AT_TEST_LR_DEFAULT_RULES.
857 (`%define lr.default_rules "all"'): Likewise.
858 (`%define lr.default_rules "consistent"'): Likewise.
859 (`%define lr.default_rules "accepting"'): Likewise.
860
44c124a3
AD
8612009-04-20 Akim Demaille <demaille@gostai.com>
862
863 Consistently refer to Yacc, not YACC.
864 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
865
42660736
JD
8662009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
867
868 Pacify make maintainer-check-posix.
869 * tests/input.at (%define, --define): Move bison command-line
870 options before grammar file name.
871
a2d05674
JD
8722009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
873
874 Document semicolon warnings.
875 * NEWS (2.5): Here.
876
c4fae1ef
AD
8772008-12-08 Akim Demaille <demaille@gostai.com>
878
879 Fix portability issue in the test suite.
880 * tests/local.at (AT_MATCHES_CHECK): New.
881 Based on Perl instead of Sed. Sed has too many portability
882 pitfalls, not ever Sed is GNU Sed.
883 * tests/actions.at (Fix user actions without a trailing semicolon):
884 Use it.
885
42f4393a
DJ
8862008-12-07 Di-an Jan <dianj@freeshell.org>
887
888 Implement the FIXME that ends an user action with a semicolon
889 if it seems necessary.
890 * src/scan-code.l (flex rules section): Flag cpp directive from
891 any `#' to the first unescaped end-of-line. Semicolon is not
892 needed after `;', `{', '}', or cpp directives and is needed after
893 any other token (whitespaces and comments have no effect).
894 * tests/actions.at (Fix user actions without a trailing semicolon):
895 New test.
896 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
897 to make user actions complete statements.
898 Adjust column numbers in error messages.
899 * tests/regression.at (Fix user actions without a trailing semicolon):
900 Remove. Covered by new test.
901
bd5df716
AD
9022009-04-14 Akim Demaille <demaille@gostai.com>
903
904 doc: minor fixes.
905 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
906 (Table of Symbols): Remove duplicate entry for %debug.
907
7ba0d59d
EB
9082009-04-10 Eric Blake <ebb9@byu.net>
909
910 submodules: update to latest
911 * submodules/autoconf: Use latest upstream Autoconf.
912
b4d71a96
EB
9132009-04-06 Eric Blake <ebb9@byu.net>
914
915 Work around autoconf 2.63b bug in testsuite.
916 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
917 autoconf bug related to # in test.
918
4ecd3681
JD
9192009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
920
921 * NEWS (2.5): Describe new -D/--define feature.
922
c65e5292
AD
9232008-11-10 Akim Demaille <demaille@gostai.com>
924
925 --trace=muscles
926 * src/getargs.h, src/getargs.c (trace_muscle): New.
927 (trace_types, trace_args): Support it.
928 * src/output.c (output_skeleton): Use it.
929
96002de2
AD
9302008-11-10 Akim Demaille <demaille@gostai.com>
931
932 muscles_output.
933 * src/output.c (muscles_output): New, extracted from...
934 (output_skeleton): here.
935 Adjust.
936
fadb13b5
AD
9372008-11-21 Akim Demaille <demaille@gostai.com>
938
939 Display the changes in cross-options.texi.
940 * build-aux/cross-options.pl ($sep): New, to separate items.
941 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
942 the changes.
943
72183df4
DJ
9442008-11-20 Di-an Jan <dianj@freeshell.org>
945
946 Improves options in the manual.
947 * doc/bison.texinfo (-g, -x): Add space before argument.
948 (Option Cross Key): Implement FIXME: listing directives also.
949 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
950 (Short Option): Special case -d. Put arguments inside @option.
fadb13b5 951 (Bison Directive): Add column, automatically extracted from
72183df4
DJ
952 src/scan-gram.l (actual name passed as the first argument)
953 with special case for %define.
954 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
955 to build-aux/cross-options.pl.
956 * src/getargs.c (usage): Document limitations of cross-options.pl.
957 * src/scan-gram.l: Likewise.
958
e80b068c
AD
9592009-02-25 Akim Demaille <demaille@gostai.com>
960
961 Copyright years.
962 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
963
e3ee30b8
AD
9642008-12-08 Akim Demaille <demaille@gostai.com>
965
966 Install autoconf as a submodule to get m4sugar.
967 * .gitmodules: Add submodules/autoconf.
968 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
969 submodules/autoconf.
970
c4eb1e84
JD
9712008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
972
973 Simplify last patch slightly.
974 * src/getargs.c (getargs): Here.
975
10fa0146
JD
9762008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
977
978 Fix last warning from --enable-gcc-warnings.
979 * src/getargs.c (getargs): Don't assign const address to non-const
980 pointer.
981
6f5be1ab
DJ
9822008-11-17 Di-an Jan <dianj@freeshell.org>
983
984 Handle --enable-gcc-warnings.
985 * src/getargs.c (command_line_location): Set parameters to void.
986
11c4e57d
AD
9872008-11-11 Akim Demaille <demaille@gostai.com>
988
989 AT_FULL_COMPILE.
990 * tests/actions.at, tests/regression.at: Use it.
991
e186a284
AD
9922008-11-07 Akim Demaille <demaille@gostai.com>
993
994 Pass command line location to skeleton_arg and language_argmatch.
995 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
996 The location argument is now mandatory.
997 Adjust all dependencies.
998 (getargs): Use command_line_location.
999
e14c6831
AD
10002008-11-07 Akim Demaille <demaille@gostai.com>
1001
1002 -D, --define.
1003 * src/getargs.c (usage): Document -D.
1004 Fix help string for --locations.
1005 (command_line_location): New.
1006 (short_options, long_options, getargs): Support -D, --define.
1007 (getargs): Move -d support at the right place.
1008 * doc/bison.texinfo (Bison Options): Update.
1009 * tests/input.at (%define, --define): New.
1010
75c21b61
AD
10112008-11-07 Akim Demaille <demaille@gostai.com>
1012
1013 Initialize the muscle table before parsing the command line.
1014 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1015 (getargs): Define file_name.
1016 * src/main.c (main): Initialize muscle_tab before calling
1017 getargs.
1018 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1019 its value is not available yet.
1020
33d2a860
AD
10212008-11-09 Akim Demaille <demaille@gostai.com>
1022
1023 Require the generation of parse-gram.output.
1024 * src/Makefile.am (YACC): Pass --report=all.
1025
006faedf
JD
10262009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1027
1028 * NEWS (2.5): New stub.
1029
ecd1b61c
JD
10302009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1031
1032 Fix options documentation.
1033 * build-aux/cross-options.pl: As in --help output, write optional
1034 arguments as [=ARG] not =[ARG].
1035 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1036
f67c4037
AD
10372008-11-07 Akim Demaille <demaille@gostai.com>
1038
1039 Fix --help.
1040 * src/getargs.c (usage): Fix help string for -W.
1041
0213d651
AD
10422008-11-07 Akim Demaille <demaille@gostai.com>
1043
1044 Handle more general types of option arguments.
1045 * build-aux/cross-options.pl: The argument ends at the first
1046 space, not the first non-symbol character.
1047 Use @var for each word appearing the argument description.
1048
c19178bf
JD
10492009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1050
1051 Remove spurious initial empty lines.
1052 * data/location.cc: End the @output lines with an @.
1053
0d2b2ab0
AD
10542008-11-04 Akim Demaille <demaille@gostai.com>
1055
1056 Remove spurious initial empty lines.
1057 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1058 * data/yacc.c: End the @output lines with an @.
1059
8ba62e3e
JD
10602009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1061
1062 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1063 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1064 requirements for a correct m4 are stricter.
1065 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
1066 * configure.ac: Update to use AC_PROG_GNU_M4.
1067 Reported by Eric Blake.
1068
5bc993d9
JD
10692009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1070
1071 Help with updating web manual.
1072 * HACKING: Incorporate instructions from gnulib/doc/README.
1073 * bootstrap.conf (gnulib_modules): Add gendocs.
1074
580c075d
JD
10752009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1076
1077 Fix strange %define locations for default values.
1078 Reported by Akim Demaille at
1079 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1080 and discussed again starting at
1081 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1082 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1083 because location information is bogus.
1084 Use angle brackets to delimit fake file name because square brackets
1085 look like underexpanded m4. Choose a better fake file name.
1086 Use negative line numbers.
1087 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1088 * src/location.c (location_print): If line for a boundary is negative,
1089 only print that boundary's file name.
1090 * src/location.h: Document that.
1091 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1092 defaults): Update output.
1093
5d3a1ecb
AD
10942008-11-07 Akim Demaille <demaille@gostai.com>
1095
1096 Locations without columns for command line arguments.
1097 * src/location.c (location_print): Don't display negative columns.
1098 * src/location.h: Document this.
1099
015e86a7
JD
11002009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1101
1102 Add reminder about uploading public key to keys.gnupg.net.
1103 * HACKING (Release Procedure): Here.
1104
c1455bab
AD
11052009-03-31 Akim Demaille <demaille@gostai.com>
1106
1107 bootstrap: --help to stdout.
1108 * bootstrap (usage): Don't send --help to stderr.
1109 Use a here doc instead of a long string.
1110
2075a82a
AD
11112009-03-31 Akim Demaille <demaille@gostai.com>
1112
1113 bootstrap: README-hacking no longer exists
1114 * bootstrap (checkout_only_file): Set to HACKING.
1115
26fccd4d
AD
11162009-03-26 Akim Demaille <demaille@gostai.com>
1117
1118 doc: merge HACKING and README-hacking.
1119 Two files is confusing.
1120 Reported by Alexandre Duret-Lutz.
5bc993d9 1121
26fccd4d
AD
1122 * README-hacking: Merge into...
1123 * HACKING (Working from the repository): here.
1124
6469c4d7
AD
11252009-03-26 Akim Demaille <demaille@gostai.com>
1126
1127 doc: update README-hacking.
1128 * README-hacking: We now use git and git submodules.
1129 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1130
b328890a
AD
11312009-03-26 Akim Demaille <demaille@gostai.com>
1132
1133 lalr1.cc: avoid GCC 4.3 warnings.
1134 GCC 4.3 now warns about "a || b && c" and asks for explicit
1135 parentheses.
1136 Reported by Alexandre Duret-Lutz.
1137 * data/location.cc: Update copyright years.
1138 (Position::operator==): Use parens to make precedence explicit.
1139 Compare lines and columns first, as they are more likely to be
1140 different, and they are faster to compare.
1141
f3079439
AD
11422009-03-26 Akim Demaille <demaille@gostai.com>
1143
1144 gnulib: update.
1145 * gnulib: Update to latest.
1146 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
1147 use +=.
1148
8defe11b
AD
11492009-01-08 Akim Demaille <demaille@gostai.com>
1150
1151 Fix grep portability issues.
1152 Grep on Solaris does not support -q.
1153 Reported by Summum Bonum.
5bc993d9 1154
8defe11b
AD
1155 * NEWS: Add a stub for 2.4.2.
1156 * THANKS: Add Summum Bonum.
1157 * tests/atlocal.in (EGREP): New.
1158 (CC, CXX, XSLTPROC): Make it possible to override them via
1159 envvars.
1160 * tests/java.at: Use $EGREP instead of egrep.
1161 Use AT_CHECK's ignore instead of grep's -q.
1162
41930e7a
JD
11632008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1164
1165 Version 2.4.1.
1166 * NEWS: Set version and date.
1167 * lib/Makefile.am: Update copyright year.
1168 * tests/atlocal.in: Update copyright year.
1169
d07932ef
JD
11702008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1171
1172 Semicolon feature removal is not about future language support.
1173 * NEWS: The semicolon feature is no longer active for newer languages,
1174 so don't claim that it causes trouble for them.
1175
0364b334
JD
11762008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1177
1178 * gnulib: Update submodule to HEAD.
1179
876fd835
AD
11802008-12-09 Akim Demaille <demaille@gostai.com>
1181
1182 Update data/README.
1183 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1184
bee1df15
EB
11852008-12-05 Eric Blake <ebb9@byu.net>
1186
1187 Build testsuite with newer autoconf.
1188 * tests/output.at (m4_expand): Don't override in newer autoconf,
1189 where the underlying implementation changed.
1190 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1191 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1192 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1193 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1194 since some of them contain unbalanced ')'.
1195
7e6d1e22
JD
11962008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1197
1198 * NEWS: Clarify a little.
1199
a957d06c
JD
12002008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1201
1202 * NEWS: Update for recent changes.
1203
462503f8
JD
12042008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1205
1206 Fix unexpanded macros in GLR defines file.
1207 Reported by Csaba Raduly at
1208 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1209 * THANKS (Csaba Raduly): Add.
1210 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1211 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1212 lexer in a separate module that includes the defines file.
1213 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
1214 source.
1215 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1216 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1217 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1218 (AT_DATA_SOURCE_PROLOGUE): New.
1219 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1220 (AT_DATA_SOURCE): New.
1221 (AT_FULL_COMPILE): New, copied from master branch and extended to
1222 support an additional source file.
1223
bf151b75
JD
12242008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1225
1226 Don't let maintainer-*-check targets force a version update.
1227 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1228 handled.
1229
f56274a8
DJ
12302008-11-17 Di-an Jan <dianj@freeshell.org>
1231
1232 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1233 Align menus. Adjust word wrapping. Use node names for menu names.
1234 (Examples): Don't abbreviate node names.
1235 (LocalWords): Remove abbreviations.
1236 (Copying): Make description a sentence.
bf151b75 1237 (Java Action Features): Remove period to match the rest of menu.
f56274a8 1238
b5775a81
PB
12392008-11-11 Paolo Bonzini <bonzini@gnu.org>
1240
1241 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1242 * configure.ac: Adjust usage.
1243 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1244 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1245 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1246
7ed73f82
JD
12472008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1248
1249 Don't add a semicolon to actions for %skeleton or %language.
1250 It breaks Java test cases as reported by Akim Demaille.
1251 * src/scan-code.l: Implement.
1252
4b1ebc49
JD
12532008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1254
1255 Clean up %skeleton and %language priority implementation.
1256 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1257 remove static qualifier because others will soon need to see it.
1258 (language_prio): Likewise.
1259 (getargs): Use command_line_prio rather than 0.
1260 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1261 enum fields.
1262 (skeleton_prio): Extern it.
1263 (language_prio): Extern it.
1264 * src/parse-gram.y: Use grammar_prio rather than 1.
1265
738cde3e
AD
12662008-11-04 Akim Demaille <demaille@gostai.com>
1267
1268 * NEWS: Mention the trailing semicolon in action.
1269
d6fb461d
AD
12702008-11-04 Akim Demaille <demaille@gostai.com>
1271
1272 Reformat NEWS.
1273 * NEWS: Use more outline-mode markup.
1274 Suggested by Jim Meyering.
1275
14da0cdd
JD
12762008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1277
1278 Fix user actions without a trailing semicolon.
1279 Reported by Sergei Steshenko at
1280 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1281 * THANKS (Sergei Steshenko): Add.
1282 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1283 * tests/regression.at (Fix user actions without a trailing semicolon):
1284 New test case.
1285
c9ba9e59
JD
12862008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1287
1288 Initiate further development.
1289 * NEWS: Create an empty section for new entries.
1290 * gnulib: Update submodule to HEAD.
1291
bfb40910
JD
12922008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1293
1294 * NEWS: Version 2.4.
1295
241fda7a
JD
12962008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1297
1298 Prepare for next release.
1299 * NEWS: Briefly mention changes since 2.3b.
1300 * README: Say GNU m4 1.4.6, which we've been requiring in release
1301 announcements already, not 1.4.3, which breaks the build.
1302
ed4d67dc
JD
13032008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1304
1305 Say %language is experimental.
1306 We're thinking of extending it's effect on output file naming. See the
1307 thread at
1308 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1309 * NEWS: Say it's experimental.
1310 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1311 recommend it over %skeleton for now.
1312 (Bison Options): Likewise.
1313 (C++ Bison Interface): Use %skeleton not %language.
1314 (Calc++ Parser): Use %skeleton not %language.
1315 * src/getargs.c (usage): Say it's experimental.
1316
e254a580
DJ
13172008-11-01 Di-an Jan <dianj@freeshell.org>
1318 Paolo Bonzini <bonzini@gnu.org>
1319
1320 Support all Java parser class modifiers.
1321 * data/java.m4 (b4_percent_define_get3): New.
1322 (b4_final_if, b4_strictfp_if): New.
1323 * data/lalr1.java (final, strictfp, extends, implements): Support.
1324 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1325 documentation.
1326 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1327 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1328 (AT_CHECK_JAVA_GREP): New.
1329 (Java parser class modifiers): New test.
1330 (Java parser class extends and implements): New test.
1331
1332 Model exception propagation better with throws and lex_throws.
1333 * data/java.m4 (b4_list2): New.
1334 (throws): Change default.
1335 * data/lalr1.java (yyaction): Add throws.
1336 (parse): Add lex_throws in addition to throws.
1337 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1338 * tests/java.at (Java throws specifications): New test.
1339
1340 Improve documentation for Java parsers.
1341 * doc/bison.texinfo (Java Parsers): Add subsections.
1342 Don't quote first argument of %define.
1343 (Java Bison Interface): Document output files. Move documentation
1344 of parser class and merge into Java Parser Interface. Document
1345 features that error out. Document directives with no effect.
1346 Move note about Javadoc higher.
1347 (Java Semantic Values): Explicitly mention stype.
1348 Document that generic types cannot be used.
1349 (Java Location Values): Use @deftypeivar. Document constructors.
1350 Correct return value for toString.
1351 (Java Parser Interface): List undocumented constants/fields.
1352 Move documentation of fields added by %parse-param closer to list
1353 of members. Document that token names are added as fields.
1354 Document constructors accurately. Remove error method.
1355 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1356 Interface. Describe %code lexer and yylex accutately.
1357 Remove documentation that does not match the code.
1358 (Java Action Features): New.
1359 (Java Differences): Add reference. Add item on semantic values.
1360 Add note about @{ ... @}. Clarify %% epilogue placement.
1361 (Java Declarations Summary): New.
1362
1363 Fix Java skeleton.
1364 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1365 (b4_remove_comma): Quote test argument.
1366 (b4_identification): Remove "bison" field.
1367 * tests/java.at (Java parser class and package names): New test.
1368 (Java %parse-param and %lex-param): New test.
1369 (Java stype, position_class and location_class): New test.
1370
f259e4e6
PB
13712008-10-31 Di-an Jan <dianj@freeshell.org>
1372
1373 * data/lalr1.jave: Update copyright years.
1374 (YYParser): Correct name of "generated from" file in Javadoc:
1375 use b4_file_name instead of @ofile@.
1376 (Location constructor): Correct Javadoc parameter name.
1377 (yylloc): Add missing opening m4 quote after b4_location_if.
1378 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1379 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1380 (YYParser constructor): Correct Javadoc parameter name.
1381
cae5057f
JD
13822008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1383
1384 Always put auxiliary code files in the same dir as other output files.
1385 * src/files.c (compute_file_name_parts): When the user specifies
1386 --output but not --file-prefix, extract the directory prefix from the
1387 file prefix not from the grammar file name. This affects the location
1388 of files like location.hh generated by the C++ skeleton. The includes
1389 in the other output files require this fix.
1390 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1391 for expected output files.
1392 (Output files): Add a test for the above.
1393
4af432ba
JD
13942008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1395
1396 * gnulib: Update submodule to HEAD.
1397
e26d4e43
JD
13982008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1399
1400 Update copyright year.
1401 * src/files.c: Here.
1402
c0ee9e21
DJ
14032008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1404
1405 Don't overwrite the input file.
1406 * src/files.c (output_file_name_check): Fatal error if using input file
1407 for output.
1408 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1409 argument.
1410 (Conflicting output files): Add test.
1411
482dc52f
AD
14122008-10-28 Akim Demaille <demaille@gostai.com>
1413
1414 Space changes.
1415 * data/lalr1.cc: Formatting changes.
1416
52cbbe84
AD
14172008-10-28 Akim Demaille <demaille@gostai.com>
1418
1419 Don't define debugging functions when !YYDEBUG.
1420 * data/lalr1.cc (debug_stream, set_debug_stream)
1421 (debug_level_type, debug_level, set_debug_level): Don't
1422 declare them when YYDEBUG is not defined.
1423 The implementation are already YYDEBUG-aware.
1424
0925d5bf
AD
14252008-10-28 Akim Demaille <demaille@gostai.com>
1426
1427 Prefer "continue" for empty loop bodies.
1428 * etc/bench.pl.in: Use "continue" instead of {}.
1429
cf98343c
AD
14302008-10-28 Akim Demaille <demaille@gostai.com>
1431
1432 Space and comments changes.
1433 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1434 * data/c.m4, data/lalr1.cc: Space changes.
1435
9f467b7d
AD
14362008-10-28 Akim Demaille <demaille@gostai.com>
1437
1438 Make gnulib a submodule.
1439 * gnulib: New.
1440 * .gitmodules (gnulib): New.
1441
0f0e1ace
JD
14422008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1443
1444 Fix yyerror_range for user-defined location type in C++. Reported by
1445 Georg Sauthoff at
1446 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1447 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1448 * THANKS (Georg Sauthoff): Add.
1449
548e2104
JD
14502008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1451
1452 Update several administrative files mainly to facilitate releasing.
1453 * HACKING (Administrivia): Make the git-merge-changelog notes more
1454 helpful.
1455 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1456 (Release Procedure): Update for git and add numerous details that were
1457 previously missing.
1458 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1459 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1460 that announcements don't claim we bootstrapped with whatever bison
1461 happened to be in PATH. Add flex as a bootstrap tool.
1462 * Makefile.maint: Remove, previously replaced by maint.mk.
1463 * Makefile.cfg: Remove, and migrate settings to...
1464 * cfg.mk: ... here for the sake of `make announcement'.
1465 * bootstrap.conf (gnulib_modules): Add announce-gen.
1466 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1467 Berry.
1468
ddf17a6e
PB
14692008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1470
1471 Small but important bugfixes for the Java skeleton.
1472 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1473 (yy_symbol_print): Call toString on yyvaluep.
1474
e1145ad8
AD
14752008-08-29 Akim Demaille <demaille@gostai.com>
1476
1477 Clarify UPDATED use.
bee1df15 1478 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 1479 not to the release date of Bison.
bee1df15 1480 Reported by Joel E. Denny.
e1145ad8 1481
0df72d78
AD
14822008-08-29 Akim Demaille <demaille@gostai.com>
1483
1484 * README: Update FAQ pointer.
1485 Reported by Joel E. Denny.
1486
9a90b6bb
EB
14872008-08-27 Eric Blake <ebb9@byu.net>
1488
1489 Resync m4sugar from autoconf.
1490 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1491 (m4_init): Adjust to latest m4.git changes.
1492 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1493 effects.
1494 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1495 (_m4_list_cmp): Reduce side effects.
1496
65015668
AD
14972008-08-27 Akim Demaille <demaille@gostai.com>
1498
1499 Check yyerrok in calc.at.
bee1df15
EB
1500 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1501 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1502 expected.
65015668 1503
98e26a92
AD
15042008-08-27 Akim Demaille <demaille@gostai.com>
1505
1506 Support yyerrok in lalr1.cc.
1507 YYBACKUP is still to import back into lalr1.cc.
bee1df15 1508 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 1509
86c0e784
JD
15102008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1511
1512 For maintainer-check*, don't recompile for a $(VERSION) update.
1513 * cfg.mk: New file.
1514 (_is-dist-target): Override the one in GNUmakefile.
1515 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1516
88511166
JD
15172008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1518
1519 Update for recent change to gnulib.
1520 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1521 string.h now.
1522
6bbb2ed5
EB
15232008-08-15 Eric Blake <ebb9@byu.net>
1524
d67c52e8
EB
1525 Remaining m4sugar merge from autoconf.
1526 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1527 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1528 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1529 * src/output.c (output_skeleton): Tell m4 how to find it.
1530
6bbb2ed5
EB
1531 Partial m4sugar merge from autoconf: m4_map.
1532 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1533 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1534 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1535 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1536 for empty list.
1537 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1538 Likewise.
1539 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1540 declares it.
1541
8dce3875
JD
15422008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1543
1544 Keep .version and PACKAGE_VERSION in sync.
1545 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1546 dependency, and add comments justifying this in more detail. Discussed
1547 starting at
1548 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1549
882a1fbf
EB
15502008-08-06 Eric Blake <ebb9@byu.net>
1551
a3764451
EB
1552 Partial m4sugar merge from autoconf: m4_shiftn.
1553 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1554 (m4_shift2, m4_shift3): New macros.
1555 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1556 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1557 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1558 * data/java.m4 (b4_remove_comma): Likewise.
1559
882a1fbf
EB
1560 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1561 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1562 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1563 (m4_init): Consolidate wrapped text into single m4_wrap.
1564 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1565 in wrapped text.
1566
a30e920d
EB
15672008-08-05 Eric Blake <ebb9@byu.net>
1568
dfcc5959
EB
1569 Partial m4sugar merge from autoconf: builtins, version.m4.
1570 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1571 (m4_prepend): Remove, as it is unused and inherently quadratic,
1572 whereas m4_append is linear in newer m4.
1573 (m4_mkstemp): New builtin.
1574 (m4_symbols): Make rename conditional.
1575 (m4_version_prereq): Ensure fatal error if used in bison, which
1576 intentionally lacks version.m4.
1577
a30e920d
EB
1578 Fix comments in m4sugar.
1579 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1580
445b7470
JD
15812008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1582
1583 Update for recent .gitignore fix in Gnulib.
1584 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1585 anchored .gitignore entries.
1586
a1e50014
JD
15872008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1588
1589 Set gnu or gnits strictness.
1590 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1591 development and gnits strictness for releases. Based on Eric Blake's
1592 suggestion at
1593 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1594
d43f77e7
PB
15952008-07-31 Paolo Bonzini <bonzini@gnu.org>
1596
1597 * NEWS: Clarify documentation of %language.
1598
fee2ed87
PB
15992008-07-31 Paolo Bonzini <bonzini@gnu.org>
1600
1601 Support usage of git-merge-changelog.
1602 * .gitattributes: New.
1603 * HACKING: Document usage of git-merge-changelog.
1604 * bootstrap: Install git-merge-changelog entries in .git/config
1605 if appropriate.
1606
78029cd5
JD
16072008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1608
1609 Remove remaining dependence on CVS Id keyword.
1610 * ChangeLog: For the sake of people still using CVS, don't use dollars
1611 when mentioning Id.
1612 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1613 unusual anyway.
1614 * data/xslt/xml2dot.xsl: Likewise.
1615 * data/xslt/xml2text.xsl: Likewise.
1616 * data/xslt/xml2xhtml.xsl: Likewise.
1617 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1618 * doc/Makefile.am (neutralize): Remove, no longer needed.
1619 (.x.1): Don't use neutralize.
1620 (edit): Don't substitute for ID.
1621 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1622
c53d18b1
JD
16232008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1624
1625 Fix dependence on computed configure variables.
1626 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1627 $(top_srcdir)/configure.ac so that changes to computed variables, such
1628 as PACKAGE_VERSION, are seen.
1629 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1630
5523ac79
JD
16312008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1632
1633 Update copyright dates for recent changes.
1634 * Makefile.am: Here.
1635 * src/Makefile.am: Here.
1636 * src/reduce.c: Here.
1637 * tests/reduce.at: Here.
1638
8fa36911
JD
16392008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1640
1641 Use git-version-gen for version names between releases.
1642 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1643 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1644 * .prev-version: New.
1645 * .version.in: Remove.
78029cd5 1646 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
1647 revision.
1648 * GNUmakefile: Remove, now copied from Gnulib.
1649 * Makefile.am: Add code suggested by comments in
1650 build-aux/git-version-gen.
1651 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1652 .prev-version, and .version.
1653 * NEWS (2.3b+): Rename to...
1654 (?.?): ... this because we're dropping the "+" version naming scheme,
1655 but, in general, we still can't be sure of our next release name.
1656 * bootstrap: Add a quick hack to remove from .gitignore the
1657 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1658 entry. This should really be fixed in gnulib instead.
1659 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1660 * configure.ac (AC_INIT): Set version name by invoking
1661 build-aux/git-version-gen.
1662 (AC_CONFIG_FILES): Remove .version, now generated by
1663 build-aux/git-version-gen.
1664 * maint.mk: New, copied from coreutils.
1665 * doc/.cvsignore (bison.1): Add.
1666 * doc/.gitignore (/bison.1): Add.
1667 * doc/bison.1: Remove, generated.
1668 * src/.cvsignore (revision.c): Remove.
1669 * src/.gitignore (/revision.c): Remove.
1670 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1671 (BUILT_SOURCES): Remove revision.c.
1672 (revision.c): Remove.
1673 * src/getargs.c (version): Don't print revision after the VERSION.
1674 * src/revision.h: Remove.
1675
bcf07cb7
JD
16762008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1677
1678 Fix untranslatable composition of sentences. Reported by Goran
1679 Uddeborg at
1680 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1681 * THANKS (Goran Uddeborg): Add.
1682 * src/reduce.c (reduce_print): Report the number of nonterminals and
1683 rules useless in the grammar in separate sentences.
1684 * tests/reduce.at (Useless Rules): Update output.
1685 (Reduced Automaton): Likewise.
1686 (Underivable Rules): Likewise.
1687 (Empty Language): Likewise.
1688
9aacab9a
JD
16892008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1690
1691 Fix some .gitignore and .cvsignore problems.
1692 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1693 (insert_vc_ignore): ... this new function, which prepends `/' to all
1694 .gitignore entries before passing them to insert_sorted_if_absent.
1695 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1696 .cvsignore files are maintained even though Bison developers run
1697 bootstrap while using Git.
1698 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1699 unneeded by Bison.
1700 (gnulib): Add.
1701 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1702 unneeded. Reported by Eric Blake.
1703 * lib/.gitignore (/*~): Add.
1704 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1705 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1706 Blake.
1707 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1708
a9fc7990
JD
17092008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1710
1711 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1712 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1713 * bootstrap.conf (gnulib_modules): Add unsetenv.
1714 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1715 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1716 (/setenv.m4): Add.
1717 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1718 the first argument because it may become position-dependent, and unset
1719 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1720 Add comments explaining these issues in more detail.
1721
0f1d6f10
JD
17222008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1723
1724 Add .gitignore everywhere based on .cvsignore.
1725 * .gitignore: New.
1726 * build-aux/.gitignore: New.
1727 * data/.gitignore: New.
1728 * doc/.gitignore: New.
1729 * etc/.gitignore: New.
1730 * examples/.gitignore: New.
1731 * examples/calc++/.gitignore: New.
1732 * lib/.gitignore: New.
1733 * m4/.gitignore: New.
1734 * po/.gitignore: New.
1735 * runtime-po/.gitignore: New.
1736 * src/.gitignore: New.
1737 * tests/.gitignore: New.
1738
7bd1665a
JD
17392008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1740
1741 * NEWS (2.3b+): New section, empty for now.
1742 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1743
72c5b982
JD
17442008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1745
1746 * NEWS (2.3b): Update release date since there has been a delay in
1747 getting the announcements and tarballs out.
1748
bd02cd5d
JD
17492008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1750
1751 * NEWS: Version 2.3b.
1752 * configure.ac (AC_INIT): Likewise.
1753 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1754
9126263e
JD
17552008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1756
1757 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1758 been doing it for years.
1759 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1760 (Release Procedure): Add FIXME about make alpha being unmaintained.
1761
fa6aa7b3
JD
17622008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1763
1764 * data/yacc.c: Reformat m4 a little for readability.
1765 * src/lalr.c (build_relations): Correct comment.
1766
d30b312d
JMG
17672008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1768
1769 DJGPP specific issue.
1770 * djgpp/config.sed: Fixes required to run configure scripts generated
1771 by autoconf 2.62.
1772
138d4cd9
JD
17732008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1774
1775 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1776 coordinator@translationproject.org.
1777
8f7e2e1f
JD
17782008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1779
1780 * THANKS: Add Eric Blake.
1781
f55efa38
JD
17822008-04-23 Eric Blake <ebb9@byu.net>
1783
1784 Revert prior patch, by working around autoconf regression.
1785 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1786 ("Output file name: ("): Uncomment test.
1787 ("Output file name: )"): Likewise.
1788 Based on an idea from Noah Misch.
1789
096c9f9d
JD
17902008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1791
1792 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1793 2.61. Reported by Juan Manuel Guerrero at
1794 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1795 * tests/output.at ("Output file name: ("): Comment out test case for
1796 now.
1797 ("Output file name: )"): Likewise.
1798
0f664b89
JD
17992008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1800
1801 * GNUmakefile: Update git-version-gen invocation so make dist
1802 succeeds.
1803
1cfe6375
JD
18042008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1805
1806 Update to the current gnulib CVS repository, and fix trigraph handling
1807 in Bison.
1808 * bootstrap: Update gnulib CVS repository URL.
1809 (symlink_to_dir): Encapsulate the code that guarantees the destination
1810 directory exists into...
1811 (check_dst_dir): ... this new function, and...
1812 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1813 fail when copying files into lib/uniwidth/.
1814 * src/output.c (prepare_symbols): When writing yytname muscles, where
1815 symbol names will be encoded in C-string literals, tell quotearg to
1816 escape trigraphs. This used to be the default in gnulib.
1817 * tests/regression.at (Token definitions): Because of the change in
1818 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1819 escapes trigraphs in symbol names. Thus, yytname no longer has
1820 trigraphs unnecessarily doubly escaped. Update test case output.
1821 Extend test case to be sure Bison's own error messages will no longer
1822 have trigraphs in symbol names unnecessarily escaped once.
1823
74c52fc8
JD
18242008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1825
1826 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1827 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1828 * .cvsignore: Add .version.
1829 * .version.in: New.
1830 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1831 * configure.ac (AC_CONFIG_FILES): Add .version.
1832 * build-aux/.cvsignore: Add git-version-gen.
1833
8e55b3aa
JD
18342008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1835
1836 * NEWS (2.3a+): Mention that -g now takes an argument.
1837 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1838 consistency. Update the -g and -x entries now that they take
1839 arguments. Use brackets to indicate optional arguments.
1840 * src/getargs.c (usage): Explain the relationship between arguments of
1841 long and short options more completely. Document --defines and -d
1842 separately since the former takes an argument but, for POSIX Yacc, the
1843 latter does not.
1844 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 1845 (getargs): Sort cases.
8e55b3aa 1846
59c5ac72
AD
18472008-02-28 Akim Demaille <demaille@gostai.com>
1848
1849 * doc/bison.texinfo: Fix a few typos.
1850
118d4978
AD
18512008-02-28 Akim Demaille <akim@epita.fr>
1852
1853 * doc/bison.texinfo (Bison Options): Document -W.
1854 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1855
7020f1e9
AD
18562008-02-28 Akim Demaille <akim@epita.fr>
1857
1858 * src/getargs.c (short_options): Split and sort for readability.
1859 -g and -x take optional arguments, just like their long options.
1860 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1861 understand.
1862 Fix the handling of $opt which resulted in all the argument to be
1863 considered as optional.
1864
59da312b
JD
18652008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1866
1867 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1868 say its interface is experimental.
1869 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1870 Java.
1871 (Bison Options): In the -L and --language entry, mention Java.
1872 (Java Bison Interface): Say the interface is experimental.
1873 * src/getargs.c (usage): Mention -L and --language.
1874
1875 * NEWS (2.3a+): Say the push parsing interface is experimental.
1876 * doc/bison.texinfo (Push Decl): Likewise.
1877 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1878 (Push Parser Function): Likewise.
1879 (Pull Parser Function): Likewise.
1880 (Parser Create Function): Likewise.
1881 (Parser Delete Function): Likewise.
1882 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1883 yypull_parse, and yypush_parse entries.
1884
1885 * NEWS (2.3a+): Mention XML support, and say the schema is
1886 experimental.
1887 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1888 * src/getargs.c (usage): Say the XML schema is experimental.
1889
1890 * NEWS (2.3a+): Say option instead of flag.
1891
2bb3ebec
WP
18922008-02-21 Wojciech Polak <polak@gnu.org>
1893
1894 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1895 text.
1896
333e670c
JD
18972008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1898
1899 Fix impure push parser compile error reported by Bob Rossi at
1900 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1901 * data/yacc.c: Clean up whitespace in the output a little.
1902 (yypstate_allocated): Define for impure push parsers regardless of
1903 whether the pull interface is also requested.
1904 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1905 check impure push parsers without the pull interface.
1906
1907 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1908 yyerror takes arguments specified by %parse-param while yypstate_new
1909 does not.
1910 * doc/bison.texinfo (Parser Create Function): Document that
1911 yypstate_new returns 0 for multiple impure parser instances.
1912 * tests/push.at (Push Parsing: Multiple impure instances): Update
1913 expected stderr output.
1914
798096e1
JD
19152008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1916
1917 * runtime-po/POTFILES.in (push.c): Remove.
1918
9ca7f077
JD
19192008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1920
1921 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1922 * data/push.c: Rename to...
1923 * data/yacc.c: ... this, overwriting it.
1924 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1925 `%push-pull-parser' -> `%define api.push_pull "both"'.
1926 Remove old yacc.c tests, and update push.c tests to yacc.c.
1927
42ee26bb
JD
19282008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1929
1930 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1931 `"%code top" blocks' instead of `%code "top" blocks'.
1932 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1933 Clean up whitespace in the output a little.
1934
b1cc23c4
JD
19352008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1936
1937 Fix documentation problems reported by Tim Josling at
1938 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1939 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1940 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1941 integers. Explain the effect of literal string aliases on error
1942 messages. Copy token 0 documentation from the C++ skeleton
1943 documentation.
1944
ab7f29f8
JD
19452008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1946
1947 Accept a token number in a %left, %right, or %nonassoc for POSIX
1948 conformance. Reported by Tim Josling at
1949 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1950 * NEWS (2.3a+): Mention.
1951 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1952 and code numbers are treated by precedence declarations.
1953 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1954 of symbols.1.
1955 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1956 of symbol.
1957 (symbol.prec): New, just like symbol but allows INT.
1958 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1959 longer holds.
1960 * tests/regression.at (Token number in precedence declaration): New
1961 test case.
1962
a924ef36
JMG
19632008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1964
1965 DJGPP specific issues.
1966 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1967 be changed. Copyright timestamp adjusted.
1968 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1969 be changed. Copyright timestamp adjusted.
1970 * djgpp/config.site: Copyright timestamp adjusted.
1971 * djgpp/config_h.sed: Copyright timestamp adjusted.
1972 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1973 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1974 filename translation list.
1975 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1976 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1977 files shall be created. Before trying to use the temp dir where the
1978 environment variable points to check that the dir really exists. If
1979 not default to the cwd as temp dir. Copyright timestamp adjusted.
1980 * djgpp/subpipe.h: Copyright timestamp adjusted.
1981 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1982
389c8cfd
PE
19832008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1984
1985 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
1986
5d1cfef4
PE
19872008-01-09 Paul Eggert <eggert@cs.ucla.edu>
1988
1989 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
1990 Problem reported by Claudio Saavedra in
1991 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
1992
e2dcf996
WP
19932008-01-05 Wojciech Polak <polak@gnu.org>
1994
1995 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
1996 document's title with the input grammar file name.
1997
da730230
JD
19982007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
1999
2000 Automate regression testing of the XML/XSLT implementation. Discussed
2001 starting at
2002 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2003 * configure.ac (XSLTPROC): New substitution.
2004 * Makefile.am (maintainer-xml-check): New phony target invoking...
2005 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2006 invoking make maintainer-check with BISON_TEST_XML=1.
2007 * tests/atlocal.in (XSLTPROC): New.
2008 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2009 not to report reachable memory when Bison is expected to have a
2010 non-zero exit status and (2) to compare XML/XSLT output with --graph
2011 and --report=all output for every working grammar when
2012 BISON_TEST_XML=1.
2013 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2014 (AT_BISON_CHECK_XML): New.
2015 (AT_QUELL_VALGRIND): New.
2016 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2017 (AT_CHECK): ... don't redefine this since this was the old way to
2018 quell Valgrind.
2019 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2020 AT_BISON_CHECK invocations.
2021 * tests/c++.at: Likewise.
2022 * tests/calc.at: Likewise.
2023 * tests/conflicts.at: Likewise.
2024 * tests/cxx-type.at: Likewise.
2025 * tests/existing.at: Likewise.
2026 * tests/glr-regression.at: Likewise.
2027 * tests/headers.at: Likewise.
2028 * tests/input.at: Likewise.
2029 * tests/java.at: Likewise.
2030 * tests/output.at: Likewise.
2031 * tests/push.at: Likewise.
2032 * tests/reduce.at: Likewise.
2033 * tests/regression.at: Likewise.
2034 * tests/sets.at: Likewise.
2035 * tests/skeletons.at: Likewise.
2036 * tests/synclines.at: Likewise.
2037 * tests/torture.at: Likewise.
2038 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2039 tends to hang xsltproc.
2040 (Big horizontal): Likewise.
2041
408476bc
JD
20422007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2043
2044 In XML output, remove redundant class attribute on symbol element.
2045 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2046 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2047 look up a symbol to determine whether it's a nonterminal or terminal.
2048 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2049 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2050
2051 Add prec/assoc information to XML output.
2052 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2053 %prec, add a percent_prec attribute.
2054 * src/print-xml.c (print_grammar): For each terminal that has a
2055 precedence or associativity, add a prec or assoc attribute.
2056 (xml_indent): New.
2057 (xml_puts): Use xml_indent.
2058 (xml_printf): Use xml_indent.
2059 * src/print-xml.h (xml_indent): Prototype.
2060
2061 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2062 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2063
d4a26c48
JD
20642007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2065
2066 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2067 (bison:ruleByNumber): ... this for clarity.
2068 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2069 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2070 (xsl:template match="reduction"): Update.
2071 (xsl:template match="item"): Update.
2072 (xsl:template match="reduction"): Update.
2073
2074 In the XML output, don't print the list of rules where symbols appear.
2075 Compute it in XSLT instead. Discussed at
2076 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2077 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2078 (bison:ruleByRhs): New.
2079 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2080 bison:ruleByRhs.
2081 (xsl:template match="terminal/rule"): Remove.
2082 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2083 bison:ruleByRhs.
2084 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2085 Remove.
2086 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2087 bison:ruleByRhs and mode="number-link" for rule template.
2088 (xsl:template match="terminal/rule"): Remove.
2089 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2090 bison:ruleByRhs and mode="number-link" for rule template.
2091 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2092 Rewrite as...
2093 (xsl:template match="rule" mode="number-link"): ... this.
2094 * src/print-xml.c (print_grammar): Don't print the list of rules.
2095
ef1b4273
JD
20962007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2097
2098 Don't let --report affect XML output; always print all information.
2099 Discussed at
2100 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2101 * src/conflicts.c (log_resolution): Implement.
2102 * src/print-xml.c (print_core): Implement.
2103 (print_state): Implement.
2104 (print_xml): Implement.
2105
2106 * NEWS (2.3a+): Fix quotes.
2107 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2108 don't let %verbose clear the list specified by --report.
2109
0f6cd9e3
AD
21102007-11-26 Akim Demaille <akim@epita.fr>
2111
2112 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2113
d80fb37a
JD
21142007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2115
2116 In the XML output, list useless and unused symbols and rules with the
2117 useful ones and add a "usefulness" attribute. Discussed starting at
2118 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2119 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2120 (grammar_rules_print_xml): Print all rules instead of just those
2121 useful in the grammar, and add a "usefulness" attribute.
2122 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2123 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2124 (print_grammar): Print all nonterminals instead of just useful ones,
2125 and add a "usefulness" attribute to nonterminals and terminals.
2126 (print_xml): Don't print a separate "reductions" or
2127 "rules-useless-in-parser" element.
2128 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2129 (reduce_xml): Remove.
2130 (reduce_token_unused_in_grammar): New.
2131 (reduce_nonterminal_useless_in_grammar): New.
2132 * src/reduce.h (reduce_xml): Remove prototype.
2133 (reduce_token_unused_in_grammar): Add prototype.
2134 (reduce_nonterminal_useless_in_grammar): Add prototype.
2135 * data/xslt/xml2text.xsl: Update for XML changes.
2136 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2137 * tests/reduce.at (Useless Terminals): Update output.
2138 (Useless Rules): Update output.
2139 (Reduced Automaton): Update output.
2140
2141 Say "Terminals unused in grammar" instead of "Unused terminals".
2142 * NEWS (2.3a+): Update.
2143 * doc/bison.texinfo (Understanding): Update example output.
2144 * src/reduce.c (reduce_output): Implement.
2145 * data/xslt/xml2text.xsl: Implement.
2146 * data/xslt/xml2xhtml.xsl: Implement.
2147
1bb2bd75
JD
21482007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2149
2150 Accept --report-file=FILE to override the default `.output' filename.
2151 * NEWS (2.3a+): Mention.
2152 * doc/bison.texinfo (Bison Options): Add an entry.
2153 * src/files.c (compute_output_file_names): Don't override
2154 spec_verbose_file if already set.
2155 * src/getargs.c (usage): Document --report-file.
2156 (REPORT_FILE_OPTION): New anonymous enum member.
2157 (long_options): Add entry for it.
2158 (getargs): Add case for it setting spec_verbose_file.
2159
2160 * build-aux/cross-options.pl: Don't record a short option just because
2161 there's an arg.
2162 * doc/.cvsignore: Add yacc.1.
2163
a005a9c4
AD
21642007-11-14 Akim Demaille <akim@epita.fr>
2165
2166 * doc/yacc.1.in: New.
2167 * configure.ac, doc/Makefile.am: Adjust.
2168 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2169 config.h symbol.
2170 Use AC_SUBST for assignments too.
2171 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2172
cff03fb2
JD
21732007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2174
2175 * src/gram.c: Remove comments that duplicate comments in gram.h.
2176
2177 When reporting useless rules and nonterminals, say "useless in grammar"
2178 instead of "useless", and say "useless in parser" instead of "never
2179 reduced". Discussed starting at
2180 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2181 * NEWS (2.3a+): Mention this change.
2182 * data/xslt/xml2text.xsl: Update output text and expected input XML
2183 element names to match changes below.
2184 * data/xslt/xml2xhtml.xsl: Likewise.
2185 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2186 Contents: "Rules useless in parser due to conflicts".
2187 * doc/bison.texinfo (Decl Summary): Reword a little.
2188 (Understanding): Update example output for changes below.
2189 * src/gram.c: (rule_useful_p): Rename to...
2190 (rule_useful_in_grammar_p): ... this.
2191 (rule_useless_p): Rename to...
2192 (rule_useless_in_grammar_p): ... this.
2193 (rule_never_reduced_p): Rename to...
2194 (rule_useless_in_parser_p): ... this.
2195 (grammar_rules_print): Update for renames.
2196 (grammar_rules_print_xml): Update for renames.
2197 (grammar_rules_never_reduced_report): Rename to...
2198 (grammar_rules_useless_report): ... this since it is used for either
2199 kind of useless rule.
2200 * src/gram.h: Reword comments and update function names in prototypes.
2201 * src/main.c (main): Say "rule useless in parser due to conflicts".
2202 * src/print-xml.c (print_rules_never_reduced): Rename to...
2203 (print_rules_useless_in_parser): ... this, and rename output XML
2204 element "rules-never-reduced" to "rules-useless-in-parser".
2205 (print_xml): Update for rename.
2206 * src/print.c (print_results): Say "Rules useless in parser due to
2207 conflicts".
2208 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2209 (nonterminals_reduce): Say "nonterminal useless in grammar".
2210 (reduce_output): Say "Nonterminals useless in grammar".
2211 Say "Rules useless in grammar".
2212 (reduce_xml): Rename output XML element "useless" to
2213 "useless-in-grammar".
2214 (reduce_print): Don't report the count of grammatically useless rules
2215 as "rules never reduced" just because %yacc is specified.
2216 In the correct report of this count, say nonterminal(s) and rule(s)
2217 "useless in grammar".
2218 * tests/conflicts.at (S/R in initial): Update expected output.
2219 (Defaulted Conflicted Reduction): Likewise.
2220 (Unreachable States After Conflict Resolution): Likewise.
2221 * tests/existing.at (GNU pic Grammar): Likewise.
2222 * tests/reduce.at (Useless Nonterminals): Likewise.
2223 (Useless Rules): Likewise.
2224 (Reduced Automaton): Likewise.
2225 (Underivable Rules): Likewise.
2226 (Empty Language): Likewise.
2227
66f0441d
JD
22282007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2229
2230 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2231 here document and before the EOF so that BSD's implementation of Bourne
2232 shell doesn't parse the delimiter as part of the here document.
2233 * doc/.cvsignore: Add cross-options.texi.
2234 * src/getargs.c (usage): Add a blank line after the warning categories.
2235
d0ee4105
PB
22362007-11-08 Paolo Bonzini <bonzini@gnu.org>
2237
2238 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2239
e8b1fb9b
AD
22402007-11-05 Akim Demaille <akim@epita.fr>
2241
2242 Remove Id: from bison.1.
2243 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2244 (perl -0777 -pi -e 's/\.PP\nId): New.
2245 (.x.1): Use it to ignore the version control revision.
2246
2f7a96b5
AD
22472007-11-05 Akim Demaille <demaille@gostai.com>
2248
2249 * build-aux/Makefile.am: Ship cross-options.pl.
2250 * doc/Makefile.am: Always refer to cross-options.texi with
2251 $(srcdir).
2252 (MAINTAINERCLEANFILES): Add it.
2253
f4101aa6
AD
22542007-11-04 Akim Demaille <demaille@gostai.com>
2255
2256 Generate the long/short option cross-table.
2257 * build-aux/cross-options.pl: New.
2258 * doc/Makefile.am (cross-options.texi): New.
2259 * doc/bison.texinfo: Use it.
2260
727a1401
AD
22612007-11-04 Akim Demaille <demaille@gostai.com>
2262
2263 Generate bison.1 using help2man.
2264 * doc/common.x, doc/bison.x: New.
2265 * doc/Makefile.am (bison.1, .x.1): New.
2266 The code is taken from autoconf-2.61/man/Makefile.am.
2267 * configure.ac: Look for help2man.
2268
6aeb9c57
AD
22692007-11-04 Akim Demaille <demaille@gostai.com>
2270
2271 Complete --help.
2272 * src/getargs.c (usage): Document -W, make it clear that -d,
2273 -g and -x have optional arguments.
2274
d7be4085
AD
22752007-11-04 Akim Demaille <demaille@gostai.com>
2276
2277 Find sha1sum when named gsha1sum.
2278 * bootstrap (find_tool): New.
2279 ($SHA1SUM): New.
2280
d9df47b6
JD
22812007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2282
2283 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2284 at
2285 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2286 * NEWS (2.3a+): Mention.
2287 * data/bison.m4 (b4_pure_if): Don't define it here.
2288 * data/c.m4 (b4_identification): Depend on individual skeletons to
2289 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2290 values of the %define variables api.pure or api.push_pull. Define
2291 YYPURE, YYPUSH, and YYPULL accordingly.
2292 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2293 glr.cc has already defined b4_pure_flag.
2294 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2295 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 2296 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
2297 * doc/bison.texinfo (Pure Decl): Update.
2298 (Push Decl): Update.
2299 (Decl Summary): Add api.pure to %define entry.
2300 In %pure-parser entry, say it's deprecated and reference %define.
2301 (Pure Calling): Update.
2302 (Error Reporting): Update.
2303 (C++ Scanner Interface): Update.
2304 (How Can I Reset the Parser): Update.
2305 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2306 reference %define.
2307 * src/getargs.c (pure_parser): Remove global variable.
2308 * src/getargs.h (pure_parser): Remove extern.
2309 * src/output.c (prepare): Don't define pure_flag muscle.
2310 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2311 wrapper around `%define api.pure'.
2312 * tests/calc.at (Simple LALR Calculator): Update.
2313 (Simple GLR Calculator): Update.
2314 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2315 Update.
2316 (GLR: Resolve ambiguity, pure, locations): Update.
2317 (GLR: Merge conflicting parses, pure, no locations): Update.
2318 (GLR: Merge conflicting parses, pure, locations): Update.
2319 * tests/glr-regression.at (Uninitialized location when reporting
2320 ambiguity): Update
2321 * tests/input.at (Unused %define api.pure): New test case.
2322 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2323 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2324 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2325
c373bf8b
JD
23262007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2327
2328 %define push_pull -> %define api.push_pull. Discussed starting at
2329 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2330 * data/push.c: Expect the new name.
2331 * data/yacc.c: Likewise.
2332 * doc/bison.texinfo (Push Decl): Update.
2333 (Decl Summary): Update %define entry.
2334 (Push Parser Function): Update.
2335 (Pull Parser Function): Update.
2336 (Parser Create Function): Update.
2337 (Parser Delete Function): Update.
2338 * tests/calc.at (Simple LALR Calculator): Update.
2339 * tests/input.at (%define enum variables): Update.
2340 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2341 (Push Parsing: Multiple impure instances): Update.
2342 (Push Parsing: Unsupported Skeletons): Update.
2343 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2344 (Exploding the Stack Size with Malloc): Update.
2345
2346 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2347 other entries some.
2348
32f19b6b
JD
23492007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2350
2351 For the XML output's terminal element, rename @number to @token-number,
2352 and add @symbol-number. In the nonterminal element, rename @number to
2353 @symbol-number. Discussed starting at
2354 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2355 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2356 renames.
2357 (xsl:template match="nonterminal"): Likewise.
2358 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2359 (xsl:template match="nonterminal"): Likewise.
2360 * src/print-xml.c (print_grammar): Implement.
2361
255a6b90
JD
23622007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2363
2364 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2365 2007-10-11 change, the child elements here are items not rules.
408476bc 2366 (xsl:template match="item"): New.
255a6b90
JD
2367 (xsl:template match="rule"): Update for new reduced itemset.
2368 (xsl:template match="point"): Remove.
2369 (xsl:template match="empty"): For consistency with --graph, don't
2370 output "/* empty */".
2371 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2372 line-wrap, don't pass a negative value as first-line-length since this
2373 won't work with the following changes.
2374 (xsl:template name="line-wrap"): Simplify slightly.
2375 (xsl:template name="ws-search"): Eliminate recursion.
2376 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2377 set next to an item whose dot is not at the end of the RHS even if it
2378 happens to be associated with the same rule.
2379
88c78747
JD
23802007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2381
31984206
JD
2382 Add %define lr.keep_unreachable_states.
2383 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2384 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2385 * src/main.c (main): Implement it.
2386 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2387 Extend to test it, and fix a typo.
2388
23892007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2390
2391 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
2392 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2393 the example .output text.
2394 * tests/regression.at (Extra lookahead sets in report): Improve wording
2395 of comments.
2396
b7a70162
WP
23972007-10-17 Wojciech Polak <polak@gnu.org>
2398
2399 * src/print-xml.c (print_grammar): Renamed
2400 <terminal> and <nonterminal> attributes:
2401 "type" to "number" and "symbol" to "name".
2402 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2403 Use new attribute names.
2404 (xsl:template match="nonterminal"): Likewise.
2405 * data/xslt/xml2xhtml.xsl: Likewise.
2406
a0de5091
JD
24072007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2408
2409 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2410 (Option Cross Key): Likewise.
2411
2412 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2413 next to an item whose dot is not at the end of the RHS even if it
2414 happens to be associated with the same rule.
2415 * src/print.c (print_core): Likewise.
2416 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2417 (Resolved SR Conflicts): Update output.
2418 * tests/regression.at (Extra lookahead sets in report): New test case.
2419
4c20d18d
WP
24202007-10-11 Wojciech Polak <polak@gnu.org>
2421
2422 * src/print-xml.c (print_core): Remove item set
2423 redundancy.
2424 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2425 Improve processing time. Suggested by Joel E. Denny.
2426 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2427 Write xsl:param "required" attribute as comment.
2428 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2429 (xsl:template match="rule"): Support new reduced itemset.
2430 (xsl:template match="point"): Remove.
2431 * data/xslt/xml2xhtml.xsl: Likewise.
2432
f506ad1c
JD
24332007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2434
2435 * src/getargs.c (version): Update copyright year.
2436
21f1b063
JD
24372007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2438
2439 Make xml2dot.xsl and --graph produce the same output.
2440 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2441 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2442 escaped later.
2443 (xsl:template name="output-node"): Use the new escape template instead
2444 of the string-replace template directly.
2445 (xsl:template name="output-edge"): Likewise.
2446 (xsl:template name="escape"): New, escapes backslashes and newlines in
2447 addition to quotation marks.
2448 * src/graphviz.c (start_graph, output_node, output_edge): Add
2449 whitespace to output for legibility.
2450
2451 Make xml2text.xsl and --report produce the same output, and remove the
2452 XML "conflicts" element since a conflict summary is easily extracted
2453 from the automaton.
2454 * data/xslt/bison.xsl: New.
2455 (xsl:template match="state" mode="bison:count-conflicts): New.
2456 * data/xslt/xml2text.xsl: Import bison.xsl.
2457 (xsl:template match="bison-xml-report"): Instead of styling the
2458 "conflicts" element, style the "automaton" element with mode
2459 "conflicts". Unlike the former, the latter lists S/R and R/R
2460 conflicts for a state on the same line.
2461 (xsl:template match="conflicts"): Remove.
2462 (xsl:template match="conflict"): Remove.
2463 (xsl:template match="terminal"): Line-wrap the list of rules in which
2464 the terminal is used.
2465 (xsl:template match="nonterminal"): Likewise for nonterminals.
2466 (xsl:template match="automaton" mode="conflicts"): New.
2467 (xsl:template match="state" mode="conflicts"): New.
2468 (xsl:template name="line-wrap"): New.
2469 (xsl:template name="ws-search"): New.
2470 * data/xslt/xml2xhtml.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."
2474 (xsl:template match="conflicts"): Remove.
2475 (xsl:template match="conflict"): Remove.
2476 (xsl:template match="automaton" mode="conflicts"): New.
2477 (xsl:template match="state" mode="conflicts): New.
2478 * src/conflicts.c (conflicts_output_xml): Remove.
2479 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2480 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2481 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2482 the corresponding XSLT is easier. Also, never wrap between a word and
2483 the comma that follows it.
2484
793fbca5
JD
24852007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2486
2487 Improve C++ namespace support. Discussed starting at
2488 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2489 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2490 b4_namespace_close): New macros that interpret the %define variable
2491 "namespace" so its value can contain "::" to indicate nested
2492 namespaces.
2493 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2494 the above macros.
2495 * data/lalr1.cc (b4_namespace): Likewise.
2496 * data/location.cc (b4_namespace): Likewise.
2497 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2498 inside a new table in the general %define entry. Document `%define
2499 namespace' there as well. Point the %name-prefix entry to it since it
2500 explains it more completely in the case of C++.
2501 (C++ Bison Interface): Mention `%define namespace' instead of
2502 %name-prefix.
2503 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2504 entry suffices.
2505 * tests/c++.at (Relative namespace references): New test case.
2506 (Absolute namespace references): New test case.
2507 (Syntactically invalid namespace references): New test case.
2508 * tests/input.at (C++ namespace reference errors): New test case.
2509
35b8730d
JD
25102007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2511
2512 Add syncline support and location accessor to internal %define
2513 interfaces.
2514 * data/bison.m4 (b4_percent_define_get_loc): New.
2515 (b4_percent_define_get_syncline): New.
2516 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2517 (b4_percent_define_default): Record defining location as line 1 rather
2518 than 0 for the sake of synchronizing #line's, and define
2519 b4_percent_define_syncline(VARIABLE).
2520 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2521 * src/muscle_tab.c (muscle_syncline_grow): New.
2522 (muscle_code_grow): Use muscle_syncline_grow.
2523 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2524 define b4_percent_define_syncline(VARIABLE).
2525 (muscle_percent_define_get_loc): New.
2526 (muscle_percent_define_get_syncline): New.
2527 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2528 remove some unused variables.
2529 (muscle_percent_define_default): Record defining location as line 1
2530 rather than 0 for the sake of synchronizing #line's, and define
2531 b4_percent_define_syncline(VARIABLE).
2532 (muscle_percent_define_check_values): Use
2533 muscle_percent_define_get_loc.
2534 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2535 (muscle_percent_define_get_syncline): Prototype.
2536 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2537 defaults): Update output for location change.
2538 (Complaining during macro argument expansion): Extend to test
2539 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2540
7dc4a694
JD
25412007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2542
2543 Fix some error-reporting macro bugs.
2544 * data/bison.m4 (b4_cat): New.
2545 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2546 to stdout so they don't become arguments to other macros. Update
2547 comments and add examples.
2548 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2549 add examples.
2550 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2551 after printing the error directive so that M4 doesn't report subsequent
2552 problems that are induced by this problem.
2553 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2554 instead of just in them. Recognize @\n in both places. Both expand to
2555 the empty string. Needed by b4_cat.
2556 * tests/skeletons.at (Complaining during macro argument expansion):
2557 New test case.
2558 (Fatal errors make M4 exit immediately): New test case.
2559
d4bd2295
JD
25602007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2561
2562 Implement --print-datadir.
2563 * src/getargs.c (usage): Mention.
2564 (PRINT_DATADIR_OPTION): New anonymous enum member.
2565 (long_options): Add entry for it.
2566 (getargs): Add case for it calling compute_pkgdatadir.
2567 * src/output.c (output_skeleton): Encapsulate data directory
2568 computation from here...
2569 (prepare): ... and from here...
2570 (compute_pkgdatadir): ... into this new function.
2571 * src/output.h (compute_pkgdatadir): Prototype.
2572
34cdeddf
JD
25732007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2574
2575 * src/print-xml.c (escape_bufs): New static global variable
2576 replacing...
2577 (xml_escape_n): ... the static local variable buf here.
2578 (print_xml): Free memory for escape_bufs.
2579 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2580
d782395d
JD
25812007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2582
2583 Replace `%push-parser' and `%push-pull-parser' with
2584 `%define push_pull "push"' and `%define push_pull "both"'.
2585 `%define push_pull "pull"' is the default.
2586 * doc/bison.texinfo (Push Decl, Push Parser Function,
2587 Pull Parser Function, Parser Create Function, Parser Delete Function):
2588 Update declarations.
2589 (Decl Summary, Table of Symbols): Replace %push-parser and
2590 %push-pull-parser entries with a %define push_pull entry.
2591 * data/bison.m4 (b4_percent_define_check_values): New macro.
2592 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2593 definitions...
2594 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2595 definitions...
2596 * data/push.c: ... to here and compute them from the value of the
2597 %define variable push_pull.
2598 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2599 parsing requests here...
2600 * data/yacc.c: ... hack this to switch to push.c any time
2601 b4_use_push_pull_flag or the %define variable push_pull is set. This
2602 will go away when we mv push.c yacc.c.
2603 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2604 push parsing is not supported since unused %define variables are
2605 reported anyway.
2606 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2607 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2608 comments for consistency with b4_percent_define_check_values.
2609 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2610 muscles.
2611 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2612 Remove.
2613 (prologue_declaration): Remove %push-parser and %push-pull-parser
2614 rules.
2615 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2616 * tests/calc.at: Update declarations.
2617 * tests/input.at (%define enum variables): New test case.
2618 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2619 declaration.
2620 (Push Parsing: Multiple impure instances): Update declaration.
2621 (Push Parsing: Unsupported Skeletons): New test case.
2622 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2623 declaration.
2624 (Exploding the Stack Size with Malloc): Update declaration.
2625
3f999f78
WP
26262007-09-24 Wojciech Polak <polak@gnu.org>
2627
2628 Add XSLT transformations.
2629
2630 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2631 * data/xslt/xml2text.xsl: Transform XML into plain text.
2632 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2633 * data/Makefile.am (xsltdir): New variable.
2634 (dist_xslt_DATA): Add xslt/*.xsl files.
2635
a4f75309
PE
26362007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2637
2638 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2639 Problem reported by Wojciech Polak.
2640 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2641 (xml_printf): Undo change I made on 21 September; that is,
2642 indent 2 spaces, not 1.
2643
ad5feac4
JD
26442007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2645
2646 Pacify ./configure --enable-gcc-warnings.
2647 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2648 `char const *' instead of `char *'.
2649 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2650 local variable `sep'.
2651
41d7a5f2
PE
26522007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2653
2654 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2655 elsewhere.
2656 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2657 (xml_printf): Indent just 1 space for level.
2658 (e_char, xlate_char): Remove.
2659 (xml_escape_string): Rewrite to avoid undefined behavior (used
2660 storage that was freed from the stack).
2661 (xml_escape_n): Don't bother checking for subscript error.
2662
3f999f78
WP
26632007-09-21 Wojciech Polak <polak@gnu.org>
2664
2665 Add Bison XML Automaton Report.
41d7a5f2
PE
2666
2667 Add support for an -x option to generate an XML report.
2668 It is not documented yet.
2669 * src/print-xml.c: New file.
2670 * src/print-xml.h: Likewise.
2671 * lib/timevar.def (TV_XML): New var.
2672 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2673 * src/conflicts.c: Include print-xml.h.
2674 (solved_conflicts_xml_obstack): New var.
2675 (log_resolution, conflicts_solve, conflicts_free):
2676 Add support for XML report.
2677 (conflicts_output_val): New function.
2678 * src/conflicts.h (conflicts_output_val): New decl.
2679 * src/files.c (spec_xml_file): New var.
2680 (compute_output_file_names, output_file_names_free): Add XML support.
2681 * src/files.h (spec_xml_file): New decl.
2682 * src/getargs.c (xml_flag): New var.
2683 (usage, short_options, long_options, getargs): Add XML support.
2684 * src/getargs.h (xml_flag): New decl.
2685 * src/gram.c: Include print-xml.h.
2686 (rule_lhs_print_xml, rule_rhs_print_xml):
2687 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2688 New functions.
2689 * src/gram.h: Declare external ones.
2690 * src/main.c: Include print-xml.h.
2691 (main): Add XML support.
2692 * src/reduce.c: Include print-xml.h.
2693 (reduce_xml): New function.
2694 * src/reduce.h: Declare it.
2695 * src/state.c: Include print-xml.h.
2696 (state_new): Add XML support.
2697 (state_rule_lookahead_tokens_print_xml): New function.
2698 * src/state.h: Declare it.
2699 (struct state): New member solved_conflicts_xml.
2700 * src/symtab.c (symbol_class_get_string): New function.
2701 * src/symtab.h: Declare it.
2702
6d8e724d
PE
27032007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2704
2705 * GNUmakefile: Switch to coreutils's version.
2706 * bootstrap: Likewise.
2707 * Makefile.cfg: Adjust to new GNUmakefile.
2708 * README-hacking: Likewise.
2709
2710 Import from gnulib:
2711
2712 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2713 Bruno Haible <bruno@clisp.org>
2714
2715 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2716 and is a script that invokes bison. Tighten the code. Add comments.
2717
922bdd7f
JD
27182007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2719
2720 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2721 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2722 * doc/bison.texinfo (Decl Summary): Fix.
2723 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2724 * tests/input.at (Boolean %define variables): Update output.
2725 * tests/skeletons.at (%define boolean variables: invalid skeleton
2726 defaults): Rename to...
2727 (%define Boolean variables: invalid skeleton defaults): ... this and
2728 update output.
2729
1b17b01d
JD
27302007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2731
2732 In impure push mode, don't allow more than one yypstate to be allocated
2733 since multiple impure parsers would corrupt yynerrs.
2734 * data/push.c (yypstate_allocated): New static global variable
2735 initialized to 0.
2736 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2737 exhaustion if yypstate_allocated is 1, but still return 2.
2738 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2739 already 1. Otherwise, set it to 1.
2740 (yypstate_delete): Set it to 0.
2741 * tests/push.at (Push Parsing: Multiple impure instances): New test
2742 case.
2743
9987d1b3
JD
27442007-08-17 Bob Rossi <bob@brasko.net>
2745
2746 * doc/bison.texinfo (Push Decl): Document the push parser.
2747 (Table of Symbols): Ditto.
2748 (Pure Decl): Ditto.
2749 (Decl Summary): Ditto.
2750 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2751 Parser Create Function, Parser Delete Function):
2752 Add new push parser symbols.
2753 (Table of Symbols): Document push-parser, push-pull-parser,
2754 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2755
f16b0819
PE
27562007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2757
2758 Update to GPLv3.
2759 * doc/gpl-3.0.texi: New file.
2760 * doc/gpl.texi: Remove.
2761 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2762 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2763 * README-hacking, TODO, bootstrap, bootstrap.conf:
2764 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2765 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2766 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2767 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2768 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2769 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2770 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2771 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2772 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2773 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2774 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2775 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2776 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2777 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2778 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2779 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2780 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2781 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2782 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2783 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2784 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2785 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2786 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2787 * src/complain.c, src/complain.h, src/conflicts.c:
2788 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2789 * src/files.h, src/flex-scanner.h, src/getargs.c:
2790 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2791 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2792 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2793 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2794 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2795 * src/print.c, src/print.h, src/print_graph.c:
2796 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2797 * src/reduce.h, src/relation.c, src/relation.h:
2798 * src/revision.h, src/scan-code.h, src/scan-code.l:
2799 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2800 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2801 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2802 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2803 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2804 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2805 * tests/existing.at, tests/glr-regression.at:
2806 * tests/headers.at, tests/input.at, tests/java.at:
2807 * tests/local.at, tests/output.at, tests/push.at:
2808 * tests/reduce.at, tests/regression.at, tests/sets.at:
2809 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2810 * tests/torture.at:
2811 Update to GPLv3.
2812
728c4be2
JD
28132007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2814
2815 Get rid of broken %no-parser, -n, and --no-parser implementation and
2816 documentation.
2817 * TODO: Don't mention them.
2818 * doc/bison.1: Likewise.
2819 * doc/bison.texinfo (Decl Summary): Likewise.
2820 (Bison Options): Likewise.
2821 (Option Cross Key): Likewise.
2822 * src/getargs.c (no_parser_flag): Remove global variable.
2823 (usage): Don't print description of -n and --no-parser.
2824 (long_options): Remove --no-parser entry here.
2825 (getargs): Remove -n case in the switch here.
2826 * src/getargs.h (no_parser_flag): Remove extern.
2827 * tests/regression.at (Web2c Actions): Remove comment that mentions
2828 --no-parser.
2829
5d31a216
JD
28302007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2831
2832 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2833 name user variables starting with `yy'. Just pass NULL instead of a
2834 dummy local &yylval to yypush_parse.
2835 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2836 starting with `yy'.
2837
a2ea208d
JD
28382007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2839
2840 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2841 true since it's then always used regardless of whether yyoverflow is
2842 defined. Reported by Christian Burger at
2843 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2844 * THANKS: Add Christian Burger.
2845
91661ebb
JD
2846 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2847 node names: say "Decl Summary" not "Bison Declaration Summary".
2848
cbd50549
JD
28492007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2850
2851 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2852 determine whether this function has already complained about an invalid
2853 value for a %define boolean variable, don't check whether Bison has
2854 ever examined the value. As written, the check was a tautology.
2855 Instead, record and check for this complaint using a separate muscle.
2856
eb1b0740
JD
28572007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2858
2859 Fix push parsing memory leak reported by Brandon Lucia at
2860 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2861 * THANKS: Add Brandon Lucia.
2862 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2863 but the parse never completed and thus freed it.
2864 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2865 * tests/testsuite.at: Include push.at.
2866 * test/push.at: New.
2867 (Push Parsing: Memory Leak for Early Deletion): New test case.
2868
9d774aff
JD
28692007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2870
2871 Improve handling of multiple S/R conflicts in the same state and of S/R
2872 conflicts involving multiple reductions.
2873 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2874 set for a state here or Bison will abort if it is reassigned on a
2875 later conflicted reduction in the same state.
2876 Similarly, don't finalize and assign the solved conflicts report here
2877 or it will be lost if it is reassigned on a later conflicted reduction
2878 in the same state.
2879 (set_conflicts): Instead, assign them both here after all S/R conflicts
2880 in the state have been fully examined.
2881 * src/print.c (shift_set): Rename to...
2882 (no_reduce_set): ... this.
2883 (print_reductions): Update for rename, and add %nonassoc error action
2884 tokens to no_reduce_set so that, when printing the first remaining
2885 reduction on an error action token, the reduction is enclosed in
2886 brackets.
2887 (print_results): Update for rename.
2888 * tests/conflicts.at (Solved conflicts report for multiple reductions
2889 in a state): New test case.
2890 (%nonassoc error actions for multiple reductions in a state): New test
2891 case.
2892
2893 * src/main.c (main): Don't depend on C99 features.
2894
10159d2a
JD
28952007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2896
2897 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
2898 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2899 uniwidth.
10159d2a 2900
953b3935
JD
29012007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2902
2903 * bootstrap (slurp): Create target directories that don't exist.
2904 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2905
6ce2d93a
JD
29062007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2907
2908 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2909 than item number.
2910 * closure.c (closure): Likewise.
2911 * state.h (reductions): Comment sorting of rules.
2912 (state): Comment sorting of items.
2913
ce3448d5
JD
29142007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2915
2916 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2917 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2918 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2919 definition in order to avoid Gnulib headers since we don't use config.h
2920 here.
2921 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2922 rather than AT_DATA so that config.h is included.
2923
8a86eef0
JD
29242007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2925
2926 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2927 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2928 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2929 and so that YYFPRINTF is guaranteed to be defined here.
2930
b1a81613
JD
29312007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2932
2933 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2934 with...
2935 (muscle_percent_define_check_values): ... this more helpful function.
2936 Again, it's not used yet, but it will be.
2937 * src/muscle_tab.h: Likewise.
2938
71b61d4d
JD
2939 Improve some comments in parser table construction.
2940 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2941 (generate_states): Don't mention ruleset, which is internal to closure.
2942 * src/closure.c (closure): Explain sorting of core and itemset, which
2943 is required for this function to behave correctly.
2944 * src/closure.h (closure): Mention sorting.
2945
2a6b783d
JD
29462007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2947
2948 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2949 move the check for disabled transitions to an aver since conflict
2950 resolution hasn't happened yet.
2951
2952 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2953 labels a state as inconsistent just because it has error transitions.
2954 The original form of this check appeared in revision 1.1 of lalr.c,
2955 which was committed on 1991-12-21. Now (at least), changing the
2956 consistency label on such a state appears to have no useful effect in
2957 any of the places it is examined, which I enumerate below. The key
2958 point to understanding each item in this enumeration is that a state
2959 with an error transition is labelled consistent in the first place only
2960 if it has no rules, so the check cannot matter for states that have
2961 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2962 to try to identify its conflicts, and a state must have *rules* to have
2963 conflicts. (2) Labelling a state as inconsistent will affect how
2964 action_row sets the default *rule* for the state. (3) Labelling a
2965 state as inconsistent will cause build_relations to add lookback edges
2966 to *rules* in that state.
2967 * src/state.h (struct state): Word the comment for member consistent
2968 more carefully.
2969
14462c2b
JD
29702007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2971
2972 Don't depend on C99 features.
2973 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2974 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2975 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2976 * src/state.c (state_mark_reachable_states): Fix for-loop.
2977 (state_remove_unreachable_states): Fix for-loop.
2978
2979 Don't widen struct state with member reachable just to temporarily
2980 record reachability. Instead, use a local bitset.
2981 * src/state.h (struct state): Remove member.
2982 * src/state.c (state_new): Don't initialize it.
2983 (state_mark_reachable_states): Rename to...
2984 (state_record_reachable_states): ... this, and use bitset.
2985 (state_remove_unreachable_states): Use bitset.
2986
5a43d418
JD
29872007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2988
2989 * src/Makefile.am (yacc): Quote target action commands properly so
2990 that the yacc script isn't corrupt. Reported by Hans Aberg at
2991 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
2992
0c650a20
JD
2993 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
2994 the case of pure parsers. Reported by Frans Englich at
2995 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
2996 * THANKS: Add Frans Englich.
2997
61fee93e
JD
2998 * NEWS (2.3a+): In the %code entry, reference section `Bison
2999 Declaration Summary' from the manual now since the %code summary has
3000 moved there.
3001 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3002 in the rules section must be terminated by semicolons.
3003
f124d423
JD
30042007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3005
3006 Extend the front-end API for %define variables to more completely
3007 mirror the back-end. This will be useful in the future.
3008 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3009 Update comments to mention the new front-end counterparts of these
3010 macros.
3011 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3012 for muscle_string_decode and muscle_location_decode.
3013 (muscle_string_decode): New static function.
3014 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3015 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3016 functions.
3017 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3018 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3019 implementation more closely.
3020 (muscle_percent_define_invalid_value): New function.
3021 * src/muscle_tab.h (muscle_percent_define_get,
3022 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3023 Prototype.
3024
75ad86ee
JD
30252007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3026
3027 * NEWS (2.3a+): Mention yesterday's state-removal change.
3028 (2.3a): Remove the %language entry, which was added after 2.3a.
3029 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3030 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3031 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3032 tests/existing.at: Update copyright date.
3033
5967f0cf
JD
30342007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3035
3036 If conflict resolution makes states unreachable, remove those states,
3037 report rules that are then unused, and don't report conflicts in those
3038 states.
3039 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3040 New global function.
3041 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3042 function.
3043 * src/main.c (main): After conflict resolution, remove the unreachable
3044 states and update all data structures that reference states by number.
3045 * src/state.c (state_new): Initialize each state's reachable member to
3046 false.
3047 (state_mark_reachable_states): New static function.
3048 (state_remove_unreachable_states): New global function.
3049 * src/state.h (struct state): Add member bool reachable.
3050 (state_remove_unreachable_states): Prototype.
3051 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3052 New test case.
3053 * tests/existing.at (GNU pic Grammar): Update test case output now that
3054 an unused rule is discovered.
3055
b09f4f48
JD
30562007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3057
3058 Minor code cleanup in parser table construction.
3059 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3060 (new_itemsets, save_reductions): Update for rename to nitemset.
3061 * src/closure.c (nritemset): Rename to...
3062 (nitemset): ... this since the "r" appears to meaningless and isn't
3063 used in the comments.
3064 (closure): Update for rename.
3065 * src/closure.h (nritemset): Update extern to...
3066 (nitemset): ... this.
3067 * src/lalr.c (LA): Fix a typo in comments.
3068 * src/print.c (print_core): Update for rename to nitemset.
3069 * src/print_graph.c (print_graph): Likewise.
3070 * src/state.h: Fix some typos in header comments.
3071
bbb44d83
PE
30722007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3073
9b33de72
PE
3074 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3075 still sticks to ASCII. Sorry!
3076
bbb44d83
PE
3077 * README-hacking: New file, taken mostly from coreutils, with changes
3078 for Bison. Contains much of the contents of:
3079 * README-cvs: Remove.
3080 * bootstrap: Sync from gnulib.
3081 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3082 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3083
29553547
JD
30842007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3085
3086 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3087 Setzer.
3088 (Java Differences): Fix some typos.
3089 * THANKS: Add Sebastian Setzer.
3090
01b477c6
PB
30912007-03-07 Paolo Bonzini <bonzini@gnu.org>
3092
730739e4
AD
3093 * data/java.m4 (b4_single_class_if): Remove.
3094 (b4_abstract_if): Look at "%define abstract".
3095 (b4_lexer_if): New.
3096 (b4_union_name): Rename...
3097 (b4_yystype): ... to this. Map to "%define stype".
3098 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3099 b4_maybe_throws): Fix quoting.
3100 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3101 * data/lalr1.java (Lexer interface): Always define.
3102 (Lexer interface within parser class): Remove.
3103 (YYLexer class): New, used when "%code lexer" is present.
3104 (constructor): When "%code lexer" is used, pass %lex-param
3105 to the lexer constructor.
3106 (yylex, yyparse): Remove %lex-param from method invocations
3107 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3108
3109 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3110 abstract". Rename "%define union_name" to "%define stype".
3111 Rename method names according to previous patch.
3112 (Java Scanner Interface): Describe "%code lexer" instead of
3113 "%pure-parser" and "%define single_class".
3114 (Java Differences): Mention "%code lexer".
3115
3116 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3117 Include scanner here, using macros from tests/local.at.
3118 (AT_DATA_CALC_Y): Remove final argument.
3119 (_AT_CHECK_JAVA_CALC): Likewise.
3120 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3121 of %locations and %error-verbose.
3122 (main): Test with and without %lex-param.
3123 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3124 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 3125
122bea3a
JMG
31262007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3127
3128 DJGPP spefic issue. Inhibit the use of disallowed characters for
3129 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3130 and concern testsuite case 46.
3131 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3132 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3133 * djgpp/config.bat: Inhibit the use of disallowed characters.
3134
9611cfa2
JD
31352007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3136
3137 Miscellaneous %define and %code cleanup.
3138 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3139 values are interpreted.
3140 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3141 documentation a little more.
3142 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3143 muscle_percent_define_insert, muscle_percent_code_grow): New
3144 functions/macros.
3145 * src/muscle_tab.h (muscle_percent_define_insert,
3146 muscle_percent_code_grow): Prototype.
3147 * src/parse-gram.y (prologue_declaration): Use
3148 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3149 %define and %code directives.
3150
3151 Make it easy to share %define boolean variables between the front-end
3152 and back-end. Though not used yet, this will be useful in the future.
3153 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3154 Bison uses of names rather than just skeleton uses of names.
3155 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3156 b4_percent_define_skeleton_variables(VARIABLE) to
3157 b4_percent_define_bison_variables(VARIABLE).
3158 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3159 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3160 b4_percent_code_bison_qualifiers(QUALIFIER).
3161 (b4_check_user_names_wrap): Update for renames.
3162 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3163 muscle_percent_define_default): New functions mimicking
3164 b4_percent_define_flag_if and b4_percent_define_default.
3165
3166 For %define variables, report locations for invalid values and
bbb44d83 3167 redefinitions.
9611cfa2
JD
3168 * data/bison.m4 (b4_percent_define_flag_if): Read
3169 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3170 value for VARIABLE.
3171 (b4_percent_define_default): Save a special location in
3172 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3173 must later be reported as invalid.
3174 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3175 functions.
3176 (muscle_percent_define_insert): Record the location of VARIABLE in
3177 muscle percent_define_loc(VARIABLE), and use it to report the previous
3178 location for a redefinition.
3179 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3180 (muscle_percent_define_default): Update like b4_percent_define_default.
3181 (muscle_grow_user_name_list): Rename to...
3182 (muscle_user_name_list_grow): ... this for consistency and use
3183 muscle_location_grow.
3184 * src/muscle_tab.h (muscle_location_grow): Prototype.
3185 * tests/input.at (%define errors): Update expected output.
3186 * tests/skeletons.at (%define boolean variables: invalid skeleton
3187 defaults): New test case.
3188
0bf92491
JD
31892007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3190
3191 * src/print.c (lookahead_set, state_default_rule): Remove.
3192 (print_reductions): Replace state_default_rule invocation with
3193 equivalent use of yydefact, which was computed in token_actions in
3194 tables.c.
3195 (print_results): Don't allocate lookahead_set.
3196
d3b12988
PB
31972007-02-27 Paolo Bonzini <bonzini@gnu.org>
3198
3199 * data/lalr1.java: Prefix all private members with yy.
3200
f57a7536
JD
32012007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3202
3203 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 3204 Sebastien Fricker at
f57a7536 3205 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 3206 * THANKS: Add Sebastien Fricker.
f57a7536
JD
3207 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3208 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3209 accept a variable number of arguments.
3210
6404a5bf
JD
32112007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3212
3213 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3214
e4e09639
JMG
32152007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3216
3217 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3218 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3219 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3220
d7e0a1a7
PE
32212007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3222
3223 Undo my 2007-02-07 change, switching back to the c-strcase module
3224 introduced in the 2007-02-03 change. Bruno Haible reported that
3225 the 2007-02-07 change would be dangerous in Turkish if we add a
3226 language whose name contains "i", since "i" is not lowercase "I"
3227 in Turkish.
3228 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3229 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3230 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3231 * m4/.cvsignore: Remove strcase.m4.
3232 * src/getargs.c: Revert 2007-02-07 change, as follows.
3233 Include c-strcase.h.
3234 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3235
deee93a1
JD
32362007-02-11 Bruno Haible <bruno@clisp.org>
3237
3238 Enable the Java related testsuite tests when the only Java compiler
3239 found is a gcj < 4.3. Discussed at
3240 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3241 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3242
574add85
JD
32432007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3244
3245 * data/Makefile.am: Update copyright date.
3246 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3247 yypstate_new returns NULL.
3248 (yypstate_new): Return NULL if malloc does.
3249 * src/reader.c (packgram): Move translation of rule actions from the
3250 beginning of packgram to...
3251 (check_and_convert_grammar): ... here right before packgram is invoked
3252 so it's easier to write more complete comments, and remove redundant
3253 code.
3254
e785ccf7
JD
32552007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3256
3257 As in semantic actions, make @$ in %initial-action, %destructor, and
3258 %printer imply %locations.
3259 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3260 scanning @$.
3261 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3262 (@$ in %initial-action implies %locations,
3263 @$ in %destructor implies %locations,
3264 @$ in %printer implies %locations): ... these new test cases.
3265
1cfe1ed7
PE
32662007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3267
3268 Undo most of the 2007-02-03 change, switching to the strcase module
3269 now that gnulib strcase has been fixed.
3270 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3271 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3272 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3273 * m4/.cvsignore: Add strcase.m4.
3274 * src/getargs.c: Revert 2007-02-03 change, as follows.
3275 Don't include c-strcase.h.
3276 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3277 strcasecmp has "unspecified behavior" outside the POSIX locale,
3278 but it works fine in practice if at least one argument is ASCII,
3279 as is the case in Bison.
3280
0049ec86
PB
32812007-02-07 Paolo Bonzini <bonzini@gnu.org>
3282
3283 * tests/java.at: Skip tests if only one of javac/java is present.
3284 Reported by Joel E. Denny.
3285 * tests/atlocal.in: Adjust copyright years.
3286
32872007-02-05 Paolo Bonzini <bonzini@gnu.org>
3288
3289 * data/lalr1.java (Stack): Work around old verifiers that disallow
3290 access to the private fields of an inner class, from the outer class.
3291 We can make Stack's fields public because user code doesn't have access
3292 to the instance of Stack used by parse(). Reported by Paul Eggert.
3293
2c2b7220
PE
32942007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3295
3296 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3297 the right spot for these files?
3298 * bootstrap.conf (gnulib_modules): Add c-strcase.
3299 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3300 c-strncasecmp.c.
3301 * src/getargs.c: Include c-strcase.h.
3302 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3303 to avoid unspecified behavior.
3304
b2b81dae
JD
33052007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3306
3307 * doc/bison.texinfo (Decl Summary): Correct typo.
3308
c1d19e10
PB
33092007-01-30 Paolo Bonzini <bonzini@gnu.org>
3310
3311 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3312 Complain if the value does not match empty, "true" or "false".
3313 * data/c++.m4: Adjust default definitions of %define variables.
3314 * data/java.m4: Adjust default definitions of %define variables.
3315 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3316 to above behavior.
3317 * tests/input.at (Boolean %define variables): Test new behavior.
3318
8405b70c
PB
33192007-01-29 Paolo Bonzini <bonzini@gnu.org>
3320
3321 * NEWS: Mention java.
3322 * TODO: Remove things that are done.
3323 * bootstrap.conf: Add javacomp-script and javaexec-script.
3324 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3325
3326 * data/Makefile.am: Add new files.
3327 * data/java-skel.m4: New.
3328 * data/java.m4: New.
3329 * data/lalr1.java: New.
3330
3331 * doc/bison.texinfo: Put "A Complete C++ Example" under
3332 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3333 under Other Languages.
3334
3335 * src/getargs.c (valid_languages): Add Java.
3336 * src/getargs.h (struct bison_language): Update size of string fields.
3337
3338 * tests/Makefile.am: Add java.at.
3339 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3340 * tests/java.at: New.
3341 * tests/testsuite.at: Include it.
3342
3eb82471
JD
33432007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3344
3345 Clean up.
3346 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3347 at_directive_argv arguments so these no longer have to be global
3348 variables. Also, update the implementation for the following changes.
3349 (fail_for_at_directive_too_many_args,
3350 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3351 (at_directive_name): Remove as at_directive_argv[0] will be used for
3352 this now.
3353 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3354 for the directive name.
3355 (at_directive_argc, at_directive_argv): Make these local within
3356 skel_lex instead of global.
3357 (INITIAL): Update directive start action for above changes.
3358 (SC_AT_DIRECTIVE_ARG): Rename to...
3359 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3360 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3361 (scan_skel): Move yylex_destroy to...
3362 (skel_scanner_free): ... here.
3363 * tests/skeletons.at (installed skeleton file name): Rename to...
3364 (installed skeleton file names): ... this.
3365
148d66d8
JD
33662007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3367
3368 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3369 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3370 Summary" not "Directives".
3371 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3372 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3373 since the former is now the more complete one.
3374 (Prologue Alternatives): Likewise and do the same for %defines.
3375 (Table of Symbols): Add summary of %code, add summary of %define, and
3376 move full %code documentation to...
3377 (Decl Summary): ... here for consistency with other entries in these
3378 sections.
3379 Move %define entry in order to keep this list alphabetized.
3380 Reword %define entry a little to put less emphasis on the skeleton
3381 concept, which most users shouldn't have to think about.
3382
665f0c24
PE
33832007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3384
3385 Adjust to recent gnulib changes.
3386 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3387 Add string.h, string_.h, unistd_.h, wchar_.h.
3388 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3389 * src/system.h: Don't include <stpcpy.h>; this is now done by
3390 <string.h>.
3391
592d0b1e
PB
33922007-01-23 Paolo Bonzini <bonzini@gnu.org>
3393
3394 Simplify implementation of unqualified %code, implement macros for
3395 uniform treatment of boolean %define flags. Document %define.
3396 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3397 b4_percent_code_ifdef): New.
3398 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3399 * data/c++.m4: Define default value for global_tokens_and_yystype.
3400 * data/glr.cc: Likewise.
3401 * data/location.cc: Use b4_percent_define_flag_if.
3402
148d66d8 3403 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
3404
3405 * src/parse-gram.y (Unqualified %code): Change muscle name to
3406 b4_percent_code().
3407 (content.opt): Default to empty.
3408
a7867f53
JD
34092007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3410
3411 Implement support for relative and absolute skeleton file names.
3412 Discussed starting at
3413 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3414 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3415 (Bison Options): Document in --skeleton entry.
3416 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3417 full_skeleton can't necessarily hold all of pkgdatadir.
3418 If the specified skeleton file name contains a `/', don't prepend
3419 pkgdatadir.
3420 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3421 file name contains a `/', prepend the grammar file directory.
3422 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3423 * skeletons.at: New file.
3424 (relative skeleton file names): New test case.
3425 (installed skeleton file names): New test case.
3426 * tests/testsuite.at: Include skeletons.at.
3427
3428 * bootstrap: Update copyright to 2007.
3429
830c9b18
PB
34302007-01-17 Paolo Bonzini <bonzini@gnu.org>
3431
3432 * bootstrap: Remove occurrences of .#bootmp from the files.
3433
a8c2e813
AD
34342007-01-17 Akim Demaille <akim@epita.fr>
3435
3436 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3437 nonterminals.
3438 Use per-type %printer.
3439
279cabb6
JD
34402007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3441
3442 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3443 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3444 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3445 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3446 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3447 tests/glr-regression.at, tests/input.at, tests/local.at,
3448 tests/output.at, tests/torture.at: Update copyright to 2007.
3449
bb32f4f2
AD
34502007-01-16 Akim Demaille <akim@epita.fr>
3451
3452 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3453 error code.
3454 (Calc++ Scanner): Exit with failure if we can't open the input
3455 file.
3456 Accept "-" standing for stdin.
3457 (Calc++ Top Level): Print the result only if the parsing was
3458 successful.
3459
7cff04b5
AD
34602007-01-16 Akim Demaille <akim@epita.fr>
3461
3462 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3463
a4e25e1d
JD
34642007-01-15 Paolo Bonzini <bonzini@gnu.org>
3465 and Joel E. Denny <jdenny@ces.clemson.edu>
3466
3467 Clean up %define and %code implementation in M4 some. Most
3468 importantly, rename all related macros to be in the b4_percent_define
3469 and b4_percent_code namespaces. Also, complete support for `.' in
3470 %define variable names and %code qualifiers.
3471 * data/bison.m4 (b4_check_user_names): Check for special
3472 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3473 m4_foreach loops.
3474 (b4_get_percent_define, b4_get_percent_code): Rename to...
3475 (b4_percent_define_get, b4_percent_code_get): ... these.
3476 Extend documentation with examples.
3477 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3478 b4_percent_define_skeleton_variables and
3479 b4_percent_code_skeleton_qualifiers.
3480 Expect any value for the %define variable `foo' to be stored in the
3481 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3482 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3483 expect any unqualified %code blocks to be stored in a macro named
3484 `b4_percent_code_unqualified'.
3485 Use m4_indir so that %define variable names and %code qualifiers can
3486 contain `.', which is allowed by the grammar parser.
3487 (b4_percent_define_default): New macro to set a default value for a
3488 %define variable.
3489 (m4_wrap): Update wrapped code, and fix some underquoting.
3490 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3491 Expect grammar uses of %define variables and %code qualifiers to be
3492 defined in b4_percent_define_user_variables and
3493 b4_percent_code_user_qualifiers.
3494 * data/c++.m4: Use b4_percent_define_default rather than
3495 m4_define_default. Fix some underquoting. Skeleton usage of %define
3496 variable define_location_comparison now implies skeleton usage of
3497 %define variable filename_type.
3498 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3499 data/push.c, data/yacc.c: Update macro names.
3500 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3501 muscle names.
3502
e37c665c
JMG
35032007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3504
3505 DJGPP specific issues.
3506
3507 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3508 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3509
7d2d521f
JD
35102007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3511
3512 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3513 run parsers in all tests so that Valgrind is invoked during
3514 maintainer-check-valgrind.
3515 (Duplicate representation of merged trees): Free all semantic values.
3516 (Duplicated user destructor for lookahead): Likewise.
3517
e0ac9b4b
JD
35182007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3519
3520 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3521 command-line prefix.
3522 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3523 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3524 miss Valgrind messages.
3525 (Exploding the Stack Size with Malloc): Likewise.
3526
78143faa
JD
35272007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3528
3529 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3530 locals. Reported by Juan Manuel Guerrero at
3531 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3532 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3533 Fix some indentation also.
3534 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3535 explaining this issue.
3536
7ecec4dd
JD
35372007-01-09 Paolo Bonzini <bonzini@gnu.org>
3538 and Joel E. Denny <jdenny@ces.clemson.edu>
3539
3540 Simplify union and prologue handling, and escape union and lex/parse
3541 params with digraphs.
3542 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3543 values to the empty string since these are no longer guaranteed
3544 initialized by the front-end.
3545 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3546 braces around b4_user_stype since this is no longer done by the
3547 front-end.
3548 * src/files.c, src/files.h (pre_prologue_obstack,
3549 post_prologue_obstack): Remove.
3550 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3551 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3552 with digraphs. This fixes lex params and parse params.
3553 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3554 * src/output.c (prepare): Remove muscle insertion of the prologues.
3555 (output): Remove freeing of pre_prologue_obstack and
3556 post_prologue_obstack.
3557 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3558 than prologue_augment for prologue parsing so you don't need prologue
3559 obstacks.
5c80250c
JD
3560 (grammar_declaration): For %union RHS, use `braceless' instead of
3561 "{...}" so that braces are already stripped and code is escaped with
3562 digraphs.
7ecec4dd
JD
3563 * src/reader.c (prologue_augment): Remove.
3564 (reader): Remove initialization of pre_prologue_obstack and
3565 post_prologue_obstack.
3566 * src/reader.h (prologue_augment): Remove.
3567
3568 * data/c.m4: Remove stray parenthesis.
3569
16dc6a9e
JD
35702007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3571
3572 Remove quotes from variables names in %define directives and from
3573 qualifiers in %code directives, and restrict the characters that are
3574 allowed in them to M4-friendly ones. For %define, continue to support
3575 the quoted form as a deprecated feature. Discussed starting at
3576 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3577 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3578 %code.
3579 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
3580 (Decl Summary): In %defines entry, update mention of `%code requires'
3581 and `%code provides'.
16dc6a9e
JD
3582 (C++ Location Values): Update %define uses.
3583 (Calc++ Parser Interface): Likewise.
3584 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 3585 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
3586 * src/parse-gram.y (prologue_declaration): For %define variables, use
3587 `variable' instead of `STRING'.
3588 (grammar_declaration): For %code qualifiers, use `ID' instead of
3589 `STRING'.
3590 (variable): New nonterminal that takes an `ID' or a `STRING'.
3591 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3592 and %define uses.
3593 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3594 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3595 (%define errors): Update %define uses.
3596
e9813cd4
JD
35972007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3598
3599 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3600 instead of muscle_insert for %define values so that M4-special
3601 characters are replaced with digraphs.
3602 * tests/input.at (%define errors): Extend to check weird values.
3603
6afc30cc
JD
36042007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3605
3606 Instead of having skeletons declare all valid %define variables and
3607 %code qualifiers, provide macros that retrieve the associated values
3608 and build these lists automatically. Thus Bison will now warn when a
3609 variable or qualifier is not used by the skeleton in the current
3610 invocation regardless of whether it might sometimes be used by that
3611 skeleton in other invocations. Also, move all %define value macros to
3612 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3613 form, which is replaced by %code.
3614 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3615 (b4_check_user_names): ... this, and change the series of valid name
3616 arguments to a single list argument for names used in the skeleton
3617 similar to the existing list argument for names used in the grammar.
3618 Warn instead of complaining.
3619 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3620 values and %code code, to format %code code properly, and to build
3621 lists of all %define variables and %code qualifiers used in the
3622 skeleton: b4_skeleton_percent_define_variables and
3623 b4_skeleton_percent_code_qualifiers.
3624 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3625 Remove, and...
3626 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3627 the skeleton names lists can finish building first. In place of
3628 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3629 expect the lists b4_user_percent_define_variables and
3630 b4_user_percent_code_qualifiers.
3631 * data/c++.m4: Where setting default values for b4_parser_class_name,
3632 b4_location_type, b4_filename_type, b4_namespace, and
3633 b4_define_location_comparison, update their names to the
3634 b4_percent_define_ namespace.
3635 * data/glr.c: Don't use b4_check_percent_define_variables and
3636 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3637 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3638 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 3639 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
3640 * data/location.cc: Use b4_get_percent_define.
3641 * data/push.c: Don't use b4_check_percent_define_variables and
3642 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3643 * data/yacc.c: Likewise, and don't call m4_exit in
3644 b4_use_push_for_pull_if or m4_wrap code will never execute.
3645 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3646 Rename to...
3647 (muscle_grow_user_name_list): ... this for consistency with the
3648 terminology used in bison.m4.
3649 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3650 %define variable names, and rename muscle used_percent_define_variables
3651 to user_percent_define_variables.
3652 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3653 user_percent_code_qualifiers.
3654 (content): Remove.
3655 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3656 {CODE} form is no longer accepted.
3657 * tests/input.at (Reject bad %code qualifiers): Rename to...
3658 (Reject unused %code qualifiers): ... this, and update test output.
3659 (%define error): Update test output.
3660
7eb8a0bc
JD
36612007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3662
3663 Check for unrecognized %define variables similar to checking for
3664 unrecognized %code qualifiers. Check for redefined %define variables.
3665 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3666 generalizes...
3667 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3668 (b4_check_percent_define_variables): New, also wraps it.
3669 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3670 variables using b4_check_percent_define_variables.
3671 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3672 all those exercised in the test suite and all those listed in the
3673 `Default values' section of c++.m4. Are there others?
3674 * data/push.c, data/yacc.c: Declare no valid %define variables.
3675 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3676 similar to muscle_find, but it works even when the muscle stores a
3677 const value.
3678 (muscle_grow_used_name_list): New function for constructing the used
3679 name list muscles that b4_check_for_unrecognized_names requires.
3680 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3681 %define'd more than once. Define the b4_used_percent_define_variables
3682 muscle with muscle_grow_used_name_list.
3683 (grammar_declaration): Abbreviate %code code with
3684 muscle_grow_used_name_list.
3685 * tests/input.at (%define errors): New.
3686
3fc65ead
JD
36872007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3688
3689 Provide warn_at, complain_at, and fatal_at function callbacks to the
3690 skeletons, and use this for %code qualifier complaints.
3691 * data/bison.m4 (b4_error_at): New, invoked by...
3692 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3693 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3694 @fatal_at(...@) directives.
3695 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3696 qualifiers in b4_used_percent_code_qualifiers and to use
3697 b4_complain_at.
3698 * src/location.c, src/location.h (boundary_set_from_string): New global
3699 function.
3700 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3701 function.
3702 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3703 to b4_used_percent_code_qualifiers.
3704 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3705 function.
3706 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3707 (lineno): Rename to...
3708 (out_lineno): ... this so I don't misunderstand it again.
3709 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3710 here; these newlines are in the input but not the output file.
3711 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3712 (at_directive_perform): ... this new static function, and add handling
3713 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3714 directives.
3715 * tests/input.at (Reject bad %code qualifiers): Update test output with
3716 locations and extend.
3717
3718 * tests/output.at (Output file name: [, Output file name: ]): Remove
3719 bogus comment about these tests failing.
3720
1c7b7e1d
JD
37212007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3722
3723 Clean up b4_check_percent_code_qualifiers a little.
3724 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3725 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3726 documentation and add examples.
3727 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3728 qualifiers here.
3729
08af01c2
JD
37302007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3731
3732 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3733 unreliable -- especially when they're hidden inside another macro.
3734 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3735 data/c.m4: Remove m4_divert(-1).
3736 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3737 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3738 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 3739 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
3740 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3741 pushed and popped by m4sugar, should be first on the stack.
3742
3743 Provide warn, complain, and fatal function callbacks to the skeletons.
3744 This provides more flexibility than m4_fatal, improves the error
3745 message format, and captures messages for translation. Discussed
3746 starting at
3747 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3748 * data/bison.m4 (b4_error): New, invoked by...
3749 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3750 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3751 directives. Because these M4 macros might be called when the current
3752 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3753 the previous removal of uses of m4_divert, which caused trouble.
3754 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3755 m4_fatal to report unrecognized %code qualifiers.
3756 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3757 push parser requests.
3758 * data/glr.c: Use b4_complain instead of m4_fatal to report
3759 non-deterministic push parser requests.
3760 Update @output usage to @output(...@) form.
3761 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3762 report missing %defines. Update @output usage to @output(...@) form.
3763 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3764 @output(...@) form.
3765 * src/main.c (main): Invoke skel_scanner_free.
3766 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3767 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3768 obstack_for_string from flex-scanner.h.
3769 (YY_DECL): Use to declare skel_lex static.
3770 (decode_at_digraphs): Remove; now handled in the new
3771 SC_AT_DIRECTIVE_ARG start condition.
3772 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3773 functions.
3774 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3775 at_directive_argv): New static globals.
3776 (INITIAL): Use fail_for_invalid_at.
3777 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3778 recognize the start of a generalized `@directive(...@)' form and
3779 start...
3780 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3781 directive args (using the new obstack_for_string), to decode the
3782 contained @ diagraphs, and to perform the directive. It recognizes
3783 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3784 @output(...@).
3785 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3786 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3787 `@,'.
3788 (scan_skel): Initialize obstack_for_string on the first call.
3789 (skel_scanner_free): New function to free obstack_for_string.
3790 * tests/input.at (Reject bad %code qualifiers): Update test output.
3791
8e0a5e9e
JD
37922007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3793
3794 Consolidate the 4 prologue alternative directives (%code, %requires,
3795 %provides, and %code-top) into a single %code directive with an
3796 optional qualifier field. Discussed at
3797 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3798 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3799 alternatives.
3800 * doc/bison.texinfo (Prologue Alternatives): Update.
3801 (Decl Summary): Update to %code "requires" and %code "provides".
3802 (Calc++ Parser): Update to %code "requires".
148d66d8 3803 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
3804 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3805 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3806 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3807 which are skeleton-specific.
3808 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3809 declare what %code qualifiers it supports and to complain if any other
3810 qualifiers were used in the grammar.
3811 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3812 and b4_user_code([b4_percent_code_provides]) in place of
3813 b4_user_requires and b4_user_provides.
3814 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3815 Add b4_user_code([b4_percent_code_top]) and
3816 b4_user_code([b4_percent_code]).
3817 Invoke b4_check_percent_code_qualifiers.
3818 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3819 PERCENT_REQUIRES): Remove.
3820 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3821 %requires. Rewrite the %code RHS as the unqualified form defining the
3822 muscle b4_percent_code. Add another RHS for the qualified %code form,
3823 which defines muscles of the form b4_percent_code_QUALIFIER and the
3824 b4_used_percent_code_qualifiers muscle.
3825 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3826 PERCENT_REQUIRES): Remove.
3827 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3828 %code "requires" and %code "provides".
3829 * tests/input.at (Reject bad %code qualifiers): New.
3830
95021767
JD
38312007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3832
3833 Use the new code_props interface for destructors and printers.
3834 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3835 printer_location members, and change the type of the destructor and
3836 printer members to code_props.
3837 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3838 symbol_printer_get, semantic_type_destructor_set,
3839 semantic_type_printer_set, default_tagged_destructor_set,
3840 default_tagless_destructor_set, default_tagged_printer_set,
3841 default_tagless_printer_set): Use code_props in arguments and return
3842 types in place of char const * and location.
3843 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3844 since the locations are now contained in the return of
3845 symbol_destructor_get and symbol_printer_get.
3846 * src/output.c (symbol_destructors_output, symbol_printers_output):
3847 Replace with...
3848 (symbol_code_props_output): ... this to eliminate duplicate code.
3849 (output_skeleton): Update to use symbol_code_props_output.
3850 * src/reader.c (symbol_should_be_used): Update use of
3851 symbol_destructor_get.
3852 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3853 Update uses of the various _destructor_set and _printer_set functions.
3854 * src/symtab.c: (default_tagged_destructor_location,
3855 default_tagless_destructor_location, default_tagged_printer_location,
3856 default_tagless_printer_location): Remove since we...
3857 (default_tagged_destructor, default_tagless_destructor,
3858 default_tagged_printer, default_tagless_printer): ... change the type
3859 of these to code_props.
3860 (symbol_new, semantic_type_new, symbol_destructor_set,
3861 semantic_type_destructor_set, symbol_destructor_get,
3862 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3863 symbol_check_alias_consistency, default_tagged_destructor_set,
3864 default_tagless_destructor_set, default_tagged_printer_set,
3865 default_tagless_printer_set): Update.
3866 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3867 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3868 code_props members.
3869 (symbol_print): Use SYMBOL_CODE_PRINT.
3870
f6857bbf
JD
38712007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3872
3873 Use the new code_props interface for rule actions.
3874 * src/symlist.h (symbol_list): Replace action, action_location, and
3875 used members with a code_props action_props member.
3876 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3877 grammar_midrule_action, grammar_current_rule_merge_set,
3878 grammar_current_rule_symbol_append, packgram): Update.
3879 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3880 * src/scan-code.l (handle_action_dollar): Update.
3881 (translate_rule_action): Remove, no longer used.
3882 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3883
7c0c6181
JD
38842007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3885
3886 Use the new code_props interface in parse-gram.y.
3887 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3888 Update all uses of translate_* functions to use the new code_props
3889 interface and to use gram_scanner_last_string_free and
3890 code_scanner_last_string_free where possible.
3891 (grammar_declaration): symbol_list_destructor_set and
3892 symbol_list_printer_set now perform the translation, so don't do it
3893 here. Use gram_scanner_last_string_free where possible.
3894 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3895 translate_code): Remove, no longer used.
3896 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3897 symbol_list_printer_set): Perform code translation here rather than
3898 depending on the caller to do so.
3899
3900 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3901 * src/scan-gram.h (gram_last_string): Remove declaration.
3902 * src/scan-gram.l (last_string): Declare it static.
3903
28e52c0d
JD
39042007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3905
3906 Encapsulate code properties and related functionality for the various
3907 destructors, printers, and actions into a code_props structure and
3908 interface. This patch merely implements code_props in scan-code.h and
3909 scan-code.l. Future patches will rewrite other modules to use it.
3910 Discussed starting at
3911 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3912 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3913 consistently initialize const structs that have an empty location
3914 field.
3915 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3916 to ensure consistency.
3917 * src/scan-code.h (code_props): New structure.
3918 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3919 function, macro, and const global variable for initializing a
3920 code_props with no code.
3921 (code_props_plain_init, code_props_symbol_action_init,
3922 code_props_rule_action_init, code_props_translate_code): The rest of
3923 the new code_props functional interface. Among other things, the init
3924 functions set the code_props kind field so that
3925 code_props_translate_code will know whether to behave like
3926 translate_symbol_action, translate_rule_action, or translate_code.
3927 These old translate functions must remain until all other modules are
3928 updated to use the new code_props interface.
3929 (code_scanner_last_string_free): New function similar to
3930 gram_scanner_last_string_free.
3931 (code_scanner_free): Add documentation.
3932 * src/scan-code.l: Implement the new interface.
3933 (code_lex): Make it static, add a code_props* argument, and remove the
3934 rule argument.
3935 (last_string): New static global similar to the one in scan-gram.l.
3936 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3937 instead of rule.
3938 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3939 code_props since Bison may one day use this information for destructors
3940 and printers.
3941 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3942 (handle_action_dollar): Use symbol_list_n_get and set used flag
3943 directly since symbol_list_n_used_set is removed.
3944 (translate_action): Add a code_props* argument and remove the rule,
3945 action, and location arguments. Pass the code_props* on to code_lex.
3946 (translate_rule_action, translate_symbol_action, translate_code):
3947 Rewrite as wrappers around the new code_props interface.
3948 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3949 it would eventually need to break the encapsulation of code_props.
3950
96034983
JD
39512007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3952
3953 * etc/.cvsignore: New.
3954
945e396c
JD
39552007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3956
3957 Add maintainer-push-check to run maintainer-check using push parsing in
3958 place of pull parsing where available.
3959 * Makefile.am (maintainer-push-check): New.
3960 * data/bison.m4 (b4_use_push_for_pull_if): New.
3961 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3962 appropriately based on their existing values.
3963 (yypush_parse): Don't print push-parser-specific diagnostics if push
3964 parsing is being used in place of pull parsing.
3965 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3966 push.c.
3967 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3968 variable, and insert b4_use_push_for_pull_flag into muscles.
3969 * tests/Makefile.am (maintainer-push-check): New.
3970
7d596384
JD
39712006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3972
3973 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3974 (whether successful or failed) so that yypush_parse can be invoked
3975 again to start a new parse using the same yypstate.
3976 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3977 check multiple yypull_parse invocations on the same yypstate. For pull
3978 mode, extend to check multiple yyparse invocations.
3979 (Exploding the Stack Size with Alloca): Extend to try with
3980 %push-pull-parser.
3981 (Exploding the Stack Size with Malloc): Likewise.
3982
3983 * tests/calc.at (Simple LALR Calculator): Don't specify
3984 %skeleton "push.c" since %push-pull-parser implies that now.
3985 * tests/headers.at (export YYLTYPE): Don't check for the push
3986 declarations. Otherwise, this test case can't be used to see if push
3987 mode can truly emulate pull mode.
3988 * tests/input.at (Torturing the Scanner): Likewise.
3989 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
3990 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
3991 AT_YACC_IF, which now includes the case of push mode since %skeleton
3992 need not be used for push mode. This will be more intuitive once
3993 push.c is renamed to yacc.c.
3994
7172e23e
JD
39952006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3996
3997 For push mode, convert yyparse from a macro to a function, invoke yylex
3998 instead of passing a yylexp argument to yypull_parse, and don't
3999 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4000 Discussed starting at
4001 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4002 * data/bison.m4 (b4_pull_if): New.
4003 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4004 * data/push.c: Improve M4 quoting a little.
4005 (b4_generate_macro_args, b4_parenthesize): Remove.
4006 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4007 any time a pull parser is requested.
4008 Don't #define this as a wrapper around yypull_parse. Instead, when
4009 both push and pull are requested, make it a function that does that
4010 same thing.
4011 (yypull_parse): If there's a b4_prefix, #define this to
4012 b4_prefix[pull_parse] when both push and pull are requested.
4013 Don't define this as a function unless both push and pull are
4014 requested.
4015 Remove the yylexp argument and hard-code yylex invocation instead.
4016 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4017 %push-parser.
4018 * src/getargs.c (pull_parser): New global initialized to true.
4019 * getargs.h (pull_parser): extern it.
4020 * src/output.c (prepare): Insert pull_flag muscle.
4021 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4022 (prologue_declaration): Set both push_parser and pull_parser = true for
4023 %push-pull-parser. Set push_parser = true and pull_parser = false for
4024 %push-parser.
4025 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4026 %push-parser since there's no backward-compatibility concern here.
4027 Scan %push-pull-parser.
4028 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4029 instead of %push-parser.
4030 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4031 prototype it in the module that calls yyparse.
4032 * tests/input.at (Torturing the Scanner): Likewise.
4033 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4034
2e7944cb
JD
40352006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4036
4037 Update etc/bench.pl. Optimize push mode a little (the yyn change
4038 deserves most of the credit).
4039 * Makefile.am (SUBDIRS): Add etc subdirectory.
4040 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4041 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4042 yytoken, yyval, and yyloc declarations to...
4043 (yyparse or yypush_parse): ... here to improve performance. For
4044 yypush_parse invocations after the first, be sure to assign yyn its old
4045 value again.
4046 (yypstate_new): Don't bother initializing the yyresult field since the
4047 initial value isn't used.
4048 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4049 remove the #define that, in push mode, set it to yyps->NAME.
4050 * etc/Makefile.am: New.
4051 * etc/bench.pl: Remove and build it instead from...
4052 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4053 "tests/bison" from the build directory by default rather than just
4054 invoking "bison" from $PATH.
4055 (calc_grammar): Update push parser code: don't declare yylval globally,
4056 don't define yyparse_wrapper, and don't #define yyparse.
4057 (bench_grammar): Update to check all working combinations of yacc.c,
4058 push.c, impure, pure, pull, and push.
4059
c3d50342
JD
40602006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4061
4062 For push mode, add pull wrappers around yypush_parse.
4063 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4064 (yypull_parse): New function wrapping yypush_parse.
4065 (yyparse): New #define wrapping yypull_parse.
4066 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4067 is declared.
4068 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4069 prototype yylex in the module that calls yyparse, and don't prototype
4070 yyparse there. Otherwise, the yyparse expansion won't compile.
4071 * tests/input.at (Torturing the Scanner): Likewise.
4072
94ebeba5
JD
40732006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4074
4075 Enable push parsers to operate in impure mode. Thus, %push-parser no
4076 longer implies %pure-parser. The point of this change is to move
4077 towards being able to test the push parser code by running the entire
4078 test suite as if %push-parser had been declared.
4079 * data/push.c (yypush_parse): For impure mode, remove the
4080 yypushed_char, yypushed_val, and yypushed_loc arguments.
4081 Instead, declare these as local variables initialized to the global
4082 yychar, yylval, and yylloc.
4083 For the first yypush_parse invocation only, restore the initial values
4084 of these global variables when it's time to read a token since they
4085 have been overwritten.
4086 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4087 %push-parser.
4088 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4089 %pure-parser along with %push-parser since this test case was designed
4090 for pure push parsers.
4091 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4092 (AT_YACC_OR_PUSH_IF): New.
4093 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4094 add a note that it's still wrong for some cases (as it has been for a
4095 while).
4096 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4097 %push-parser no longer implies %pure-parser.
4098
a0633178
JD
40992006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4100
4101 Remove some unnecessary differences between the pull parser code and
4102 the push parser code. This patch enables yynerrs in push mode.
4103 * data/push.c: Reformat M4 a little.
4104 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4105 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4106 because push mode is on. Instead, if pure mode is on, move yynerrs
4107 to...
4108 (b4_declare_parser_state_variables): ... here.
4109 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4110 to yyps->NAME so it can be used in yypush_parse.
4111 (yypush_parse): Don't omit uses of yynerrs in push mode.
4112
8646b6a3
JD
41132006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4114
4115 Fix bug such that the first pushed token's value and location are
4116 sometimes overwritten (sometimes by %initial-action) before being used.
4117 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4118 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4119 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4120 more closely mimic the pull parser logic.
4121 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4122 time to read a token, which is after any initialization of yylval and
4123 yylloc.
4124 (gottoken): Rename label to...
4125 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4126 user namespace.
4127
9baf4d74
JD
41282006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4129
4130 Rearrange initialization of the parser state variables so that the
4131 skeleton doesn't have to have a copy for pull mode and another for push
4132 mode. This patch also fixes at least a bug such that yylloc was not
4133 initialized (with b4_location_initial_line and
4134 b4_location_initial_column) upon calling yypush_parse. However, that
4135 initialization now overwrites the first token's location;
4136 %initial-action assigning @$ already did the same thing, and both bugs
4137 will be fixed in a later patch.
4138 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4139 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4140 yyss, yyvs, yyls, and yystacksize.
4141 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4142 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4143 yylsp.
4144 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4145 yyps->NAME so it can be used in yypush_parse.
4146 (yyparse or yypush_parse): For yypush_parse, don't print the
4147 "Starting parse" diagnostic for invocations after the first.
4148 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4149 yypush_parse, only do it for the first invocation.
4150 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4151 initialization to occur in yypush_parse but only on the first
4152 invocation.
4153
23522164
JD
41542006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4155
4156 * data/push.c: Add CPP guards around push parser declarations in both
4157 the header and the code file.
4158 In the code file, move the push parser declarations to the same place
4159 they appear in the header file.
4160 Clean up the M4 some, especially the inconsistent underquoting in
4161 some b4_c_function_def and b4_c_function_decl uses.
4162
bb010fe5
JD
41632006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4164
4165 Encapsulate the push parser state variables into an M4 macro so the
4166 push skeleton doesn't have to list them again for pull mode's yyparse.
4167 For push mode, remove yypush_parse's local equivalents of these
4168 variables to eliminate unnecessary copying between the two sets at
4169 run-time. This patch also fixes at least a bug related to multiple
4170 %initial-action invocations in push mode.
4171 * data/push.c (b4_declare_parser_variables): Rename to...
4172 (b4_declare_scanner_communication_variables): ... this for clarity and
4173 update both uses.
4174 (b4_declare_yyparse_variables): Remove and move its contents to the one
4175 spot where it was invoked.
4176 (b4_declare_parser_state_variables): New macro containing the parser
4177 state variables required by push mode.
4178 (struct yypstate): Replace all fields but yynew with
4179 b4_declare_parser_state_variables.
4180 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4181 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4182 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4183 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4184 parser state variable declarations with
4185 b4_declare_parser_state_variables.
4186 Don't initialize parser state variables when calling yypush_parse since
4187 yypstate_new already does that.
4188 Invoke the user's initial action only upon the first yypush_parse
4189 invocation.
4190 Remove all code that copies between the local parser state variables
4191 and the yypstate.
4192
2d212f8c
JD
41932006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4194
4195 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4196 prevent a name collision in a future patch where these names will
4197 sometimes be #define'd.
4198 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4199 since it no longer has the same name as the existing argument.
4200 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4201
e6e704dc
JD
42022006-12-19 Paolo Bonzini <bonzini@gnu.org>
4203 and Joel E. Denny <jdenny@ces.clemson.edu>
4204
4205 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4206 that the argument is case-insensitive, and there's no `=' here.
4207 For the %skeleton entry, mention that %language is better.
4208 (Bison Options): Likewise for --language and --skeleton. Move the
4209 --skeleton entry so that the `Tuning the parser' section is sorted
4210 alphabetically on long options.
4211 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4212 %language directive in detail here; cross-reference the %language
4213 documentation instead.
4214 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4215 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 4216 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
4217 * examples/extexi (normalize): Instead of replacing every %require
4218 argument with the current Bison version, just substitute for
4219 `@value{VERSION}'. This guarantees that we're testing what actually
4220 appears in the documentation.
4221 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4222 rather than `@VERSION@'.
4223
0e021770
PE
42242006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4225
fd575f05
PE
4226 * NEWS: Reword the %language news a bit, and put it earlier.
4227
0e021770
PE
4228 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4229 Rewrite to simplify the logic.
4230 (language_argmatch): Likewise.
fd575f05
PE
4231 (program_name): We now own this var.
4232 * src/getargs.h (struct bison_language): Use char[] rather than
4233 const char *.
0e021770
PE
4234
4235 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4236 Java is supported.
4237 * src/complain.c (program_name): Remove decl; no longer needed.
4238 * src/main.c (program_name): Remove; now belongs to getargs.
4239
42402006-12-18 Paolo Bonzini <bonzini@gnu.org>
4241
4242 * NEWS: Document %language.
4243
4244 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4245
4246 * data/c-skel.m4, data/c++-skel.m4: New files.
4247 * data/glr.c: Complain on push parsers.
4248
4249 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4250 over %skeleton.
148d66d8 4251 (Decl Summary): Document %language and %skeleton.
0e021770
PE
4252 (Command line): Document -L.
4253
4254 * examples/extexi: Rewrite %require directive.
4255 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4256
4257 * src/files.c (compute_exts_from_gc): Look in language structure
4258 for .y extension.
4259 (compute_file_name_parts): Check whether .tab should be added.
4260 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4261 (language, skeleton_arg, language_argmatch): New.
4262 (long_options): Add --language.
4263 (getargs): Use skeleton_arg, add -L/--language.
4264 * src/getargs.h: Include location.h.
4265 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4266 * src/output.c (prepare): Pick default skeleton from struct language.
4267 Don't dispatch C skeletons here.
4268 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4269 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4270 * src/scan-gram.l ("%language"): New rule.
4271
4272 * tests/calc.at: Test %skeleton and %language.
4273 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4274 (AT_GLR_IF): Look for %skeleton "glr.cc".
4275 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4276 (AT_YACC_IF): Reject %language.
4277
5691bf57
PE
42782006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4279
db06f0ce
PE
4280 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4281 since it wasn't used; only the typedef name 'semantic_type' is needed.
4282 Also, omit trailing white space.
4283
5691bf57
PE
4284 * bootstrap: Sync from coreutils.
4285 (gnulib_extra_files): Add build-aux/announce.gen.
4286 (slurp): Adjust .gitignore files like .cvsignore files.
4287 * build-aux/announce-gen: Remove from CVS, since bootstrap
4288 now creates this.
4289
791934e4
JD
42902006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4291
4292 Make %push-parser imply %pure-parser. This fixes several bugs; see
4293 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4294 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4295 pure_parser = true.
4296 * data/push.c: Don't bother testing b4_push_if when deciding whether
4297 to expand b4_declare_parser_variables globally.
4298 (yypush_parse): Likewise in here.
4299
4300 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4301 (yy_reduce_print): Reformat M4 for readability.
4302
ee5abb37
JD
43032006-12-15 Bob Rossi <bob@brasko.net>
4304 and Joel Denny <jdenny@ces.clemson.edu>
4305
4306 * data/push.c (yypstate): Add typedef, and update all uses of
4307 struct yypstate to just yypstate.
4308 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4309
16ca01f9
JD
43102006-12-14 Bob Rossi <bob@brasko.net>
4311
4312 * data/push.c (yypush_parse): Declare prototype regardless of
4313 %locations option.
4314
ab8e7e1a
JD
43152006-12-14 Bob Rossi <bob@brasko.net>
4316
4317 * data/push.c (yyparse): Remove the prototype and the #define when in
4318 push-parser mode.
4319
9bf32be3
JD
43202006-12-13 Bob Rossi <bob@brasko.net>
4321
4322 * data/push.c (yypstate_init): Rename to...
4323 (yypstate_new): ... this and use b4_c_function_def.
4324 (yypstate_delete): New.
4325 (yypush_parse): Change parameters yynval and yynlloc to be const.
4326 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4327 yypstate_delete functions.
4328
f02e2948
JD
43292006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4330
4331 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4332 strange test case titles. Reported by Bob Rossi.
4333
38eb7751
PE
43342006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4335
4336 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4337 of potential ambiguities in GLR grammers.
4338
bd9d212b
JD
43392006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4340
4341 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4342 `bison ', use m4_index instead of m4_substr since chopping up a string
4343 containing M4-special characters causes problems here.
4344
4345 Fix a couple of bugs related to special characters in user-specified
4346 file names, and make it easier for skeletons to compute output file
4347 names with the same file name prefix as Bison-computed output file
4348 names.
4349 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4350 b4_parser_file_name and b4_spec_defines_file instead of
4351 @output_parser_name@ and @output_header_name@, which are now redundant.
4352 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4353 b4_parser_file_name, b4_spec_defines_file, and the new
4354 @basename(FILENAME@) instead of @output_parser_name@ and
4355 @output_header_name@, which inappropriately escaped the file names as
4356 C string literals.
4357 * src/files.c (all_but_ext): Remove static qualifier.
4358 (compute_output_file_names): Move `free (all_but_ext)' to...
4359 (output_file_names_free): ... here since all_but_ext is needed later.
4360 * src/files.h (all_but_ext): Extern.
4361 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4362 exactly what MUSCLE_INSERT_STRING used to do.
4363 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4364 characters are escaped properly.
4365 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4366 all_but_ext.
4367 For pkgdatadir muscle, maintain previous functionality by using
4368 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4369 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4370 digraphs would never be expanded. Hopefully no one has M4-special
4371 characters in his Bison installation path.
4372 * src/scan-skel.l: Don't parse @output_header_name@ and
4373 @output_parser_name@ anymore since they're now redundant.
4374 In @output, use decode_at_digraphs.
4375 Parse a new @basename command that invokes last_component.
4376 (decode_at_digraphs): New.
4377 (BASE_QPUTS): Remove unused.
4378 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4379 (Output file name): New tests.
4380
3f7ca628
JD
43812006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4382
4383 Warn about output files that are generated by the skeletons and that
4384 conflict with other output files.
4385 * data/glr.c: Don't generate the header file here when glr.cc does.
4386 * src/files.c (file_names, file_names_count): New static globals.
4387 (compute_output_file_names): Invoke output_file_name_check for files
4388 not generated by the skeletons and remove existing checks.
4389 (output_file_name_check): New function that warns about conflicting
4390 output file names.
4391 (output_file_names_free): Free file_names.
4392 * src/files.h (output_file_name_check): Declare.
4393 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4394 the skeletons.
4395 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4396 (Conflicting output files): New tests.
4397
178e123e
PE
43982006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4399
4400 * doc/bison.texinfo: Fix a couple of typos.
4401
44022006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
4403
4404 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4405 Rename to...
4406 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4407 update all uses.
4408 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4409 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4410 local pv.
4411 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4412 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4413
ea17f233
JD
44142006-12-07 Bob Rossi <bob@brasko.net>
4415 and Joel Denny <jdenny@ces.clemson.edu>
4416
4417 * data/push.c (yypvarsinit): Change return type from void* to struct
4418 yypvars*. No longer cast to void* on return.
4419 (struct yypvars): Remove yylen since it need not be remembered between
4420 yypushparse invocations.
4421 (yypushparse): Don't copy between yylen and pv->yylen.
4422
55a30bda
JD
44232006-12-05 Bob Rossi <bob@brasko.net>
4424
4425 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4426 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4427 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4428 (struct yypvars): Remove b4_declare_parser_variables.
4429 (yypvarsinit): Remove init code for removed variables.
4430 (global scope): Do not declare b4_declare_parser_variables if
4431 push or pure mode.
4432 (yypushparse): Add b4_declare_parser_variables.
4433 Init new local variables, and remove init code for removed
4434 yypvars variables.
4435 (yyparse): Delete.
4436 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4437 and yyparse for other modes.
4438 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4439 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4440 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4441 (AT_PURE_LEX_IF): True if pure or push parser.
4442
85894313
JD
44432006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4444
4445 Document Yacc prologue alternatives and default %destructor's and
4446 %printer's as experimental. Don't mention Java yet. Discussed at
4447 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4448 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4449 (2.3a): Annotate this entry to say the old forms of these features were
4450 also experimental.
4451 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 4452 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
4453 of Java (we'll want this back eventually).
4454
02975b9a
JD
44552006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4456
4457 Support a file name argument to %defines. Deprecate `=' in
4458 %file-prefix, %name-prefix, and %output. Discussed at
4459 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4460 * NEWS (2.3a+): Mention.
148d66d8 4461 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
4462 form of %defines, and remove `=' from entries for %file-prefix,
4463 %name-prefix, and %output.
4464 * src/parse-gram.y (prologue_declaration): Implement.
4465 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4466 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4467 all but one occurrence of %name-prefix.
4468 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4469 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4470 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4471 occurrence of each of %file-prefix and %output. Add check for %defines
4472 with argument.
4473 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4474 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4475 Remove the `=' from %output.
4476
287b314e
JD
44772006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4478
4479 Don't escape $ in test case titles since Autoconf 2.61 now does that
4480 correctly.
4481 * tests/actions.at (Default %printer and %destructor are not for error
4482 or $undefined): Here.
4483 (Default %printer and %destructor are not for $accept): Here.
4484 * tests/input.at (Invalid $n and @n): Here.
4485
3ebecc24
JD
44862006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4487
4488 Rename <!> to <>. Discussed starting at
4489 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4490 * NEWS (2.3a+): Update.
148d66d8 4491 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
4492 Update.
4493 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4494 * src/scan-gram.l (INITIAL): Implement.
4495 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4496 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4497 comment.
4498 * tests/actions.at (Default tagless %printer and %destructor,
4499 Default tagged and per-type %printer and %destructor,
4500 Default %printer and %destructor are not for error or $undefined,
4501 Default %printer and %destructor are not for $accept,
4502 Default %printer and %destructor for mid-rule values): Update.
4503 * tests/input.at (Default %printer and %destructor redeclared,
4504 Unused values with default %destructor): Update.
4505
26b8a438
JD
45062006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4507
4508 Don't let %prec take a nonterminal.
4509 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4510 token.
4511 * tests/input.at (%prec takes a token): New test checking that %prec
4512 won't take a nonterminal.
4513
07c39ae9
JD
45142006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4515
405d53b7
JD
4516 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4517 it was double-quoted.
07c39ae9
JD
4518 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4519 grammar is maintained with Bison's highest standards.
4520 * src/getargs.c: Fix some typos in Doxygen comments.
4521
580b8926
JD
45222006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4523
4524 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4525 later. Reported by Paul Eggert in
4526 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4527 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4528 * src/scan-code.l (translate_action): Don't bother invoking
4529 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4530 (code_scanner_free): Instead of invoking
4531 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4532 which frees more.
4533 * src/scan-gram.l (gram_scanner_free): Likewise.
4534 * src/scan-skel.l (scan_skel): Likewise.
4535
4502eadc
JD
45362006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4537
4538 * src/files.c (tr): Change return type to void.
4539 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4540 has been called previously for the same key.
4541 (muscle_find): Return storage instead of value so that
4542 --enable-gcc-warnings doesn't produce warnings that the return discards
4543 const. aver that the value and storage are the same since storage
4544 could potentially be NULL when value is not.
4545 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4546 same as 0.
4547
7746c8f6
PE
45482006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4549
4550 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4551 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4552 us a slightly cleaner distribution, and also works.
4553 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4554 gnulib changes.
4555
eb095650
PE
45562006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4557 and Paul Eggert <eggert@cs.ucla.edu>
4558
4559 Don't let Bison leak memory except when it complains.
4560 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4561 (spec_defines_file, dir_prefix): Now char *, not const char *,
4562 since they are freed.
4563 * src/files.c: Likewise.
4564 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4565 Likewise.
4566 (tr): Now operates in-place. All uses changed.
4567 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4568 values.
4569 (compute_file_name_parts, compute_output_file_names): Don't store
4570 read-only data in variables that will be freed.
4571 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4572 src_extension, and header_extension.
4573 (output_file_names_free): New public function to free
4574 spec_verbose_file, spec_graph_file, spec_defines_file,
4575 parser_file_name, and dir_prefix.
4576 * src/getargs.c (getargs): Don't store read-only data in variables that
4577 will be freed.
4578 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4579 (which previously existed but was unused), and quotearg_free.
4580 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4581 * src/muscle_tab.c: Likewise.
4582 (muscle_entry): Make the value char const *,
4583 and add a new storage member that is char * and can be freed.
4584 (muscle_entry_free): New private function.
4585 (muscle_init): Use it instead of free.
4586 (muscle_insert, muscle_grow): Update and use new storage member.
4587 (muscle_code_grow): Free the string passed to muscle_grow
4588 since it's not needed anymore.
4589 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4590 add a new `char *code' member.
4591 ("{...}"): Declare semantic type as code.
4592 * src/scan-code.h (translate_rule_action):
4593 (translate_symbol_action, translate_code, translate_action): Return
4594 `char const *' rather than `char *' since external code should not free
4595 these strings.
4596 * src/scan-code.l: Likewise.
4597 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4598 which is "{...}" in the parser.
4599 * tests/Makefile.am (maintainer-check-valgrind): Set
4600 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4601 Valgrind.
4602 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4603 complain.
4604 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4605 expecting a non-zero exit status sets --leak-check=summary and
4606 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4607 this case, and we don't want to hear about it.
4608
ac564be4
PE
46092006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4610
4611 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4612 instead of from the template, to simplify configuration a bit.
4613 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4614 and m4/wint_t.m4, as they are needed with the latest gnulib.
4615
17bd8a73
JD
46162006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4617
4618 Disable unset/unused mid-rule value warnings by default, and recognize
4619 --warnings=midrule-values to enable them. Discussed starting at
4620 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4621 * NEWS (2.3a+): Mention.
4622 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4623 warnings): Add entry for midrule-values subargument.
4624 * src/reader.c (symbol_should_be_used): Don't return true just because
4625 the value is a set/used mid-rule value unless
4626 --warnings=midrule-values was specified.
4627 * tests/input.at (Unused values, Unused values before symbol
4628 declarations): Run tests with and without --warnings=midrule-values.
4629
4630 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4631 than LIST_FREE directly.
4632
89eb3c76
JD
46332006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4634
4635 Finish implementing --warnings=error, which should not be implied by
4636 --warnings=all (or by its synonyms -W and --warnings without
4637 subarguments).
4638 * src/complain.c (set_warning_issued): New function to report that
4639 warnings are being treated as errors and to record an error if so.
4640 Invoke...
4641 (warn_at, warn): ... here.
4642 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4643 "error - warnings are errors" does not appear above "all - all of the
4644 above".
4645 (getargs): For -W and --warnings without subarguments, don't let
4646 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4647 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4648
ba7560e2
JD
46492006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4650
4651 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4652 empty subargument list. For example: `bison --warnings= parser.y'.
4653
31283fc3
JD
46542006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4655
4656 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4657 the parser header file so that gcc doesn't warn.
4658
12e35840
JD
46592006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4660
4661 Split the default %destructor/%printer into two kinds: <*> and <!>.
4662 Discussed starting at
4663 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4664 * NEWS (2.3a+): Mention.
4665 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4666 previous change today related to mid-rules.
148d66d8 4667 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 4668 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
4669 (TYPE_TAG_ANY): Add as <*>.
4670 (TYPE_TAG_NONE): Add as <!>.
4671 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4672 for <*> and <!>.
4673 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4674 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4675 * src/symlist.c (symbol_list_default_new): Split into tagged and
4676 tagless versions.
4677 (symbol_list_destructor_set, symbol_list_printer_set): Split
4678 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4679 SYMLIST_DEFAULT_TAGLESS.
4680 * src/symlist.h: Update symbol_list_default*_new prototypes.
4681 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4682 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4683 * src/symtab.c (default_destructor, default_destructor_location,
4684 default_printer, default_printer_location): Split each into tagged and
4685 tagless versions.
4686 (symbol_destructor_get, symbol_destructor_location_get,
4687 symbol_printer_get, symbol_printer_location_get): Implement tagged
4688 default and tagless default cases.
4689 (default_destructor_set, default_printer_set): Split each into tagged
4690 and tagless versions.
4691 * src/symtab.h: Update prototypes.
4692 * tests/actions.at (Default %printer and %destructor): Rename to...
4693 (Default tagless %printer and %destructor): ... this, and extend.
4694 (Per-type %printer and %destructor): Rename to...
4695 (Default tagged and per-type %printer and %destructor): ... this, and
4696 extend.
4697 (Default %printer and %destructor for user-defined end token): Extend.
4698 (Default %printer and %destructor are not for error or $undefined):
4699 Update.
4700 (Default %printer and %destructor are not for $accept): Update.
4701 (Default %printer and %destructor for mid-rule values): Extend.
4702 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4703 (Unused values with default %destructor): Extend.
4704
f91b1629
JD
47052006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4706
4707 Don't apply the default %destructor/%printer to an unreferenced midrule
4708 value. Mentioned at
4709 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4710 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4711 like $@n instead of just @n so that the default %destructor/%printer
4712 logic doesn't see them as user-defined symbols.
4713 (symbol_is_dummy): Check for both forms of the name.
4714 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4715 name for which the midrule value is referenced in any action.
4716 * tests/actions.at (Default %printer and %destructor for mid-rule
4717 values): New test.
4718 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4719 for change to dummy symbol names.
4720
519d0004
JD
47212006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4722
4723 Warn about unset midrule $$ if the corresponding $n is used.
4724 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4725 $n usage.
4726 (packgram): Before invoking grammar_rule_check on any rule, make sure
4727 all actions have already been scanned in order to set `used' flags.
4728 Otherwise, checking that a midrule's $$ is set will not always work
4729 properly because the midrule check must forward-reference the midrule's
4730 parent rule.
4731 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4732 warning.
4733
a501eca9
JD
47342006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4735
4736 More improvements to the documentation of the prologue alternatives:
4737 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4738 Bison manual.
4739 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4740 some text to clarify the relative importance of the new directives and
4741 to show how these directives may be viewed as code labels.
4742
2cbe6b7f
JD
47432006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4744
4745 Similar to the recently removed %before-header, add %code-top as the
4746 alternative to the pre-prologue. Mentioned at
4747 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4748 Also, let the prologue alternatives appear in the grammar section.
4749 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4750 (prologue_declaration): Move the existing prologue alternatives to...
4751 (grammar_declaration): ... here and add %code-top.
4752 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4753
4754 Clean up and extend documentation for the prologue alternatives.
4755 * NEWS (2.3a+): Describe prologue alternatives.
4756 * doc/bison.texinfo (Prologue): Move discussion of prologue
4757 alternatives to...
4758 (Prologue Alternatives): ... this new section, and extend it to discuss
4759 all 4 directives in detail.
148d66d8
JD
4760 (Table of Symbols): Clean up discussion of prologue alternatives and
4761 add %code-top.
2cbe6b7f 4762
e557d3ea
JMG
47632006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4764
4765 DJGPP specific issues.
4766
4767 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4768 config.bat accordingly.
4769 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4770 * djgpp/config.site: Likewise.
4771
136a0f76
PB
47722006-10-16 Paolo Bonzini <bonzini@gnu.org>
4773
27bd5d67
PB
4774 Replace %*-header with %provides, %requires, %code. See discussion at
4775 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4776
136a0f76
PB
4777 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4778 (b4_user_start_header): Remove.
4779 * data/glr.c: Use new macros instead of b4_*start_header
4780 and b4_*end_header.
4781 * data/glr.cc: Likewise.
4782 * data/lalr1.cc: Likewise.
4783 * data/push.c: Likewise.
4784 * data/yacc.c: Likewise.
4785
4786 * doc/bison.texinfo: Remove %before-header, rename
4787 %{start,end,after}-header to %requires, %provides, %code.
4788
4789 * src/parse-gram.y: Likewise (also rename token names accordingly).
4790 * src/scan-gram.l: Likewise.
4791 * tests/actions.at: Likewise.
4792
10f429ef
PE
47932006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4794
4795 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4796 Problem reported by Joel E. Denny.
4797
47982006-10-14 Jim Meyering <jim@meyering.net>
4799
4800 (Sync from coreutils.)
4801 Work also when the working directory (with e.g. coreutils sources)
4802 is version controlled with git, rather than CVS.
4803 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4804 rather than CVS.
4805 In messages and comments, say e.g., "checked-out sources",
4806 rather than "CVS sources".
4807 (version_controlled_file): New function. Work for git as well as
4808 for CVS. Don't use grep's -q option.
4809 (slurp): Call it here, in place of CVS-specific code.
4810
c4bd5bf7
JD
48112006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4812
4813 Fix testsuite for ./configure --enable-gcc-warnings:
4814 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4815 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4816 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4817 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4818 * test/regression.at (Diagnostic that expects two alternatives):
4819 Likewise.
4820
46356ea4
PE
48212006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4822
231ed89a
PE
4823 * bootstrap.conf (gnulib_modules): Add config-h.
4824 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4825 worry about HAVE_CONFIG_H.
4826 * lib/abitset.c: Likewise.
4827 * lib/bitset.c: Likewise.
4828 * lib/bitset_stats.c: Likewise.
4829 * lib/bitsetv-print.c: Likewise.
4830 * lib/bitsetv.c: Likewise.
4831 * lib/ebitset.c: Likewise.
4832 * lib/get-errno.c: Likewise.
4833 * lib/lbitset.c: Likewise.
4834 * lib/subpipe.c: Likewise.
4835 * lib/timevar.c: Likewise.
4836 * lib/vbitset.c: Likewise.
4837 * lib/bitset.c: Include "bitset.h" first, to test interface.
4838 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4839 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4840 * lib/bitsetv.c: Include "bitsetv.h" first.
4841 * lib/get-errno.c: Include "get-errno.h" first.
4842 * m4/.cvsignore: Add config-h.m4.
4843 * tests/actions.at (Default %printer and %destructor for ...):
4844 Adjust expected line numbers in output to reflect removal of #if
4845 HAVE_CONFIG_H lines.
4846 * tests/glr-regression.at (Missed %merge type warnings when ...):
4847 Likewise.
4848 * tests/regression.at (Braced code in declaration in rules section):
4849 Likewise.
4850 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4851 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4852 Include <config.h> unconditionally.
4853
46356ea4
PE
4854 * bootstrap: Sync from coreutils, as follows:
4855
4856 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4857
4858 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4859 variable was sometimes used without being initialized. This
4860 messed up the installation of the INSTALL file in some cases.
4861
4862 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4863
4864 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4865 --copy. Inspired by a suggestion from Bruno Haible.
4866
4867 2006-10-03 Jim Meyering <jim@meyering.net>
4868
4869 * bootstrap: Undo last change to this file, since now gnulib-tool
4870 sticks with the automake default in generating dependencies.
4871
dd4bf078
PE
48722006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4873
cf2a5f7c
PE
4874 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4875 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4876
4877 * doc/bison.1: Add copyright notice.
4878
4879 * data/glr.c: Don't include <stdarg.h>; not used.
4880
35fe0834
PE
4881 * NEWS: The -g and --graph options now output graphs in Graphviz
4882 DOT format, not VCG format.
4883 * doc/bison.1: Likewise.
4884 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
4885 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4886 of this change in
4887 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
4888 * TODO: Remove Graphviz entry.
4889 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4890 remove vcg.c, vcg.h, vcg_defaults.h.
4891 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4892 * src/graphviz.c, src/graphviz.h: New files.
4893 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4894 * src/files.h: Make comment more generic.
4895 * src/main.c (main): Likewise.
4896 * src/print_graph.h: Likewise.
4897 * src/getargs.c (usage): Make usage description more generic.
4898 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4899 (static_graph, fgraph): Remove. All uses changed to pass
4900 arguments instead of sharing a static var.
4901 (print_core, print_actions, print_state, print_graph):
4902 Output graphviz format rather than VCG format.
4903 * tests/.cvsignore: Remove *.vcg; add *.dot.
4904 * tests/output.at: Expect *.dot files, not *.vcg files.
4905
dd4bf078
PE
4906 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4907 accommodates the 2006-10-08 change.
4908
efdd7421
PE
49092006-10-11 Bob Rossi <bob@brasko.net>
4910
4911 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4912 (b4_yyssa, b4_yyerror_range): New macros.
4913 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4914 (yypvarsinit): Remove init of removed fields.
4915 (yypushparse): Remove use of removed fields; use new macros instead.
4916
96a1981a
PE
49172006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4918
4919 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4920 in a push parser. Reindent slightly to match yacc.c better.
4921
49222006-10-11 Bob Rossi <bob@brasko.net>
4923
46356ea4
PE
4924 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4925 yymsg_alloc fields.
4926 (yypvarsinit, yypushparse): Remove init of removed fields.
4927 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 4928
c1630a8b
PE
49292006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4930
4931 * THANKS: Add Paolo Bonzini and Bob Rossi.
4932
90b9908d
PB
49332006-10-08 Paolo Bonzini <bonzini@gnu.org>
4934
4935 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4936 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4937 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4938 b4_define_user_cde and uses): Remove.
4939 (b4_comment, b4_prefix, b4_sync_start): New.
4940 * data/bison.m4: New file, with most of the content removed from c.m4.
4941 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4942 * src/output.c (output_skeleton): Pass bison.m4.
4943 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4944 only if specified.
4945
cf806753
PE
49462006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4947
4948 Fix test failure reported by Tom Lane in
4949 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4950 and try to make such failures easier to catch in the future.
4951 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4952 that's now the caller's responsibility.
4953 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4954 Set yychar = YYEOF if it's negative.
4955 * tests/actions.at (yylex): Abort if asked to read past EOF.
4956 * tests/conflicts.at (yylex): Likewise.
4957 * tests/cxx-type.at (yylex): Likewise.
4958 * tests/glr-regression.at (yylex): Likewise.
4959 * tests/input.at (yylex): Likewise.
4960 * tests/regression.at (yylex): Likewise.
4961 * tests/torture.at (yylex): Likewise.
4962
0e2f006a
PE
49632006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4964
4965 Fix problems with translating English-language diagnostics.
4966 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4967 respect to bison-runtime pot generation. The YY_ stuff
4968 wasn't being captured.
4969 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4970 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4971 * runtime-po/POTFILES.in: Add data/push.c.
4972
e3ddc1e3
PE
49732006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4974
4975 Merge bootstrap changes from coreutils.
4976
4977 2006-09-28 Jim Meyering <jim@meyering.net>
4978
4979 Automatically generated dependencies are important even
4980 when all of the sources in a directory come from gnulib.
4981 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4982 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4983
4984 2006-09-23 Jim Meyering <jim@meyering.net>
4985
4986 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
4987
4988 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4989
4990 * bootstrap: Add support for --force.
4991 (usage): New function. Describe usage less tersely.
4992 (CVS_only_file): New var.
4993
01e972b3
PE
49942006-09-21 Paul Eggert <eggert@cs.ucla.edu>
4995
4996 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4997 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
4998 Adjust white space and comments to match GNU style better.
4999
c63d3e90
PE
50002006-09-20 Bob Rossi <bob@brasko.net>
5001
5002 * data/push.c (yyresult_get): Remove function.
5003 (YYPUSH_MORE): Add #define.
5004 (yypushparse): Modify return value.
5005
e70f46d1
PE
50062006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5007
5008 * stamp-h.in: Remove; no longer needed.
5009 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5010 Remove config.h, config.hin, intl (no longer created).
5011 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5012 stamp-h1.
5013
5014 Sync bootstrap from coreutils, as follows:
5015
5016 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5017
5018 * bootstrap (symlink_to_gnulib): New function.
5019 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5020 to copies-of-gnulib.
5021 (cp_mark_as_generated, slurp, gnulib_files):
5022 Avoid making a copy if it's the same as the old version.
5023 (gnulib_files): Add support for this variable (used by Bison).
5024
a92be413
PE
50252006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5026
5027 * src/getargs.c (usage): Rework to use conventions similar to
5028 coreutils, to make translation a bit easier and the code a bit
5029 smaller. Problem reported by Tim Van Holder.
5030
4f82b42a
PE
50312006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5032
3b2942e6
PE
5033 Use some of gnulib's new modules, taken from coreutils.
5034
5035 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5036 * bootstrap.conf: New file.
5037 (gnulib_modules): Add configmake, inttypes, unistd.
5038 (XGETTEXT_OPTIONS): Add complain, complain_at,
5039 fatal, fatal_at, warn, warn_at, unexpected_end.
5040 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5041 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5042 (gl_EARLY): Add.
5043 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5044 (gl_INIT): Add
5045 (GNULIB_AUTOCONF_SNIPPET): Remove.
5046 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5047 the pickiest.
5048 * lib/.cvsignore: Add inttypes_.h.
5049 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5050 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5051 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5052 no-longer-necessary initializations.
5053 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5054 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5055 use the unistd module.
5056 * src/system.h: Likewise.
5057 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5058 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5059 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5060 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5061 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5062 * src/system.h: Include inttypes.h unconditionally, now that we
5063 use the inttypes module. Don't bother to include stdint.h, since
5064 inttypes.h now does that for us.
5065 (LOCALEDIR): Remove, now that we use the configmake module.
5066 * src/getargs.c: Include configmake.h.
5067 * src/main.c: Likewise.
5068 * src/output.c: Likewise.
5069 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5070 not from $abs_top_builddir, since config.h moved.
5071
5072
4f82b42a
PE
5073 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5074 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5075
5076 * src/parse-gram.y (symbol_declaration): Don't put statements
5077 before declarations; it's not portable to C89.
5078 * src/scan-code.l (handle_action_at): Likewise.
5079
5080 * src/scan-code.l: Always initialize braces_level; the old code
5081 left it uninitialized and therefore had undefined behavior.
5082
5083 Don't attempt to redefine 'assert', since it runs afoul of
5084 systems where standard headers (mistakenly) include <assert.h>.
5085 Instead, define and use our own alternative, called 'aver'.
5086 * src/reader.c: Don't include assert.h, since we no longer
5087 use assert.
5088 * src/scan-code.l: Likewise.
5089 * src/system.h (assert): Remove, replacing with....
5090 (aver): New function, taking a bool arg. All uses changed.
5091 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5092 not merely an integer.
5093
31c10e38
PE
50942006-09-15 Bob Rossi <bob@brasko.net>
5095
5096 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5097 * data/c.m4 (YYPUSH): New.
5098 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5099 * src/getargs.c (push_parser): New var.
5100 * src/getargs.h (push_parser): New declaration.
5101 * src/output.c (prepare): Add macro insertion of `push_flag'.
5102 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5103 (prologue_declaration): Parse %push-parser.
5104 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5105 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5106 list of removed lines from the traces observed.
5107 (AT_CHECK_CALC_LALR): Added push parser tests.
5108
fa7b79c0
PE
51092006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5110
21fe08ca
PE
5111 * NEWS: Version 2.3a.
5112 * configure.ac (AC_INIT): Likewise.
5113
e8ec4d9b
PE
5114 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5115 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5116 due to header ordering dependencies. I don't know why the #define
5117 was there.
5118
fa7b79c0
PE
5119 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5120 runtime cost when YYDEBUG is not defined, and so that some tests
5121 that used to fail now work. Problem and initial suggestion by
5122 Paolo Bonzini.
5123 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5124 * data/glr.cc (b4_parser_class_name):
5125 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5126 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5127 (yydebug_) [YYDEBUG]: New member.
5128 (yycdebug_): Now defined only if YYDEBUG.
5129 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5130 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5131 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5132 if YYYDEBUG.
5133 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5134 Define only if YYDEBUG.
5135 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5136 set_debug_level.
5137 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5138 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5139 AT_CHECK_CALC_GLR_CC that are working now.
5140
4ec13d60
PE
51412006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5142
5143 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5144 We don't need them in glr.cc, and glr.c defines them.
5145 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5146 assumes that defining it to anything is the same as defining
5147 it to 1. Problem reported by Paolo Bonzini.
5148
8e1687ae
PE
51492006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5150
5151 * data/c.m4 (b4_null, b4_case): Define.
5152 * src/output.c (prepare_symbols): Use b4_null.
5153 (user_actions_output): Use b4_case.
5154
3dc5e96b
PE
51552006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5156
aef3da86
PE
5157 * data/glr.c (b4_shared_declarations): Put start-header first,
5158 before any #includes that we generate, so that feature-test
5159 macros work. Problem reported by Michael Deutschmann in
5160 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5161 * data/lalr1.cc: Likewise.
5162 * doc/bison.texinfo (Prologue): Document that feature-test macros
5163 should be defined before any Bison declarations.
5164 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5165 that depend on location.hh after, not before, Bison decls, since
5166 we now include location.hh after the first user prologue.
5167
3dc5e96b
PE
5168 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5169 Sander Brandenburg in
5170 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5171 Also, fix minor white space and comment issues.
aef3da86
PE
5172 (Prologue): Mention that it's better to define feature-test macros
5173 before Bison declarations. Problem reported by Michael Deutschmann.
5174
5175 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5176 by Jim Meyering.
5177 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5178 This adjusts to recent gnulib changes.
3dc5e96b 5179
b2a0b7ca
JD
51802006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5181
5182 Finish implementation of per-type %destructor/%printer. Discussed
5183 starting at
5184 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5185 and
5186 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5187 * NEWS (2.3+): Add a description of this feature to the default
5188 %destructor/%printer description.
5189 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5190 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5191 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5192 list node contains a semantic type.
5193 * src/symtab.c, src/symtab.h: Extend with a table that associates
5194 semantic types with their %destructor's and %printer's.
5195 (semantic_type_from_uniqstr, semantic_type_get,
5196 semantic_type_destructor_set, semantic_type_printer_set): New functions
5197 composing the public interface of that table.
5198 (symbol_destructor_get, symbol_destructor_location_get,
5199 symbol_printer_get, symbol_printer_location_get): If there's no
5200 per-symbol %destructor/%printer, look up the per-type before trying
5201 the default.
5202 * tests/actions.at (Per-type %printer and %destructor): New test case.
5203 * tests/input.at (Default %printer and %destructor redeclared):
5204 Extend to check that multiple occurrences of %symbol-default in a
5205 single %destructor/%printer declaration is an error.
5206 (Per-type %printer and %destructor redeclared, Unused values with
5207 per-type %destructor): New test cases.
5208
3be03b13
JD
52092006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5210
5211 Require default %destructor/%printer to be declared using
5212 %symbol-default instead of an empty symbol list, and start working on
5213 new per-type %destructor/%printer. Discussed at
5214 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5215 * NEWS (2.3+): Add %symbol-default to example.
5216 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 5217 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
5218 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5219 (generic_symlist, generic_symlist_item): New nonterminals for creating
5220 a list in which each item is a symbol, semantic type, or
5221 %symbol-default.
5222 (grammar_declaration): Use generic_symlist in %destructor and %printer
5223 declarations instead of symbols.1 or an empty list.
5224 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5225 for changes to symbol_list.
5226 * src/reader.c: Update for changes to symbol_list.
5227 * src/scan-code.l: Likewise.
5228 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5229 * src/symlist.c, src/symlist.h: Extend such that a list node may
5230 represent a semantic type or a %symbol-default in addition to just an
5231 ordinary symbol. Add switched functions for setting %destructor's and
5232 %printer's.
5233 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5234 %destructor/%printer declarations.
5235
3508ce36
JD
52362006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5237
5238 Whether the default %destructor/%printer applies to a particular symbol
5239 isn't a question of whether the user *declares* that symbol (in %token,
5240 for example). It's a question of whether the user by any means
5241 *defines* the symbol at all (by simply using a char token, for
5242 example). $end is defined by Bison whereas any other token with token
5243 number 0 is defined by the user. The error token is always defined by
5244 Bison regardless of whether the user declares it with %token, but we
5245 may one day let the user define error as a nonterminal instead.
5246 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5247 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5248 the meaning of "user-defined".
5249 * tests/actions.at (Default %printer and %destructor for user-declared
5250 end token): Rename to...
5251 (Default %printer and %destructor for user-defined end token): ...
5252 this.
5253
5254 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5255 computation of whether to apply the default, don't maintain a list of
5256 every Bison-defined symbol. Instead, just check for a first character
5257 of '$', which a user symbol cannot have, and check for the error token.
5258
9350499c
JD
52592006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5260
5261 Don't apply the default %destructor or %printer to the error token,
5262 $undefined, or $accept. This change fits the general rule that the
5263 default %destructor and %printer are only for user-declared symbols,
5264 and it solves several difficulties that are described in the new test
5265 cases listed below.
5266 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5267 * tests/actions.at (Default %printer and %destructor are not for error
5268 or $undefined, Default %printer and %destructor are not for $accept):
5269 New test cases.
5270
4d7370cb
JD
52712006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5272
5273 Allow %start after the first rule.
5274 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5275 when parsing the first rule.
5276 (check_and_convert_grammar): Search for it here after all grammar
5277 declarations have been parsed. Skip midrules, which have dummy LHS
5278 nonterminals.
5279 * src/symtab.c (symbol_is_dummy): New function.
5280 * src/symtab.h (symbol_is_dummy): Declare it.
5281 * tests/input.at (%start after first rule): New test.
5282
6d0ef4ec
JD
52832006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5284
5285 Redo some of the previous commit: add back the ability to use
5286 non-aliased/undeclared string literals since it might be useful to
5287 those declaring %token-table.
5288 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5289 commit: don't worry about complaints from symbols_pack.
5290 * src/symtab.c (symbol_new, symbol_class_set,
5291 symbol_check_alias_consistency): Undo changes in previous commit: count
5292 each string literal as a new symbol and token, assign it a symbol
5293 number, and don't complain about non-aliased string literals.
5294 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5295 and token counts but does still set aliased tokens to the same number,
5296 symbol_pack_processor now leaves empty slots in the symbols array.
5297 Remove those slots.
5298 * tests/regression.at (Undeclared string literal): Remove test case
5299 added in previous commit since non-aliased string literals are allowed
5300 again.
5301 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5302 remove unnecessary string literal declarations.
5303 * tests/sets.at (Firsts): Likewise.
5304
965537bc
JD
53052006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5306
5307 Don't allow an undeclared string literal, but allow a string literal to
5308 be used before its declaration.
5309 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5310 symbols_pack complained.
5311 * src/symtab.c (symbol_new): Don't count a string literal as a new
5312 symbol.
5313 (symbol_class_set): Don't count a string literal as a new token, and
5314 don't assign it a symbol number since symbol_make_alias does that.
5315 (symbol_make_alias): It's not necessary to decrement the symbol and
5316 token counts anymore. Don't assume that an alias declaration occurs
5317 before any uses of the identifier or string, and thus don't assert that
5318 one of them has the highest symbol number so far.
5319 (symbol_check_alias_consistency): Complain if there's a string literal
5320 that wasn't declared as an alias.
5321 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5322 symbol_pack asserts that every token has been assigned a symbol number
5323 although undeclared string literals have not.
5324 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 5325 string literal): New test cases.
965537bc
JD
5326 (Characters Escapes, Web2c Actions): Declare string literals as
5327 aliases.
5328 * tests/sets.at (Firsts): Likewise.
5329
47aee066
JD
53302006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5331
5332 In the grammar scanner, STRING_FINISH unclosed constructs and return
5333 them to the parser in order to improve error messages.
5334 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5335 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5336 * tests/input.at (Unclosed constructs): New test case.
5337 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5338 seen.
5339
5340 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5341 unused global.
5342
1f6b3679
JD
53432006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5344
5345 Handle string aliases for character tokens correctly.
5346 * src/symtab.c (symbol_user_token_number_set): If the token has an
5347 alias, check and set its alias's user token number instead of its own,
5348 which is set to indicate the alias. Previously, every occurrence of
5349 the character token in the grammar overwrote that alias indicator with
5350 the character code.
5351 * tests/input.at (String aliases for character tokens): New test.
5352
219741d8
JD
53532006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5354
5355 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5356
11daa4e7
PE
53572006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5358
5359 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5360 to prevent failures when building on older platforms.
5361 Check for autopoint failure.
5362 Set XGETTEXT_OPTIONS to values that check for C format strings,
5363 so that translators are warned about them (this also helps
5364 prevent core dumps).
5365
5366 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5367 function, since it simplifies our code a bit.
5368
5369 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5370 rather than -W, so we don't get bogus warnings about sign comparisons.
5371 Add -Wpointer-arith, since that warning is useful (it reports code
5372 that does not conform to C89 and that some compilers reject).
5373 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5374 since it's no longer needed.
5375
f9bfc42a
JD
53762006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5377
5378 Clean up scanners a bit.
5379 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5380 definitions so gcc won't warn when obstack_for_string is unused.
5381 * src/scan-code.l: config.h and system.h are already #include'd by
5382 scan-code-c.c, so get rid of them here.
5383 * src/scan-gram.l: Likewise.
5384 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5385 definitions rather than duplicating the rest of it.
5386 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5387
06e8700a
JD
53882006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5389
5390 Suppress signed/unsigned comparison warnings for yycheck.
5391 * data/c.m4 (b4_safest_int_type): New macro.
5392 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5393 a signed int type, cast it to b4_safest_int_type first.
5394 * data/yacc.c: Likewise.
5395 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5396 also overwritten.
5397
9c437126
PE
53982006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5399
5400 * doc/bison.texinfo: Fix some typos.
5401
284d8a13
PE
54022006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5403
5404 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5405 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5406
5407 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5408 the latest gnulib does this a different way.
5409 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5410 translation was patched, so stop omitting it.
5411
ec5479ce
JD
54122006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5413
5414 Enable declaration of default %printer/%destructor. Make the parser
5415 use these for all user-declared grammar symbols for which the user does
5416 not declare a specific %printer/%destructor. Thus, the parser uses it
5417 for token 0 if the user declares it but not if Bison generates it as
5418 $end. Discussed starting at
5419 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5420 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5421 and
5422 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5423 * NEWS (2.3+): Mention.
5424 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5425 declare a %destructor for a mid-rule's semantic value. It's just
5426 impossible to declare one specific to it.
5427 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5428 code. Describe default %destructor form.
5429 * src/parse-gram.y (grammar_declaration): Parse default
5430 %printer/%destructor declarations.
5431 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5432 and symbol_destructor_location_get rather than accessing the destructor
5433 and destructor_location members of struct symbol.
5434 (symbol_printers_output): Likewise but for %printer's.
5435 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5436 again.
5437 * src/symtab.c (default_destructor, default_destructor_location,
5438 default_printer, default_printer_location): New static global
5439 variables to record the default %destructor and %printer.
5440 (symbol_destructor_get, symbol_destructor_location_get,
5441 symbol_printer_get, symbol_printer_location_get): New functions to
5442 compute the appropriate %destructor and %printer for a symbol.
5443 (default_destructor_set, default_printer_set): New functions to set the
5444 default %destructor and %printer.
5445 * src/symtab.h: Prototype all those new functions.
5446 * tests/actions.at (Default %printer and %destructor): New test to
5447 check that the right %printer and %destructor are called, that they're
5448 not called for $end, and that $$ and @$ work correctly.
5449 (Default %printer and %destructor for user-declared end token): New
5450 test to check that the default %printer and %destructor are called for
5451 a user-declared end token.
5452 * tests/input.at (Default %printer and %destructor redeclared, Unused
5453 values with default %destructor): New tests to check related grammar
5454 warnings and errors.
5455
868d2d96
JD
54562006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5457
5458 Clean up handling of %destructor for the end token (token 0).
5459 Discussed starting at
5460 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5461 and
5462 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5463
5464 Make the skeletons consistent in how they pop the end token and invoke
5465 its %destructor.
5466 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5467 state, which has token number 0, since this would invoke the
5468 %destructor for the end token.
5469 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5470 until after shifting the end token, or else it won't be popped.
5471 * data/yacc.c (yyparse): Likewise.
5472
5473 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5474 it's the end token. Upon termination, destroy an unshifted lookahead
5475 even when it's the end token.
5476 * data/lalr1.cc (yy::parser::parse): Likewise.
5477 * data/yacc.c (yyparse): Likewise.
5478
5479 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5480 value warnings for the end token when the user gives the end token a
5481 %destructor.
5482
5483 * tests/actions.at (Printers and Destructors): Test all the above.
5484
62a9592d
PE
54852006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5486
5487 Update to latest gnulib and gettext versions.
5488 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5489 Add fopen-safer.
5490 (gnulib_files): Add m4/warning.m4. Don't worry about files
5491 overwritten by autopoint.
5492 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5493 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5494 rejects them.
5495 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5496 so that we can remove the intl files at a better time.
5497 (intl_files_to_remove): Remove aclocal.m4, since it gets
5498 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5499 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5500 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5501 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5502 Remove datarootdir hack; no longer needed.
5503 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5504 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5505 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5506 strdup.h.
5507 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5508 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5509
10d6970f
PE
55102006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5511
5512 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5513 it with --assume-autoconf='latest-stable'.
5514
50a33993
JD
55152006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5516
5517 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5518 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5519 YYSTYPE' and `{'.
5520 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5521 those from muscle_tab.c since the old ones are misleading.
5522
2ce4ed68
AD
55232006-07-13 Akim Demaille <akim@epita.fr>
5524
5525 Support %define "KEY" {VALUE}.
5526 * src/scan-code.h, src/scan-code.l (translate_action)
5527 (translate_rule_action, translate_symbol_action, translate_code):
5528 Return char *, not const char *.
5529 * src/parse-gram.y (declaration): Rename as...
5530 (prologue_declaration): this.
5531 (string_content): Remove this nonterminal, use STRING.
5532 (braceless, content, content.opt): New nonterminal.
5533 Use them.
5534 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5535 as value.
5536 * src/scan-gram.l (getargs.h): Don't include it.
5537
db7e5eb5
PE
55382006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5539
5540 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5541 rather than a for-loop that declares a local bool variable. This
5542 should work around a compatibility problem with a Cray x1e C++
5543 compiler reported by Hung Nguyen in
5544 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5545 The for-loop was introduced in the 2004-11-17 change but I don't
5546 know why it was needed.
5547
a5d80ba5
AD
55482006-07-12 Akim Demaille <akim@epita.fr>
5549
5550 * data/c.m4: Comment changes.
5551
23eb2a69
AD
55522006-07-10 Akim Demaille <akim@lrde.epita.fr>
5553
5554 * src/complain.c (error_message, ERROR_MESSAGE): New.
5555 To factor...
5556 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5557 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5558
ddc8ede1
PE
55592006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5560
5561 * NEWS: Instead of %union, you can define and use your own union type
5562 YYSTYPE if your grammar contains at least one <type> tag.
5563 Your YYSTYPE need not be a macro; it can be a typedef.
5564 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5565 (Union Decl, Decl Summary): Document this.
5566 * data/glr.c (YYSTYPE): Implement this.
5567 * data/glr.cc (YYSTYPE): Likewise.
5568 * data/lalr1.cc (YYSTYPE): Likewise.
5569 * data/yacc.c (YYSTYPE): Likewise.
5570 * src/output.c (prepare): Output tag_seen_flag.
5571 * src/parse-gram.y (declaration, grammar_declaration):
5572 Use 'union_seen' rather than 'typed' to determine whether
5573 %union has been seen, since grammars can now be typed without
5574 %union.
5575 (symbol_declaration, type.opt, symbol_def):
5576 Keep track of whether a tag has been seen.
5577 * src/reader.c (union_seen, tag_seen): New vars.
5578 (typed): remove.
5579 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5580 * src/scan-code.l (untyped_var_seen): New variable.
5581 (handle_action_dollar): Adjust to above changes.
5582 (handle_action_dollar, handle_action_at):
5583 Improve overflow checking for outlandish numbers.
5584 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5585 avoid new diagnostics generated by above changes.
5586 * tests/regression.at (YYSTYPE typedef): Add test to check
5587 for type tags without %union.
5588
5589 * src/symlist.c (symbol_list_length): Return int, not unsigned
5590 int, since callers expect int. This may need to get revisited
5591 once we have proper integer overflow checking.
5592
5593 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5594 object is now static.
5595
5596 * src/getargs.c (flags_argmatch): Return void, not int,
5597 to pacify ./configure --enable-gcc-warnings.
5598
5599 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5600 since last_string is already defined to FLEX_PREFIX (last_string).
5601
7b42569e
AD
56022006-07-09 Akim Demaille <akim@lrde.epita.fr>
5603
5604 Implement --warnings/-W.
5605 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5606 replaced by...
5607 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5608 Adjust callers.
5609 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5610 (warnings_args, warnings_types): New.
5611 (getargs, short_options, long_options): Accept -W/--warnings.
5612 Sort the options by alphabetical order, upper case letter right
5613 before its lower case.
5614
3b452f4e
JD
56152006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5616
5617 Change %merge result type clash warnings to errors. Discussed at
5618 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5619 * src/reader.c (record_merge_function_type): Use complain_at.
5620 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5621 declared later): Update test case results.
5622
b8a41559
AD
56232006-07-09 Akim Demaille <akim@lrde.epita.fr>
5624
5625 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5626 to be in alphabetical order.
5627 (trace_args): Spelling fixes.
5628
cd9e1ba2
PE
56292006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5630
5631 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5632 so they don't collide with user-defined macros.
5633 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5634 this was never guaranteed, and now that we're using gnulib stdint,
5635 which defines int_fast16_t to long int, the problem is exposed.
5636
cb48f191
PE
56372006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5638
b8445a15
PE
5639 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5640 need the full POSIX semantics (and weren't implementing them
5641 anyway).
5642
cb48f191
PE
5643 Adjust to Autoconf 2.60 and today's gnulib.
5644 * bootstrap (gnulib_modules): Add stdint.
5645 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5646 no longer copies it.
5647 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5648 since stdint needs the former and wcwidth (which is now required
5649 by mbswidth) needs the latter.
5650 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5651 work around a compatibility glitch between gettext 0.14.6 and
5652 Autoconf 2.60.
5653 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5654 Do not check for uintptr_t, since new stdint module does the right
5655 thing.
5656 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5657 Add stdint.h, stdint_.h, wcwidth.h.
5658 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5659 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5660 stdint.m4, wchar_t.m4, wcwidth.m4.
5661 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5662 usual order for ../lib/*.h files.
5663 (file_name_split): Use last_component, not base_name, to adjust
5664 to gnulib changes.
5665 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5666 for ../lib/*.h files.
5667 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5668 Define unconditionally, since we now assume the stdint module.
5669 * src/scan-skel.l: Include <dirname.h>.
5670 (BASE_QPUTS): Use last_component, not base_name.
5671 * src/system.h: Include <unlocked-io.h> in the usual order
5672 for ../lib/*.h files. Include <stdint.h> unconditionally,
5673 since we now use the stdint module.
5674 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5675 HAVE_UINTPTR_T, since we now use the stdint module.
5676 (base_name): Remove decl, since files now include <dirname.h>
5677 to get the decl.
5678
cd48d21d
AD
56792006-07-08 Akim Demaille <akim@lrde.epita.fr>
5680
5681 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5682 New, default to 1.
5683 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5684 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5685 default.
5686 * tests/calc.at: Adjust.
5687
8ec0a172
AD
56882006-07-08 Akim Demaille <akim@lrde.epita.fr>
5689
b8445a15 5690 * data/c.m4 (b4_basename): New.
8ec0a172
AD
5691 (b4_syncline): Also output the location of its invocation (from
5692 the skeleton).
5693 (b4_user_action, b4_define_user_action, b4_user_actions)
5694 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5695 (b4_user_stype): New.
5696 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5697
4a678af8
JD
56982006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5699
5700 In the grammar file, the first column is 1 not 0 on the first line as
5701 on every other line.
5702 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5703 * tests/input.at (Torturing the Scanner): Update output.
5704
5705 * src/scan-gram.l (scanner_cursor): Declare it static.
5706
dd60572a
JD
57072006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5708
5709 In warnings, say "previous declaration" rather than "first
5710 declaration".
5711 * src/symtab.c (redeclaration): Do that here.
5712 * src/reader.c (record_merge_function_type): In the case of a result
5713 type clash, report the previous declaration rather than the very first
5714 one in the grammar file.
5715 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5716 declared later): Add a third declaration to check this behavior.
5717 * tests/input.at (Incompatible Aliases): Update output.
5718
2073e1b6
AD
57192006-06-27 Akim Demaille <akim@epita.fr>
5720
5721 * doc/Doxyfile.in: New.
5722 * doc/Makefile.am: Use it.
5723 * src/lalr.h, src/symtab.h: Initial doxygenation.
5724
8ee5b538
JD
57252006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5726
5727 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
5728 declared after the %merge. This continues the effort of the previous
5729 patch.
8ee5b538
JD
5730 * src/reader.c (get_merge_function): Don't set the merger type yet.
5731 (record_merge_function_type): New function for setting the merger type
5732 and checking for clashes.
5733 (grammar_current_rule_merge_set): Set the location of the %merge for
5734 the current rule.
5735 (packgram): Invoke record_merge_function_type for each rule now that
5736 all symbol type declarations have been parsed.
5737 * src/reader.h (merger_list.type_declaration_location): New member
5738 storing the location of the first %merge from which the type for this
5739 merging function was derived.
5740 * src/symlist.h (symbol_list.merger_declaration_location): New member
5741 storing the location of a rule's %merge, if any.
5742 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5743 declared later): New test to catch the error fixed by the above patch.
5744
ffa4ba3a
JD
57452006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5746
5747 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
5748 declarations appear after the rules. Discussed at
5749 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5750 and
5751 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5752 Don't mistake the type of $$ in a midrule to be that of its parent
5753 rule's $$.
ffa4ba3a
JD
5754 * src/reader.c (grammar_current_rule_end): Don't invoke
5755 grammar_rule_check yet since not all symbol declarations may have been
5756 parsed yet.
5757 (grammar_midrule_action): Likewise.
5758 Don't record whether the midrule's $$ has been used yet since actions
5759 haven't been translated yet.
5760 Record the midrule's parent rule and its RHS index within the parent
5761 rule.
5762 (grammar_current_rule_action_append): Don't translate the action yet
5763 since not all symbol declarations may have been parsed yet and, thus,
5764 warnings about types for $$, $n, @$, and @n can't be reported yet.
5765 (packgram): Translate the action and invoke grammar_rule_check now that
5766 all symbol declarations have been parsed.
5767 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5768 after parsing the entire grammar file, the symbol list here in the case
5769 of a midrule is actually the midrule's empty RHS, so reference its
5770 parent rule's RHS where necessary.
5771 On the other hand, now that you can already know it's a midrule, you
5772 aren't forced to think $$ has the same type as its parent rule's $$.
5773 (handle_action_at): In the case of a midrule, reference the parent rule
5774 where necessary.
5775 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5776 members.
5777 (symbol_list_length): Now that this is invoked after all rules have
5778 been parsed, a NULL symbol (rather than a NULL symbol list node)
5779 terminates a rule. symbol_list_print already does this correctly.
5780 * src/symlist.h (symbol_list.midrule_parent_rule,
5781 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5782 remember their relationships with their parents.
5783 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5784 fixed by the above patch.
5785 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5786 implementing...
5787 (Unused values): ... this old test case and...
5788 (Unused values before symbol declarations): ... this new test case.
5789 This one is the same as `Unused values' except that all symbol
5790 declarations appear after the rules in order to catch the rest of the
5791 errors fixed by the above patch.
5792
e256e17f
JD
57932006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5794
300a1930
JD
5795 More cleanup.
5796 * src/reader.c (current_rule): Declare it static since it's no longer
5797 used outside this file.
5798 (grammar_current_rule_action_append): Remove redundant arguments from
5799 translate_rule_action invocation.
5800 * src/reader.h (current_rule): Remove this unused extern.
5801 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5802 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 5803
381ecb06
JD
58042006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5805
5806 Clean up yesterday's patch.
5807 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5808 to...
5809 * src/reader.c (grammar_current_rule_action_append): ... here for
5810 consistency with grammar_current_rule_symbol_append.
5811 * tests/regression.at (Braced code in declaration in rules section):
5812 Make yyerror and yylex static as usual.
5813
4210cd0b
JD
58142006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5815
5816 Fix bug that mistakes braced code in a declaration in the rules section
5817 to be a rule action. Mentioned at
5818 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5819 * src/scan-gram.l: Move midrule action detection from the start of the
5820 scanning of any braced code to...
5821 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5822 action. For readability, use $2 and @2 rather than the equivalent
5823 global variables.
5824 * tests/regression.at (Braced code in declaration in rules section):
5825 New test to catch the error fixed by the above patch.
5826
5827 Work on code readability some.
5828 * src/scan-code.l (current_rule): Get rid of this misleading and
5829 redundant declaration: it's actually extern'ed in reader.h.
5830 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5831 translate_action): Add a rule argument and use it instead of the global
5832 current_rule.
5833 (translate_rule_action): This already receives current_rule through an
5834 argument, so pass it on to translate_action instead of assigning
5835 current_rule to current_rule.
5836 (translate_symbol_action, translate_code): Pass rule = NULL to
5837 translate_action.
5838
34f98f46
JD
58392006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5840
5841 Rename %before-definitions to %start-header and %after-definitions to
5842 %end-header. Don't use these declarations to separate pre-prologue
5843 blocks from post-prologue blocks. Add new order-independent
5844 declarations %before-header and %after-header as alternatives to the
5845 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5846 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5847 * NEWS (2.3+): Update for these changes.
5848 * data/glr.c (b4_before_definitions): Update to...
5849 (b4_start_header): ... this.
5850 (b4_after_definitions): Update to...
5851 (b4_end_header): ... this.
5852 * data/glr.cc: Likewise.
5853 * data/lalr1.cc: Likewise.
5854 * data/yacc.c: Likewise.
5855 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5856 prologue blocks with %*-header declarations.
5857 (Calc++ Parser): Likewise.
91661ebb 5858 (Decl Summary): Update names.
148d66d8 5859 (Table of Symbols): Update description.
34f98f46
JD
5860 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5861 (PERCENT_END_HEADER): ... this.
5862 (PERCENT_BEFORE_DEFINITIONS): Update to...
5863 (PERCENT_START_HEADER): ... this.
5864 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5865 (declaration): Update token names and m4 macro names.
5866 When parsing %end-header and %start-header, invoke translate_code
5867 before muscle_code_grow, and no longer set global booleans to remember
5868 whether these declarations have been seen.
5869 Parse new %after-header and %before-header.
5870 * src/reader.c (before_definitions, after_definitions): Remove.
5871 (prologue_augment): Accept a new bool argument to specify whether to
5872 augment the pre-prologue or post-prologue.
5873 * src/reader.h (before_definitions, after_definitions): Remove these
5874 extern's.
5875 (prologue_augment): Add new bool argument.
5876 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5877 (PERCENT_END_HEADER): ... this.
5878 (PERCENT_BEFORE_DEFINITIONS): Update to...
5879 (PERCENT_START_HEADER): ... this.
5880 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5881 * tests/actions.at (Printers and Destructors): Update names.
5882
31b2b07e
JD
58832006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5884
5885 Add comparison operators for C++ location classes. Discussed at
5886 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5887 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5888 declaration indicating whether filename_type has an operator==. If
5889 filename_type is `std::string', it defaults to `1', `0' otherwise.
5890 * data/location.cc: Iff b4_define_location_comparison is `1', add
5891 operator== and operator!= for class position and for class location.
5892
5893 Some minor fixes.
5894 * src/scan-action.l: Remove unused file.
5895 * src/symtab.c (symbol_printer_set): Use printer_location not
5896 destructor_location.
5897 * src/symtab.h (struct symbol): Replace incorrect source comment for
5898 printer members.
5899 * tests/input.at (Incompatible Aliases): Update output with correct
5900 printer location.
5901
9bc0dd67
JD
59022006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5903
5904 Don't put the pre-prologue in the header file. For the yacc.c code
5905 file and the glr.c header and code files, move the pre-prologue before
5906 the token definitions. Add new %before-definitions and
5907 %after-definitions to declare code that will go in both the header file
5908 and code file. Discussed at
5909 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5910 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5911 and
5912 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5913 * NEWS (2.3+): Describe these changes.
5914 * data/glr.c (b4_pre_prologue): Move from within to before...
5915 (b4_shared_declarations): ... this.
5916 Add new b4_before_definitions before b4_token_enums.
5917 Add new b4_after_definitions at the end.
5918 * data/glr.cc (b4_pre_prologue): Replace with...
5919 (b4_before_definitions): ... this in the header file.
5920 (b4_after_definitions): New near the end of the header file.
5921 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5922 code file right before including the header file.
5923 (b4_before_definitions): New in the previous position of
5924 b4_pre_prologue in the header file.
5925 (b4_after_definitions): New near the end of the header file.
5926 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5927 (b4_token_enums_defines): In the code file, move to right before
5928 YYSTYPE for consistency with the header file.
5929 (b4_before_definitions): New right before b4_token_enums_defines in
5930 both the header and code file.
5931 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5932 header and code file.
5933 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5934 of prologues for %union dependencies.
91661ebb
JD
5935 (Decl Summary): In %defines description, mention the effect of
5936 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
5937 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5938 than in the pre-prologue so that make check succeeds.
148d66d8 5939 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
5940 %after-definitions.
5941 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5942 %before-definitions.
5943 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5944 (declaration): Parse those declarations and append to
5945 b4_before_definitions and b4_after_definitions, respectively.
5946 * src/reader.c (before_definitions, after_definitions): New bools to
5947 track whether those declarations have been seen.
5948 (prologue_augment): Add to the post-prologue if %union,
5949 %before-definitions, or %after-definitions has been seen.
5950 * src/reader.h (before_definitions, after_definitions): New extern's.
5951 * src/scan-gram.l: Scan the new declarations.
5952 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5953 prologue block in a %before-definitions or a %after-definitions based
5954 on whether the %union is declared.
5955 * tests/regression.at (Early token definitions with --yacc, Early token
5956 definitions without --yacc): Move tests for token definitions into the
5957 post-prologue since token names are no longer defined in the
5958 pre-prologue.
5959
203b9274
AD
59602006-06-20 Akim Demaille <akim@epita.fr>
5961
5962 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5963 (symbol_get): Use it.
5964 * src/parse-gram.y: Use it.
5965
a7ee59cf
JD
59662006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5967
5968 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5969 build succeeds when configured with --enable-gcc-warnings.
5970
5a2baae7
PE
59712006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5972
33ad1a9c
PE
5973 * src/parse-gram.y (char_name): New function.
5974 (CHAR, STRING, string_content): For %printer, properly escape.
5975 (ID): Prefer fputs to fprintf.
5976 (id): Reindent to be consistent with other rules.
5977 Properly quote char.
5978
5a2baae7
PE
5979 The Translation Project changed its way of publishing translations
5980 to maintainers. I haven't received any responses to my request
5981 for supporting the old way, or for documenting the new way. I
5982 have modified 'bootstrap' to use screen scraping
5983 (in this case, HTML scraping). This is unreliable and inelegant,
5984 but I don't see any better way. Yuck.
5985 * bootstrap (TP_URL, WGET_COMMAND): New vars.
5986 (get_translations): New function, which uses HTML scraping to
5987 deduce locations of latest translations.
5988 Use this function to grab both bison and bison-runtime .po files.
5989 Don't bother priming the pump for the runtime-po domain any more,
5990 as it's now translated better than bison is.
5991
58d7a1a1
AD
59922006-06-19 Akim Demaille <akim@epita.fr>
5993
5994 * src/scan-gram.l: No longer "parse" things after `%union' until
5995 `{'. Rather, return a single "%union" token.
5996 No longer make symbols: return strings, and leave the conversion
5997 to symbols to the parser.
5998 (SC_PRE_CODE, token_type): Remove.
5999 * src/parse-gram.y (%union): New field `character'.
6000 Sort tokens.
6001 (CHAR): New token.
6002 (ID, ID_COLON): Now that the scanner no longer makes them
6003 identifiers, adjust all uses to invoke symbol_get.
6004 (id_colon): New, wraps the conversion from string to symbol.
6005 (%union): Accept a possible union_name.
6006 (symbol): Now can be a char.
6007 * data/c.m4 (b4_union_name): Leave a default value.
6008 * data/glr.c, data/yacc.c: Use it.
6009
b931235e
JD
60102006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6011
6012 For associating token numbers with token names for "yacc.c", don't use
6013 #define statements unless `--yacc' is specified; always use enum
6014 yytokentype. Most important discussions start at:
6015 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6016 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6017 and
6018 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6019 * NEWS (2.3+): Mention.
6020 * data/c.m4 (b4_yacc_if): New.
6021 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6022 token #define's.
6023 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6024 on token name definitions.
6025 * src/getargs.c (usage): Capitalize `Yacc' in English.
6026 * src/output.c (prepare): Define b4_yacc_flag.
6027 * tests/regression.at (Early token definitions): Test that tokens names
6028 are defined before the pre-prologue not just before the post-prologue.
6029 Remove this test case and copy to...
6030 (Early token definitions with --yacc): ... this to test #define's.
6031 (Early token definitions without --yacc): ... and this to test enums.
6032
9e6e7ed2
PE
60332006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6034
6035 * NEWS: Reword the post-2.3 change to not be so optimistic about
6036 removing the old "look-ahead" spelling.
6037 Update previous look-ahead/lookahead change reports.
6038 * REFERENCES: look-ahead -> lookahead (since that's
6039 what he actually wrote).
6040 * doc/refcard.tex: look ahead -> lookahead,
6041 look-ahead -> lookahead
6042
742e4900
JD
60432006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6044
6045 For consistency, use `lookahead' instead of `look-ahead' or
6046 `look_ahead'. Discussed starting at
6047 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6048 and then at
6049 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6050 * NEWS: For the next release, note the change to `--report'.
6051 * TODO, doc/bison.1: Update English.
6052 * doc/bison.texinfo: Update English.
6053 (Understanding Your Parser, Bison Options): Document as
6054 `--report=lookahead' rather than `--report=look-ahead'.
6055 * src/conflicts.c: Update English in comments.
6056 (lookahead_set): Rename from look_ahead_set.
6057 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6058 (resolve_sr_conflict): Rename local look_ahead_tokens to
6059 lookahead_tokens, and update other uses.
6060 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6061 count_rr_conflicts, conflicts_free): Update uses.
6062 * src/getargs.c (report_args): Move "lookahead" before alternate
6063 spellings.
6064 (report_types): Update uses.
6065 (usage): For `--report' usage description, state `lookahead' spelling
6066 rather than `look-ahead'.
6067 * src/getargs.h (report.report_lookahead_tokens): Rename from
6068 report_look_ahead_tokens.
6069 * src/lalr.c: Update English in comments.
6070 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6071 (state_lookahead_tokens_count): Rename from
6072 state_look_ahead_tokens_count.
6073 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6074 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6075 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6076 Update other uses.
6077 Update English in output.
6078 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6079 * src/print.c: Update English in comments.
6080 (lookahead_set): Rename from look_ahead_set.
6081 (print_reduction): Rename argument lookahead_token from
6082 look_ahead_token.
6083 (print_core, state_default_rule, print_reductions, print_results):
6084 Update uses.
6085 * src/print_graph.c: Update English in comments.
6086 (print_core): Update uses.
6087 * src/state.c: Update English in comments.
6088 (reductions_new): Update uses.
6089 (state_rule_lookahead_tokens_print): Rename from
6090 state_rule_look_ahead_tokens_print, and update other uses.
6091 * src/state.h: Update English in comments.
6092 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6093 (state_rule_lookahead_tokens_print): Rename from
6094 state_rule_look_ahead_tokens_print.
6095 * src/tables.c: Update English in comments.
6096 (conflict_row, action_row): Update uses.
6097 * tests/glr-regression.at
6098 (Incorrect lookahead during deterministic GLR,
6099 Incorrect lookahead during nondeterministic GLR): Rename
6100 print_look_ahead to print_lookahead.
6101 * tests/torture.at: Update English in comments.
6102 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6103 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6104 (Many lookahead tokens): Update uses.
6105 * data/glr.c: Update English in comments.
6106 * lalr1.cc: Likewise.
6107 * yacc.c: Likewise.
6108 * src/conflicts.h: Likewise.
6109 * src/lalr.h: Likewise.
6110 * src/main.c: Likewise.
6111 * src/output.c: Likewise.
6112 * src/parse-gram.c: Likewise.
6113 * src/tables.h: Likewise.
6114 * tests/calc.at: Likewise.
6115
3c40d0b5
JD
61162006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6117
6118 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6119
5d278082
PE
61202006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6121
6122 * TODO: Add request from Nelson H. F. Beebe to be able to install
6123 Bison without installing the yacc script.
6124
9e668899
JD
61252006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6126
6127 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6128 and yytext if they're already #define'd.
6129 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6130 * src/scan-code-c.c: ... here.
6131 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6132 <config.h>.
6133
0c8e079f
JD
61342006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6135
6136 Get Bison to build again when configured with --enable-gcc-warnings.
6137 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6138 missing #include's.
6139 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6140 loc argument as it shadows a global.
6141 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6142 invocation.
6143
6144 * src/.cvsignore: Add scan-code.c.
6145
2346344a
AD
61462006-06-07 Akim Demaille <akim@epita.fr>
6147
6148 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6149 to...
6150 * src/scan-code.l: here.
6151 * tests/input.at (Torturing the Scanner): Fix another location
6152 error.
6153
4862bdfd
AD
61542006-06-07 Akim Demaille <akim@epita.fr>
6155
6156 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6157
e9071366
AD
61582006-06-06 Akim Demaille <akim@epita.fr>
6159
6160 Extract the parsing of user actions from the grammar scanner.
6161 As a consequence, the relation between the grammar scanner and
6162 parser is much simpler. We can also split "composite tokens" back
6163 into simple tokens.
6164 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6165 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6166 rename as...
6167 * src/location.h, src/location.c (add_column_width)
6168 (location_compute): these.
6169 Fix the column count: the initial column is 0.
6170 (location_print): Be robust to ending column being 0.
6171 * src/location.h (boundary_set): New.
6172 * src/main.c: Adjust to scanner_free being renamed as
6173 gram_scanner_free.
6174 * src/output.c: Include scan-code.h.
6175 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6176 Use boundary_set.
6177 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6178 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6179 which is now, again, a separate token.
6180 Adjust all dependencies.
6181 Whereever actions with $ and @ are used, use translate_code.
6182 (action): Remove this nonterminal which is now useless.
6183 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6184 (grammar_current_rule_action_append): Use translate_code.
6185 (packgram): Bound check ruleno, itemno, and rule_length.
6186 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6187 (last_string, last_braced_code_loc, max_left_semantic_context)
6188 (scanner_initialize, scanner_free, scanner_last_string_free)
6189 (gram_out, gram_lineno, YY_DECL_): Move to...
6190 * src/scan-gram.h: this new file.
6191 (YY_DECL): Rename as...
6192 (GRAM_DECL): this.
6193 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6194 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6195 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6196 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6197 Move these declarations, and...
6198 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6199 these to...
6200 * src/flex-scanner.h: this new file.
6201 * src/scan-gram.l (rule_length, rule_length_overflow)
6202 (increment_rule_length): Remove.
6203 (last_braced_code_loc): Rename as...
6204 (gram_last_braced_code_loc): this.
6205 Adjust to the changes of the parser.
6206 Move all the handling of $ and @ into...
6207 * src/scan-code.l: here.
6208 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6209 (handle_action_dollar, handle_action_at): Move to...
6210 * src/scan-code.l: here.
6211 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6212 scan-code.h, scan-code-c.c, scan-gram.h.
6213 (EXTRA_bison_SOURCES): Add scan-code.l.
6214 (BUILT_SOURCES): Add scan-code.c.
6215 (yacc): Be robust to white spaces.
6216
6217 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6218 * tests/regression.at: Adjust the column numbers.
6219 * tests/regression.at: Adjust the error message.
7891a7c4 6220
184e42f0
JD
62212006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6222
6223 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6224 Use Akim's wording from
6225 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6226
7891a7c4
JD
62272006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6228
6229 Between Bison releases, manually append `+' to the previous Bison
6230 release number, and use that as a signal to automatically print the
6231 ChangeLog's CVS Id keyword from --version. Discussed starting at
6232 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6233 * ChangeLog: Add Id header.
6234 * configure.ac (AC_INIT): Append `+' to `2.3'.
6235 * src/.cvsignore: Add revision.c.
6236 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6237 (BUILT_SOURCES): Add revision.c.
6238 (revision.c): New target rule. This file defines a new global variable
6239 named revision. It initializes it with either the Id from ChangeLog
6240 or, if VERSION doesn't contain `+', with the empty string.
6241 * src/getargs.c (version): Print the value of revision.
6242 * src/revision.h: Extern revision.
6243
4ad3ed84
PE
62442006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6245
6246 * NEWS: Version 2.3.
6247 * configure.ac (AC_INIT): Likewise.
6248
02103984
PE
62492006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6250
6251 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6252 with no arguments, not as an object-like macro. This is for
6253 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6254 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6255 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6256 Document this.
6257
2c08afa5
JD
62582006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6259
6260 * src/getargs.c (usage): Back out yesterday's modification of the
6261 --help output so that we don't have to wait for translation before
6262 releasing 2.3.
6263
6077da58
PE
62642006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6265
6266 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6267 Problem reported by Akim Demaille.
6268
2a26b6c2
JD
62692006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6270
6271 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6272
aefef0d6
PE
62732006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6274
6275 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6276 generated source code. Problem reported by Frans Englich in
6277 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6278
fcd8e201
PE
62792006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6280
6281 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6282 shell, not within 'make', so that 'make' by an ordinary builder
6283 (using GNU make) does not worry about configuring gzip. This also
6284 works around a bug reported independently by Keith Thompson and by
6285 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6286 stderr rather than stdout, messing up the build logs.
6287
7b5cdcbd
JD
62882006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6289
6290 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6291 to make sure that YYID will never be unused. This fixes a 'make
6292 maintainer-check' failure caused by the recent changes to the 'Trivial
6293 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6294 not used.
6295 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6296
5ad0a449
JD
62972006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6298
6299 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6300 state before an empty RHS is always resolved here. Only the location
6301 of that state is guaranteed to be resolved, and that's enough. This
6302 fixes the remaining bug reported by Derek M. Jones in
6303 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6304 * tests/glr-regression.at (Uninitialized location when reporting
6305 ambiguity): Test the above case.
6306 Also, the embedded comments in this test case claim it checks the case
6307 of an empty RHS that has inherited the initial location. However, the
6308 corresponding LHS was already resolved, so yyresolveLocations didn't
6309 actually have reason to modify it. Fix this by forcing
6310 nondeterministic operation at the beginning of the parse.
6311
50cce58e
PE
63122006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6313
6314 * data/c.m4 (b4_yy_symbol_print_generate):
6315 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6316 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6317 of the bugs reported today by Derek M Jones in
6318 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6319 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6320 defined to be a type name without parens or brackets.
6321 (Location Type): Similarly for YYLTYPE.
6322 * tests/regression.at (Trivial grammars): Put in a test for this
6323 bug that will be caught by 'make maintainer-check' (though not,
6324 alas, by 'make check' unless your compiler is picky).
6325
ab8d9dc5
PE
63262006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6327
0d2c8934 6328 * NEWS: Version 2.2.
ab8d9dc5
PE
6329 * configure.ac (AC_INIT): Likewise.
6330
9138c575
JD
63312006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6332
6333 * data/glr.c (yyreportTree): Make room in yystates for the state
6334 preceding the RHS. This fixes the segmentation fault reported by Derek
6335 M. Jones in
6336 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6337 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6338 to the user. Reported for yyreportTree by Derek M. Jones later in the
6339 same thread.
6340 * THANKS: Add Derek M. Jones.
6341 Update my email address.
6342 Fix typo in Steve Murphy's name.
6343
276f48df
PE
63442006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6345
d6645148
PE
6346 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6347 checking against YYLAST that caused the parser to miss a potential
6348 alternative in its diagnostic.
6349 Problem reported by Maria Jose Moron Fernandez in
6350 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6351 * data/lalr1.cc (yysyntax_error_): Likewise.
6352 * data/yacc.c (yysyntax_error): Likewise.
6353 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6354 tokens, in case we run into an older C compiler.
6355 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6356 Use them to check for the off-by-one error fixed above.
6357
276f48df
PE
6358 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6359 YYSIZE_T, not size_t.
6360 * tests/regression.at (Trivial grammars): New test, to catch
6361 the error fixed by the above patch.
6362
cd8b5791
AD
63632006-05-14 Akim Demaille <akim@lrde.epita.fr>
6364
6365 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6366 scheme.
6367 Reported by Steve Murphy.
6368
34376418
AD
63692006-05-14 Akim Demaille <akim@lrde.epita.fr>
6370
6371 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6372 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6373
327afc7c
AD
63742006-05-14 Akim Demaille <akim@lrde.epita.fr>
6375
6376 Implement --trace=m4.
6377 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6378 * src/output.c (output_skeleton): When set, pass -dV to m4.
6379
6380 Factor the handling of flags in m4.
6381 * src/output.c (prepare): Rename the muscle names debug, defines,
6382 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6383 * data/c.m4: Adjust.
6384 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6385 Use b4_define_flag_if to define other b4_FLAG_if macros.
6386 (b4_location_if): As a consequence, rename as...
6387 (b4_locations_if): this, for consistency.
6388 Adjust all the skeletons.
6389
ba9ecd19
AD
63902006-05-14 Akim Demaille <akim@lrde.epita.fr>
6391
6392 * etc/bench.pm: Shorten bench names.
6393
4e83ea15
AD
63942006-05-14 Akim Demaille <akim@lrde.epita.fr>
6395
6396 * src/output.h, src/output.c (error_verbose): Move to...
6397 * src/getargs.h, src/getargs.c: here.
6398 Sort the flags.
6399 Adjust dependencies.
6400
6e93d810
PE
64012006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6402
6403 * data/c.m4 (b4_copyright): Put the special exception for Bison
6404 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
6405 uses changed. Suggested by Akim Demaille. Also, wrap the
6406 copyright notice, in case it is longer than 80 columns. Replace
6407 comma by newline after title.
6e93d810 6408
eaea13f5
PE
64092006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6410
6411 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6412 incompatibility, not a bug. Mention that it wasn't fixed as of
6413 flex 2.5.33.
6414
3cf084ec
AD
64152006-05-11 Akim Demaille <akim@lrde.epita.fr>
6416
6417 * examples/extexi: Enforce the precedence of concatenation over
6418 >>.
0a9f1c7d 6419 Reported by Tommy Nordgren.
3cf084ec 6420
32c96bd7
AD
64212006-05-11 Akim Demaille <akim@lrde.epita.fr>
6422
6423 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6424 with the member "token".
f94705b2 6425 Reported by Martin Nylin.
32c96bd7 6426
eaea13f5
PE
64272006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6428
6429 * data/glr.c: Switch to Bison 2.2 special-exception language in
6430 the copyright notice. Use more-regular format for titles and
6431 copyright notices.
6432 * data/glr.cc: Likewise.
6433 * data/location.cc: Likewise.
6434 * data/yacc.cc: Likewise.
6435 * doc/bison.texinfo (Conditions): Document this.
6436 * NEWS: likewise. Upgrade version to 2.2.
6437
6e2d1146
AD
64382006-04-27 Akim Demaille <akim@lrde.epita.fr>
6439
6440 * data/glr.cc: Remove dead code.
6441
47671055
PE
64422006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6443
6444 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6445 that variable and the line breaks the bootstrap. Problem reported
6446 by Juan M. Guerrero.
6447
ed2e6384
AD
64482006-04-24 Akim Demaille <akim@lrde.epita.fr>
6449
6450 * doc/bison.texinfo (Multiple start-symbols): New.
6451
3cedc2dc
AD
64522006-04-24 Akim Demaille <akim@lrde.epita.fr>
6453
6454 * etc/README, etc/bench.pl: New.
6455
b2ddc3f3
AD
64562006-04-03 Akim Demaille <akim@lrde.epita.fr>
6457
6458 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6459 rule.
6460 Reported by Mickael Labau.
6461 * tests/input.at (Torturing the Scanner): Test it.
6462
91e3ac9a
PE
64632006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6464
6465 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6466 Problem reported by Bob Rossi.
6467
64682006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6469
6470 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6471 and didn't really work.
6472 For the index, use @ifnotinfo, not @iftex.
6473 Minor cleanups of spacing and terminology.
6474
5cf61e93
AD
64752006-03-12 Akim Demaille <akim@lrde.epita.fr>
6476
6477 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6478 of AT_NAME_PREFIX when %name-prefix is not used.
6479
aa08666d
AD
64802006-03-12 Akim Demaille <akim@lrde.epita.fr>
6481
6482 Apply --prefix to C++ skeletons too: they change the namespace.
6483 The test suite already exercize these cases.
6484 * data/c++.m4 (b4_namespace): New.
6485 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6486 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6487 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6488 * doc/bison.texinfo: Document it.
6489 (Option Cross Key): Use @multitable in all formats. It looks
6490 nicer, even in TeX outputs.
6491 (Rules): Use the same code whatever the output type is.
6492 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6493 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6494 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 6495
45567173
AD
64962006-03-10 Akim Demaille <akim@lrde.epita.fr>
6497
6498 * TODO: Remove dead items.
6499
e9d8f881 65002006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
6501
6502 * doc/FAQ: Remove, merged into...
6503 * doc/bison.texinfo (FAQ): this.
6504 * doc/Makefile.am (EXTRA_DIST): Adjust.
6505
c095d689
AD
65062006-03-10 Akim Demaille <akim@lrde.epita.fr>
6507
6508 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6509 even if empty.
6510 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6511 * doc/bison.texinfo (Calc++ Scanner): Use it.
6512
6e0f8287
PE
65132006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6514
6515 Fix two nits reported by twlevo, plus one more that I discovered.
6516
6517 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6518 this is the usual Bison style.
6519 * src/location.h (location_print): Likewise.
6520
6521 * src/reader.h (token_name): Likewise.
6522
d6b771c3
PE
65232006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6524
6525 Fix some nits reported by twlevo.
6526 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6527 and "POSIX". Use more-modern syntax for URLs. Mention C++
6528 and ask for Java. Don't hardwire OS version numbers. Add
6529 copyright notice.
6530 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6531 * src/conflicts.c (solved_conflicts_obstack): Now static.
6532
1e137b71
JD
65332006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6534
6535 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6536 page. Say "you can use it" not "you may use it" as on the web page;
6537 we're describing capabilities not granting permission.
6538
73f2e47e
PE
65392006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6540
6d05403d
PE
6541 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6542 shadowing warnings. Use usual patter for iterating through RHS.
6543 * tests/glr-regression.at
6544 (Uninitialized location when reporting ambiguity):
6545 Modify yylex so that it uses its argument, rather than trying
6546 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6547 const char -> char const.
6548
73f2e47e
PE
6549 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6550 Don't use tabs inside commands; it messes up 'ps'.
6551 Problem reported by twlevo.
6552
8710fc41
JD
65532006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6554
6555 * tests/glr-regression.at (Uninitialized location when reporting
6556 ambiguity): New test case.
6557 * data/glr.c (yyresolveLocations): New function, which uses
6558 YYLLOC_DEFAULT.
6559 (yyresolveValue): Invoke yyresolveLocations before reporting an
6560 ambiguity.
6561 * doc/bison.texinfo (Default Action for Locations): Note
6562 YYLLOC_DEFAULT's usage for ambiguity locations.
6563 (GLR Semantic Actions): Cross-reference those notes.
6564
ae952af2
JD
65652006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6566
6567 * tests/glr-regression.at (Leaked semantic values when reporting
6568 ambiguity): Remove unnecessary union and type declarations.
6569 (Leaked lookahead after nondeterministic parse syntax error): New test
6570 case.
6571 * data/glr.c (yyparse): Check for zero stacks remaining before
6572 attempting to shift the lookahead so that you don't lose it.
6573
35ee866a
JD
65742006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6575
6576 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6577 * tests/glr-regression.at (Leaked semantic values when reporting
6578 ambiguity): New test case.
6579 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6580 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6581 now unnecessary yystackp parameter.
6582 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6583 destructors can be called.
6584
6585 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6586 in existing testcases.
6587
520181ab
JD
65882006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6589
6590 Don't leak semantic values for parent RHS when a user action cuts the
6591 parser, and clean up related code a bit.
6592 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
6593 cuts parse): Rename to...
6594 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
6595 for leaked parent RHS values.
6596 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6597 between an unresolved state (non-empty chain of semantic options) and
6598 an incomplete one (signaled by an empty chain).
ae952af2 6599 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
6600 successfully or unsuccessfully resolved yyGLRState to...
6601 (yyresolveValue): ... here so that yyresolveValue always leaves a
6602 yyGLRState with consistent data and thus is easier to understand.
6603 Remove the yyvalp and yylocp parameters since they are always just
6604 taken from the yys parameter. When reporting a discarded merged value
6605 in debugging output, note that it is incompletely merged. Document the
6606 interface.
6607 (yyresolveAction): If resolving any of the RHS states fails, destroy
6608 them all rather than leaking them. Thus, as long as user actions are
6609 written to clean up the RHS correctly, yyresolveAction always cleans up
6610 the RHS of a semantic option. Document the interface.
6611
18d9185c
PE
66122006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6613
6614 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6615 led to a segmentation fault in GNU Pascal. Problem reported
6616 by Waldek Hebisch.
6617
841a7737
JD
66182006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6619
6620 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6621 mid-rule action inside a nonterminal symbol in order to declare a
6622 destructor for its semantic value.
6623
fc3f467f
PE
66242006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6625
6626 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6627 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6628 __cplusplus && ! defined _STDLIB_H && !
6629 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6630 defined free))]: Include <stdlib.h> rather than rolling our own
6631 declarations of malloc and free, to avoid problems with
6632 incompatible declarations (using 'throw') C++'s stdlib.h. This
6633 should fix Debian bug 340012
6634 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6635 reported by Guillaume Melquiond.
6636
a3af26dd
PE
66372006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6638
4d7bc38c
PE
6639 * NEWS: Clarify symbols versus types in unused-value warnings.
6640
a3af26dd
PE
6641 * configure.ac (AC_INIT): Bump version number.
6642
4e26c69e
PE
66432006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6644
6645 * NEWS: Version 2.1a.
6646 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6647 since C99 requires this.
6648
498e897c
PE
66492006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6650
6651 * m4/c-working.m4: New file.
6652 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6653
57bb17ca
PE
66542006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6655
6656 * Makefile.maint: Merge from coreutils.
6657
0be105dc
PE
66582006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6659
6660 More portability fixes for problems summarized by Nelson H. F. Beebe.
6661
6662 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6663 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6664 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6665 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6666 messes up because C++ code is compiled in 32-bit mode but linked
6667 in 64-bit mode.
6668
6fc0c024
PE
66692006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6670
6671 More portability fixes for problems summarized by Nelson H. F. Beebe.
6672
7870f699
PE
6673 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6674 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6675
6fc0c024
PE
6676 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6677 nodist_PROGRAMS, since we don't need to actually compile the
6678 example if we're just doing a plain 'make'. This avoids bothering
6679 the installer unnecessarily about problems due to weird C++
6680 compilers.
6681
fe6c2fde
PE
66822006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6683
6684 More portability fixes for problems summarized by Nelson H. F. Beebe.
6685
6686 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6687 than #include "...", and compile with -I'.'. The old method was
6688 not portable, according to Posix and the C standard, and it does
6689 not work with Sun C 5.7, where previous #line directives affect
6690 the working directory used in later #include "..." directives.
6691
927b425b
JMG
66922006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6693
6694 Various DJGGP specific issues in /djgpp
6695
d9735e9e
PE
66962006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6697
6698 More portability fixes for problems summarized by Nelson H. F. Beebe.
6699
6700 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6701 '#include <map>' works and that you can apply ++ to iterators.
6702
5a6755af
PE
67032006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6704
67a0dc4f
PE
6705 Work around portability problems summarized by Nelson H. F. Beebe in
6706 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6707
8c86f0ef
PE
6708 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6709 that '#include <string>' works.
6710
de35dd59
PE
6711 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6712 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6713 "warning: sorry: semantics of inline function static data `const
6714 unsigned char translate_table[262]' are wrong (you'll wind up with
6715 multiple copies)".
6716
67a0dc4f
PE
6717 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6718 or, xor to not_, and_, or_, and xor_, respectively. This works
6719 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6720 random system header somewhere that includes the equivalent of
6721 <iso646.h>.
6722
5a6755af
PE
6723 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6724 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 6725 Suite Version 2.0.
5a6755af 6726
3f001415
JD
67272006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6728
6729 During deterministic GLR operation, user actions should be able to
6730 influence the parse by changing yychar. To make this easier to fix and
6731 to make glr.c easier to evolve in general, don't maintain yytoken in
6732 parallel with yychar; just compute yytoken when needed.
6733 * tests/glr-regression.at (Incorrect lookahead during deterministic
6734 GLR): Check that setting yychar in a user action has the intended
6735 effect.
6736 * data/glr.c (yyGLRStack): Remove yytokenp member.
6737 (yyclearin): Don't set *yytokenp.
6738 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6739 yychar rather than *yytokenp to determine the current lookahead.
6740 Compute yytoken locally when needed.
6741 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6742 point to.
6743
6744 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6745 after `--report' documentation.
6746
e2a8c0f5
PE
67472006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6748
6749 * src/parse-gram.y (grammar_declaration): Location of printer
6750 symbol is @1, not list->location. Bug reported by twlevo.
6751 * tests/input.at (Incompatible Aliases): Adjust to above change.
6752
6b702268
PE
67532006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6754
27622431
PE
6755 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6756 all the test at once. This makes the output easier to read in the
6757 normal case.
6758
6b702268
PE
6759 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6760 got from <http://bro-ids.org/download.html>. The bug is that
6761 when two actions appeared in succession, the second one was
6762 scanned before the first one was added to the grammar rule
6763 as a midrule action. Bison then output the incorrect warning
6764 "parse.y:905.17-906.36: warning: unused value: $3".
6765 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6766 associated with a value.
6767 (rhs): Don't invoke grammar_current_rule_action_append.
6768 (action): Invoke it here instead.
6769 * src/reader.c (grammar_midrule_action): Now extern.
6770 (grammar_current_rule_action_append): Don't invoke
6771 grammar_midrule_action; that is now the scanner's job.
6772 * src/reader.h (last_string, last_braced_code_loc):
6773 (grammar_midrule_action): New decls.
6774 * src/scan-gram.l (last_string): Now extern, sigh.
6775 (last_braced_code_loc): New extern variable.
6776 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6777 rule already has an action.
6778 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6779 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6780 Add some tests to check that the above changes fixed the bug.
6781
d40ba6c2
PE
67822006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6783
6784 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6785 All used changed. Check whether the symbol has a destructor,
6786 not whether it is typed.
6787 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6788 that the values are still reported as unused. All line numbers
6789 adjusted.
6790
401aace6
PE
67912006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6792
6793 Work around a bug in bro 0.8, which underparenthesizes its
6794 definition of YYLLOC_DEFAULT.
6795 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6796 their arguments.
6797 * data/lalr1.cc: Likewise.
6798 * data/yacc.cc: Likewise.
6799
06f01bc4
PE
68002006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6801
401aace6
PE
6802 Work around a bug in Pike 7.0, and give the Pike folks a
6803 better way to override the usual int widths.
6804 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6805 user can override the types.
6806 (short): #undef, to work around a bug in Pike 7.0.
6807 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6808 (union yyalloc.yyss): Use yytype_int16 rather than short.
6809 All uses changed.
6810 (yysigned_char): Remove.
6811 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6812 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6813 * tests/regression.at (Web2c Actions): Adjust to above changes.
6814
6815 * src/reader.c (check_and_convert_grammar): New function.
6816 (reader): Close the input file even if something went wrong during
6817 parsing. Minor file descriptor leak reported by twlevo.
6818
06f01bc4
PE
6819 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6820 to pacify gcc -Wswitch-default.
6821 * src/scan-gram.l (adjust_location): Use a default: break; case
6822 to pacify gcc -Wswitch-default.
6823 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6824 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6825 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6826 Move these decls to scan-skel.l, since they don't need to be
6827 visible elsewhere.
6828 * src/scan-skel.l: Accept the above decls.
6829 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6830 is used.
6831
02650b7f
PE
68322006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6833
6834 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6835 since we don't want to insist on a version number at the start
6836 of the changelog every time.
6837 * Makefile.maint: Sync from coreutils a bit better.
6838 (sc_trailing_blank): Renamed from sc_trailing_space.
6839 All uses changed.
6840 (sc_no_if_have_config_h, sc_require_config_h):
6841 (sc_prohibit_assert_without_use): New rules.
6842 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6843 (sc_dd_max_sym_length): Fix leading spaces in rule.
6844 (sc_system_h_headers): Prefix with @.
6845 (sc_useless_cpp_parens, m4-check): Output line numbers.
6846 (changelog-check): Allow version only in head.
6847 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6848 satisfy new Makefile.maint rule.
6849 * data/glr.c: Likewise.
6850 * data/glr.cc: Likewise.
6851 * data/lalr1.cc: Likewise.
6852 * data/yacc.c: Likewise.
6853 * lib/ebitsetv.c: Likewise.
6854 * lib/lbitset.c: Likewise.
6855 * lib/subpipe.c: Likewise.
6856 * lib/timevar.c: Likewise.
6857 * src/system.h: Likewise.
6858 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6859 * djgpp/Makefile.maint: Add copyright notice.
6860 * djgpp/README.in: Likewise.
6861 * djgpp/config.bat: Likewise.
6862 * djgpp/config.site: Likewise.
6863 * djgpp/config_h.sed: Likewise.
6864 * djgpp/djunpack.bat: Likewise.
6865 * djgpp/config.sed: Fix copyright notice to match standard format.
6866 * djgpp/subpipe.h: Likewise.
6867 * lib/bitsetv-print.c: Likewise.
6868 * lib/bitsetv.c: Likewise.
6869 * lib/subpipe.h: Likewise.
6870 * lib/timevar.c: Likewise.
6871 * lib/timevar.h: Likewise.
6872 * djgpp/subpipe.c: Use standard recipe for config.h.
6873 * lib/abitset.c: Likewise.
6874 * lib/bitset.c: Likewise.
6875 * lib/bitset_stats.c: Likewise.
6876 * lib/bitsetv-print.c: Likewise.
6877 * lib/bitsetv.c: Likewise.
6878 * lib/ebitsetv.c: Likewise.
6879 * lib/get-errno.c: Likewise.
6880 * lib/lbitset.c: Likewise.
6881 * lib/subpipe.c: Likewise.
6882 * lib/timevar.c: Likewise.
6883 * lib/vbitset.c: Likewise.
6884 * tests/local.at: Likewise.
6885 * src/scan-gram.l: Don't include verify.h, since system.h does
6886 that for us.
6887 * .x-sc_require_config_h: New file.
6888 * .x-sc_unmarked_diagnostics: New file.
6889
287c78f6
PE
68902006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6891
287c78f6
PE
6892 Be a bit more systematic about using 'abort'.
6893 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6894 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6895 Put 'default: abort ();' before some other case, to satisfy older
6896 pedantic compilers.
6897 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6898 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6899 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6900 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
6901 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6902 (get_decision_str, get_orientation_str, get_node_alignment_str):
6903 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6904 (get_linestyle_str, get_arrowstyle_str): Likewise.
6905 * src/conflicts.c (resolve_sr_conflict):
6906 Use a default case rather than one for the one remaining enum
6907 value, to catch invalid enum values as well.
6908 * src/lalr.c (set_goto_map, map_goto):
6909 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6910 * src/nullable.c (nullable_compute, token_definitions_output):
6911 Likewise.
6912 * src/reader.c (packgram, reader): Likewise.
6913 * src/state.c (transitions_to, state_new, state_reduction_find):
6914 Likewise.
6915 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6916 (symbol_pack): Likewise.
6917 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
6918 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6919 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
6920 * src/system.h: Don't include <assert.h>.
6921 (assert): New macro.
6922
6923 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6924 (Destructor Decl, Parser Function, Pure Calling):
6925 Describe rules for braces inside C code more carefully.
287c78f6 6926
c66dfadd
PE
69272006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6928
c21493b8
PE
6929 Fix some porting glitches found by Nelson H. F. Beebe.
6930 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6931 compilers that don't understand that abort () does not return.
6932 * src/state.c (transitions_to): Likewise.
6933 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6934 that '#include <cstdlib>' works.
6935 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6936 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6937 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6938 for the benefit of some pre-C99 compilers.
6939
b6e3facf
PE
6940 * bootstrap: Undo changes to gnulib files that autoreconf made.
6941
c66dfadd
PE
6942 Minor fixups to get 'make maintainer-check' to work.
6943 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6944 with the new verify.h implementation.
6945 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6946 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6947 * data/yacc.c (YYUSE): Likewise.
6948 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6949 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6950 * src/parse-gram.y (declaration): Don't pass a string constant
6951 to a function that expects char *, since GCC might complain
6952 about the constant value.
6953 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6954 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6955 before #defining them.
6956 * tests/glr-regression.at
6957 (Incorrectly initialized location for empty right-hand side in GLR):
6958 In yyerror, use the msg arg.
6959 (Corrupted semantic options if user action cuts parse):
6960 (Incorrect lookahead during deterministic GLR):
6961 (Incorrect lookahead during nondeterministic GLR):
6962 Don't name a local var 'index'; it shadows string.h's 'index'.
6963
ed94ef2a
AD
69642006-01-19 Akim Demaille <akim@epita.fr>
6965
6966 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6967 location, not just parts of it.
6968
e9ad4aec
PE
69692006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6970
d6ca7905
PE
6971 * NEWS: Document the fact that multiple %unions are now allowed.
6972 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
6973 * TODO: This feature is now implemented, so remove it from
6974 the wishlist.
d6ca7905 6975
ef1b70e0
PE
6976 * Makefile.maint: Merge with coreutils Makefile.maint.
6977 (CVS_LIST): Use build-aux version if available.
6978 (VERSION_REGEXP): New macro.
6979 (syntax-check-rules): Add sc_no_if_have_config_h,
6980 sc_prohibit_assert_without_use, sc_require_config_h,
6981 sc_useless_cpp_parens.
6982 (sc_obsolete_symbols): Check for O_NDELAY.
6983 (sc_dd_max_sym_length): Track coreutils.
6984 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6985 (sc_useless_cpp_parens): New rule.
6986 (news-date-check): Look for version or today's date.
6987 (changelog-check): Don't require version number near head.
6988 (copyright-check): Use current year instead of hardwiring 2005.
6989 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
6990 (announcement): Add --gpg-key-ID.
6991
6992 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
6993 with "file system".
6994
2073ce56 6995 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
6996 array. Problem reported by twlevo.
6997 * src/reader.c (packgram): Prepend a new sentinel before ritem.
6998 * src/lalr.c (build_relations): Rely on new sentinel.
6999 * src/gram.c (gram_free): Adjust to new sentinel.
7000
b7691f15
JD
70012006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7002
7003 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7004 yylookaheadNeeds. All uses updated.
7005 (yysplitStack): Rename local yynewLookaheadStatuses to
7006 yynewLookaheadNeeds.
7007 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7008 GLR): In comments, change `lookahead status' to `lookahead need'.
7009
ddee1b06
PH
70102006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7011
7012 * data/glr.c (yysplitStack): A little stylistic rewrite.
7013
12f4614d
PH
70142006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7015
7016 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7017
32c29292
JD
70182006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7019
7020 * doc/bison.texinfo: Fix some typos.
7021 (GLR Semantic Actions): New subsection discussing special
7022 considerations because GLR semantic actions might be deferred.
7023 (Actions): Mention look-ahead usage of yylval.
7024 (Actions and Locations): Mention look-ahead usage of yylloc.
7025 (Special Features for Use in Actions): Add YYEOF entry and mention it
7026 in the yychar entry.
7027 In the yychar entry, remove mention of the local yychar case (pure
7028 parser) since this is irrelevant information when writing semantic
148d66d8 7029 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
7030 yychar is otherwise described as an external variable.
7031 In the yychar entry, don't call it the `current' look-ahead since it
7032 isn't when semantic actions are deferred.
7033 In the yychar and yyclearin entries, add note about deferred semantic
7034 actions.
7035 Add yylloc and yylval entries discussing look-ahead usage.
7036 (Look-Ahead Tokens): When discussing yychar, don't call it the
7037 `current' look-ahead, and do mention yylval and yylloc.
7038 (Error Recovery): Cross-reference `Action Features' when mentioning
7039 yyclearin.
148d66d8 7040 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
7041 look-ahead.
7042 In the yylloc and yylval entries, mention look-ahead usage.
7043
de366a2f 70442006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
7045
7046 * tests/glr-regression.at: Update copyright year to 2006.
7047
bf70fa87
JD
70482006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7049
7050 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7051 use during nondeterministic operation to track which stacks have
7052 actually needed the current lookahead.
7053 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7054 Allocate, deallocate, resize, and otherwise shuffle space for
7055 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7056 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7057 appropriately during nondeterministic operation.
7058 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7059 members to store the current lookahead to be used by the deferred
7060 user action.
7061 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7062 from which the RHS is taken. Set the lookahead members of the new
7063 yySemanticOption according to the lookahead status for stack yyk.
7064 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7065 yyaddDeferredAction.
7066 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7067 members of yySemanticOption before invoking yyuserAction, and then set
7068 them back to their current values afterward.
7069 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7070 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7071 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7072 titles for consistency.
7073 (Leaked merged semantic value if user action cuts parse): In order to
7074 suppress lint warnings, use arguments in merge function, and assign
7075 char value < 128 in main.
7076 (Incorrect lookahead during deterministic GLR): New test case.
7077 (Incorrect lookahead during nondeterministic GLR): New test case.
7078
05449a2c
JD
70792006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7080
de366a2f 7081 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
7082 !yyvaluep as signal that no semantic value is available to print.
7083 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7084 to print a semantic value.
7085
4158e0a1 70862006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 7087
4158e0a1
JD
7088 * tests/glr-regression.at: For consistency with my newer test cases,
7089 don't thank myself.
7090
d659304d
JD
70912006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7092
7093 * data/glr.c (yyresolveValue): When merging semantic options, if at
7094 least one user action succeeds but a later one cuts the parse, then
7095 destroy the semantic value before returning rather than leaking it.
7096 (yyresolveStates): If a user action cuts the parse and thus
7097 yyresolveValue fails, ignore the (unset) semantic value rather than
7098 corrupting the yyGLRState, and empty the semantic options list since
7099 the user actions should have called all necessary destructors.
7100 Simplify code with YYCHK.
7101 * tests/glr-regression.at (Corrupted semantic options if user action
7102 cuts parse): New test case.
7103 (Undesirable destructors if user action cuts parse): New test case.
7104 Before applying any of this patch, this test case never actually failed
7105 for me... but only because the corrupted semantic options usually
7106 masked this bug.
7107 (Leaked merged semantic value if user action cuts parse): New test
7108 case.
7109
6ec2c0f2
AD
71102006-01-05 Akim Demaille <akim@epita.fr>
7111
7112 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7113
1b9c21fb
PE
71142006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7115
7116 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7117 _MSC_VER. Problem reported by Cenzato Marco.
7118 (b4_c_function_def): Use it.
7119 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7120 b4_c_modern.
7121 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7122 than rolling our own.
7123
84866159
AD
71242006-01-04 Akim Demaille <akim@epita.fr>
7125
7126 Also warn about non-used mid-rule values.
7127 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7128 member.
7129 (symbol_list_new): Adjust.
7130 * src/reader.c (symbol_typed_p): New.
7131 (grammar_rule_check): Use it.
7132 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7133 Check its rule.
7134 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7135 Use it.
7136 * tests/actions.at (Exotic Dollars): Adjust.
7137
378f4bd8
AD
71382006-01-04 Akim Demaille <akim@epita.fr>
7139
7140 * src/reader.c (grammar_midrule_action): If $$ is set in a
7141 mid-rule, move the `used' bit to its lhs.
7142 * tests/input.at (Unused values): New.
7143 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7144
e2a21b6f
PE
71452006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7146
54662697
PE
7147 * doc/bison.texinfo (Bison Options): Say more accurately what
7148 --yacc does.
7149 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7150 about declarations in the grammar when in Yacc mode, as POSIX does
7151 not require a diagnostic when the grammar uses extensions.
7152
7153 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7154
073f9288
PE
7155 Warn about dubious constructions like "%token T T".
7156 Reported by twlevo.
7157 * src/symtab.h (struct symbol.declared): New member.
7158 * src/symtab.c (symbol_new): Initialize it to false.
7159 (symbol_class_set): New arg DECLARING, specifying whether
7160 this is a declaration that we want to warn about, if there
7161 is more than one of them. All uses changed.
7162
1221b78a
PE
7163 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7164 Allow multiple %union directives, whose contents concatenate.
7165 * src/parse-gram.y (grammar_declaration): Likewise.
7166 Use muscle_code_grow, so that we don't need stype_line any more.
7167 All uses changed.
7168
7169 * src/muscle_tab.c (muscle_grow): Fix comment.
7170
e2a21b6f
PE
7171 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7172 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7173 Update copyright year to 2006.
7174
8f7e3cf9
AD
71752006-01-03 Akim Demaille <akim@epita.fr>
7176
7177 Have glr.cc pass (some of) the calc.at tests.
7178 * data/glr.cc (b4_parse_param_orig): New.
7179 (b4_parse_param): Improve its definition, and bound it more
7180 clearly in the skeleton.
7181 (b4_epilogue): Append, instead of prepending, in order to keep
7182 #line consistency.
7183 Simplify the generation of auxiliary functions: locations and
7184 purity are mandated.
7185 (b4_global_tokens_and_yystype): Honor it.
7186 * data/location.cc (c++.m4): Don't include it.
7187 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7188 and AT_SKEL_CC_IF.
7189 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7190 AT_LALR1_CC_IF.
7191 Be sure to initialize the first position's filename.
7192 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7193 mandated anyway.
7194 (AT_CHECK_CALC_GLR_CC): New.
7195 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7196
3953ed88
AD
71972006-01-02 Akim Demaille <akim@epita.fr>
7198
7199 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7200 c.m4.
0a96ba81 7201 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
7202 * data/glr.cc: Do not include stack.hh.
7203
9ecafbbf
AD
72042006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7205
7206 * data/glr.c: Reformat whitespace with tabs.
7207 (b4_lpure_formals): Remove this unused m4 macro.
7208 * tests/cxx-type.at: Reformat whitespace with tabs.
7209 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7210 since it's a member. Rename type to isNterm for clarity.
7211
c4d497a0
AD
72122005-12-29 Akim <akim@sulaco.local>
7213
7214 Let glr.cc catch up with symbol_value_print.
7215 * data/glr.cc (b4_yysymprint_generate): Replace by...
7216 (b4_yy_symbol_print_generate): this.
7217 (yy_symbol_print, yy_symbol_value_print): Declare them.
7218
4517da37
PE
72192005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7220
7221 * src/location.h (boundary): Note that a line or column equal
7222 to INT_MAX indicates an overflow.
7223 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7224 (rule_length_overflow, increment_rule_length, add_column_width):
7225 New functions.
7226 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7227 (<SC_BRACED_CODE>"}"):
7228 Use increment_rule_length rather than incrementing it by hand.
7229 (adjust_location, handle_syncline): Diagnose overflow.
7230 (handle_action_dollar, handle_action_at):
7231 Fix bug with monstrosities like $-2147483648.
7232 Remove now-unnecessary checks.
7233 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7234 (convert_ucn_to_byte): Verify assumptions.
7235 (handle_syncline): New arg LOC. All callers changed.
7236 Don't store through a value derived from char const * pointer.
7237
7238 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7239 GCC warnings.
7240
e3233bf6
PE
72412005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7242
7243 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7244 Remove unnecessary forward static decls.
7245
8f3596a6
AD
72462005-12-27 Akim Demaille <akim@epita.fr>
7247
7248 * src/reader.c (grammar_current_rule_check): Also check that $$
7249 is used.
7250 Take the rule to check as argument, hence rename as...
7251 (grammar_rule_check): this.
7252 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7253 Rename as...
7254 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7255 (grammar_midrule_action, grammar_symbol_append): Now static.
7256 * tests/torture.at (input): Don't rely on the default action
7257 being always performed.
7258 * tests/calc.at: "Set" $$ even when the action is "cut" with
7259 YYERROR or other.
7260 * tests/actions.at (Exotic Dollars): Instead of using unused
7261 values, check that the warning is issued.
7262
721be13c
PE
72632005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7264
7265 * NEWS: Improve wording for unused-value warnings.
7266
a0af42fc
AD
72672005-12-22 Akim Demaille <akim@epita.fr>
7268
7269 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7270 (b4_yysymprint_generate): Rename as...
7271 (b4_yy_symbol_print_generate): this.
7272 Generate yy_symbol_print instead of yysymprint.
7273 Generate also yy_symbol_value_print, and use it.
7274
affac613
AD
72752005-12-22 Akim Demaille <akim@epita.fr>
7276
721be13c 7277 * NEWS: Warn about unused values.
affac613
AD
7278 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7279 a `used' member.
7280 (symbol_list_n_get, symbol_list_n_used_set): New.
7281 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7282 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7283 * src/reader.c (grammar_current_rule_check): Check that values are
7284 used.
7285 * src/symtab.c (symbol_print): Accept 0.
7286 * tests/existing.at: Remove the type information.
7287 Empty the actions.
7288 Remove useless actions (beware of mid-rule actions: perl -000
7289 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7290 * tests/actions.at (Exotic Dollars): Use unused values.
7291 * tests/calc.at: Likewise.
7292 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7293 Likewise.
7294
7295 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7296 rule_useful_p.
7297
9d9b8b70
PE
72982005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7299
8bb4c753
PE
7300 Undo 2005-12-01 tentative license wording change. The wording is
7301 still being reviewed by the lawyers, and we don't want to wait for
7302 them before publishing a test release. For now, revert to the
7303 previous wording.
7304 * NEWS: Undo 2005-12-01 change.
7305 * data/glr.c: Revert to previous license wording.
7306 * data/glr.cc: Likewise.
7307 * data/lalr1.cc: Likewise.
7308 * data/location.cc: Likewise.
7309 * data/yacc.c: Likewise.
7310
9d9b8b70
PE
7311 * NEWS: Reword %destructor vs YYABORT etc.
7312 * data/glr.c: Use American spacing, for consistency.
7313 * data/glr.cc: Likewise.
7314 * data/lalr1.cc: Likewise.
7315 * data/yacc.c: Likewise.
7316 * data/yacc.c: Reformat comments slightly.
7317 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7318 for consistency. Fix some spelling errors and reword recently-included
7319 text slightly.
7320 * tests/cxx-type.at: Cast results of malloc, for C++.
7321
2c3b392a
AD
73222005-12-21 Joel E. Denny <address@hidden>
7323
7324 * tests/cxx-type.at: Construct a tree, count the parents of shared
7325 nodes, and free each node once and only once. Previously, the memory
7326 for semantic values was leaked instead.
7327
d6cff4dc
AD
73282005-12-21 Joel E. Denny <address@hidden>
7329
7330 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7331 (yylval, yylloc): If pure, #define to yystackp->yyval and
7332 yystackp->yyloc similar to yychar and yynerrs.
7333 (yyparse): If pure, remove local yylval and yylloc. Add local
7334 yystackp to accommodate pure definitions of yylval and yylloc.
7335 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7336 yylvalp and yyllocp to &yylval and &yylloc.
7337 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7338 namespace. Previously, nerrs and char were missing, but lval and lloc
7339 weren't necessary.
7340 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7341 yylvalp and yyllocp parameters since, if pure, these are now always
7342 accessible through yystackp. If not pure, they are still accessible
7343 globally.
7344 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7345 `if (YYID (N))' to pacify lint.
7346
a85284cf
AD
73472005-12-21 Akim Demaille <akim@epita.fr>
7348
7349 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7350 destroy the RHS symbols of a rule.
7351 * data/yacc.c (yylen): Initialize to 0.
7352 Keep its value to the number of items to possibly shift.
7353 In particular, a regular successful parse that ends on YYFINAL by
7354 a (internal) YYACCEPT must not have yylen != 0.
7355 (yyerrorlab, yyreturn): Pop the RHS.
7356 Reorder a bit to emphasize the `shifting' bits of code.
7357 (YYPOPSTACK): Now accept a number of items to pop.
7358 * data/lalr1.cc: Likewise.
7359 * data/glr.c: Formatting changes.
7360 Use goto instead of fall through.
7361 * doc/bison.texinfo (Destructor Decl): Complete.
7362
d508c281
JMG
73632005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7364
7365 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7366 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7367 * djgpp/config.bat: Replace every occurence of the file name
7368 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7369 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7370 * djgpp/config.sed: Replace every occurence of the file name
7371 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7372 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7373 * djgpp/djunpack.bat: DJGPP specific file.
7374 * djgpp/fnchange.lst: DJGPP specific file.
7375 * djgpp/README.in: Add new information about how to unpack the bison
7376 source on MSDOS and other systems which have 8.3 file name restrictions
7377 using djunpack.bat and fnchange.lst.
7378
3e7a2cd9
PE
73792005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7380
7381 * bootstrap (build_cvs_prefix): Remove; unused.
7382 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7383 when getting gnulib.
7384
73852005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7386
7387 * data/glr.c: Reorder typedef declarations for structs to match order
7388 of struct declarations.
7389 Rename yystack everywhere to yystackp except in yyparse where it's not
7390 a pointer.
7391 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7392 consistency.
7393 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7394 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7395 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7396 lint.
7397
877519f8
PE
73982005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7399
0eca5a39
PE
7400 * tests/sets.at (Accept): Fix typos in regular expression used to
7401 sed out the final state number.
7402
2cec9080
PE
7403 Work around portability problem on Solaris 10: flex-generated
7404 files include <stdio.h> before <config.h>, which messes up
7405 because the latter defines __EXTENSIONS__. Address the problem
7406 by creating two new little files that include <config.h> first,
7407 then include the flex-generated files. Rewrite everyone else
7408 to include <config.h> first, as well.
7409 * lib/timevar.c: Always include "config.h".
7410 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7411 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7412 (EXTRA_bison_SOURCES): New macro.
7413 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7414 * src/system.h: Don't include config.h.
7415 * src/LR0.c: Include <config.h> first.
7416 * src/assoc.c: Likewise.
7417 * src/closure.c: Likewise.
7418 * src/complain.c: Likewise.
7419 * src/conflicts.c: Likewise.
7420 * src/derives.c: Likewise.
7421 * src/files.c: Likewise.
7422 * src/getargs.c: Likewise.
7423 * src/gram.c: Likewise.
7424 * src/lalr.c: Likewise.
7425 * src/location.c: Likewise.
7426 * src/main.c: Likewise.
7427 * src/muscle_tab.c: Likewise.
7428 * src/nullable.c: Likewise.
7429 * src/output.c: Likewise.
7430 * src/parse-gram.y: Likewise.
7431 * src/print.c: Likewise.
7432 * src/print_graph.c: Likewise.
7433 * src/reader.c: Likewise.
7434 * src/reduce.c: Likewise.
7435 * src/relation.c: Likewise.
7436 * src/state.c: Likewise.
7437 * src/symlist.c: Likewise.
7438 * src/symtab.c: Likewise.
7439 * src/tables.c: Likewise.
7440 * src/uniqstr.c: Likewise.
7441 * src/vcg.c: Likewise.
7442
877519f8
PE
7443 * src/parse-gram.y: Fix minor problems uncovered by lint.
7444 (current_lhs, current_lhs_location): Now static.
7445 (current_assoc): Remove unused variable.
7446
7447 Cleanups so that Bison-generated parsers have less lint.
7448 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7449 Prepend /*ARGSUSED*/, for lint's sake.
7450 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7451 definition if 'lint' is defined.
7452 (YYID): New macro (or function, if lint).
7453 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7454 * data/yacc.c: Likewise.
7455 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7456 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7457 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7458 is C++ only.
7459 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7460 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7461 Use YYID(0) rather than 0, for lint.
7462 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7463 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7464
f5228370
PE
74652005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7466
7467 * tests/glr-regression.at
7468 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7469 Close memory leak reported by twlevo.
7470
69ce078b
PE
74712005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7472
6ff99711
PE
7473 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7474 all stacks.
7475 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
7476 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7477 New test case.
7478 (Duplicated user destructor for lookahead): This test now is expected
7479 to succeed.
7480
af3412cd
PE
74812005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7482
32b5b719 7483 * NEWS: Document the following change.
af3412cd
PE
7484 * data/yacc.c: Say "parser skeleton" rather than "file", since
7485 it's no longer just a file.
7486 * data/glr.c: Grant a special exception for C GLR parsers, that
7487 reads like the already-existing exception for C LALR(1) parsers.
7488 * data/glr.cc: Likewise.
7489 * data/lalr1.cc: Likewise.
7490 * data/location.cc: Likewise.
7491 * data/yacc.c: Reword the "written by" statement to clarify that
7492 it was the parser skeleton, not the entire output file.
7493 * data/glr.c: Written by Paul Hilfinger.
7494 * data/glr.cc: Written by Akim Demaille.
7495 * data/lalr1.cc: Likewise.
7496
035aa4a0
PE
74972005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7498
d9963c85
PE
7499 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7500 Fix typos in previous change that broke 'make check'.
7501 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7502 supported in C.
7503 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7504 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7505 We can revert this once things settle down.
7506
035aa4a0
PE
7507 * src/conflicts.c (conflicts_print): Don't print file name twice
7508 when %expect fails because there were no conflicts.
7509 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7510 change.
7511 * tests/conflicts.at (%expect not enough, %expect too much):
7512 (%expect with reduce conflicts): Adjust to new behavior.
7513
75142005-11-18 Akim Demaille <akim@epita.fr>
7515
7516 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7517 errors.
7518 * NEWS: Document this.
7519 * doc/bison.texinfo (Expect Decl): Likewise.
7520
d1ff7a7c
AD
75212005-11-16 Akim Demaille <akim@epita.fr>
7522
7523 Generalize the display of semantic values and locations in traces.
7524 * data/glr.c (yy_reduce_print): Fix indices (again).
7525 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7526 literal integers.
7527 * data/lalr1.cc (yyreduce_print): Rename as...
7528 (yy_reduce_print): this.
7529 Display values and locations.
7530 * data/yacc.c (yy_reduce_print): Likewise.
7531 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7532 (yysymprint): Move higher to be visible from yy_reduce_print).
7533 (yyparse): Adjust.
7534 * tests/calc.at: Adjust the expected length of the traces.
7535
6de5398d
AD
75362005-11-14 Akim Demaille <akim@epita.fr>
7537
7538 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7539 from 1 to N, while values and location start at 0.
7540 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7541
a1373f55
AD
75422005-11-14 Akim Demaille <akim@epita.fr>
7543
7544 * data/glr.c (yy_reduce_print): Fix the $ number.
7545
613d8952
AD
75462005-11-14 Akim Demaille <akim@epita.fr>
7547
7548 "Use" parse parameters.
7549 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7550 * data/glr.c, data/glr.cc: Use them.
7551 * data/glr.c (YYUSE): Have a C++ definition that supports
7552 non-pointer types.
7553
b2741627
AD
75542005-11-14 Akim Demaille <akim@epita.fr>
7555
7556 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7557
5059b5c8
AD
75582005-11-14 Akim Demaille <akim@epita.fr>
7559
42249483
AD
7560 * data/glr.cc: New.
7561 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 7562
4626a15d
AD
75632005-11-12 Akim Demaille <akim@epita.fr>
7564
7565 Let position and location be PODs.
7566 * data/location.cc (position::initialize, location::initialize): New.
7567 (position::position, location::location): Define only if
7568 b4_location_constructors is defined.
7569 * data/lalr1.cc (b4_location_constructors): Define it for backward
7570 compatibility.
7571 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7572
75732005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
7574
7575 * data/lalr1.cc: Move the body of the ctor and dtor into the
7576 parser file (instead of the header).
7577 Wrap the implementations in a "namespace yy".
7578
75792005-11-12 Akim Demaille <akim@epita.fr>
7580
7581 Have glr.c include its header file when created.
7582 * data/glr.c (b4_shared_declarations): New.
7583 Output them verbatim in the parser if !%defines, otherwise
7584 output then in the header file, and include it instead.
7585
1989d947
AD
75862005-11-11 Akim Demaille <akim@epita.fr>
7587
7588 * data/glr.c: Comment changes.
7589
75902005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
7591
7592 When yydebug, report semantic and location values for reductions.
7593 * data/glr.c (yy_reduce_print): Report the semantic values and the
7594 locations.
7595 (YY_REDUCE_PRINT): Adjust.
7596 (yyglrReduce): Use them.
7597 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7598 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7599 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7600 traces.
7601
02998094
AD
76022005-11-10 Akim Demaille <akim@epita.fr>
7603
7604 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7605 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7606 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7607
5210672f
PE
76082005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7609
7610 * m4/cxx.m4, examples/Makefile.am: Don't build
7611 examples/calc++ if no C++ compiler is available. (trivial change)
7612
a8991a1d
AD
76132005-11-09 Akim Demaille <akim@epita.fr>
7614
7615 * src/scan-skel.l: Use a couple of asserts.
7616
36b5e963
AD
76172005-11-03 Akim Demaille <akim@epita.fr>
7618
7619 In some (weird) cases, the final state number is incorrect.
7620 Reported by Alexandre Duret-Lutz.
7621 * src/LR0.c (state_list_append): Remove the computation of
7622 final_state.
7623 (save_reductions): Do it here.
7624 (get_state): Alpha conversion.
7625 (generate_states): Use a for loop.
7626 * src/gram.h (item_number_is_rule_number)
7627 (item_number_is_symbol_number): New.
7628 * src/state.c: Use assert.
7629 * src/system.h: Include assert.h.
7630 * tests/sets.at (Accept): New.
7631
44e7ead1
PH
76322005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7633
7634 * data/glr.c (yyfill): Adjust comment.
36b5e963 7635 (yyresolveAction): Initialize default location properly
44e7ead1
PH
7636 for empty right-hand sides.
7637 (yydoAction): Ditto.
7638 Add comment explaining apparently dead code.
36b5e963
AD
7639 * tests/glr-regression.at
7640 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 7641 New test.
36b5e963 7642
e10a80ee
PE
76432005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7644
7645 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7646 gnulib when interrupted. This fixes some race conditions and
7647 works around some portability problems (one noted by Paul
7648 Hilfinger).
7649
067b32ee
AD
76502005-10-22 Akim <akim@epita.fr>
7651
7652 * Makefile.cfg: Adjust to config -> build-aux.
7653 Reported by twledo.
7654
4b367315
AD
76552005-10-21 Akim Demaille <akim@epita.fr>
7656
7657 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7658 the %parse-params.
7659 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7660 * data/yacc.c (b4_Pure_if): Rename as...
7661 (b4_yacc_pure_if): this.
7662 (YY_SYMBOL_PRINT, yyparse): Adjust.
7663 * doc/bison.texinfo: Formatting changes.
7664
24cc23d9
AD
76652005-10-21 Akim Demaille <akim@epita.fr>
7666
7667 Finish the transition config -> build-aux.
7668 * configure.ac, Makefile.am: Use build-aux.
7669 * config/prev-version, config/announce-gen, config/Makefile.am:
7670 Move to...
7671 * build-aux/prev-version, build-aux/announce-gen,
7672 * build-aux/Makefile.am: here.
7673
d4476375
AD
76742005-10-14 Akim Demaille <akim@epita.fr>
7675
7676 * examples/calc++/test: Use set -x only when VERBOSE.
7677
302c0aee
PE
76782005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7679
7680 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7681 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7682
7625ec2c
AD
76832005-10-13 Akim Demaille <akim@epita.fr>
7684
7685 * src/scan-skel.l: Output the base name parts of the parser and
7686 header file names.
302c0aee 7687 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
7688 additional checks.
7689 Use this to exercise C++ outputs in subdirs.
7690 Reported by Oleg Smolsky.
7691
ba0fe3c7
PE
76922005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7693
7694 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7695 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7696 Problem reported by John P. Hartmann.
7697 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7698 already defined it.
7699
9b8a5ce0
AD
77002005-10-12 Akim Demaille <akim@epita.fr>
7701
7702 * src/parse-gram.y (version_check): Exit 63 to please missing
7703 (stands for "version mismatch).
7704 * tests/input.at, doc/bison.texinfo: Adjust.
7705
4f6e011e
PE
77062005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7707
7708 Work around portability problems with Visual Age C compiler
7709 (xlc and xlC_r) reported by John P. Hartmann.
7710 * data/location.cc (initial_column, initial_line): Remove.
7711 All uses replaced by 0 and 1.
7712 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7713 that xlc complains about.
7714 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 7715 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 7716 as __STDC__.
4d7aa45e
PE
7717 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7718 __STDC_VERSION__. Use it everywhere instead of looking at
7719 __STDC__ and __cplusplus.
4f6e011e 7720
a1b3bf8c
AD
77212005-10-10 Akim Demaille <akim@epita.fr>
7722
7723 * examples/calc++/test: Be quiet unless VERBOSE.
7724
412e44aa
PE
77252005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7726
2a4647a3
PE
7727 * data/c.m4 (yydestruct, yysymprint):
7728 Use YYUSE instead of casting to void.
7729 * data/glr.c (YYUSE): New macro.
7730 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7731 Use it instead of rolling our own.
7732 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7733 (YYCHK1):
7734 Use /*CONSTCOND*/ to suppress lint warnings.
7735 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7736 (YY_STACK_PRINT): Use 'false' not '0'.
7737 (YYUSE): New macro.
7738 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7739 * data/yacc.c (YYUSE): New macro.
7740 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7741 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7742 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7743
7744
412e44aa
PE
7745 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7746 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7747
88c6637f
PE
77482005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7749
2f4f028d
PE
7750 Undo the parts of the unlocked-I/O change that substituted
7751 putc or puts for printf. This might hurt performance a bit,
7752 but some people prefer the printf style.
7753 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7754 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7755 All uses replaced by YYFPRINTF and YYDPRINTF.
7756 * data/yacc.c: Likewise.
7757 * lib/bitset.c (bitset_print): Likewise.
7758 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7759 putc and puts.
7760 * lib/lbitset.c (debug_lbitset): Likewise.
7761 * src/closure.c (print_firsts, print_fderives): Likewise.
7762 * src/gram.c (grammar_dump): Likewise.
7763 * src/lalr.c (look_ahead_tokens_print): Likewise.
7764 * src/output.c (escaped_output): Likewise.
7765 (user_actions_output): Break apart two printfs.
7766 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7767 * src/reduce.c (reduce_print): Likewise.
7768 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7769 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7770
88c6637f
PE
7771 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7772 Use assignments rather than casts-to-void to suppress
7773 unused-variable warnings. This pacifies 'lint'.
7774 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7775 unused-variable warnings.
7776
fb32e373
JMG
77772005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7778
7779 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7780
edb8f44f
PE
77812005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7782
fb9c0b33
PE
7783 Use unlocked I/O for a minor performance improvement on hosts like
7784 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7785 is to use the gnlib unlocked-io module, and to prefer putc and
7786 puts to printf when either will work (since the latter doesn't
7787 come in an unlocked flavor).
7788 * bootstrap (gnulib_modules): Add unlocked-io.
7789 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7790 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7791 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7792 and similarly for puts and putc and printf.
7793 * data/yacc.c: Likewise.
7794 * lib/bitset.c (bitset_print): Likewise.
7795 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7796 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7797 to printf.
7798 * lib/lbitset.c (debug_lbitset): Likewise.
7799 * src/closure.c (print_firsts, print_fderives): Likewise.
7800 * src/gram.c (grammar_dump): Likewise.
7801 * src/lalr.c (look_ahead_tokens_print): Likewise.
7802 * src/output.c (escaped_output): Likewise.
7803 (user_actions_output): Coalesce two printfs.
2f4f028d 7804 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
7805 * src/reduce.c (reduce_print): Likewise.
7806 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 7807 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 7808
edb8f44f
PE
7809 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7810 this confuses xgettext.
7811
b50d2359
AD
78122005-10-02 Akim Demaille <akim@epita.fr>
7813
7814 * bootstrap (gnulib_modules): Add strverscmp.
7815 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7816 * m4/.cvsignore: Add strverscmp.m4.
7817 * src/parse-gram.y (%require): New token, new rule.
7818 (version_check): New.
7819 * src/scan-gram.l (%require): Adjust.
7820 * tests/input.at (AT_REQUIRE): New.
7821 Use it.
7822 * doc/bison.texinfo (Require Decl): New.
7823 (Calc++ Parser): Use %require.
7824
21667f64
AD
78252005-10-02 Akim Demaille <akim@epita.fr>
7826
7827 * data/location.cc: New.
7828
2b81e969
AD
78292005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7830 Akim Demaille <akim@epita.fr>
7831
7832 Make sure -odir/foo.cc creates dir/location.hh etc.
7833 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7834 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7835 (spec_defines_file): Now const.
7836 (dir_prefix): New.
7837 (short_base_name): Remove.
7838 * src/files.c: Adjust.
7839 (dirname.h): Include.
7840 (base_name): Don't prototype it.
7841 (finput): Remove, duplicates gram_in.
7842 (full_base_name, short_base_name): Replace by...
7843 (all_but_ext, all_but_tab_ext): these.
7844 (compute_base_names): Rename as...
7845 (compute_file_name_parts): this.
7846 Update to compute the new variables, including dir_prefix.
7847 Adjust dependencies.
7848 * src/output.c (prepare): Output them.
7849 * src/reader.c: Adjust to use gram_in, not finput.
7850 * src/scan-skel.l (@dir_prefix@): New.
7851
ad6a9b97
JMG
78522005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7853
7854 * lib/subpipe.c: New function end_of_output_subpipe() added
7855 to allow support for non-posix systems. This is a no-op function
7856 for posix systems.
7857
7858 * lib/subpipe.h: New function end_of_output_subpipe() added
7859 to allow support for non-posix systems. This is a no-op function
7860 for posix systems.
7861
7862 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7863 handle the lack of pipe/fork functionality on non-posix systems.
7864
7865 * djgpp/Makefile.maint: DJGPP specific file.
7866
7867 * djgpp/README.in: DJGPP specific file.
7868
7869 * djgpp/config.bat: DJGPP specific configuration file.
7870
7871 * djgpp/config.sed: DJGPP specific configuration file.
7872
7873 * djgpp/config.site: DJGPP specific configuration file.
7874
7875 * djgpp/config_h.sed: DJGPP specific configuration file.
7876
7877 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7878
7879 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7880
fc695704
AD
78812005-10-02 Akim Demaille <akim@epita.fr>
7882
7883 * data/location.cc: New, extract from...
7884 * data/lalr1.cc: here.
7885 (location.hh): Include it after the user prologue, in case the
7886 filename type is defined by the user.
7887 Forward declation location and position before the pre-prologue.
7888 (yyresult_): Rename as...
7889 (yyresult): this, it's a local variable, not an attribute.
7890 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7891
78922005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
7893
7894 * examples/extexi: Restore the #line generation.
7895
fb9712a9
AD
78962005-09-30 Akim Demaille <akim@epita.fr>,
7897 Alexandre Duret-Lutz <adl@gnu.org>
7898
7899 Move the token type and YYSTYPE in the parser class.
7900 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7901 (parser::token): New, from the moved free definition of tokens.
7902 (parser::semantic_value): Now a full definition instead of an
7903 indirection to YYSTYPE.
7904 (b4_post_prologue): No longer included in the header file, but
7905 in the implementation file.
7906 * doc/bison.texi (C+ Language Interface): Update.
7907 * src/parse-gram.y: Support unary %define.
7908 * tests/actions.at: Define global_tokens_and_yystype for backward
7909 compatibility until we update the tests.
7910 * tests/calc.at: Idem.
7911 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7912 to simplify the code.
7913
55f0c7b1
PE
79142005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7915
7916 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7917 Ah, the good old days! Problem reported by Peter Klein.
7918 * bootstrap (gnulib_modules): Add strerror, strtoul.
7919 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7920 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7921
fb9712a9 79222005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
7923
7924 * data/c.m4 (b4_error_verbose_if): New.
7925 * data/lalr1.cc: Use it.
7926 (YYERROR_VERBOSE_IF): Remove.
7927 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7928 parser members, replaced by...
7929 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7930 local variables.
7931 (yysyntax_error_): Takes the state number as argument.
7932 (yyreduce_print_): Use the argument yyrule, not the former
7933 attribute yyn_.
7934
8a6f72f3
PE
79352005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7936
7937 * bootstrap (gnulib_modules): Add verify.
7938 * lib/.cvsignore: Add verify.h.
7939 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7940 * src/system.h (verify): Remove.
7941 Include verify.h instead.
7942 * src/tables.c (tables_generate): Use new API for 'verify'.
7943
0d50976f
PE
79442005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7945
ebc3737e
PE
7946 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7947 local variables whose names begin with 'yy'.
7948 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7949 Trivial changes from Joel E. Denny.
7950
0d50976f
PE
7951 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7952 it itself.
7953 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7954 don't use alloca any more.
7955
7956 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7957 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 7958 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
7959 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7960 to match yacc.c, to test more hosts.
7961
a05b79df
PE
79622005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7963
55289366
PE
7964 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7965 doesn't affect behavior.
7966 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7967 Solaris, AIX, MSC.
7968 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7969 This works a bit better with glibc, if user code has already included
7970 stdlib.h.
7971 * doc/bison.texinfo (Bison Parser): Document that users can't
7972 arbitrarily use malloc and free for other purposes. Document
7973 that <alloca.h> and <malloc.h> might be included.
7974 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7975 user must declare alloca.
7976
a05b79df
PE
7977 * HACKING (release): Forwarn the Translation Project about
7978 stable releses.
7979
3ab2ca22
AD
79802005-09-20 Akim Demaille <akim@epita.fr>
7981
7982 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7983
a9739e7c
PE
79842005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7985
a702593e
PE
7986 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
7987 (YYSTACK_ALLOC_MAXIMUM): Use it.
7988 (yysyntax_error): New function.
7989 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
7990 multiple syntax errors are reported, and alloca is being used.
7991 Instead, reallocate buffers twice as big each time, so that
7992 we waste at most half the allocated memory. Start with a small
7993 (128-byte) buffer that will suffice in most cases anyway.
7994 Use yysyntax_error to do most of the work.
7995
7996 * doc/bison.texinfo (Error Reporting, Table of Symbols):
7997 yynerrs is the number of errors reported, not the number of
7998 errors encountered.
7999
a9739e7c
PE
8000 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8001 Mark it as expected to fail.
8002 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8003 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8004 Don't start user-code symbols with "yy", to avoid name space problems.
8005
f479c6c6
AD
80062005-09-19 Akim Demaille <akim@epita.fr>
8007
8008 Remove the traits, failed experiment.
8009 It never proved useful, and anyway because of the current
8010 definition, it was not possible to have several specialization of
8011 this traits, making it useless.
8012 * data/lalr1.cc (yy:traits): Remove.
8013 Inline its definitions in the parser class.
8014
e2586f82
AD
80152005-09-19 Akim Demaille <akim@epita.fr>
8016
8017 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8018 least Mac OSX with a /usr/local install of gettext.
8019
2e8cf949
AD
80202005-09-19 Akim Demaille <akim@epita.fr>
8021
8022 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8023 and yytoken for similarity with the other skeletons.
8024
c7fb0b90
AD
80252005-09-19 Akim Demaille <akim@epita.fr>
8026
4e26c69e 8027 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 8028
1bd0deda
PE
80292005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8030
8031 * NEWS: Version 2.1.
8032
8033 * NEWS: Remove notice of yytname change, since it was never in an
8034 official release.
8035 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8036 diagnostic.
8037 * src/output.c (prepare): Likewise.
8038 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8039 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8040 is not defined. This is an awful hack, but it's enough for now.
8041 All callers changed.
8042 * tests/glr-regression-at (make_value): Args are const pointers now,
8043 to avoid GCC warning.
8044 (Duplicated user destructor for lookahead): New test. Currently
8045 skipped. It fails on my host but I'm not sure it'll always fail.
8046
80472005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
8048
8049 * src/symtab.h (struct symbol): Declare the printer and destructor
8050 as const, to avoid accidental calls to free.
8051 (symbol_destructor_set, symbol_printer_set): Adjust.
8052 * src/symtab.c: Adjust.
8053
1bd0deda 80542005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
8055
8056 * data/c.m4 (b4_token_enums): New.
8057 (b4_token_defines): Rename as...
8058 (b4_token_enums_defines): this.
8059 (b4_token_defines): New, output only the #defines.
8060 * data/yacc.c, data/glr.c: Adjust.
8061 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8062 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8063 as default values.
8064
dbcdae2d
AD
80652005-09-16 Akim Demaille <akim@epita.fr>
8066
8067 * data/lalr1.cc (yylex_): Remove, inline its code.
8068 (yyreport_syntax_error_): Remove, replaced by...
8069 (yysyntax_error_): this which returns a string and leaves to the
8070 caller the call to the users' error function.
8071 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8072 Move from members of the parser object...
8073 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8074 to local variables of the parse function.
8075
70d8f291
AD
80762005-09-16 Akim Demaille <akim@epita.fr>
8077
8078 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8079 since it's in Bison's name space.
8080
b47dbebe
PE
80812005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8082
ae199bf1
PE
8083 * data/glr.c (yyresolveValue): Add default case to pacify
8084 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8085
b47dbebe
PE
8086 * NEWS: Document when yyparse started to return 2.
8087 * doc/bison.texinfo (Parser Function): Document when yyparse
8088 returns 2.
8089
8090 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8091 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8092 changed.
8093 (class position): file_name -> filename (reverting). All uses changed.
8094
80952005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8096
8097 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8098 do anything if $@ exists. This reverts part of the 2005-07-07
8099 patch.
8100
00292f66
PE
81012005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8102
8103 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8104 contains obsolete information and isn't worth distributing as a
8105 separate file anyway.
8106 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8107 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8108 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8109 (yyparse): Abort if user code uses longjmp to throw an unexpected
8110 value.
8111
a420f962
PE
81122005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8113
00292f66
PE
8114 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8115 Suggested by twlevo@xs4all.nl.
8116
127287e9
PE
8117 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8118 This avoids a diagnostic from gcc -Wswitch-enum.
8119 Problem reported by twlevo@xs4all.nl.
8120
a420f962
PE
8121 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8122 standards. Use "file name" or "file" or "name", depending on
8123 the context.
8124 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8125 not to hack/foo.tab.c.
8126 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
8127 * data/glr.c: b4_filename -> b4_file_name.
8128 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8129 All uses changed.
8130 (class position): filename -> file_name. All uses changed.
8131 * data/yacc.c: b4_filename -> b4_file_name.
8132 * lib/bitset.h: filename -> file_name in local vars.
8133 * lib/bitset_stats.c: Likewise.
8134 * src/files.c: Likewise.
8135 * src/scan-skel.l ("@output ".*\n): Likewise.
8136 * src/files.c (file_name_split): Renamed from filename_split.
8137 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
8138
81392005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8140
8141 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8142 to accommodate latest gnulib.
8143
8144 * tests/glr-regression.at (Duplicate representation of merged trees):
8145 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8146
8147 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8148 needed.
8149
42a6501d
PE
81502005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8151
8152 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8153 All uses changed. Invoke user destructor after an error during a
8154 split parse (trivial change from Joel E. Denny).
8155
8156 * tests/glr-regression.at
8157 (User destructor after an error during a split parse): New test case.
8158 Problem reported by Joel E. Denny in:
8159 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8160
ef9a1faf
PE
81612005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8162
5b4aaf78
PE
8163 * README-cvs: Give URLs for recommended tools.
8164 Mention Gzip version problem, and bootstrapping issues.
8165 Remove troubleshooting section, as it's somewhat obsolete.
8166
b5240ba5
PE
8167 * bootstrap (no_cache): New var, to accommodate different wget
8168 variants. Use it instead of '-C off'. Problem reported by
8169 twlevo@xs4all.nl.
8170
ef9a1faf
PE
8171 * data/glr.c (yydestroyStackItem): New function.
8172 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8173 debugging information. Problem reported by Joel E. Denny.
8174
e6efa9da
AD
81752005-08-25 Akim Demaille <akim@epita.fr>
8176
8177 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8178
adc90f13
PE
81792005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8180
8181 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8182 Don't invoke destructor on unresolved entries.
8183 * tests/glr-regression.at
8184 (User destructor for unresolved GLR semantic value): New test case.
8185 Problem reported by Joel E. Denny in:
8186 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8187
f9315de5
PE
81882005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8189
15d29c1f
PE
8190 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8191 Add strnlen.c.
8192 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8193 lib-prefix.m4, po.m4.
8194
dd5f2af2
PE
8195 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8196 in yydestruct diagnostic, since it might not be an error.
8197 Problem reported by Joel Denny near end of
8198 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 8199 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
8200 * data/yacc.c (yyreturn): Likewise.
8201 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8202
8203 * src/files.c: Remove obsolete FIXME comment.
8204
8205 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8206 with the other templates, and to fix bogus run-on messages such
8207 as the one reported at the end of
8208 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8209 All callers changed to avoid the newline.
8210 (yyprocessOneStack): Output two lines rather than one, to accommodate
8211 the above change. This changes the debug output format slightly.
8212
f9315de5
PE
8213 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8214 reported by Joel E. Denny in
8215 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8216 (trivial change).
8217 * tests/glr-regression.at (Duplicate representation of merged trees):
8218 New test, from Joel E. Denny in:
8219 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8220 * THANKS: Add Joel E. Denny.
8221
8222 * configure.ac (AC_INIT): Bump to 2.0c.
8223
04098407
PE
82242005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8225
8226 * NEWS: Version 2.0b.
8227
ca5d2013
PE
8228 * Makefile.am (SUBDIRS): Put examples before tests, so that
8229 "make check" doesn't finish with "All 1 tests passed".
8230
3d54b576
PE
8231 * tests/regression.at (Token definitions): Don't rely on
8232 AT_PARSER_CHECK for data that contains backslashes. It currently
8233 uses 'echo', and 'echo' isn't portable if its argument contains
8234 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8235 that the byte '\0xff' is not printable in the C locale; it is,
8236 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8237 not printable, so use '\0x81' to test.
8238
d53ae497
PE
8239 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8240 version of GCC, since the macro is used with non-GCC compilers.
8241
fc01665e
PE
8242 Fix core dump reported by Pablo De Napoli in
8243 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8244 * tests/regression.at (Invalid inputs with {}): New test.
8245 * src/parse-gram.y (token_name): Translate type before using
8246 it as an index.
8247
04098407
PE
8248 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8249 the user's name space. All uses changed to __attribute__
8250 ((__unused__)).
8251 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8252 Add __attribute__ ((__noreturn__)).
8253
8254 * etc/clcommit: Remove. We weren't using it, and it failed
8255 "make maintainer-distcheck".
8256 * Makefile.maint: Merge from coreutils.
8257 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8258 (syntax-check-rules): Change list of rules as described below.
8259 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8260 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8261 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8262 (sc_trailing_space): New rules.
8263 (sc_xalloc_h_in_src): Remove.
8264 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8265 (sc_space_tab, sc_error_exit_success, sc_changelog):
8266 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8267 (makefile-check, po-check, author_mark_check):
8268 (makefile_path_separator_check, copyright-check):
8269 Use grep -n, to make it easier to find violations.
8270 Use CVS_LIST and CVS_LIST_EXCEPT.
8271 (header_regexp, h_re): Remove.
8272 (dd_c): New macro.
8273 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8274 (my-distcheck): Use more-modern GCC flags.
8275 (signatures, %.asc): Remove.
8276 (rel-files, announcement): Remove signatures.
8277 Restore old updating code, even though we don't use it, so
8278 that we're the same as coreutils.
8279 (alpha, beta, major): Depend on news-date-check.
8280 Make the upload commands.
8281
8282 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8283 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8284 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8285 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8286 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8287 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8288 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8289 * tests/sets.at: Likewise.
8290
8291 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8292 we comment out the Autoconf version number.
8293 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8294 it's error-prone and "make maintainer-distcheck" rejects it.
8295
8296 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8297 Indent calls to "error" to pacify "make maintainer-distcheck",
8298 when the calls are not intended to be translated.
8299 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8300
8301 * src/Makefile.am (DEFS): Use +=, to pacify
8302 "make maintainer-distcheck".
8303 (bison_SOURCES): Add scan-skel.h.
8304 (sc_tight_scope): New rule, from coreutils.
8305
8306 * src/files.c (src_extension, header_extension):
8307 Now static, not extern.
8308 * src/getargs.c (short_options): Likewise.
8309 * src/muscle_tab.c (muscle_table): Likewise.
8310 * src/parse-gram.y (current_class, current_type, current_prec):
8311 Likewise.
8312 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8313 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8314 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8315 void, to avoid warning when NLS is disabled.
8316 * src/output.c: Include scan-skel.h.
8317 (scan_skel): Remove decl, since scan-skel.h does this.
8318 (output_skeleton):
8319 Indent calls to "error" to pacify "make maintainer-distcheck".
8320 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8321 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8322 "make maintainer-distcheck".
8323 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8324 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8325 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8326 (skel_lex_destroy, scan_skel): Move these decls to...
8327 * src/scan-skel.h: New file.
8328 * src/uniqstr.c (uniqstr_assert):
8329 Indent calls to "error" to pacify "make maintainer-distcheck".
8330
8331 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8332 not @VAR@.
8333
8334 * tests/torture.at: Revamp to avoid misuse of atoi that
8335 "make maintainer-distcheck" complained about.
8336
8337 * examples/extexi (message): Don't print a message more than once,
8338 and omit line-number decoration that makes Emacs compile think
8339 that informative messages are worth worrying about.
8340
83412005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8342
8343 * configure.ac: Update version number.
8344
8345 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8346 accidentally.
8347 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8348 autogenerated by the maintainer.
8349 * examples/calc++/.cvsignore: Add *.yy.
8350
8351 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8352 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8353 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8354
8355 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8356
8357 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8358 from maintainer-distcheck about casting the argument of 'free'.
8359
8360 * NEWS: Mention recent yytname changes.
8361 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8362
8363 * bootstrap: For translations that have not yet been upgraded to
8364 the new runtime-po domain, prime the pump by extracting the
8365 relevant strings from the obsolete translations. This code can be
8366 removed once the bison-runtime domain has been translated by each
8367 team.
8368
8369 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8370 now that token names are already quoted.
8371
8372 Fix problem reported by Anthony Heading.
8373 * data/glr.c (YYTOKEN_TABLE): New macro.
8374 (yytname): Define if YYTOKEN_TABLE.
8375 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8376 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8377 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8378 * src/output.c (prepare_symbols): Output token_table_flag.
8379
0ffda363
PE
83802005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8381
8382 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8383 again if the first call fails.
8384
8385 * data/glr.c (yytnamerr): New function.
8386 (yyreportSyntaxError): Use it to dequote most string literals.
8387 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8388 with other skeletons. All uses changed.
8389 (yytnameerr_): New function.
8390 (yyreport_syntax_error): Use it to dequote most string literals.
8391 * data/yacc.c (yytnamerr): New function.
8392 (yyerrlab): Use it to decode most string literals.
8393 * doc/bison.texinfo (Decl Summary, Calling Convention):
8394 Clarify quoting convention of yytname.
8395 * src/output.c (prepare_symbols): Quote all names. This undoes
8396 the 2005-04-17 change, which is now accomplished (mostly) via
8397 changes in the parsers as described above.
8398 * tests/regression.at (Token definitions, Web2c Actions):
8399 Undo most 2005-04-17 change here, too.
8400
84012005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8402
8403 Fix more problems reported by twlevo@xs4all.nl.
8404 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8405 remove trailing spaces. This loses the exit status of ./types,
8406 and isn't needed since ./types shouldn't be emitting trailing
8407 spaces.
8408 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8409 as the stack isn't valid in that case.
8410
8411 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8412 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8413 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8414 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8415 is used.
8416 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8417 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8418 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8419 Likewise.
8420
8421 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8422 overly-picky compilers that reject 'char *foo = "bar";'.
8423
8424 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8425 to FILE * parameter, not to stderr. This fixes a typo introduced
8426 in the 2005-07-12 change.
8427
8428 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8429 warnings from GCC 4.
8430
8431 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8432 (yyglrShiftDefer, yysplitStack):
8433 Remove unused parameters b4_pure_formals. All uses changed.
8434 (yyglrShift): Remove unused parameters b4_user_formals.
8435 All uses changed.
8436 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8437
6100a9aa
PE
84382005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8439
258b75ca
PE
8440 Destructor cleanups and regularization among the three skeletons.
8441 * NEWS: Document the behavior changes.
8442 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8443 stack before failing, as the cleanup code will do it for us now.
8444 * data/lalr1.cc (yyerrlab): Likewise.
8445 * data/glr.c (yyparse): Pop everything off the stack before
8446 freeing it, so that destructors get called properly.
8447 * data/lalr1.cc (yyreturn): Likewise.
8448 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8449 This is more consistent.
8450 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8451 why destructors might be called. 1.875 -> 2.1.
8452 (Destructor Decl, Decl Summary, Table of Symbols):
8453 Some English-language cleanups for %destructor.
8454 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8455 Add output line for destructor of start symbol.
8456 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8457 because of that same extra output line.
8458
1a059451
PE
8459 * NEWS: Document minor wording changes in diagnostics of
8460 Bison-generated parsers.
8461 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8462 Remove unused formals. All uses changed.
8463 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8464 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8465 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8466 Rename yyoverflowab to yyexhaustedlab.
8467 When memory exhaustion occurs during syntax-error reporting,
8468 report it separately rather than in a single diagnostic; this
8469 eases translation.
8470 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8471 (Memory Exhausted): Renamed from Parser Stack Overflow.
8472 Revamp wording slightly to prefer "memory exhaustion".
8473 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8474
97460c78
PE
8475 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8476
30757c8c
PE
8477 Add i18n support to the GLR skeleton. Partially fix the C++
8478 skeleton; a C++ expert needs to finish this. Remove debugging
8479 msgids; there's little point to having them translated, since they
8480 can be understood only by someone who can read the
8481 (English-language) source code.
8482
8483 Generate runtime-po/bison-runtime.pot automatically, so that we
8484 don't have to worry about garbage getting in that file. We'll
8485 make sure after the next official release that old msgids don't
8486 get lost. See
8487 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8488
8489 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8490 Now auto-generated.
8491 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8492 Fix typos in explanations of the runtime file.
8493 * bootstrap: Change gettext keyword from YYI18N to YY_.
8494 Use standard Makefile.in.in in runtime-po, since we'll arrange
8495 for backward-compatible bison-runtime.po files in a different way.
8496 * data/glr.c (YY_): New macro, from yacc.c.
8497 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8498 Translate messages intended for users.
8499 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8500 the wording in the other skeletons. We don't know that the memory
8501 is virtual.
8502 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8503 Use same method that yacc.c uses.
8504 Don't translate debugging messages.
8505 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8506 it doesn't work (yet), and requires C++ expertise to fix.
8507 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8508 Move defn to a more logical place, to be consistent with other
8509 skeletons.
8510 Don't translate debugging messages.
8511 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8512 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8513 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8514 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8515
ac8c5689
PE
8516 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8517 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8518 void, not int.
8519 * tests/glr-regression.at (Badly Collapsed GLR States):
8520 Likewise.
8521 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8522 yylex should return 0 at EOF rather than aborting.
8523
6100a9aa
PE
8524 Improve tests for stack overflow in GLR parser.
8525 Problem reported by twlevo@xs4all.nl.
8526 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8527 All uses removed.
8528 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8529 can handle the problem.
8530 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8531 (yyparse): New local variable yyresult to record the result.
8532 Use result of setjmp to set it, rather than storing itinto
8533 struct.
8534 (yyDone): Remove label.
8535 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8536 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8537 if YYABORT is used).
8538 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8539 yyparse status; put status > 1 into diagnostic.
8540 Check that status==2 works.
8541 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8542 Use exit status 3 for failure to open (which shouldn't happen).
8543
15f40952
PE
85442005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8545
67fd79c4
PE
8546 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8547 1 on syntax error; just let yyparse do its thing.
8548 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8549 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8550 (Exploding the Stack Size with Alloca):
8551 (Exploding the Stack Size with Malloc):
8552 Expect exit status 2, not 1, since the parser is supposed to blow
8553 its stack. Problem reported by twlevo@xs4all.nl.
8554
15f40952
PE
8555 * data/glr.c (yyparse): Don't assume that the initial calls
8556 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8557 Print a stack-overflow message and fail instead.
8558 Initialize the line-number information before creating the stack,
8559 so that the stack-overflow message can report line zero safely.
8560
f32c66b5
PE
85612005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8562
a22ff96f 8563 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
8564 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8565 (yyuserMerge): Provide a default case if b4_mergers is empty.
8566 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8567 * tests/glr-regression.at
8568 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 8569 Add casts to pacify C++ compilers.
1beb0b24
PE
8570 * tests/glr-regression.at (Improper merging of GLR delayed action
8571 sets): Declare yylex before using it.
f32c66b5 8572 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
8573 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8574 test for valgrind; valgrind is independent of g++.
8575 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8576 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8577 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8578 Use a destructor, so that we can expand the stack. Change
8579 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 8580
d741bd1b
PE
85812005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8582
8583 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8584 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8585
0410a6e0
PE
85862005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8587
8588 * PACKAGING: New file, suggested by Bruno Haible and taken from
8589 similar wording in gettext's PACKAGING file.
8590 * NEWS: Mention PACKAGING.
8591 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8592
f7ab6a50
PE
85932005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8594
baf785db 8595 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
8596 * bootstrap: Get runtime translations into runtime-po.
8597 Create runtime-po files automatically, if possible.
8598 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8599 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8600 does not infringe on the user's name space.
8601 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8602 * doc/bison.texinfo (Internationalization): Revamp the English
8603 and Texinfo syntax a bit, to try to make it clearer.
8604 (Bison Options, Option Cross Key): Mention --print-localedir.
8605 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8606 YYENABLE_NLS. Quote a bit more.
8607 * runtime-po/.cvsignore: New file.
8608 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8609 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8610 * runtime-po/quot.sed: Likewise.
8611 * runtime-po/boldquot.sed: Likewise.
8612 * runtime-po/en@quot.header: Likewise.
8613 * runtime-po/en@boldquot.header: Likewise.
8614 * runtime-po/insert-header.sin: Likewise.
8615 * runtime-po/remove-potcdate.sin: Likewise.
8616 * runtime-po/Makevars: Likewise.
8617 * runtime-po/LINGUAS: Likewise.
8618 * runtime-po/de.po: Likewise; we will rely on the translation project
8619 to maintain this, so "bootstrap" should get it.
0410a6e0 8620 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
8621 its value.
8622 * src/main.c (main): Bind the bison-runtime domain, too.
8623
86242005-07-12 Bruno Haible <bruno@clisp.org>
8625
8626 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8627 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8628 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8629 * runtime-po: New directory.
8630 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8631 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8632 * runtime-po/Rules-quot: New file, copied from po/.
8633 * runtime-po/quot.sed: Likewise.
8634 * runtime-po/boldquot.sed: Likewise.
8635 * runtime-po/en@quot.header: Likewise.
8636 * runtime-po/en@boldquot.header: Likewise.
8637 * runtime-po/insert-header.sin: Likewise.
8638 * runtime-po/remove-potcdate.sin: Likewise.
8639 * runtime-po/Makevars: New file.
8640 * runtime-po/POTFILES.in: New file.
8641 * runtime-po/LINGUAS: New file.
8642 * runtime-po/bison-runtime.pot: New file.
8643 * runtime-po/de.po: New file.
8644 * m4/bison.m4: New file.
8645 * Makefile.am (SUBDIRS): Add runtime-po.
8646 (aclocaldir, aclocal_DATA): New variables.
8647 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8648 Define aclocaldir.
8649 * src/getargs.c (usage): Document --print-localedir option.
8650 (PRINT_LOCALEDIR_OPTION): New enum item.
8651 (long_options): Add --print-localedir option.
8652 (getargs): Handle --print-localedir option.
8653 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8654 (Internationalization): New section.
8655
22dda0f0
AD
86562005-07-12 Akim Demaille <akim@epita.fr>
8657
8658 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8659 for consistency with the rest of the code.
8660 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8661 Add separators.
8662
82b248ad
AD
86632005-07-12 Akim Demaille <akim@epita.fr>
8664
8665 * src/parse-gram.y: Use %printer instead of YYPRINT.
8666
fa0e9314
AD
86672005-07-12 Akim Demaille <akim@epita.fr>
8668
867a3e00
AD
8669 * src/symtab.h, src/symtab.c (symbol_print): New.
8670 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8671 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8672
86732005-07-12 Akim Demaille <akim@epita.fr>
8674
8675 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
8676 b4_at_dollar and b4_dollar_dollar.
8677
e054b190
PE
86782005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8679
8680 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8681 and Pennello's paper.
8682
34160ec4
PE
86832005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8684
407d4a75
PE
8685 * data/yacc.c (yyparse): Undo previous patch. Instead,
8686 set yylsp[0] and yyvsp[0] only if the initial action
8687 sets yylloc and yylval, respectively.
8688
34160ec4
PE
8689 * data/yacc.c (yyparse): In the initial action, set
8690 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8691 This avoids the use of undefined variables if the initial
8692 action does not set yylloc and/or yylval.
8693
c3d5a4a7
PE
86942005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8695
b34d96c1
PE
8696 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8697 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8698 Remove from CVS. These files are automatically generated.
8699 * examples/extexi: Clarify that this file is now part of Bison,
8700 not GNU M4, and that it works with any POSIX-compatible Awk.
8701 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8702 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8703 so that we also get calc++-parser.yy. Geneate it.
8704 Use $(AWK), not gawk, since any conforming Awk will do.
8705 Put comment before action, since older 'make' can't handle comment
8706 in action.
8707 $(BUILT_SOURCES): List all built sources, not just some of them.
8708 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8709 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8710 $($(calc_sources_generated)): Remove unnecessary test for existence
8711 of target. (This had a shell syntax error anyway; a stray "x".)
8712 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8713 calc++-parser.yy.
8714 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8715
c3d5a4a7
PE
8716 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8717 implied by the other modules.
8718
828c373b
AD
87192005-07-06 Akim Demaille <akim@epita.fr>
8720
8721 Bind examples/calc++ to the package.
8722 * examples/calc++/Makefile: Remove, replaced by...
8723 * examples/calc++/Makefile.am: ... this new file.
8724 * examples/calc++/test: Remove input.
8725 * examples/calc++/compile: Remove.
8726 * examples/Makefile.am: New.
8727 * configure.ac, Makefile.am: Adjust.
8728 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8729
63cb01d6
PE
87302005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8731
fd2df2ed
PE
8732 * data/glr.c (yyFail): Drastically simplify; since the format argument
8733 never had any % directives, we can simply pass it to yyerror.
8734 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8735 be modified later, as that is the usual style in glr.c.
8736 Problems reported by Paul Hilfinger.
8737
63cb01d6
PE
8738 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8739 and size overflow errors.
8740 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8741 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8742 (YYSIZEMAX): New macro.
8743 (yystpcpy): New function, taken from yacc.c.
8744 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8745 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8746 so that we don't have to maintain their signatures.
8747 (yyFail): Check for buffer overflow, by using vsnprintf rather
8748 than vsprintf. Allocate a bigger buffer if possible.
8749 Report an error if buffer allocation fails.
8750 (yyStackOverflow): New function.
8751 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8752 the initialization was successful. It might fail if storage was
8753 exhausted.
8754 (yyexpandGLRStack): Add more checks for storage allocation failure.
8755 Use yyStackOverflow to report failures.
8756 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8757 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8758 Don't assume stack number fits in int.
8759 (yysplitStack): Check for storage allocation failure.
8760 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8761 can print diagnostics on storage allocation failure. All callers
8762 changed.
8763 (yyresolveValue): Use yybool for boolean.
8764 (yyreportSyntaxError): Check for size-calculation overflow.
8765 This code is taken from yacc.c.
8766 (yyparse): Check for storage allocation errors when allocating
8767 the initial stack.
8768
1c59e0a1
AD
87692005-07-05 Akim Demaille <akim@epita.fr>
8770
8771 Extract calc++ from the documentation.
8772 * doc/bison.texinfo (Calc++): Add the extraction marks.
8773 * examples/extexi: New, from the aborted GNU Programming 2E.
8774 Separate the different paragraph of a file with empty lines.
8775 * examples/Makefile: Use it to extract the whole calc++ example.
8776
8a0adb01
AD
87772005-06-24 Akim Demaille <akim@epita.fr>
8778
8779 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8780 class typedefs.
8781
12545799
AD
87822005-06-22 Akim Demaille <akim@epita.fr>
8783
8784 * doc/bison.texinfo (C++ Language Interface): First stab.
8785 (C++ Parsers): Remove.
8786
99be0235
AD
87872005-06-22 Akim Demaille <akim@epita.fr>
8788
8789 * data/lalr1.cc (yylex_): Honor %lex-param.
8790
0ffd4fd1
AD
87912005-06-22 Akim Demaille <akim@epita.fr>
8792
8793 Start a set of simple examples.
8794 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8795 * examples/calc++/calc++-driver.hh,
8796 * examples/calc++/calc++-parser.yy,
8797 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8798 * examples/calc++/compile, examples/calc++/test: New.
8799
0925ebb4
PE
88002005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8801
8802 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8803 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8804 which stems from the 2005-05-27 patch.
8805
43d3b664
PH
88062005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8807
8808 * data/glr.c: Modify treatment of unused parameters to permit use
8809 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8810
3062864d
PE
88112005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8812
8813 Fix infringement on user name space reported by Janos Zoltan Szabo.
8814 * data/yacc.c (yyparse): strlen -> yystrlen.
8815
989b5b8e
AD
88162005-05-30 Akim Demaille <akim@epita.fr>
8817
8818 * data/lalr1.cc (_): New.
8819 Translate the various messages.
8820
bedf57f5
PE
88212005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8822
8823 Fix infringement on user name space reported by Bruno Haible.
8824 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8825 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8826 the user's name space.
8827 (alloca): Include <stdlib.h> to get it, if it's not built in.
8828 (YYMALLOC, YYFREE): Define only if needed.
8829 (malloc, free): Declare, but only if needed, as this infringes on
8830 the user name space.
8831
4d1801f1
PE
88322005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8833
8834 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8835 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8836 with %d format.
8837 * lib/ebitset.c (min, max): Undef before defining.
8838 * lib/vbitset.c (min, max): Likewise.
8839 * lib/subpipe.c (create_subpipe): Save local variables in case
8840 vfork clobbers them.
8841
88422005-05-24 Bruno Haible <bruno@clisp.org>
8843
8844 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8845 error message syntax used by gcc-4.0.
8846
b94a9e1e
PE
88472005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8848
85ac3861
PE
8849 * README: Mention m4 1.4.3. Remove obsolete advice about
8850 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8851
b94a9e1e
PE
8852 * bootstrap: Remove workaround for problem I encountered with
8853 gettext 0.14.1; it seems to be fixed now.
8854
51c30d21
PE
88552005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8856
009ce67d
PE
8857 * NEWS: Version 2.0a.
8858
f2a97c62
PE
8859 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8860 the previous change.
8861
c8775f93
PE
8862 Various maintainer cleanups.
8863 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8864 conftest*, for benefit of CVS commands run at the same time as
8865 "configure". Add build-aux, since "bootstrap" now creates it and
8866 its subfiles.
8867 * Makefile.cfg (move_if_change): Remove.
8868 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8869 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8870 (po_repo, do-po-update, po-update, wget_files, get-targets):
8871 (config.guess-url_prefix, config.sub-url_prefix):
8872 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8873 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8874 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8875 Remove.
8876 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8877 this is now the recommended name.
8878 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8879 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8880 ylwrap. These files now go into build-aux.
8881 * config/move-if-change: Remove.
8882 * config/prev-version.txt: Bump from 1.75 to 2.0.
8883
3ea5f0ec
PE
8884 * bootstrap: Add stdio-safer, unistd-safer modules.
8885 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8886 we don't need it).
8887 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8888 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8889 * lib/subpipe.c: Include "unistd-safer.h".
8890 (create_subpipe): Make sure all the newly-created
8891 file descriptors are > 2, so that diagnostics don't
8892 get sent down them (which might cause Bison to hang, in theory).
8893 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8894 * src/files.c (xfopen): Use fopen_safer, not fopen.
8895
51c30d21
PE
8896 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8897 yesterday's yacc.c fix.
8898
cea1469d
PE
88992005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8900
3ea5f0ec
PE
8901 * data/glr.c, data/lalr1.cc: Update copyright date.
8902
cea1469d
PE
8903 Fix a destructor bug reported by Wolfgang Spraul in
8904 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8905 * data/yacc.c (yyabortlab): Don't call destructor, and
8906 don't set yychar to EMPTY.
8907 (yyoverflowlab): Don't call destructor.
8908 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8909 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8910 since we no longer output the message "discarding lookahead token
8911 end of input ()".
8912
5e6f62f2
PH
89132005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8914
8915 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8916 fix a small glitch in debugging output.
8917 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8918 after YY_SYMBOL_PRINT where needed.
8919
8920 (struct yyGLRState): Add some comments.
8921 (struct yySemanticOption): Add some comments.
8922 (union yyGLRStackItem): Add comment.
8923
8924 (yymergeOptionSets): Correct this to properly perform the union,
8925 avoiding infinite reported by Michael Rosien.
8926 Update comment.
8927
8928 * tests/glr-regression.at: Add test for GLR merging error reported
8929 by M. Rosien.
cea1469d 8930
0fb669f9
PE
89312005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8932
8933 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8934 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8935 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8936 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8937 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8938 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8939 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8940 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8941 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8942 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8943 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8944 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8945 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8946 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8947 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8948 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8949 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8950 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8951 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8952 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8953 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8954 src/output.h, src/parse-gram.c, src/parse-gram.h,
8955 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8956 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8957 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8958 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8959 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8960 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8961 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8962 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8963 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8964 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8965 tests/reduce.at, tests/regression.at, tests/sets.at,
8966 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8967 Update FSF postal mail address.
8968
51f4735e
PE
89692005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8970
8971 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8972 Problem reported by Ralf Menzel.
8973
80ce3401
PE
89742005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8975
8976 * tests/actions.at: Test that stack overflow invokes destructors.
8977 From Marcus Holland-Moritz.
8978 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8979 from here....
8980 (yyreturn): to here. That way, destructors are called properly
8981 even if the stack overflows, or the user calls YYACCEPT or
8982 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8983 (yyoverflowlab): Destroy the lookahead.
8984
89852005-04-24 Paul Eggert <eggert@cs.ucla.edu>
8986
8987 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
8988
72f000b0
PE
89892005-04-17 Paul Eggert <eggert@cs.ucla.edu>
8990
8991 * NEWS: Bison-generated C parsers no longer quote literal strings
8992 associated with tokens.
8993 * src/output.c (prepare_symbols): Don't escape strings,
8994 since users don't want to see C escapes.
8995 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
8996 in diagnostics.
c19683bb 8997 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
8998 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
8999
1094323f
PE
90002005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9001
9002 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9003 the data size is known to be too small and we can't increase it.
9004 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9005
ca407bdf
PE
90062005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9007
9008 * src/parse-gram.y: Include quotearg.h.
9009 (string_as_id): Quote $1 before using it as a key, since the
9010 lexer no longer quotes it for us.
9011 (string_content): Don't strip quotes, since lexer no longer
9012 quotes it for us.
9013 * src/scan-gram.l: Include quotearg.h.
9014 ("\""): Omit quote.
9015 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9016 a key, since the rest of the lexer doesn't quote it.
9017 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9018 * tests/regression.at (Token definitions): Check for backslashes
9019 in token strings.
9020
9021 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9022 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9023 (yyparse): Revamp code to generate long syntax error message, to
9024 make it easier to translate, and to avoid problems with arithmetic
9025 overflow. Change "virtual memory" to "memory" in diagnostic, since
9026 we don't know whether the memory is virtual.
9027
1ce59070
PE
90282005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9029
9030 * NEWS: Bison-generated C parsers now use the _ macro to
9031 translate strings.
9032 * data/yacc.c (_) [!defined _]: New macro.
9033 All English strings wrapped inside this macro.
9034 * doc/bison.texinfo (Bison Parser): Document _.
9035 * po/POTFILES.in: Include src/parse-gram.c, since it now
9036 includes translateable strings that parse-gram.y doesn't.
9037
a749a695
PE
90382005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9039
9040 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9041 reverting the 2004-10-11 change to this function.
9042 (symbol_check_alias_consistency): Don't call symbol_type_set
9043 if the type name is already correct.
9044 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9045
8fb1053b
PE
90462005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9047
9048 * tests/regression.at (Token definitions): Don't use a token named
9049 c, as that generates a "#define c ..." that runs afoul of buggy
9050 stdlib.h that uses the identifier c as a member of struct
9051 drand48_data. Problem reported by Horst Wente.
9052
ff498c4a
PE
90532005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9054
9055 * bootstrap: Change translation URL from
9056 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9057 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9058 redirection glitches. Problem reported by twlevo@xs4all.nl.
9059
65211d70
PE
90602005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9061
9062 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9063 after operands; POSIX says this isn't portable for the c99 command.
9064
9577fb1f
PE
90652005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9066
9067 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9068 immediately if a data overrun has occurred; this may help us track
9069 down what may be a spurious failure on MacOS.
9070
78b178f7
PE
90712005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9072
a2599d0f
PE
9073 Respond to problems reported by twlevo@xs4all.nl.
9074
9075 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9076
78b178f7
PE
9077 * src/vcg.h: Comment fix.
9078 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9079 (G_CMAX): Change to -1 instead of INT_MAX.
9080
9081 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 9082
7296e729
PE
90832005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9084
9085 * src/tables.c (state_number_to_vector_number): Put it inside an
9086 "#if 0", since it's not currently used. Problem reported by
9087 Roland McGrath.
9088
05ac60f3
PE
90892005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9090
9091 * src/output.c (escaped_output): Renamed from
9092 escaped_file_name_output, since we now use it for symbol tags as
9093 well. All uses changed.
9094 (symbol_destructors_output, symbol_printers_output):
9095 Escape symbol tags too.
9096 Problem reported by Matyas Forstner in
9097 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9098
9099 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9100 not needed.
9101 * src/output.c (user_actions_output, token_definitions_output,
9102 symbol_destructors_output, symbol_printers_output): Likewise.
9103 * src/reader.c (prologue_augment): Likewise.
9104 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9105
9106 * src/vcg.c (output_edge): Don't quote linestyle arg.
9107 Problem reported by twlevo@xs4all.nl.
9108
7eb453ac
PE
91092005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9110
9111 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9112 example, reported by Derek M Jones. Also, make the example even
9113 more outrageous, to better illustrate how bad the problem is.
9114
4c04c52a
PE
91152005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9116
9117 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9118 putsym. Typo reported by Sebastian Piping.
9119
a61e1620
PE
91202005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9121
9122 * doc/bison.texinfo (Language and Grammar): some -> same
9123 (Epilogue): int he -> in the
9124 Typos reported by Sebastian Piping via Justin Pence.
9125
9ec93868
PE
91262005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9127
9128 * tests/glr-regression.at (Improper handling of embedded actions
9129 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9130 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9131 with dollar signs in test names.
9132 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9133 for a similar reason.
9134
73ce7e7e
PE
91352005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9136
9137 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9138 wants to redefine G_VIEW.
9139
2e72b98e
PE
91402005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9141
9142 * src/vcg.c (get_view_str): Remove case for normal_view.
9143 Problem reported by twlevo@xs4all.nl.
9144
e0d634e5
PE
91452005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9146
ccf830a4
PE
9147 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9148 Problem reported by twlevo@xs4all.nl.
9149
e0d634e5
PE
9150 * doc/bison.texinfo: Change @dircategory from "GNU programming
9151 tools" to "Software development". Requested by Richard Stallman
9152 via Karl Berry.
9153
7bbc8cb0
PE
91542005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9155
9156 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9157 Problem reported by twlevo@xs4all.nl.
9158
08b770bc
PE
91592005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9160
9161 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9162 keyword; it's not needed with modern compilers, and it doesn't
9163 affect correctness with older compilers. Suggested by
9164 twlevo@xs4all.nl.
9165
95f22ad2
PE
91662005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9167
9168 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9169 gcc -Wswitch-default.
9170 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9171 * data/yacc.c (yyparse): Likewise.
9172
d229d15c
PE
91732005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9174
9175 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9176 already. Let config.h define any nonstandard values.
9177
ecadd90f
PE
91782005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9179
9180 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9181 for the benefit of slower hosts. Problem reported by
9182 Nelson H. F. Beebe.
9183
213744b5
PE
91842005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9185
9186 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9187 being defined and not used.
9188 * data/lalr1.cc (yyparse): Likewise.
9189 Use "if (false)" rather than "if (0)".
9190
249d3236
PE
91912005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9192
9193 * TODO: Mention that we should allow NUL bytes in tokens.
9194
987cc1fb
PE
91952005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9196
9197 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9198 Problem reported by Hans Aberg.
9199
08fe02d9
PE
92002005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9201
9202 * src/getargs.c (version): Happy new year; update overall
9203 program copyright date from 2004 to 2005.
9204
9205 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9206 Problem reported by Hans Aberg.
9207 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9208 (Output file names.): Add a test for the case when standard output
9209 is closed.
9210
010c0266
PE
92112004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9212
9213 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9214 to fix an oversight in the Bison 2.0 manual.
9215
da12206a
PE
92162004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9217
9218 * NEWS: Version 2.0. Reformat the existing news items since
9219 1.875, so that related items are grouped together.
3a4734aa 9220 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
9221 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9222
c935d934
PE
9223 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9224 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9225 otherwise, we're not testing alloca. Unfortunately there's no
9226 simple way to consult HAVE_ALLOCA here.
9227
da12206a
PE
9228 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9229 for yymsg, too.
9230
9231 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9232 hand. This avoids a warning about comparing int to size_t when
9233 GCC warnings are enabled.
9234
0a2c5137
PE
92352004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9236
d7e14fc0
PE
9237 * NEWS: Bison-generated parsers no longer default to using the
9238 alloca function (when available) to extend the parser stack, due
9239 to widespread problems in unchecked stack-overflow detection.
9240 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9241 responsibility to set it to a positive value. This lets the user
9242 specify a value that is not a preprocessor constant.
9243 * data/yacc.c (YYMAXDEPTH): Likewise.
9244 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9245 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9246 to be a compile-time constant. However, explain the constraints on it.
9247 Also, explain the constraints on YYINITDEPTH.
9248 (Table of Symbols): Explain that alloca is no longer the default.
9249 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9250 to 1.
9251
0a2c5137
PE
9252 * doc/bison.texinfo (Location Default Action): Mention that n must
9253 be zero when k is zero. Suggested by Frank Heckenbach.
9254
e019c247
AD
92552004-12-22 Akim Demaille <akim@epita.fr>
9256
9257 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9258 (parser::state_type, parser::semantic_type, parser::location_type):
9259 Private, not public.
9260 (parser::parse): Return ints, not bool.
9261 Returning a bool introduces a problem: 0 corresponds to false, and
9262 it seems weird to return false on success. Returning true changes
9263 the conventions for yyparse.
9264 Alternatively we could return void and send an exception.
9265 There is no clear consensus (yet?).
9266 (state_stack, semantic_stack, location_stack): Rename as...
9267 (state_stack_type, semantic_stack_type, location_stack_type): these.
9268 Private, not public.
9269 * tests/c++.at: New.
9270 * tests/testsuite.at, tests/Makefile.am: Adjust.
9271
72731bb7
AD
92722004-12-21 Akim Demaille <akim@epita.fr>
9273
9274 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9275
9a0d8bec
AD
92762004-12-21 Akim Demaille <akim@epita.fr>
9277
9278 Don't impose std::string for filenames.
9279
9280 * data/lalr1.cc (b4_filename_type): New.
9281 (position::filename): Use it.
9282 (parser.hh): Move the inclusion of stack.hh and location.hh below
9283 the user code, so that needed headers for the filename type can be
9284 included first.
72731bb7
AD
9285 Forward declare them before the user code.
9286 * tests/Makefile.am (check-local, installcheck-local): Pass
9287 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 9288
99880de5
AD
92892004-12-20 Akim Demaille <akim@epita.fr>
9290
9291 Use more STL like names: my_class instead of MyClass.
9292
9293 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9294 (SemanticStack, SemanticType, StateStack, StateType)
9295 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9296 (Parser::value): Rename as...
9297 (location_stack, location_type, rhs_number_type, semantic_stack)
9298 (semantic_type, state_stack, state_type, token_number_type, stack)
9299 (slice, traits, parser::yylloc, parser::yylval): these.
9300
9301 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9302
9bec482e
PE
93032004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9304
9305 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9306 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9307
f6fbd3da
PE
93082004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9309
9310 Remove uses of 'short int' and 'unsigned short int'. This raises
9311 some arbitrary limits. It uses more memory but nowadays that's
9312 not much of an issue.
9313
9314 This change does not affect the generated parsers; that's a different
9315 task, as some users will want to conserve memory there.
9316
9317 Ideally we should use size_t to represent all object counts, and
9318 something like ptrdiff_t to represent signed differences of object
9319 counts; but that will require more code-cleanup than I have the
9320 time to do right now.
9321
9322 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9323 Use size_t, not int or short int, to count objects.
9324 * src/closure.c (nritemset, closure): Likewise.
9325 * src/closure.h (nritemset, closure): Likewise.
9326 * src/nullable.c (nullable_compute): Likewise.
9327 * src/print.c (print_core): Likewise.
9328 * src/print_graph.c (print_core): Likewise.
9329 * src/state.c (state_compare, state_hash): Likewise.
9330 * src/state.h (struct state): Likewise.
9331 * src/tables.c (default_goto, goto_actions): Likewise.
9332
9333 * src/gram.h (rule_number, rule): Use int, not short int.
9334 * src/output.c (prepare_rules): Likewise.
9335 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9336 errs, reductions): Likewise.
9337 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9338 Likewise.
9339 * src/tables.c (vector_number, tally, action_number,
9340 ACTION_NUMBER_MINIMUM): Likewise.
9341 * src/output.c (muscle_insert_short_int_table): Remove.
9342
efeed023
AD
93432004-12-17 Akim Demaille <akim@epita.fr>
9344
9345 * data/lalr1.cc: Extensive Doxygenation.
9346 (error_): Rename as...
9347 (error): this, since it is visible to the user.
9348 Adjust callers.
9349 (Parser::message): Now an automatic variable from...
9350 (Parser::yyreport_syntax_error_): here.
9351 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9352 Parser::error.
9353 * tests/input.at: Escape $.
9354
bc82c5a5
PE
93552004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9356
9357 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9358 Parenthesize rhs to avoid obscure problems with mistakes like
9359 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9360 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9361 b4_rhs_location): Likewise.
9362 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9363 b4_rhs_location): Likewise.
9364
fd19f271
AD
93652004-12-16 Akim Demaille <akim@epita.fr>
9366
9367 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9368 yacc.c: be sure to stay within yycheck_.
9369 * tests/actions.at: Re-enable C++ tests.
9370
10454ea4
AD
93712004-12-16 Akim Demaille <akim@epita.fr>
9372
9373 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9374 real.
9375
c5b95ccf
AD
93762004-12-16 Akim Demaille <akim@epita.fr>
9377
9378 Use #define to handle the %name-prefix.
9379
9380 * data/glr.c, data/yacc.c: Comment changes.
9381 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9382 so that one can refer to yylex in the parser file, and have it
9383 renamed, as is the case with other skeletons.
9384
617a8f12
AD
93852004-12-16 Akim Demaille <akim@epita.fr>
9386
9387 Move lalr1.cc internals into yy*.
9388
9389 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9390 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9391 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9392 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9393 (empty_, final_, terror_, errcode_, ntokens_)
9394 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9395 (looka_, ilooka_, error_range_, nerrs_):
9396 Rename as...
9397 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9398 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9399 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9400 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9401 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9402 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9403 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9404 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9405 these.
9406
1e547e6e
PE
94072004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9408
9409 Fix some problems reported by twlevo at xs4all.
9410 * src/symtab.c (symbol_new): Report an error if the input grammar
9411 contains too many symbols. This is better than calling abort() later.
9412 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9413 (struct node, struct graph):
9414 Rename member expand to stretch. All uses changed.
9415 (struct graph): Remove member layoutalgorithm. All uses removed.
9416 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9417 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9418 All uses changed.
9419 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9420
735d6bd4
AD
94212004-12-15 Akim Demaille <akim@epita.fr>
9422
9423 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9424 Add more Doxygen comments.
9425 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9426 (report_syntax_error_, translate_): Rename as...
9427 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9428 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9429
2e1f5829
AD
94302004-12-15 Akim Demaille <akim@epita.fr>
9431
9432 * data/lalr1.cc (lex_): Rename as...
9433 (yylex_): this.
9434 Move the trace here.
9435 Take the %name-prefix into account.
9436 Reported by Alexandre Duret-Lutz.
9437
a3cb6248
AD
94382004-12-15 Akim Demaille <akim@epita.fr>
9439
9440 Simplify the C++ parser constructor.
9441
9442 * data/lalr1.cc (debug_): Rename as...
9443 (yydebug_): so that the parser's internals are always in the yy*
9444 pseudo namespace.
9445 Adjust uses.
9446 (b4_parse_param_decl): Remove the leading comma as it is now only
9447 called as unique argument list.
9448 (Parser::Parser): Remove the constructor accepting a location and
9449 an initial debugging level.
9450 Remove from the other ctor the argument for the debugging level.
9451 (debug_level_type, debug_level, set_debug_level): New.
9452
9453 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9454 constructor calls.
9455
07fed891
AD
94562004-12-15 Akim Demaille <akim@epita.fr>
9457
9458 Remove b4_root related material: failure experiment
a3cb6248 9459 (which goal was to allow to derive from a class).
07fed891
AD
9460
9461 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9462 definitions and uses.
9463
e603eaa5
PE
94642004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9465
9466 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9467 not 2, since it's not portable to subtract 1 from the start of an
9468 array. The new item 0 is never set or used. All uses changed.
9469
9470 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9471 the default definition of YYLLOC_DEFAULT. Problem reported
9472 by Frank Heckenbach.
9473
fafb007d
PE
94742004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9475
9476 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9477 the normal case and one for the error case. Just use the
9478 first one uniformly. Problem reported by Frank Heckenbach.
9479 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9480 use exactly the same macro in both places.
9481 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9482 so that the normal-case YYRHSLOC works for the error case too.
9483 All uses changed.
9484 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9485 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9486 * doc/bison.texinfo (Location Default Action): Don't claim that
9487 we have an array of locations. Use the same macro for both glr
9488 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9489 the index is 0.
9490
48814dcd
PE
94912004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9492
a4e1a53b
PE
9493 * HACKING: Update email addresses to send announcements to.
9494
48814dcd
PE
9495 * configure.ac (AC_INIT): Bump version to 1.875f.
9496
337116ba
PE
94972004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9498
9499 * NEWS: Version 1.875e.
9500 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9501
9502 * src/scan-skel.l: Include "complain.h", for "fatal".
9503
9504 * src/relation.h (relation_print, relation_digraph):
9505 Relation sizes are of type relation_node, not size_t (this is
9506 merely a doc fix, since the two types are equivalent).
9507 (relation_transpose): Relation sizes are of type relation_node,
9508 not int.
9509 * src/relation.c: Likewise.
9510 (top, infinity): Now of type relation_node, not int.
9511 (traverse, relation_transpose): Use relation_node, not int.
9512
9513 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9514 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9515 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9516
9517 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 9518 specifying whether the test should be skipped. Use it tp
337116ba 9519 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 9520 fail on some hosts, and should be skipped.
337116ba 9521
da2a7671
PE
95222004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9523
9524 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9525 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9526 unless otherwise specified below.
9527
9528 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9529 to allocate kernel_base, kernel_items, kernel_size, since
9530 they needn't be initialized to 0.
9531 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9532 * src/closure.c (new_closure): Likewise, for itemset.
9533 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9534 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9535 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9536 (build_relations): Likewise for edge, states1, includes.
9537 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9538 * src/reader.c (packgram): Likewise, for ritem, rules.
9539 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9540 * src/relation.c (relation_digraph): Likewise for VERTICES.
9541 (relation_transpose): Likewise for new_R, end_R.
9542 * src/symtab.c (symbols_token_translations_init): Likewise for
9543 token_translations.
9544 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9545 (token_actions): Likewise for yydefact, actrow, conflrow,
9546 conflict_list.
9547 (save_column): Likewise for froms[symno], tos[symno].
9548 (goto_actions): Likewise for state_count.
9549 (pack_table): Likewise for base, pos, check.
9550 (tables_generate): Likewise for width.
9551
9552 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9553 for initial core. Just have a separate core, so we needn't worry
9554 about whether kernel_size and kernel_base are initialized.
9555
9556 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9557 kernel_size, kernel_items): Remove unnecessary initialization.
9558 * src/conflicts.c (conflicts): Likewise.
9559 * src/derives.c (derives): Likewise.
9560 * src/muscle_tablc (muscle_insert): Likewise.
9561 * src/relation.c (relation_digraph): Likewise.
9562 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9563 conflrow, conflict_table, conflict_list, table, check):
9564 Likewise.
9565
9566 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9567 This is because all callers pass unsigned int.
9568 * src/closure.h (new_closure): Likewise.
9569
9570 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9571 (build_relations): Initialize includes[i] in all cases.
9572 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9573 and rules[ruleno].precsym. Initialize members in order.
9574 * src/relation.c (relation_transpose): Always initialize new_R[i]
9575 and end_R[i].
9576 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9577
9578 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9579 conflict_list[0] was always 0, but now it isn't initialized.
9580
9581 * src/table.c (table_grow): When conflict_table grew, the grown
9582 area wasn't cleared. Fix this.
9583
9584 * lib/.cvsignore: Add strdup.c, strdup.h.
9585 * m4/.cvsignore: Add strdup.m4.
9586
00baeeac
PE
95872004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9588
9589 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9590 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9591 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9592 ngotos + 1 without checking for overflow.
9593 (build_relations): Use END_NODE, not -1, to denote end of edges.
9594 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9595 build_relations): Use goto_number, not int, for goto numbers.
9596 * src/tables.c (save_column, default_goto): Likewise.
9597
be3d9d42
AD
95982004-11-23 Akim Demaille <akim@epita.fr>
9599
9600 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9601 of #defining from yystype.
9602 Don't typedef yystype, C++ does not need it.
9603 This lets it possible to forward declare it as union.
9604
78e526d5
PE
96052004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9606
9607 * bootstrap (gnulib_modules): Add extensions.
9608 Problem reported by Jim Meyering.
9609
afbb696d
PE
96102004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9611
9612 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9613 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9614 src/system.h, src/tables.c: XFREE -> free, to accommodate
9615 recent change to gnulib xalloc.h.
78e526d5 9616 Problem reported by Jim Meyering.
afbb696d 9617
c1f8f16a
AD
96182004-11-17 Akim Demaille <akim@epita.fr>
9619
9620 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9621
db7e5eb5 96222004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
9623 Alexandre Duret-Lutz <adl@gnu.org>
9624
9625 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9626 changes.
9627 (YYCDEBUG): Adjust.
9628 Use it instead of cdebug_.
9629 (Parser::debug_stream, Parser::set_debug_stream): New.
9630 (Parser::symprint_): Define cdebug_ for temporary backward
9631 compatibility.
9632 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9633 debug_stream ().
9634
68e11668
AD
96352004-11-17 Akim Demaille <akim@epita.fr>
9636
9637 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9638 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9639 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9640 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9641
97cbc73e
PE
96422004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9643
9644 * data/glr.c (yyloc_default): Remove; not used.
9645 Problem reported by Frank Heckenbach.
9646
e342c3be
AD
96472004-10-25 Akim Demaille <akim@epita.fr>
9648
9649 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9650 Introduce another definition to address simple location arrays.
9651 (yyGLRStack): New member: yyerror_range.
9652 (yyrecoverSyntaxError, yyparse): Update it.
9653 (yyrecoverSyntaxError): Use it when shifting the error token to
9654 have an accurate range, equivalent to the one computed by both
9655 yacc.c and lalr1.cc.
9656 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9657 that column numbers start at column 0, as per GNU Coding
9658 Standards, the others tests, and the doc.
9659 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9660 Adjust to the above change (first column is 0).
9661 And adjust the location of the "<error>", now covering the whole
9662 line.
9663
93602feb 96642004-10-22 Akim Demaille <akim@epita.fr>
04098407 9665 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
9666
9667 Remove some arbitrary limits on goto numbers and relations.
9668 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9669 initial values, since they're never used.
9670 (set_goto_map): ngotos is now unsigned, so test for overflow
9671 by seeing whether it wraps around to zero.
9672 * src/lalr.h (goto_number): Now size_t, not short int.
9673 (GOTO_NUMBER_MAXIMUM): Remove.
9674 * src/relation.c (relation_print, traverse, relation_transpose):
9675 Check for END_NODE rather than looking at sign.
9676 * src/relation.h (END_NODE): New macro.
9677 (relation_node): Now size_t, not short int.
9678
dba08b04
PE
96792004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9680
9681 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9682 keyword, not an identifier. Problem reported by Baron Schwartz in
9683 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9684
df09ef2e
AD
96852004-10-11 Akim Demaille <akim@epita.fr>
9686
9687 * src/symtab.c (symbol_check_alias_consistency): Also check
9688 type names, destructors, and printers.
9689 Reported by Alexandre Duret-Lutz.
9690 Recode the handling of associativity and precedence in terms
9691 of symbol_precedence_set.
9692 Accept no redeclaration at all, not even equal to the previous
9693 value.
9694 (redeclaration): New.
9695 Use it to factor redeclaration complaints.
9696 (symbol_make_alias): Don't set the type of the alias, let
9697 symbol_check_alias_consistency do it as for other features.
9698 * src/symtab.h (symbol): Add new member prec_location, and
9699 type_location.
9700 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9701 * tests/input.at (Incompatible Aliases): New.
9702
146bc99d
PE
97032004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9704
9705 .cvsignore fixes to accommodate gnulib changes,
9706 and the practice of naming build directories "_build".
9707 * .cvsignore: Add "_*". Sort.
9708 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9709 * m4/.cvsignore: Add "*_gl.m4".
9710
e503aa60
AD
97112004-10-06 Akim Demaille <akim@epita.fr>
9712
9713 * src/parse-gram.y (add_param): Fix the truncation of trailing
9714 spaces.
9715
b4a20338
AD
97162004-10-05 Akim Demaille <akim@epita.fr>
9717
9718 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9719 whether the reducion was empty or not. This leaves room to
9720 improve the use of YYLLOC_DEFAULT in such a case.
9721 lalr1.cc is still experimental, so changing this is acceptable.
9722 And finally, there are probably not many users who changed the
9723 handling of locations in GLR, so changing is admissible too.
9724
9725 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9726 empty reduction, set @$ to an empty location ending the previously
9727 stacked symbol.
9728 Adjust uses to make sure the code is triggered on empty
9729 reductions.
9730 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9731 expected output: empty reductions have empty locations.
9732
f85a5e6f
AD
97332004-09-29 Akim Demaille <akim@epita.fr>
9734
9735 * data/lalr1.cc: Move towards a more standard C++ coding style
9736 for templates: Class < T > -> Class<T>.
9737
b203fc2c
AD
97382004-09-29 Akim Demaille <akim@epita.fr>
9739
9740 * data/lalr1.cc: Reinstall the former ctor, for sake of
9741 compatibility, but warn it will be removed.
9742 Move towards a more standard C++ coding style (i.e., type *var ->
9743 type* var).
9744
5b7e1e73
PE
97452004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9746
3fee967f
PE
9747 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9748 since it's less likely to work if NULs are involved in the future.
5b7e1e73 9749
0dcca5c2
AD
97502004-09-27 Akim Demaille <akim@epita.fr>
9751
9752 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9753
6dde1c82
AD
97542004-09-27 Akim Demaille <akim@epita.fr>
9755
9756 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 9757 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
9758 and argument names.
9759 (b4_cc_constructor_call): Likewise.
9760
b233d555
AD
97612004-09-24 Akim Demaille <akim@epita.fr>
9762
9763 * src/parse-gram.y (add_param): Strip the leading and trailing
9764 blanks from a formal argument declaration.
9765 (YY_LOCATION_PRINT): New.
9766
619404e3
AD
97672004-09-24 Akim Demaille <akim@epita.fr>
9768
9769 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9770 after the location.
9771
dd8d9022
AD
97722004-09-24 Akim Demaille <akim@epita.fr>
9773
9774 * doc/bison.texinfo (Table of Symbols): Sort.
9775
0092f063
AD
97762004-09-21 Akim Demaille <akim@epita.fr>
9777
9778 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9779 the useless parentheses.
9780 Suggested by Paul Eggert.
9781
451364ed
AD
97822004-09-20 Akim Demaille <akim@epita.fr>
9783
9784 Let the initial-action act on the look-ahead, and use it for the
9785 "initial push" (corresponding to an hypothetical beginning-of-file).
9786 And let lalr1.cc honor %initial-action.
9787
9788 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9789 example.
9790 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9791 (Parser::Parser): Remove the ctor that used to initialize it.
9792 (Parser::parse): Like in the other skeletons, issue the "starting
9793 parse" message before any action.
9794 Honor %initial-action.
9795 Initialize the stacks with the lookahead.
9796 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9797 look-ahead.
9798 Push them in the stacks.
9799 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9800
18d192f0
AD
98012004-09-20 Akim Demaille <akim@epita.fr>
9802
9803 * doc/bison.texinfo (Initial Action Decl): New.
9804
b8458aa5
AD
98052004-09-20 Akim Demaille <akim@epita.fr>
9806
9807 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9808 clearer criterion to define it.
9809 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9810 When reducing on an empty RHS, use the latest stacked location as
9811 location.
9812 yylloc is not always available.
9813 * data/glr.c: Likewise.
9814 Also, honor initial-actions.
9815
3fc16193
AD
98162004-09-20 Akim Demaille <akim@epita.fr>
9817
9818 * data/yacc.c (YY_LOCATION_PRINT): New.
9819 Define when we know YYLTYPE's structure, i.e., when the default
9820 YYLLOC_DEFAULT is used.
9821 * data/c.m4 (b4_yysymprint_generate): Use it.
9822 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9823 value of the result.
9824 (error_start_): Replace with...
9825 (error_range_): this location array.
9826 This allows to replace code relying on the implementation of
9827 locations by portable code.
9828 * data/yacc.c (yylerrsp): Replace with...
9829 (yyerror_range): this.
9830 Every time a token is popped, update yyerror_range[0], to have an
9831 accurate location for the error token.
9832 * data/glr.c (YY_LOCATION_PRINT): New.
9833 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9834 deference a pointer.
9835 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9836 report the location in %printers.
9837
9838 * src/scan-skel.l: Instead of abort, report error messages to ease
9839 understanding skeleton scanning failures.
9840
ecfe33e7
AD
98412004-09-16 Akim Demaille <akim@epita.fr>
9842
9843 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9844 (iterator, const_iterator): these, to be more in the C++ spirit.
9845 Also, return reverse iterators so that when displaying the stack
9846 we display its bottom first.
9847 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9848 from yacc.c.
9849 We should probably use vector here though.
9850
1576d44d
AD
98512004-09-16 Akim Demaille <akim@epita.fr>
9852
9853 Have more complete shift traces.
9854
9855 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9856 to report Shifts instead of ad hoc YYDPRINTF invocations,
9857 including for the error token.
9858 * data/lalr1.cc (symprint_): Output the location.
9859 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9860 output the location within the %printer.
9861 Activate GLR tests, at least to make sure they compile properly.
9862 They still don't pass though.
9863 * tests/calc.at: Adjust expect verbose output, since now "Entering
9864 state..." is on a different line than the "Shifting" message.
9865
9c66f418
AD
98662004-09-08 Akim Demaille <akim@epita.fr>
9867
9868 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9869 Bison directive from the Bison file to the invocation of this
9870 macro, so that these directives are passed to
9871 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9872 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9873 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9874 the extra Bison directives instead of the whole series.
9875 Change the grammar so that there are recoverable errors, and
9876 unrecoverable errors. Now we can have the parser give up before
9877 consuming the whole input. As a result we now can observe that
9878 the lookahead is freed when needed.
9879 Change the parser source to parse argv[1] instead of a hard coded
9880 string.
9881 Simplify yylex, and give a value and location to EOF.
9882 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9883 passed directives already coded in the file.
9884 Add some tests to check the location of "error".
9885 For some tests, the C++ parser is correct, and not yacc.c.
9886 For other tests, they provide different, but unsatisfying, values,
9887 so keep the C++ value so that at least one parser is "correct"
9888 according to the test suite.
9889 (Actions after errors): Remove, this is subsumed by the
9890 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9891
52d5733f
AD
98922004-09-06 Akim Demaille <akim@epita.fr>
9893
9894 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 9895 (Parser::pop): New.
52d5733f
AD
9896 Use it.
9897
a0e68930
AD
98982004-09-06 Akim Demaille <akim@epita.fr>
9899
9900 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9901 argument, an informative message.
9902 Call YY_SYMBOL_PRINT.
9903 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9904 * data/lalr1.cc (destruct_): Likewise.
9905 In addition, no longer depend on b4_yysymprint_generate and
9906 b4_yydestruct_generate to generate these functions, do it "by
9907 hand".
9908
e757bb10
AD
99092004-09-03 Akim Demaille <akim@epita.fr>
9910
9911 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9912 invoked, yydestruct the lookahead.
9913 * tests/calc.at (Calculator $1): Update the expected lengths of
9914 traces: there is an added line for the discarded lookahead.
9915 * doc/bison.texinfo (Destructor Decl): Some rewording.
9916 Define "discarded" symbols.
9917
0fe1f06d
AD
99182004-09-02 Akim Demaille <akim@epita.fr>
9919
9920 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9921
284acc8b
AD
99222004-09-02 Akim Demaille <akim@epita.fr>
9923
9924 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9925 (YYDSYMPRINTF): Rename as...
9926 (YY_SYMBOL_PRINT): this.
9927 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9928 two.
9929 Use it instead of direct symprint_ calls.
9930 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9931 one.
9932
a5eb1ed2
AD
99332004-09-02 Akim Demaille <akim@epita.fr>
9934
b7c72fe1
AD
9935 * data/lalr1.cc (b4_yysymprint_generate): New.
9936 (symprint_): New member function, defined when YYDEBUG.
9937 Use it consistently instead of token/nterm debugging output by
9938 hand.
a5eb1ed2
AD
9939 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9940 %printer calls to use cdebug_ when using lalr1.cc.
9941
417141dd
AD
99422004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9943
9944 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9945 with #ifdef YYDEBUG.
9946
2fa09258
AD
99472004-08-26 Akim Demaille <akim@epita.fr>
9948
9949 * doc/bison.texinfo (Implementing Loops): Rename as...
9950 (Implementing Gotos/Loops): this.
9951
9378b508
PE
99522004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9953
9954 Adjust to latest gnulib.
9955 * bootstrap (gnulib_modules): Add xalloc-die.
9956 Set LC_ALL=C so that file names sort consistently.
9957 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9958 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9959 uintmax_t.m4, ulonglong.m4.
9960 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9961 po.m4 since we are now using _gl.m4 instead.
9962
87a8ad5c
PE
99632004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9964
9965 * src/scan-action.l: Remove. Scanning of semantic actions is
9966 handled in scan-gram.l.
9967
dca81a78
PE
99682004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9969
9970 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9971
9972 * src/location.h (struct): The file member is a uniqstr.
9973 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9974
c9cbf7c5
PE
99752004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9976
9977 Fix bug with non-%union parsers that have printers or destructors,
9978 which led to a Bison core dump. Reported by Peter Fales in
9979 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 9980
c9cbf7c5
PE
9981 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9982 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9983 not to our own type.
9984 * src/output.c (symbol_destructors_output, symbol_printers_output):
9985 Don't assume %union.
9986 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
9987 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
9988 UNION-FLAG. All callers changed.
9989 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
9990 Use type char, not unsigned int, when declaring an array of char;
9991 this lets us remove a cast.
9992 (Printers and Destructors): Add non-%union test cases.
9993
fa7e68c3
PE
99942004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9995
9996 * doc/bison.texinfo: Minor editorial changes, mostly to the new
9997 GLR writeups. E.g., avoid frenchspacing and the future tense,
9998 change "lookahead" to "look-ahead", and change "wrt" to "with
9999 respect to".
2fa09258 10000
fa7e68c3
PE
100012004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10002
10003 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10004 New sections, split off from the GLR Parsers section. Put the new
10005 Simple GLR Parser near the start of the GLR section, for clarity.
10006 Rewrite connective text.
10007
99a9344e
PE
100082004-06-21 Frank Heckenbach <frank@g-n-u.de>
10009
10010 * doc/bison.texinfo (Simple GLR Parsers): New section.
10011
8dd162d3
PE
100122004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10013
10014 * NEWS, TODO, doc/bison.texinfo:
10015 Use "look-ahead" instead of "lookahead", to be consistent.
10016 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10017 while we're fixing "look-ahead".
10018 * src/conflicts.c (shift_set): Renamed from shiftset.
10019 (look_ahead_set): Renamed from lookaheadset.
10020 * src/print.c: Likewise.
10021 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10022 name for "lookahead".
10023 (report_types, usage): Likewise.
10024 * src/getargs.h (report_look_ahead_tokens): Renamed from
10025 report_lookaheads.
10026 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10027 compute_lookaheads.
10028 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10029 (look_ahead_tokens_print): Renamed from lookaheads_print.
10030 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10031 state_rule_lookaheads_print.
10032 * src/state.h: Likewise.
10033 (reductions.look_ahead_tokens): Renamed from lookaheads.
10034 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10035 AT_DATA_LOOKAHEADS_GRAMMAR.
10036
57a90331
PE
100372004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10038
10039 * README: Update location of patched M4 distribution.
10040
8ed3234a
PE
100412004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10042
10043 Don't assume the C++ compiler takes the same arguments as the C compiler
10044 (trivial change).
10045 * configure.ac (O0CXXFLAGS): New var.
10046 * tests/atlocal.in (CXXFLAGS): Use it.
10047
07971983
PE
100482004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10049
10050 Fix some "make check" problems with C++ reported by
10051 Albert Chin-A-Young for Tru64 C++ in this thread:
10052 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10053
10054 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10055 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10056 Output to a .cc file for C++, not to a .c file.
10057 * tests/calc.at (AT_CHECK_CALC): Likewise.
10058 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10059 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10060
29058652
PE
100612004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10062
10063 * tests/calc.at, tests/actions.at: Workaround for SGI
10064 C++ compiler. (trivial change)
10065
62cb8a99
PE
100662004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10067
fd418816
PE
10068 Spent a few hours checking out which prerequisite versions the
10069 current sources actually require. I went all the way back to
10070 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10071 a seemingly endless set of combinations of versions more recent
10072 than that. The bottom line is that the current sources require
10073 fairly recent versions of the build tools, and it'll be some work
10074 to change this.
10075 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10076 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10077 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10078 Add comments explaining why those particular versions are
10079 currently needed.
2fa09258 10080
62cb8a99
PE
10081 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10082 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 10083 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
10084
10085 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10086 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10087
caa52c10
PE
100882004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10089
10090 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10091 0.11.5. Suggested by Bruno Haible.
10092 * bootstrap: Remove gettext version checking.
10093
10094 * doc/bison.texinfo (Decl Summary): Also mention that %union
10095 can depend on prerequisite types. Problem reported by Tim
10096 Van Holder.
10097
4bfd5e4e
PE
100982004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10099
2cef3017
PE
10100 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10101 * README-alpha: Don't tell people not to package this.
10102
b9c85d5c
PE
10103 * bootstrap: Don't assume $(...) works; use `...` instead.
10104 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10105 gettext better.
10106
4bfd5e4e
PE
10107 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10108 put into the -d output file, and mention what to do if YYSTYPE is
10109 defined as a macro.
10110
6a36ff94
PE
101112004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10112
6712933e
PE
10113 Undo change made earlier today: it caused autopoint to not bring
10114 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10115 autopoint's.
10116
10117 * bootstrap: Check that gettext version matches what's in
10118 configure.ac. Warn users to ignore robots.txt ERROR 404.
10119 * bootstrap: Undo today's earlier change (logged below).
10120 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 10121
6a36ff94
PE
10122 The gettext version checking is causing more trouble than it's
10123 curing; remove it. Problem reported by Paul Hilfinger.
10124
10125 * bootstrap: Issue a warning that one can expect a message
10126 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10127 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10128
209ea708
PE
101292004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10130
10131 Ensure that the C++ compiler used for testing actually works on a
10132 simple test program; if not, skip the C++-related tests. Problem
10133 reported by Vin Shelton in:
161a71f3 10134 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
10135
10136 * m4/cxx.m4: New file.
10137 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10138 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10139 * tests/local.at (AT_COMPILE_CXX): Use it.
10140
41ca2549
PE
101412004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10142
383e69dc
PE
10143 * data/glr.c (yylloc): Output this macro even if locations are not
10144 being generated, as the GLR parser needs it even in that case.
10145 Problem reported by Troy A. Johnson
10146 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10147
41ca2549
PE
10148 * configure.ac (AC_INIT): Update to 1.875e.
10149
e476c87d
PE
101502004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10151
10152 * NEWS: Version 1.875d.
10153 * configure.ac (AC_INIT): Likewise.
10154 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10155
10156 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10157 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10158 lalr1.cc runs afoul of the first, and the last two are no longer
10159 supported by GCC 3.4.0.
10160 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10161 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10162
233a88ad
PE
101632004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10164
10165 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10166 unsigned int, for compatibility with latest gnulib hash module.
10167 * src/state.c (state_hash, state_hasher): Likewise.
10168 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10169 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 10170
12ffdd28
PE
101712004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10172
10173 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10174
10175 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10176 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10177 character and string literals.
10178 (unexpected_end): New function.
10179 (unexpected_eof): Use it.
10180 (unexpected_newline): New function.
10181 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10182 actions.
e476c87d 10183
12ffdd28
PE
10184 * NEWS: Document %expect-rr.
10185
10186 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10187 Fix typo by replacing $1 with $option.
10188 Remove more 'intl'-related files.
9668e2be 10189 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
10190
10191 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10192 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10193 strtoul.c.
10194 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10195 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10196 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10197 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10198 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10199 * src/.cvsignore: Add *.output.
10200
10201 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10202 gets copied to the output file.
e476c87d 10203
1f65350a
PE
102042004-04-28 Paul Eggert <eggert@twinsun.com>
10205
10206 Get files from the gnulib and po repositories, instead of relying
10207 on them being in our CVS. Upgrade to latest versions of gnulib
10208 and Automake.
10209
10210 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10211 * bootstrap: Bootstrap from gnulib and po repositories.
10212 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10213 * README-cvs: Document these changes. Remove version numbers from
10214 mentions of build tools, since they change so often. Mention Flex.
10215
10216 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10217 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
10218 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10219 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 10220 does this for us.
12ffdd28
PE
10221 (AC_ISC_POSIX): Remove; we no longer support this
10222 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
10223 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10224 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10225 Do not check for C89 headers, except for locale.h which is used
10226 by the Yacc library and must port to K&R hosts.
10227 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10228 Do not check for C89 functions, except for setlocale which is
10229 used by the Yacc library.
10230 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10231 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10232 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10233 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10234 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10235 AM_GNU_GETTEXT): Remove; now done by:
10236 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10237 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10238 for us.
10239
10240 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10241 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10242 Define to empty, as gnulib.mk will do the rest for us.
10243 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10244 for us.
10245 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10246 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10247
10248 * src/files.c: Include gnulib's xstrndup.h.
10249
10250 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10251 (REALLOC): Use xnrealloc, for likewise.
10252 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10253 (strnlen, memrchr): Remove decls; functions no longer used.
10254 Include <stpcpy.h>.
10255
10256 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10257 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10258 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10259 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10260 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10261 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10262 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10263 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10264 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10265 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10266 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10267 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10268 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10269 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10270 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10271 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10272 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10273 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10274 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10275 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10276 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10277 Remove, as these files are now generated automatically
10278 by bootstrap or automake.
10279
10280 * po/ChangeLog: Remove: all but one entry was a duplicate
10281 of this file, and I moved that 2000-11-02 entry here.
10282
10283 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10284 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10285 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10286 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10287 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10288 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10289 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10290 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10291 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10292 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10293 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10294 xstrndup.h.
10295 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10296 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10297 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10298 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10299 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10300 * src/.cvsignore: Remove *_.c.
10301
10302
10303 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10304 support it. (The latest stable gzip doesn't.)
10305
103062004-04-27 Paul Eggert <eggert@twinsun.com>
10307
10308 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10309 case, as stos_ is now used by destructors due to the 2004-02-09
10310 change.
10311
10312 Remove more K&R C support.
10313 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10314 * lib/subpipe.c (errno): Remove decl.
10315 Include <stdlib.h> unconditionally.
10316 (EXIT_FAILURE): Remove macro.
10317 * src/complain.c (vfprintf, strerror): Remove.
10318 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10319 unconditionally.
10320 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10321 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10322 (strchr, strspn, memchr): Remove decls.
10323 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10324 unconditionally. Do not declare perror.
10325 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10326 unconditionally.
10327
10328 * src/complain.c (_): Remove useless defn, as system.h defines this.
10329
10330 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10331 with latest obstack.h.
10332 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10333 to procedure types, as obstack.h now does that for us.
10334 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10335
10336 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10337 so that this include file can stand alone.
10338 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10339 does this now. Include subpipe.h first after config.h, to
10340 test whether it can stand alone.
10341
10342 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10343 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10344 unused declaration.
10345
10346 * tests/synclines.at (%union synch line): Put a dummy member in
10347 the union, because empty unions aren't allowed in C. Caught
10348 by GCC 3.4.0.
10349
4f16766c
PE
103502004-04-13 Jim Meyering <jim@meyering.net>
10351
10352 * src/conflicts.c (conflicts_print): Correct format string typo:
10353 use `%%' to produce literal `%'. (trivial change)
10354
779e7ceb
PE
103552004-03-30 Paul Eggert <eggert@twinsun.com>
10356
10357 * src/getargs.c (version): Update copyright year to 2004.
10358
10359 * data/c.m4 (b4_int_type): Use 'short int' rather than
10360 'short', and similarly for 'long', 'unsigned', etc.
10361 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10362 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10363 yy_yypstack, yydumpstack): Likewise.
10364 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10365 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10366 Likewise.
10367 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10368 yy_stack_print, yyparse): Likewise.
10369 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10370 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10371 * lib/bitset.c (bitset_print): Likewise.
10372 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10373 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10374 * lib/bitsetv.c (bitsetv_dump): Likewise.
10375 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10376 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10377 Likewise.
10378 * src/LR0.c (allocate_itemsets): Likewise.
10379 * src/gram.h (rule_number, rule): Likewise.
10380 * src/lalr.h (goto_number): Likewise.
10381 * src/nullable.c (nullable_compute): Likewise.
10382 * src/output.c (prepare_rules): Likewise.
10383 * src/relation.c (relation_print, relation_digraph): Likewise.
10384 * src/relation.h (relation_node): Likewise.
10385 * src/state.h (state_number, transitions, errs, reductions,
10386 struct state): Likewise.
10387 * src/symtab.h (symbol_number, struct symbol): Likewise.
10388 * src/tables.c (vector_number, tally, action_number,
10389 default_goto, goto_actions): Likewise.
10390 * tests/existing.at (GNU Cim Grammar): Likewise.
10391 * tests/regression.at (Web2c Actions): Likewise.
10392
10393 * src/output.c (muscle_insert_short_int_table): Renamed from
10394 muscle_insert_short_table. All uses changed.
10395
d6328241
PH
103962004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10397
10398 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10399 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10400 Add %expect-rr rule.
4f16766c 10401
d6328241
PH
10402 * src/scan-gram.l: Recognize %expect-rr.
10403
4f16766c 10404 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 10405 expected_conflicts.
4f16766c 10406 (expected_rr_conflicts): Declare.
d6328241
PH
10407
10408 * src/conflicts.c (expected_sr_conflicts): Rename from
10409 expected_conflicts.
10410 (expected_rr_conflicts): Define.
10411 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10412 for GLR parsers.
10413 Use expected_sr_conflicts in place of expected_conflicts.
10414 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 10415
d6328241 10416 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 10417
1452af69
PE
104182004-03-08 Paul Eggert <eggert@gnu.org>
10419
10420 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 10421 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
10422
10423 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10424 in lalr1.cc.
10425 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10426 * src/scan-gram.l (scan_integer): New function.
10427 ({int}): Use it.
10428 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10429 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10430 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10431 Say "long int", not "long", for uniformity with GNU style.
10432
006d217d
PE
104332004-02-25 Paul Eggert <eggert@twinsun.com>
10434
10435 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10436 compilers. This fixes a problem with Intel's C++ compiler being
10437 chatty, reported by Guido Trentalancia in
161a71f3 10438 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 10439
c2729758
ADL
104402004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10441
10442 Support %destructor and merge error locations in lalr1.cc.
10443
10444 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10445 (Parser::stos_): Define unconditionally.
10446 (Parser::destruct_): New method. Generate its body with
10447 b4_yydestruct_generate.
10448 (Parser::error_start_): New attribute.
10449 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10450 token which are discarded.
10451 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10452 error_start_ when erroneous token are discarded.
10453 (Parser::parse) <yyerrlab1>: Compute the location of the error
10454 token so that it covers all the discarded tokens.
10455 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10456 it can be called with `%skeleton "lalr1.cc"', and do that.
10457
dd0e0635
PE
104582004-02-02 Paul Eggert <eggert@twinsun.com>
10459
10460 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10461 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10462 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10463 There's no need to mention top_builddir since Automake does that
10464 for us.
10465 (INCLUDES): Remove, as Automake says it's obsolescent.
10466 Contents migrated into AM_CPPFLAGS as described above.
10467 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10468
104692004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10470
10471 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10472 (yyreportSyntaxError): Handle case where lookahead token is
10473 YYEMPTY.
10474
be16239b
PH
104752004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10476
10477 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10478 resulting parsers are compilable with C++.
10479
5fa90832
PE
104802003-12-23 Paul Eggert <eggert@twinsun.com>
10481
10482 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10483 * src/output.c (output_skeleton): Rename local var.
10484 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10485 Bison tokens, as this runs afoul of the 2003-10-07 change that
10486 disallowed NUL bytes in character constants or string literals.
10487
10488 * tests/local.at: Require Autoconf 2.59's Autotest.
10489 * tests/testsuite.at: Don't include local.at, since we now assume
10490 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10491 including it.
10492 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10493 multiple inclusion warnings.
dd0e0635 10494
b165c324
AD
104952003-12-02 Akim Demaille <akim@epita.fr>
10496
10497 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10498 conditions.
10499 From Bruno Haible.
10500
26e06a21
ADL
105012003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10502
10503 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10504
92ac3705
PE
105052003-10-07 Paul Eggert <eggert@twinsun.com>
10506
6a5ecb38
PE
10507 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10508 if testsuite doesn't exist.
10509
92ac3705
PE
10510 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10511 literals, unfortunately.
10512 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10513 Complain about NUL bytes in character constants or string literals.
10514
91d2c560
PE
105152003-10-05 Paul Eggert <eggert@twinsun.com>
10516
10517 * NEWS: Don't document %no-default-prec, as it's still
10518 too experimental.
10519 * doc/bison.texinfo: Document %no-default-prec only if
10520 the defaultprec flag is set. Normally it's not.
10521
0cc3da3a
PE
105222003-10-04 Paul Eggert <eggert@twinsun.com>
10523
10524 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10525 non-modifiable lvalue, instead of a modifiable one.
10526 * doc/bison.texinfo (Actions): Document that $$ can
10527 be assigned to. Do not claim that $$ and $N are
10528 array element references: user code should not rely on this.
10529
22fccf95
PE
105302003-10-01 Paul Eggert <eggert@twinsun.com>
10531
10532 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10533 (grammar_declaration): Use it.
10534 * src/scan-gram.l: New token %no-default-prec.
10535 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10536 * NEWS, doc/bison.texinfo: Document the above.
10537
fc8f2965
AD
105382003-10-01 Akim Demaille <akim@epita.fr>
10539
10540 VCG no longer supports long_straight_phase.
10541
10542 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10543 * src/print_graph.c (print_graph): Adjust.
10544
39a06c25
PE
105452003-09-30 Frank Heckenbach <frank@g-n-u.de>
10546 and Paul Eggert <eggert@twinsun.com>
10547
10548 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10549 Table of Symbols): Document %default-prec.
10550 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10551 (grammar_declaration): Set default_prec on %default-prec.
10552 * src/scan-gram.l (%default-prec): New token.
10553 * src/reader.h (default_prec): New flag.
10554 * src/reader.c: Likewise.
10555 (packgram): Handle it.
10556 * tests/conflicts.at (%default-prec without %prec,
10557 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 10558
39a06c25
PE
105592003-09-30 Paul Eggert <eggert@twinsun.com>
10560
10561 * tests/testsuite.at: Include local.at, not input.at, fixing
10562 a typo in the 2003-08-25 patch.
10563
62b6aef9
AD
105642003-08-27 Akim Demaille <akim@epita.fr>
10565
10566 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10567 GCC warnings.
10568
89e1cc61
AD
105692003-08-26 Akim Demaille <akim@epita.fr>
10570
10571 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10572 "<\#" to avoid magic from Gnus when posting parts of this script.
10573
a08460b0
AD
105742003-08-26 Akim Demaille <akim@epita.fr>
10575
10576 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10577 (Parser::parse): here.
10578 Adjust: nerrs and errstatus is now replaced by...
10579 (Parser::nerrs_, Parser::errstatus_): New.
10580
603f1cfd
AD
105812003-08-25 Akim Demaille <akim@epita.fr>
10582
10583 * config/announce-gen, Makefile.cfg: New.
10584 * Makefile.am: Adjust.
10585 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10586 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10587
cd3684cf
AD
105882003-08-25 Akim Demaille <akim@epita.fr>
10589
10590 When reducing initial empty rules, Bison parser read an initial
10591 location that is not defined. This results in garbage, and that
10592 affects Bison's own parser. Therefore we need (i) to extend Bison
10593 to support a means to initialize this location, and (ii) to use
10594 this CVS Bison to fix CVS Bison's parser.
10595
10596 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10597 with...
10598 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10599 * src/parse-gram.y: Adjust.
10600 (%initial-action): New.
10601 (%error-verbose): Since we require CVS Bison, there is no reason
10602 not to use it.
10603 * src/scan-gram.l: Adjust.
10604 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10605 * data/yacc.c (yyparse): Use b4_initial_action.
10606
4e03e201
AD
106072003-08-25 Akim Demaille <akim@epita.fr>
10608
10609 * doc/bison.texinfo: Don't promote stdout for error messages.
10610
8c182d05
AD
106112003-08-25 Akim Demaille <akim@epita.fr>
10612
10613 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10614 From Alexandre Duret-Lutz.
10615
6a60c4cf
PE
106162003-08-25 Akim Demaille <akim@epita.fr>
10617
10618 Version 1.875c.
10619
25f66e1a
AD
106202003-08-25 Akim Demaille <akim@epita.fr>
10621
10622 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10623 Use them.
10624
5348bfbe
AD
106252003-08-25 Akim Demaille <akim@epita.fr>
10626
10627 * data/lalr1.cc (Parser::reduce_print_): New.
10628 Use it.
10629
47301314
AD
106302003-08-25 Akim Demaille <akim@epita.fr>
10631
10632 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10633 error recovery loops. This patch is based on
161a71f3 10634 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
10635 Also, augment the similarity between lalr1.cc and yacc.c.
10636 Note: the locations of error recovery rules are not correct yet.
10637
10638 * data/lalr1.cc: Comment changes to augment the similarity between
10639 lalr1.cc and yacc.c.
10640 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10641 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10642 yyerrlab), when hitting EOF, pop the whole stack here instead of
10643 merely falling thru the default error handling mechanism.
10644 (yyerrorlab): New label, with the old contents of YYERROR,
10645 plus the following change: pop the stack of rhs corresponding
10646 to the production that invoked YYERROR. That is how Yacc
10647 behaves (required by POSIX).
10648 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10649 fail.
10650
1f7a61ff
AD
106512003-08-25 Akim Demaille <akim@epita.fr>
10652
10653 Tune local.at so that people can "autom4te -l autotest calc.at -o
10654 calc" for instance, to extract a sub test suite.
10655
10656 * tests/testsuite.at: Move the initialization, Autotest version
10657 requirement, and AT_TESTED invocation into...
10658 * tests/local.at: here.
10659 * tests/testsuite.at: Include it for compatibility with Autoconf
10660 2.57.
10661 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10662 be ignore.
10663
327b5b56
PE
106642003-08-04 Paul Eggert <eggert@twinsun.com>
10665
10666 Rework code slightly to avoid gcc -Wtraditional warnings.
10667 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10668 The returned value is now stored in *YY0. All callers changed.
10669 * src/output.c (merge_output): Adjust to the above change.
10670
0051e3ed
PE
106712003-07-26 Paul Eggert <eggert@twinsun.com>
10672
10673 * data/glr.c (YYASSERT): New macro.
10674 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10675 yyresolveStates, yyprocessOneStack):
10676 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10677 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 10678
137437c6
PE
106792003-07-25 Paul Eggert <eggert@twinsun.com>
10680
5b620e06
PE
10681 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10682 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 10683 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
10684 by Frank Heckenbach, though I have omitted the structure-initialization
10685 part of his glr-knr.diff patch since I recall that the Portable
10686 C Compiler didn't require that change.
10687
137437c6
PE
10688 Let the user specify how to allocate and free memory.
10689 Derived from a suggestion by Frank Heckenbach in
161a71f3 10690 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
10691 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10692 All uses of free, malloc, realloc changed to use these macros,
10693 and unnecessary casts removed.
10694 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10695
ddb85ca5
PE
106962003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10697
10698 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10699 use s.empty() rather than s == "" to test for empty string; see
161a71f3 10700 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
10701 (trivial change)
10702
39910e09
AD
107032003-06-25 Akim Demaille <akim@epita.fr>
10704
10705 * config/depcomp, config/install-sh: Update from masters.
10706
0ae99356
PE
107072003-06-20 Paul Eggert <eggert@twinsun.com>
10708
10709 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10710 and return properly parenthesized result.
10711 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10712 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10713 Remove unnecessary parentheses from uses.
10714 * doc/bison.texinfo (Location Default Action): Describe the
10715 conventions for parentheses.
10716
cd05d13c
PE
107172003-06-19 Paul Eggert <eggert@twinsun.com>
10718
81fd08ca
PE
10719 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10720 yyreportTree): Do not assume that size_t is the same width as int,
10721 when printing sizes. Print sizes using an unsigned format.
10722 Problem reported by Frank Heckenbach in
161a71f3 10723 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 10724
cd05d13c
PE
10725 Port to Forte Developer 7 C compiler.
10726 * data/glr.c (struct YYLTYPE): If locations are not being used,
10727 declare a single dummy member, as empty structs do not conform
10728 to the C standard.
10729 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10730 the Forte Developer 7 C compiler complains that end-of-loop
10731 code is not reached.
10732
4dcf140b
PE
107332003-06-17 Paul Eggert <eggert@twinsun.com>
10734
10735 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10736 avoid warnings from picky compilers about redefinition of PARAMS.
10737
8dd76bee
PE
107382003-06-17 Paul Eggert <eggert@twinsun.com>
10739
10740 Version 1.875b.
10741
10742 * NEWS: Document 1.875b.
10743
10744 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10745 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10746 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10747 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10748 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10749 per recent gettext manual's suggestion.
10750 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10751 Use prototypes, not old-style definitions.
10752 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10753 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10754 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10755 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10756 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10757 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10758 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10759 vbitset_or_and_cmp, vbitset_copy): Likewise.
10760
10761 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10762 Do not include <stdlib.h>.
10763 (PARAMS): Define unconditionally for C89.
10764 (ATTRIBUTE_NORETURN): Remove.
10765 (ATTRIBUTE_UNUSED): Define unconditionally.
10766
10767 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 10768 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
10769 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10770 * lib/vbitset.c, lib/vbitset.h: New files.
10771 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10772 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10773 from libbitset.
10774
10775 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10776 `How Can I Reset @code{yyparse}', since texinfo does not allow
10777 arbitrary @ in node names.
10778
10779 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10780 shouldn't be needed according to the gettext 0.12.1 documentation
10781 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 10782 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 10783 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 10784 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 10785
8dd76bee
PE
10786 * lib/.cvsignore: Add stdbool.h.
10787 * m4/.cvsignore: Add nls.m4, po.m4.
10788
10789 Upgrade to CVS gnulib.
10790 * stdbool_.h: File renamed from stdbool.h.in.
10791 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10792 AC_HEADER_STDBOOL.
10793 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10794 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10795 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10796 (MOSTLYCLEANFILES): New var.
10797 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10798 (stdbool.h): New rule.
10799 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10800 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10801 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10802 m4/quote.m4: Upgrade to today's gnulib.
10803
10804 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10805 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10806 the tests right now.
10807 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10808 yyerror are declared before use; C99 requires this.
10809
25005f6a
PH
108102003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10811
10812 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10813 first.
10814 (yyrecoverSyntaxError): Correct the logic for setting and testing
10815 yyerrState.
10816 Correct comment on handling EOF.
10817 Allow states with only a default reduction, rather than failing
8dd76bee 10818 (I can't quite reconstruct why these were not allowed before).
25005f6a 10819
137437c6 10820 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 10821 buffer overruns, corrupting state.
8dd76bee
PE
10822
10823 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
10824 definition.
10825 * src/reader.h (max_left_semantic_context): New variable declaration.
10826 * src/scan-gram.l (max_left_semantic_context): Define.
10827 (handle_action_dollar): Update max_left_semantic_context.
10828 * data/glr.c (YYMAXLEFT): New definition.
10829 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10830 (yyresolveAction): Ditto.
10831
10832 Fixes to problems with location handling in GLR parsers reported by
10833 Frank Heckenbach (2003/06/05).
10834
10835 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10836 (YYRHSLOC): Add parentheses, and define only if locations used.
10837 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10838 locations not used.
10839 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10840 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 10841
25005f6a
PH
10842 * tests/cxx-type.at: Exercise location information; update tests
10843 to differentiate output with and without locations.
8dd76bee 10844 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
10845 because default YYLTYPE not yet defined.
10846 Change semantic actions to compute strings, rather than printing
10847 them directly (to test proper passing of semantics values). Change
10848 output to prefix notation and update test data and expected results.
10849 (yylex): Track locations.
10850 (stmtMerge): Return value rather than printing, and include arguments
10851 in value.
8dd76bee 10852
711f40b7
PE
108532003-06-03 Paul Eggert <eggert@twinsun.com>
10854
10855 Avoid warnings generated by GCC 2.95.4 when Bison is
10856 configured with --enable-gcc-warnings.
10857 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10858 yy::]b4_parser_class_name[::translate_,
10859 yy::Stack::operator[] (unsigned),
10860 yy::Stack::operator[] (unsigned) const,
10861 yy::Slice::operator[] (unsigned),
10862 yy::Slice::operator[] (unsigned) const):
10863 Rename local vars to avoid warnings.
10864 * tests/glr-regression.at (Improper handling of embedded actions
10865 and $-N in GLR parsers): Remove unused local variable from yylex.
10866 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10867 (void) as arg when not pure, since we now assume C89 when building
10868 Bison. Pacify GCC by using parameter.
10869
ac695f7d
PE
108702003-06-02 Paul Eggert <eggert@twinsun.com>
10871
10872 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10873 yy::Location::lines, yy::Location::columns): Rename arguments
10874 to avoid shadowing; this removes a warning generated by GCC 3.3.
10875
26ec81e0
PE
108762003-06-01 Paul Eggert <eggert@twinsun.com>
10877
10878 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10879 to g++, as GCC 3.3 complains if you do it.
10880 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10881 everything that WARNING_CFLAGS has, except omit warnings
10882 not suitable for C++.
10883 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10884 * tests/atlocal.in (CXXFLAGS): New var.
10885 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10886
10887 Fix a GLR parser bug I reported in February; see
161a71f3 10888 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
10889 The problem was that GLR parsers did not conform to the C standard,
10890 because actions like { $1 = $2 + $3; } expanded to expressions
10891 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10892 to a local variable. The C standard says that expressions
10893 like (var = f ()) + (var = f ()) have undefined behavior.
10894 Another problem was that GCC sometimes issues warnings that
10895 yyfill and its parameters are unused.
10896
10897 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10898 as possibly unused.
10899 (yyfill): New function.
10900 (YYFILL): Use it.
10901 (yyuserAction): Change type of yynormal to bool, so that it matches
10902 the new yyfill signature. Mark it as possibly unused.
10903
10904
10905 Follow up on a bug I reported in February, where a Bison-generated
10906 parser can loop. Provide a test case and a fix for yacc.c. I
10907 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10908 The original bug report is in:
161a71f3 10909 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
10910
10911 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10912 macro's size was becoming unwieldy.
10913 (yyerrlab): Do not discard an empty lookahead symbol, as this
10914 might destroy garbage.
10915 (yyerrorlab): New label, with the old contents of YYERROR,
10916 plus the following change: pop the stack of rhs corresponding
10917 to the production that invoked YYERROR. That is how Yacc
10918 behaves, and POSIX requires this behavior.
10919 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10920 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10921 Define 'alarm' to do nothing if unistd.h is not available.
10922 Add a new rule "exp: '-' error;" to test the above change to
10923 data/yacc.c. Use 'alarm' to abort any test taking longer than
10924 10 seconds, as it's probably looping.
10925 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10926 Also, the new yacc.c generates two fewer diagnostics for an
10927 existing test.
10928
d0829076
PE
109292003-05-24 Paul Eggert <eggert@twinsun.com>
10930
c6ae27df
PE
10931 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10932 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10933 This fixes a problem reported by John Bowman when the Compaq/HP
10934 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10935 -ansi -Wall -gall).
10936 * data/yacc.c (union yyalloc): Likewise.
10937 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 10938
d0829076
PE
10939 Switch from 'int' to 'bool' where that makes sense.
10940
10941 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10942 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10943 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10944 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10945 Return or accept bool, not int. All callers changed.
10946 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10947 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10948 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10949 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10950 bitset_or_and_cmp_): Likewise.
10951 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10952 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10953 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10954 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10955 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10956 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10957 bitset_stats_or_and_cmp): Likewise.
10958 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10959 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10960 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10961 ebitset_xor_cmp): Likewise.
10962 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10963 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10964 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10965 lbitset_xor_cmp): Likewise.
10966 * lib/bbitset.h: Include <stdbool.h>.
10967 (struct bitset_vtable): The following members now return bool, not
10968 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10969 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10970 or_and_cmp).
10971 * src/conflicts.c (count_rr_conflicts): Likewise.
10972 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10973 All uses changed.
10974 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10975 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10976 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10977 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10978 graph_flag): Likewise.
10979 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10980 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10981 graph_flag): Likewise.
10982 * src/output.c (error_verbose): Likewise.
10983 * src/output.h (error_verbose): Likewise.
10984 * src/reader.c (start_flag, typed): Likewise.
10985 * src/reader.h (typed): Likewise.
10986 * src/getargs.c (LOCATIONS_OPTION): New constant.
10987 (long_options, getargs): Use it.
10988 * src/lalr.c (build_relations): Use bool, not int.
10989 * src/nullable.c (nullable_compute): Likewise.
10990 * src/print.c (print_reductions): Likewise.
10991 * src/tables.c (action_row, pack_vector): Likewise.
10992 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
10993 * src/output.c (prepare): Use it.
10994 * src/output.c (token_definitions_output,
10995 symbol_destructors_output, symbol_destructors_output): Use string,
10996 not boolean integer, to keep track of whether to output separator.
10997 * src/print_graph.c (print_core): Likewise.
10998 * src/state.c (state_rule_lookaheads_print): Likewise.
10999
11000 * config/install-sh: Sync from automake 1.7.5.
11001
6b2584b7
PE
110022003-05-14 Paul Eggert <eggert@twinsun.com>
11003
11004 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11005 semicolon after a grammar declaration, in the interest of possible
11006 future changes to the Bison input language.
11007 Do not allow a stray semicolon at the start of the grammar.
11008 (rhses.1): Allow one or more semicolons after any rule, including
11009 just before "|" as required by POSIX.
11010 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11011 grammar.
11012
caf37a36
ADL
110132003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11014
11015 %parse-param support for lalr1.cc.
11016
11017 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11018 b4_cc_constructor_calls, b4_cc_constructor_call,
11019 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11020 definitions.
11021 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11022 parse-param arguments.
11023 (yy::b4_parser_class_name): Declare instance variables to
11024 hold parse-param arguments.
11025 * tests/calc.at: s/value/semantic_value/ because value clashes
11026 with a member of yy::b4_parser_class_name. Adjust C++ code
11027 to handle %parse-param. Enable %parse-param test in C++.
11028
3ab37077
PE
110292003-05-12 Paul Eggert <eggert@twinsun.com>
11030
11031 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11032 English a bit. Fix fclose typo. Change "const char" to "char
11033 const", and use ANSI C rather than K&R for "main". Suggest
11034 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11035 and suggest yy_switch_to_buffer.
11036
110372003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
11038
11039 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11040 C89. This avoids a diagnostic on compilers that define __STDC__
11041 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 11042 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 11043
e743727f
PE
110442003-05-03 Paul Eggert <eggert@twinsun.com>
11045
11046 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11047 Do not overrun array bounds.
11048 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 11049 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 11050
916708d5
AD
110512003-04-29 Akim Demaille <akim@epita.fr>
11052
11053 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11054 * src/getargs.c, src/getargs.h: here, as bool, not int.
11055 (nondeterministic_parser): New.
11056 * src/parse-gram.y, src/scan-gram.l: Support
11057 %nondeterministic-parser.
11058 * src/output.c (prepare): Use nondeterministic_parser instead
11059 of glr_parser where appropriate.
11060 * src/tables.c (conflict_row, action_row, save_row)
11061 (token_actions, token_actions, pack_vector): Ditto.
11062
a06ea4aa
AD
110632003-04-29 Akim Demaille <akim@epita.fr>
11064
11065 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11066
211074ca
AD
110672003-04-29 Akim Demaille <akim@epita.fr>
11068
11069 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11070 with %pure-parser and %locations to exercise the patch from Yakov
11071 Markovitch below.
11072
6175ffe3
PE
110732003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11074
11075 * data/yacc.c: (b4_lex_param): Corrected for the case where
11076 %lex-param is provided and %pure-parser isn't.
11077
b1e95857
PE
110782003-04-27 Paul Eggert <eggert@twinsun.com>
11079
11080 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 11081 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
11082 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11083 if it is not defined.
11084 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11085
acda9df6
PE
110862003-04-26 Paul Eggert <eggert@twinsun.com>
11087
3470c57b
PE
11088 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11089 Declare to be of type suitable for the ninf value itself, not of
11090 type suitable for the corresponding table, since the latter might
11091 be unsigned but the ninf value might be negative. This fixes a
11092 bug reported by Alexandre Duret-Lutz in
161a71f3 11093 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 11094
acda9df6
PE
11095 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11096 invokes it. We shouldn't invoke it twice because it will attempt
11097 to put error.o in the archive twice. This fixes a glitch reported
11098 by Martin Mokrejs in
161a71f3 11099 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 11100
b5250f26
PE
111012003-04-21 Paul Eggert <eggert@twinsun.com>
11102
11103 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11104 to gnulib.
11105
089ac0f1
PE
111062003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11107
11108 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11109 Fix obvious typo that results in uncompilable GLR parsers
11110 when both %pure-parser and %locations are used. (trivial change)
11111
5ededac6
PE
111122003-04-17 Paul Eggert <eggert@twinsun.com>
11113
1b8f2fff
PE
11114 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11115 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11116 Do not insert the expected token via unput, as this runs afoul
11117 of a POSIX-compatibility bug in flex 2.5.31.
11118 All uses changed to BEGIN the parent state,
11119 since we no longer insert the expected token via unput.
11120 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11121 that is no longer emitted after the above change.
11122
5ededac6
PE
11123 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11124 the first one. This change is from Paul Hilfinger, and it fixes
11125 regression reported by Werner Lemberg in
161a71f3 11126 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
11127
11128 (resolve_sr_conflict): Don't invoke state_errs_set
11129 unless one or more tokens have been explicitly made errors.
11130 Otherwise, the above change causes Bison to abort.
11131
11132 * tests/existing.at (GNU pic Grammar): New test case, taken from
11133 Lemberg's email.
11134
b8be9132
AD
111352003-03-31 Akim Demaille <akim@epita.fr>
11136
11137 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11138
d423d460
AD
111392003-03-31 Akim Demaille <akim@epita.fr>
11140
11141 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11142 output.
11143
c7e441b4
AD
111442003-03-31 Akim Demaille <akim@epita.fr>
11145
11146 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11147 From Paul Hilfinger.
11148
231897ad
AD
111492003-03-29 Akim Demaille <akim@epita.fr>
11150
11151 * m4/error.m4: Do not put under dynamic conditions some code which
11152 expansion is under static control.
11153
5b066063
AD
111542003-03-29 Akim Demaille <akim@epita.fr>
11155
11156 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11157
22a74fec
AD
111582003-03-29 Akim Demaille <akim@epita.fr>
11159
11160 * doc/bison.texinfo (Strings are Destroyed): New.
11161
0eee27e7
PE
111622003-03-13 Paul Eggert <eggert@twinsun.com>
11163
11164 * .cvsignore: Add configure.lineno.
11165 * src/.cvsignore: Add yacc.
11166 * tests/.cvsignore: Add testsuite.log.
11167 * doc/fdl.texi: Sync with latest FSF version.
11168
f61aad93
PE
111692003-03-12 Paul Eggert <eggert@twinsun.com>
11170
537636c7
PE
11171 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11172 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11173 cursor, instead of leaving it undefined. This fixes a bug
11174 reported by Tim Van Holder in
161a71f3 11175 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
11176 * tests/input.at (Torturing the Scanner): Test the scanner on
11177 an empty input file, which was Tim Van Holder's test case.
11178
11179 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11180 <sys/resource.h> can be included, include sys/time.h and
11181 sys/times.h first, if available. This works around the SunOS
11182 4.1.4 porting bug reported by Bruce Becker in
161a71f3 11183 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
11184
11185 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11186 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11187 AC_HEADER_SYS_WAIT.
11188
f61aad93
PE
11189 Merge changes from gnulib. This was prompted because the CVS
11190 snapshot didn't build on Solaris 7 due to strnlen problems.
11191
11192 These changes need to be merged back into gnulib:
11193 * lib/hash.c: Include <stdbool.h> unconditionally.
11194 * m4/onceonly.m4 (m4_quote): New macro.
11195 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11196 Quote AC_FOREACH variable-expansions properly.
11197 The 2003-01-03 obstack.h change also needs merging.
11198 {end of changes requiring merging}
5b066063 11199
f61aad93
PE
11200 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11201 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11202 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11203 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11204 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11205 New files, imported from gnulib.
11206 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11207 above.
11208
11209 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11210 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11211 gnulib sources.
11212
11213 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11214 Add.
11215 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11216 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11217 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11218 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11219 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11220 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11221 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11222 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11223 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11224 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11225 (jm_PREREQ_ARGMATCH): Remove.
11226 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11227 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11228
11229 * src/system.h: Include <stdbool.h> unconditionally.
11230
11231 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11232 assuming at least C89 in the bitset code for some time now.
11233
d2ffe116
AD
112342003-03-03 Akim Demaille <akim@epita.fr>
11235
11236 * ro.po: New.
11237
052826fd
AD
112382003-03-02 Akim Demaille <akim@epita.fr>
11239
11240 * doc/bison.texinfo (Table of Symbols): Reactivate the
11241 documentation for %lex-param, and %parse-param.
11242
c4749565
AD
112432003-03-02 Akim Demaille <akim@epita.fr>
11244
11245 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11246 generate verbose error messages.
11247 Use the number of tokens as an upper bound in yytname, as it
11248 cannot be a non terminal.
11249
d5286af1
AD
112502003-03-02 Akim Demaille <akim@epita.fr>
11251
11252 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11253 message.
11254
22e304a6
AD
112552003-03-02 Akim Demaille <akim@epita.fr>
11256
22e304a6
AD
11257 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11258 Use them to exercise yycheck overrun.
11259 Based on Andrew Suffield's grammar.
11260
67a25fed
AD
112612003-03-02 Akim Demaille <akim@epita.fr>
11262
11263 Create tests/local.at for Bison generic testing macros.
11264
11265 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11266 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11267 This new file.
11268 * tests/calc.at (AT_CHECK_CALC): Adjust.
11269 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11270 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11271 * tests/local.at: here.
11272 (AT_COMPILE_CXX): Tags the tests using it as c++.
11273 Ignore the test if CXX is not functional.
11274
9c2b381f
PE
112752003-03-01 Paul Eggert <eggert@twinsun.com>
11276
11277 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11278 not loc->end, since loc->end might contain garbage and this leads
11279 to undefined behavior on some platforms.
11280 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11281 depend on *loc, so that the reader doesn't give the the false
11282 impression that *loc is initialized.
11283 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11284 does not survive the return.
11285
0433ba88
AD
112862003-03-01 Akim Demaille <akim@epita.fr>
11287
11288 * src/scan-gram.l (code_start): Always initialize it when entering
11289 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11290 yylex invocation. An alternative would be making it static, but
11291 then it starts with the second %%'s beginning, instead of its end.
11292
b305ea69
PE
112932003-02-28 Paul Eggert <eggert@twinsun.com>
11294
11295 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11296 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 11297 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 11298
c3d25e01
PE
112992003-02-26 Paul Eggert <eggert@twinsun.com>
11300
11301 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11302 Remove Sequent/Pyramid discussion (nobody uses them any more).
11303 Merge VMS and MS-DOS discussion; these ports may well be dead
11304 but let's keep mentioning them for now. Put <> around email
11305 addresses. Add copyright notice.
11306
c267ffbc
PE
113072003-02-24 Paul Eggert <eggert@twinsun.com>
11308
11309 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11310 to avoid collision with flex use of yylineno.
11311 Problem reported by Bruce Lilly in
161a71f3 11312 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
11313 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11314 * data/yacc.c (yy_reduce_print): Likewise.
11315
11316 * config/depcomp: Sync with Automake 1.7.3.
11317
f939fc12
AD
113182003-02-21 Akim Demaille <akim@epita.fr>
11319
11320 * data/lalr1.cc: Use temporary variables instead of casts to
11321 change integer types.
11322 Suggested by Paul Eggert.
11323
95923bd6
AD
113242003-02-21 Akim Demaille <akim@epita.fr>
11325
11326 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11327 to avoid confusions with lalr1.cc's notion of Position.
11328 Suggested by Paul Eggert.
11329
2cdc240e
AD
113302003-02-20 Akim Demaille <akim@epita.fr>
11331
11332 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11333 before initial_columns.
11334 (location.hh): Use consistent variable names when defining the
11335 operator<<.
11336 Use "last" so that we subtract from Positions, not from unsigned.
11337
5d003116
AD
113382003-02-20 Akim Demaille <akim@epita.fr>
11339
11340 * data/lalr1.cc (position.hh): New subfile, including the extended
11341 and Doxygen'ed documentation of class Position.
11342 (location.hh): Use it.
11343 Document a` la Doxygen.
ba1ecc07 11344 With the help of Benoit Perrot.
5d003116 11345
d02b25f9
AD
113462003-02-20 Akim Demaille <akim@epita.fr>
11347
11348 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11349 AT_YACC_IF.
11350 Redefine AT_YYERROR_SEES_LOC_IF using it.
11351 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11352 not defined.
11353 Don't use the location in yy::Parser::error_ and
11354 yy::Parser::print_ when not %locations.
11355 Activate more lalr1.cc tests.
11356
0d1c3a04
AD
113572003-02-19 Akim Demaille <akim@epita.fr>
11358
11359 * data/lalr1.cc: When displaying a line number, be sure to make it
11360 an int.
11361
60a777aa
AD
113622003-02-19 Akim Demaille <akim@epita.fr>
11363
11364 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11365 Remove, useless.
11366 (YYABORT, YYACCEPT, YYERROR): New.
11367 * tests/calc.at: Renable the lalr1.cc test.
11368
0b86fc41
AD
113692003-02-19 Akim Demaille <akim@epita.fr>
11370
11371 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11372 error recovery, mixing with/without pops and discarding of the
11373 lookahead.
11374 Exercise YYERROR.
11375 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11376
da99a5dc
PE
113772003-02-17 Paul Eggert <eggert@twinsun.com>
11378
11379 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11380 * tests/testsuite.at (AT_COMPILE): Use them.
11381 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 11382 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 11383
93b8c255
PE
113842003-02-12 Paul Eggert <eggert@twinsun.com>
11385
11386 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11387 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 11388 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
11389 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11390 Check for malloc failure, for consistency with yacc.c.
11391 (yytname_size): Remove, for consistency with yacc.c.
11392
11393 The bug still remains in data/lalr1.cc, as I didn't have time
11394 to fix it there.
11395
7548fed2
AD
113962003-02-06 Akim Demaille <akim@epita.fr>
11397
11398 * configure.ac (GXX): Rename as...
11399 (CXX): this, to keep the original Autoconf semantics.
11400 Require 2.57.
11401 * data/lalr1.cc: Fix b4_copyright invocations.
11402 If YYDEBUG is not defined, don't depend upon name_ being defined.
11403 (location.hh): Include string and iostream.
11404 (Position::filename): New member.
11405 (Position::Position ()): New.
11406 (operator<< (Position)): New.
11407 (operator- (Position, int)): New.
11408 (Location::first, Location::last): Rename as...
11409 (Location::begin, Location::end): these, to mock the conventional
11410 iterator names.
11411 (operator<< (Location)): New.
11412 * tests/atlocal.in (CXX): New.
11413 * tests/testsuite.at (AT_COMPILE_CXX): New.
11414 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11415 locations in a more synthetic way.
11416 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11417 lalr1.cc is used.
11418 Adjust the C locations to match those from Emacs: first column is
11419 column 0.
11420 Change all the expected results.
11421 Conform to the GCS: simplify the locations when applicable.
11422 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11423 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11424 these CPP macros with the m4 macros new defined by...
11425 (AT_CHECK_PUSHDEFS): this, i.e.:
11426 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 11427 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
11428 New macros.
11429 (AT_CHECK_POPDEFS): Undefine them.
11430 (AT_CHECK_CALC_LALR1_CC): New.
11431 Use it for the first lalr1.cc test.
11432
43a176ef
AD
114332003-02-04 Akim Demaille <akim@epita.fr>
11434
11435 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11436 Location as is defined.
11437
fc049e9c
AD
114382003-02-04 Akim Demaille <akim@epita.fr>
11439
11440 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11441 name_ being defined.
11442
a737b216
PE
114432003-02-03 Paul Eggert <eggert@twinsun.com>
11444
11445 * src/gram.h (start_symbol): Remove unused decl.
11446
11447 Use more-consistent naming conventions for local vars.
11448
11449 * src/derives.c (derives_compute): Change type of local var from
11450 int to rule_number.
11451 * src/gram.c (grammar_rules_partial_print): Likewise.
11452 * src/print.c (print_core): Likewise.
11453 * src/reduce.c (reduce_grammar_tables): Likewise.
11454
11455 * src/gram.c (grammar_dump): Change name of item_number *
11456 local var from r to rp.
11457 * src/nullable.c (nullable_compute): Likewise.
11458
11459 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11460
11461 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11462 for symbol or symbol_number var.
11463 * src/reader.c (grammar_start_symbol_set): Likewise.
11464 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11465 Likewise.
11466 * src/state.c (transitions_to): Likewise.
11467 * src/state.h: Likewise.
11468 * src/tables.c (symbol_number_to_vector_number): Likewise.
11469
11470 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11471 char * var.
11472
11473 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11474 var.
11475
11476 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11477 var.
11478
11479 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11480 Use str, not s, for char * var. Use ch, not c, for character var.
11481 Use size for size var.
11482
11483 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11484 char * var.
11485 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11486 uniqstr var.
11487 * src/uniqstr.h: Likewise.
11488
11489 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11490 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11491 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11492 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11493 param to have same name as that of enum, so that we don't use
11494 "s" to stand for a non-state.
11495
68e93ad5
AD
114962003-02-02 Akim Demaille <akim@epita.fr>
11497
11498 * src/scan-skel.l: Scan more than one inert character per yylex
11499 invocation.
11500
92898986
PE
115012003-02-01 Paul Eggert <eggert@twinsun.com>
11502
11503 Version 1.875a.
11504
1d9d5d71
PE
11505 * po/LINGUAS: Add ms.
11506
0435d061
AD
115072003-01-30 Akim Demaille <akim@epita.fr>
11508
11509 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11510
6029a57f
PH
115112003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11512
11513 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11514 of $1.
0435d061
AD
11515
11516 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 11517 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 11518 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 11519
6029a57f
PH
11520 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11521 (b4_rhs_location): Ditto.
0435d061 11522 (yyfill): New function to copy from stack tree into array
6029a57f 11523 incrementally.
0435d061
AD
11524 (yyuserAction): Modify to allow incremental move of semantic values
11525 to rhs array when in GLR mode.
11526 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
11527 as needed.
11528 Remove dummy use of yystack, as there is now a guaranteed use.
11529 (yydoAction): Modify to allow incremental move of semantic values
11530 to rhs array when in GLR mode.
11531 (yyresolveAction): Ditto.
11532 (yyglrShiftDefer): Update comment.
0435d061 11533 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
11534 (yyglrReduce): Ditto.
11535 (yydoAction): Ditto
0435d061 11536
6029a57f
PH
11537 * tests/glr-regr1.at: Rename to ...
11538 * tests/glr-regression.at: Add new regression test for the problems
11539 described above (adapted from S. Eken).
11540 Update copyright notice.
11541 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11542 * tests/Makefile.am: Ditto.
11543
6cee6297
PE
115442003-01-28 Paul Eggert <eggert@twinsun.com>
11545
11546 * data/lalr1.cc: Do not use @output_header_name@ unless
11547 b4_defines_flag is set. This fixes two bugs reported by
11548 Tim Van Holder in
161a71f3
PE
11549 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11550 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 11551
b2a836b5
PE
115522003-01-21 Paul Eggert <eggert@twinsun.com>
11553
11554 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11555 we don't need to worry about yyerrlab1 being reported as an
11556 "unused label" by non-GCC C compilers. The downside is that if
11557 locations are used then a couple of statements are duplicated each
11558 time YYERROR is invoked, but the upside is that the warnings
11559 should vanish.
11560 (yyerrlab1): Move code to YERROR.
11561 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11562 This reverts some of the 2002-12-27 change.
11563
4196b931
PE
115642003-01-17 Paul Eggert <eggert@twinsun.com>
11565
11566 * src/output.c (symbol_printers_output): Fix typo that led
11567 to core dump. Problem reported by Antonio Rus in
161a71f3 11568 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 11569
3ae831b4
AD
115702003-01-13 Akim Demaille <akim@epita.fr>,
11571 Quoc Peyrot <chojin@lrde.epita.fr>,
11572 Robert Anisko <anisko_r@lrde.epita.fr>
11573
11574 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11575 when the stacks contain one element, as the loop would otherwise
11576 free the last state, and then use the top state (the one we just
11577 popped). This means that the initial elements will not be freed
11578 explicitly, as is the case in yacc.c; it is not a problem, as
11579 these elements have fake values.
11580
e3aa65c5
PE
115812003-01-11 Paul Eggert <eggert@twinsun.com>
11582
11583 * NEWS: %expect-violations are now just warnings, reverting
11584 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11585 bootstrapping problem reported by Matthias Klose; see
161a71f3 11586 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
11587 * src/conflicts.c (conflicts_print): Likewise.
11588 * tests/conflicts.at (%expect not enough, %expect too much,
11589 %expect with reduce conflicts): Likewise.
11590 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11591 that the warning is enabled if the number of conflicts changes
11592 (not necessarily increases).
11593
11594 * src/getargs.c (version): Update copyright year.
11595
f0057011
AD
115962003-01-09 Akim Demaille <akim@epita.fr>
11597
11598 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11599
1ee6d2a0
PE
116002003-01-08 Paul Eggert <eggert@twinsun.com>
11601
11602 * Makefile.maint (WGETFLAGS):
11603 New macro, containing "-C off" to disable proxy caches.
11604 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11605 (rel-check): Use $(WGET) instead of wget.
11606
d4fd77c4
PE
116072003-01-06 Paul Eggert <eggert@twinsun.com>
11608
11609 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11610 the GLR paper of Scott, Johnstone and Hussain.
11611
464c6927
PE
116122003-01-04 Paul Eggert <eggert@twinsun.com>
11613
d600ee67
PE
11614 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11615 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11616 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11617 (EXTRA_LIBRARIES): New var, for liby.a.
11618 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11619 (EXTRA_SCRIPTS): New var, for yacc.
11620
464c6927
PE
11621 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11622 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11623 Problem reported by Nelson H. F. Beebe.
11624
116252003-01-03 Paul Eggert <eggert@twinsun.com>
11626
11627 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11628 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11629 when compiling Bison 1.875's `bitset bset = obstack_alloc
11630 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11631
11632 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11633 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11634 grow to a huge size with typical invocation.
d600ee67 11635
464c6927
PE
11636 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11637 Use the pattern recommended by Autoconf 2.57, except also protect
11638 against double-definition.
11639 * src/system.h: Likewise.
11640 Portability issues reported by Nelson H. F. Beebe.
d600ee67 11641
464c6927
PE
11642 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11643 All uses changed. Provide a definition in both C and C++.
11644 (yytrue, yyfalse): Define even if defined (__cplusplus).
11645
11646 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11647 Reported by Nelson H. F. Beebe.
d600ee67 11648
464c6927
PE
11649 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11650
0f42c7d5
PE
116512003-01-02 Paul Eggert <eggert@twinsun.com>
11652
11653 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11654 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11655 Bug reported by Nelson H. F. Beebe.
11656
dc546b0f
PE
116572003-01-01 Paul Eggert <eggert@twinsun.com>
11658
11659 * Version 1.875.
11660
2c09b6a7
PE
116612002-12-30 Paul Eggert <eggert@twinsun.com>
11662
11663 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11664 Moved here from...
11665 (<INITIAL>","): Here. This causes stray "," to be treated
11666 more uniformly.
11667
dc546b0f 11668 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
11669 last brace in braced code when not in Yacc mode, for compatibility
11670 with Bison 1.35. This resurrects the 2001-12-15 patch to
11671 src/reader.c.
11672
11673 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11674 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11675
535c0f63
PE
116762002-12-28 Paul Eggert <eggert@twinsun.com>
11677
11678 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11679 that of SYM's type. This fixes Debian bug 168069, reported by
11680 Thomas Olsson.
d600ee67 11681
963fcc17
PE
116822002-12-28 Paul Eggert <eggert@twinsun.com>
11683
11684 Version 1.75f.
11685
11686 Switch back to the Yacc style of conflict reports, undoing some
11687 of the 2002-07-30 change.
11688 * doc/bison.texinfo (Understanding): Use Yacc style for
11689 conflict reports. Also, use new way of locating rules.
11690 * src/conflicts.c (conflict_report):
11691 Renamed from conflict_report_yacc, removing the old
11692 'conflict_report'. Translate the entire conflict report at once,
11693 so that we don't assume that "," has the same interpretation in
11694 all languages.
11695 (conflicts_output): Use Yacc-style conflict report for each state,
11696 instead of our more-complicated style.
11697 (conflicts_print): Use Yacc-style conflict report, except print
11698 the input file name when not emulating Yacc.
11699 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11700 Conflicted Reduction, %expect not enough, %expect too much,
11701 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11702 * tests/existing.at (GNU Cim Grammar): Likewise.
11703 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11704
11705 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11706 fatal): Don't invoke fflush; it's not needed and it might even be
11707 harmful for stdout, as stdout might not be open.
11708 * src/reduce.c (reduce_print): Likewise.
11709
b1efe548
PE
117102002-12-27 Paul Eggert <eggert@twinsun.com>
11711
11712 Fix a bug where error locations were not being recorded correctly.
11713 This problem was originally reported by Paul Hilfinger in
161a71f3 11714 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
11715
11716 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11717 top of the location stack's error locations.
11718 (yyerrlab): Set it. When discarding a token, push its location
11719 onto yylerrsp so that we don't lose track of the error's end.
11720 (yyerrlab1): Now is only the target of YYERROR, so that we can
11721 properly record the location of the action that failed. For GCC
11722 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11723 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11724 (yyerrlab2): New label, which yyerrlab now falls through to.
11725 Compute the error's location by applying YYLLOC_DEFAULT to
11726 the locations of all the symbols that went into the error.
11727 * doc/bison.texinfo (Location Default Action): Mention that
11728 YYLLOC_DEFAULT is also invoked for syntax errors.
11729 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11730 Error locations include the locations of all the tokens that were
11731 discarded, not just the last token.
d600ee67 11732
983c5c2c
PE
117332002-12-26 Paul Eggert <eggert@twinsun.com>
11734
b1efe548
PE
11735 * src/files.c: Include quote.h.
11736 (compute_output_file_names): Warn if we detect conflicting
11737 outputs to the same file. This should catch the misunderstanding
11738 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11739
11740 * src/conflicts.c (conflicts_print): If the user specifies
11741 "%expect N", report an error if there are any reduce/reduce
11742 conflicts. This is what the manual says should happen.
11743 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11744 * tests/conflicts.at (%expect with reduce conflicts): New test.
11745
983c5c2c
PE
11746 Don't use m4_include on relative file names, as it doesn't work as
11747 desired if there happens to be a file with that name under ".".
d600ee67 11748
983c5c2c
PE
11749 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11750 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11751 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11752 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11753 * src/output.c (output_skeleton): Use full path names when
11754 specifying a file to include; don't rely on include path, as
11755 it's unreliable when the working file contains a file with
11756 that name.
d600ee67 11757
983c5c2c
PE
117582002-12-25 Paul Eggert <eggert@twinsun.com>
11759
11760 Remove obsolete references to bison.simple and bison.hairy.
11761 Problem mentioned by Aubin Mahe in
161a71f3 11762 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
11763 * data/glr.c: Comment fix.
11764 * doc/bison.1: Remove references. Also, mention "yacc".
11765
11766 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11767 with -g option.
11768
11769 * src/parse-gram.y (declaration): Use enum "report_states" rather
11770 than its numeric value 1.
11771
11772 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11773 opening a new one. This fixes Debian bug 165349, reported by
11774 Bruce Stephens.
11775
23f2d9dc
PE
117762002-12-24 Paul Eggert <eggert@twinsun.com>
11777
11778 Version 1.75e.
11779
11780 * Makefile.maint (cvs-update): Don't assume that the shell
11781 supports $(...), as Solaris sh doesn't.
11782
11783 * src/parse-gram.y (lloc_default): Remove test for empty
11784 nonterminals at the end, since it didn't change the result.
11785
117862002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
11787
11788 If the user does not define YYSTYPE as a macro, Bison now declares it
11789 using typedef instead of defining it as a macro. POSIX requires this.
11790 For consistency, YYLTYPE is also declared instead of defined.
11791
11792 %union directives can now have a tag before the `{', e.g., the
11793 directive `%union foo {...}' now generates the C code
11794 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11795 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11796 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11797 instead of `yyltype'.
11798
11799 `yystype' and `yyltype' are now obsolescent macros instead of being
11800 typedefs or tags; they are no longer documented and will be
11801 withdrawn in a future release.
11802
11803 * data/glr.c (b4_location_type): Remove.
11804 (YYSTYPE): Renamed from yystype.
11805 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11806 (struct YYLTYPE): Renamed from struct yyltype.
11807 (YYLTYPE): Renamed from yyltype.
11808 (yyltype, yystype): New (and obsolescent) macros,
11809 for backward compatibility.
11810 * data/yacc.c: Likewise.
11811
11812 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11813 does not specify a union tag. This is for compatibility with
11814 Solaris 9 yacc.
11815
11816 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11817 const *, since it is now modified by stripping surrounding { }.
11818 (current_braced_code): Remove.
11819 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11820 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11821 trailing " {...}". Now of type <chars>.
11822 (grammar_declaration): Adjust to bundled tokens.
11823 (code_content): Remove; stripping is now done by add_param.
11824 (print_token_value): Print contents of bundled tokens.
11825 (token_name): New function.
11826
11827 * src/reader.h (braced_code, current_braced_code): Remove.
11828 (token_name): New decl.
11829
11830 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11831 token_type, not braced_code code_kind. All uses changed.
11832 (SC_PRE_CODE): New state, for scanning after a keyword that
11833 has (or usually has) an immediately-following braced code.
11834 (token_type): New local var, to keep track of which token type
11835 to return when scanning braced code.
11836 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 11837 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
11838 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11839 instead of returning a token type immediately.
11840 (<INITIAL>"{"): Set token type.
11841 (<SC_BRACED_CODE>"}"): Use it.
11842 (handle_action_dollar, handle_action_at): Now returns bool
11843 indicating success. Fail if ! current_rule; this prevents a core dump.
11844 (handle_symbol_code_dollar, handle_symbol_code_at):
11845 Remove; merge body into caller.
11846 (handle_dollar, handle_at): Complain in invalid contexts.
11847
11848 * NEWS, doc/bison.texinfo: Document the above.
11849 * NEWS: Fix years and program names in copyright notice.
11850
879ca4f8
PE
118512002-12-17 Paul Eggert <eggert@twinsun.com>
11852
11853 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11854 Reporting, Table of Symbols): Omit mentions of %lex-param and
11855 %parse-param from the documentation for now.
11856
1c5fe69d
PE
118572002-12-15 Paul Eggert <eggert@twinsun.com>
11858
11859 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11860 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11861 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
11862 disagreed with the Bison documentation. Bug
11863 reported by Andrew Walrond.
d600ee67 11864
1c5fe69d
PE
11865 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11866 as the caller now does that.
11867 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11868 (YYEMPTY): Parenthesize right hand side, since others use it.
11869 (yyparse): Don't assume that our generated code is the only code
11870 that sets yychar.
11871
d1de5372
PE
118722002-12-13 Paul Eggert <eggert@twinsun.com>
11873
11874 Version 1.75d.
11875
11876 POSIX requires a "yacc" command.
11877 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11878 (MOSTLYCLEANFILES): Add yacc.
11879 (yacc): New rule.
1c5fe69d 11880 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
11881 as an alias for bison y.
11882
11883 * po/LINGUAS: Add da.
d600ee67 11884
d1de5372
PE
11885 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11886 problem with latest <getopt.h>.
11887 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11888
11889 * doc/fdl.texi: Upgrade to 1.2.
11890 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11891 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11892 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11893 gnulib.
11894 * config/install-sh: Sync with autotools.
11895
11896 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 11897 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
11898 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11899 locations are requested.
11900 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11901 locations are requested.
11902
d0f3fe23
PE
119032002-12-12 Paul Eggert <eggert@twinsun.com>
11904
11905 Remove unportable casts and storage allocation tricks.
11906 While we're at it, remove almost all casts, since they
11907 usually aren't needed and are a sign of trouble.
11908
11909 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11910
11911 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11912 the pointer DSET returned by malloc; this isn't portable.
11913 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11914 Similarly for DERIVES.
11915 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11916 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11917 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11918
11919 * src/derives.c (derives_compute): Do not bother invoking
11920 int_of_rule_number, since rule numbers are integers.
11921
11922 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11923 rather than XMALLOC (char, N).
11924
11925 * src/files.c (filename_split): Rewrite to avoid cast.
11926
11927 * src/gram.h (symbol_number_as_item_number,
11928 item_number_as_symbol_number, rule_number_as_item_number,
11929 item_number_as_rule_number):
11930 Now inline functions rather than macros, to avoid casts.
11931 * src/state.h (state_number_as_int): Likewise.
11932 * src/tables.c (state_number_to_vector_number,
11933 symbol_number_to_vector_number): Likewise.
11934
11935 * src/gram.h (int_of_rule_number): Remove; no longer used.
11936
11937 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11938 since the resulting storage is always stored into.
11939
11940 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11941 where it's needed.
11942
11943 * src/muscle_tab.c (muscle_m4_output):
11944 Now inline. Return bool, not int.
11945 * src/state.c (state_compare): Likewise.
11946 * src/symtab.c (symbol_check_defined,
11947 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11948 hash_compare_symbol, hash_symbol):
11949 Likewise.
11950 * src/uniqstr.c (uniqstr_print): Likewise.
11951 * src/muscle_tab.c (muscle_m4_output_processor):
11952 New function, to avoid casts.
11953 * src/state.c (state_comparator, stage_hasher): Likewise.
11954 * src/symtab.c (symbol_check_defined_processor,
11955 symbol_check_alias_consistency_processor, symbol_pack_processor,
11956 symbol_translation_processor, hash_symbol_comparator,
11957 hash_symbol_hasher): Likewise.
11958 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11959 * src/muscle_tab.c (muscles_m4_output):
11960 Use new functions instead of casting old functions unportably.
11961 * src/state.c (state_hash_new): Likewise.
11962 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11963 symbols_token_translations_init):
11964 Likewise.
11965 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11966
11967 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11968 var instead of casting to long, to avoid casts.
11969 (prepare_states): Use MALLOC rather than alloca, so that we don't
11970 have to worry about alloca.
11971 * src/state.c (state_hash_lookup): Likewise.
11972
11973 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11974 local var instead of casting to unsigned char, to avoid casts.
11975
11976 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11977 STATE_ALLOC): Remove.
11978 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11979 rather than calloc, and use offsetof to avoid allocating slightly
11980 too much storage.
11981 (state_new): Initialize all members.
11982
11983 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11984
11985 * src/symtab.c (symbol_free): Remove; unused.
11986 (symbol_get): Remove cast in lhs of assignment.
11987 (symbols_do): Now static. Accept generic arguments, not
11988 hashing-related ones.
11989
11990 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
11991 (symbol_processor): Remove.
11992 (symbols_do): Remove decl; now static.
11993
11994 * src/system.h (alloca): Remove; decl no longer needed.
11995 (<stddef.h>): Include, for offsetof.
11996 (<inttypes.>, <stdint.h>): Include if available.
11997 (uintptr_t): New type, if system lacks it.
11998 (CALLOC, MALLOC, REALLOC): New macros.
11999 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12000 new macros.
12001
12002 * src/tables.c (table_size): Now int, to pacify GCC.
12003 (table_grow, table_ninf_remap): Use signed table size.
12004 (save_row): Don't bother initializing locals when not needed.
12005 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12006 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12007
12008 * src/vcg.h: Correct misspellings.
12009
12010 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12011
12012
12013 * src/getargs.c (getargs): Don't assume EOF == -1.
12014
26b4a969
PE
120152002-12-09 Paul Eggert <eggert@twinsun.com>
12016
12017 Change identifier spellings to avoid collisions with names
12018 that are reserved by POSIX.
12019
12020 Don't use names ending in _t, since POSIX reserves them.
12021 For consistency, remove _e and _s endings -- they're weren't
12022 needed to remove ambiguity. All uses changed.
12023 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12024 turn was just renamed from struniq_t.
12025 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12026 which in turn was just renamed from struniq_processor_t.
12027 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12028 in turn was renamed from hash_compare_struniq_t.
12029 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12030 (state_list): Renamed from state_list_t.
12031 * src/assoc.h (assoc): Renamed from assoc_t.
12032 * src/conflicts.c (enum conflict_resolution): Renamed from
12033 enum conflict_resolution_e.
12034 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12035 (rule_list): Renamed from rule_list_t.
12036 * src/getargs.h (enum trace): Renamed from enum trace_e.
12037 (enum report): Renamed from enum report_e.
12038 * src/gram.h (item_number): Renamed from item_number_t.
12039 (rule_number): Renamed from rule_number_t.
12040 (struct rule_s): Remove the "rule_s" part; not used.
12041 (rule): Renamed from rule_t.
12042 (rule_filter): Renamed from rule_filter_t.
12043 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12044 (goto_list): Renamed from goto_list_t.
12045 * src/lalr.h (goto_number): Renamed from goto_number_t.
12046 * src/location.h (location): Renamed from location_t.
12047 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12048 and moved here from:
12049 * src/muscle_tab.h (muscle_entry_t): here.
12050 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12051 (rule_list): Renamed from rule_list_t.
12052 * src/print_graph.c (static_graph): Renamed from graph.
12053 * src/reader.h (braced_code): Renamed from braced_code_t.
12054 Remove brace_code_e tag.
12055 * src/relation.h (relation_node): Renamed from relation_node_t.
12056 (relation_nodes): Renamed from relation_nodes_t.
12057 (relation): Renamed from relation_t.
12058 * src/state.h (state_number): Renamed from state_number_t.
12059 (struct state): Renamed from struct state_s.
12060 (state): Renamed from state_t.
12061 (transitions): Renamed from transitions_t. Unused (and
12062 misspelled) transtion_s tag removed.
12063 (errs): Renamed from errs_t. Unused errs_s tag removed.
12064 (reductions): Renamed from reductions_t. Unused tag
12065 reductions_s removed.
12066 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12067 (struct symbol_list): Renamed from struct symbol_list_s.
12068 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12069 (struct symbol): Renamed from struct symbol_s.
12070 (symbol): Renamed from symbol_t.
12071 * src/tables.c (vector_number): Renamed from vector_number_t.
12072 (action_number): Renamed from action_t.
12073 * src/tables.h (base_number): Renamed from base_t.
12074 * src/vcg.h (enum color): Renamed from enum color_e.
12075 (enum textmode): Renamed from enum textmode_e.
12076 (enum shape): Renamed from enum shape_e.
12077 (struct colorentry): Renamed from struct colorentry_s.
12078 (struct classname): Renamed from struct classname_s.
12079 (struct infoname): Renamed from struct infoname_s.
12080 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12081 (enum decision): Renamed from enum decision_e.
12082 (enum orientation): Renamed from enum orientation_e.
12083 (enum alignment): Renamed from enum alignment_e.
12084 (enum arrow_mode): Renamed from enum arrow_mode_e.
12085 (enum crossing_type): Renamed from enum crossing_type_e.
12086 (enum view): Renamed from enum view_e.
12087 (struct node): Renamed from struct node_s.
12088 (node): Renamed from node_t.
12089 (enum linestyle): Renamed from enum linestyle_e.
12090 (enum arrowstyle): Renamed from enum arrowstyle_e.
12091 (struct edge): Renamed from struct edge.
12092 (edge): Renamed from edge_t.
12093 (struct graph): Renamed from struct graph_s.
12094 (graph): Renamed from graph_t.
12095 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12096 Rename value_t -> value.
12097 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12098 value_t_as_yystype -> value_as_yystype.
12099
12100 Don't include <errno.h> in the mainstream code, since it
12101 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12102 * lib/get-errno.c, lib/get-errno.h: New files.
12103 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12104 get-errno.c.
12105 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12106 * src/output.c (output_skeleton): Likewise.
12107 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12108 instead of errno.
12109 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12110 Likewise.
12111 (handle_action_dollar, handle_action_at): Likewise.
12112 * src/system.h: Do not include <errno.h>.
12113 (TAB_EXT): Renamed from EXT_TAB.
12114 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12115
12116 Avoid str[a-z]*, since <string.h> reserves that name space.
12117 Change all instances of "struniq" in names to "uniqstr", and
12118 likewise for "STRUNIQ" and "UNIQSTR".
12119 * src/uniqstr.c: Renamed from src/struniq.c.
12120 * src/uniqstr.h: Renamed from src/struniq.h.
12121 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12122 * src/files.c (strsuffix): Remove; unused.
12123 (concat2): Renamed from stringappend. Now static.
12124 * src/files.h (strsuffix, stringappend): Remove; unused.
12125 * src/parse-gram.y (<chars>): Renamed from <string>.
12126 (<uniqstr>): Renamed from <struniq>.
12127 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12128 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12129 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12130 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12131 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12132 (N_EXPAND): Renamed from N_STRETCH.
12133
12134 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12135 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12136 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12137 Remove; unused.
12138 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12139 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12140 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12141 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12142 (BASE_MAXIMUM): Renamed from BASE_MAX.
12143 (BASE_MINIMUM): Renamed from BASE_MIN.
12144 (ACTION_MAX): Remove; unused.
12145 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12146 Unnecessary casts removed from above defines.
12147
12148
12149 Fix misspelling in names.
12150 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12151 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12152 G_NODE_ALIGNEMENT.
12153
12154
12155 * lib/timevar.c (timevar_report): Renamed from time_report,
12156 for consistency with other names.
12157 * lib/timevar.h (timevar_report): New decl.
12158 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12159
12160
12161 Sort include-file uses.
12162
12163 Reorder all include files under src to be in the order "system.h".
12164 then the ../lib include files in angle brackets (alphabetized),
12165 then the . include files in double-quotes (alphabetized). Fix
12166 dependency breakages encountered in this process, as follows:
12167 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12168 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12169 * src/state.h: Include "symtab.h".
12170
996b1c7e
PE
121712002-12-08 Paul Eggert <eggert@twinsun.com>
12172
12173 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12174 since this causes problems when __file__ contains character
12175 sequences like "@" that are treated specially by src/scan-skel.l.
12176 Instead, just use the file's basename. This fixes the bug
12177 reported by Martin Mokrejs in
161a71f3 12178 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 12179
e19c4e5d
PE
121802002-12-06 Paul Eggert <eggert@twinsun.com>
12181
12182 Add support for rules that do not have trailing semicolons, as
12183 POSIX requires. Improve the quality of locations in Bison
12184 diagnostics.
26b4a969 12185
e19c4e5d
PE
12186 * src/location.c: Include <quotearg.h>.
12187 (empty_location): Now const.
12188 (location_print): New function. Follow the recommendation of the
12189 GNU Coding Standards for locations that span file boundaries.
12190 * src/location.h: Do not include <quotearg.h>; no longer needed.
12191 (boundary): New type.
12192 (location_t): Use it. This allows locations to span file boundaries.
12193 All member uses changed: file -> start.file or end.file (as needed),
12194 first_line -> start.line, first_column -> start.column,
12195 last_line -> end.line, last_column -> end.column.
12196 (equal_boundaries): New function.
12197 (LOCATION_RESET, LOCATION_STEP): Remove.
12198 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12199 (empty_location): Now const.
12200 (location_print): New decl.
12201 * src/parse-gram.y (lloc_default): New function, which handles
12202 empty locations more accurately.
12203 (YYLLOC_DEFAULT): Use it.
12204 (%token COLON): Remove.
12205 (%token ID_COLON): New token.
26b4a969 12206 (rules): Use it.
e19c4e5d
PE
12207 (declarations, rules): Remove trailing semicolon.
12208 (declaration, rules_or_grammar_declaration):
12209 Allow empty (";") declaration.
12210 (symbol_def): Remove empty actions; no longer needed.
12211 (rules_or_grammar_declaration): Remove trailing semicolon.
12212 (semi_colon.opt): Remove.
12213 * src/reader.h: Include location.h.
12214 (scanner_cursor): New decl.
12215 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12216 rolling our own.
12217 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12218 of *loc.
12219 (STEP): Remove. No longer needed, now that adjust_location does
12220 the work. All uses removed.
12221 (scanner_cursor): New var.
12222 (adjust_location): Renamed from extend_location. It now sets
12223 *loc and adjusts the scanner cursor. All uses changed.
12224 Don't bother testing for CR.
12225 (handle_syncline): Remove location arg; now updates scanner cursor.
12226 All callers changed.
12227 (unexpected_end_of_file): Now accepts start boundary of token or
12228 comment, not location. All callers changed. Update scanner cursor,
12229 not the location.
12230 (SC_AFTER_IDENTIFIER): New state.
12231 (context_state): Renamed from c_context. All uses changed.
12232 (id_loc, code_start, token_start): New local vars.
12233 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12234 processing of Yacc white space and equivalents here.
12235 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12236 instead of returning ID immediately, since we need to search for
12237 a subsequent colon.
12238 (<INITIAL>"'", "\""): Save token_start.
12239 (<INITIAL>"%{", "{", "%%"): Save code_start.
12240 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12241 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12242 BEGIN context_state at end, not INITIAL.
12243 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12244 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12245 Return correct token start.
12246 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12247 the start of a character, string or multiline comment is found.
12248 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12249 Reduction): Adjust reported locations to match the more-precise
12250 results now expected.
12251 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12252 * tests/reduce.at (Useless Rules, Reduced Automaton,
12253 Underivable Rules): Likewise.
12254 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12255 or "|"' now that so many other tokens are allowed by the new grammar.
12256
12257 * src/complain.h (current_file): Remove duplicate decl;
12258 current_file is now owned by files.h.
12259 * src/complain.c, src/scan-gram.l: Include files.h.
12260
122612002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 12262
e19c4e5d
PE
12263 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12264 promotes to int; it might be unsigned int.
12265 * data/yacc.c (yy_reduce_print): Likewise.
12266
12267 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12268 be #defined in the prologue, not in the Bison declarations.
12269 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 12270
b64755e3
PE
122712002-12-02 Paul Eggert <eggert@twinsun.com>
12272
12273 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12274 * lib/strtoul.c: New file, from gnulib.
12275 This fixes a porting bug reported by Peter Klein in
161a71f3 12276 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 12277
6e746484
PE
122782002-11-30 Paul Eggert <eggert@twinsun.com>
12279
b64755e3
PE
12280 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12281 and put only a forward declaration in the prologue. This is for
12282 consistency with the other scanner helper functions.
12283
6ba55592
PE
12284 Type clashes now generate warnings, not errors, since it
12285 appears that POSIX may allow some grammars with type clashes.
12286 * src/reader.c (grammar_current_rule_check): Warn about
12287 type clashes instead of complaining.
12288 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12289
6e746484
PE
12290 Add Yacc library, since POSIX requires it.
12291 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12292 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12293 * lib/main.c, lib/yyerror.c: New files.
12294
12295 gram_error can be static; it need not be extern.
12296 * src/reader.h (gram_error): Remove decl.
12297 * src/parse-gram.y (gram_error): Now static. Add static decl.
12298 (print_token_value): Omit parameter names from forward decl,
12299 for consistency.
12300
88510f9c
PE
123012002-11-29 Paul Eggert <eggert@twinsun.com>
12302
6e746484
PE
12303 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12304 be declared before being used. E.g., one should typically
12305 declare them in the prologue. Use GNU coding style in examples.
12306 Put "const" consistently after the type it modifies. Mention
12307 that C99 supports "inline". Mention that yyerror traditionally
12308 returns "int".
12309
88510f9c
PE
12310 %parse-param and %lex-param now take just one argument, the
12311 declaration; the argument name is deduced from the declaration.
12312
12313 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12314 Reporting, Table of Symbols): Document this.
12315 * src/parse-gram.y (add_param): New function.
12316 (COMMA): Remove.
12317 (declaration): Implement new rule for %parse-param and %lex-param.
12318 * src/scan-gram.l: "," now elicits a warning, rather than being
12319 a token; this is more compatible with byacc.
12320 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12321
bb92250c
PE
123222002-11-27 Paul Eggert <eggert@twinsun.com>
12323
12324 Rename identifiers to avoid real and potential collisions.
12325
12326 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12327 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 12328 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
12329 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12330 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12331 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12332 All uses changed.
12333 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12334 The name "yycontrol" violates the name space rules, and this stuff
12335 wasn't being used anyway.
12336 (input): Remove action; this stuff wasn't being used.
12337 (gram_error): Rename local variable yylloc -> loc.
12338 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12339 (YY_DECL): Don't use "yy" at start of local variables.
12340 All uses changed, e.g., yylloc -> loc.
12341 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12342 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12343 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12344 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12345
12346 * src/parse-gram.y (gram_error): loc is now const *.
12347 * src/reader.h (gram_error): Likewise.
12348
3af4feb2
PE
123492002-11-24 Paul Eggert <eggert@twinsun.com>
12350
12351 Version 1.75c.
12352
12353 * tests/actions.at (Actions after errors): Use an output format
12354 more similar to that of the Printers and Destructors test.
12355 Test the position of the ';' token too.
12356 (Printers and Destructors): Likewise.
12357 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12358 unnecessarily alarming people when the test fails.
12359
12360 * data/yacc.c (yyerrlab1): Move this label down, so that the
12361 parser does not discard the lookahead token if the user code
12362 invokes YYERROR. This change is required for POSIX conformance.
12363
12364 * lib/error.c: Sync with gnulib.
12365
123662002-11-22 Paul Eggert <eggert@twinsun.com>
12367
12368 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12369 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12370 * lib/xmalloc.c: Likewise.
26b4a969 12371
58004308
PE
123722002-11-20 Paul Eggert <eggert@twinsun.com>
12373
12374 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12375
123762002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 12377
58004308
PE
12378 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12379 should use `if (! x) abort ();' rather than `assert (x);', and
12380 anyway it's one less thing to worry about configuring.
12381
12382 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12383 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12384 and replace all instances of assert with abort.
12385 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12386 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12387
12388 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12389 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12390 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12391 hash_find_entry, hash_rehash, hash_insert): Likewise.
12392 * src/conflicts.c (resolve_sr_conflict): Likewise.
12393 * src/lalr.c (set_goto_map, map_goto): Likewise.
12394 * src/nullable.c (nullable_compute): Likewise.
12395 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12396 * src/reader.c (packgram, reader): Likewise.
12397 * src/state.c (state_new, state_free, state_transitions_set,
12398 state_reduction_find): Likewise.
12399 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12400 symbol_pack): Likewise.
12401 * src/tables.c (conflict_row, pack_vector): Likewise.
12402 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12403 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12404 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12405 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12406
12407 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12408 (ARGMATCH_CONSTRAINT): New macro.
12409 (ARGMATCH_ASSERT): Use it.
12410
12411 * src/system.h (verify): New macro.
12412 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12413 rather than assert.
12414 * src/tables.c (tables_generate): Likewise.
12415
12416 * src/struniq.c (struniq_assert): Now returns void, and aborts
12417 if the assertion is false.
12418 (struniq_assert_p): Remove.
12419 * src/struniq.h: Likewise.
12420
76ae8198
PE
124212002-11-18 Paul Eggert <eggert@twinsun.com>
12422
12423 * data/glr.c (yygetLRActions): Replace `yyindex' with
12424 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12425 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 12426 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 12427
d3c4e709
AD
124282002-11-18 Akim Demaille <akim@epita.fr>
12429
12430 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12431 space.
12432 From Tim Van Holder.
12433
8d8a7238
PE
124342002-11-17 Paul Eggert <eggert@twinsun.com>
12435
12436 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12437 to "SyntaxError" for consistency with my 2002-11-15 change.
12438
12439 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12440 not define to {}, since this breaks the common use of `YYDPRINTF
12441 ((...));' if a single statement is desired (e.g. before `else').
12442 Work around GCC warnings by surrounding corresponding calls with
12443 {} if needed.
12444 (yyhasResolvedValue): Remove unused function.
12445 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12446 loop body.
12447 (yyreportSyntaxError): Renamed from yyreportParseError.
12448 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12449 All uses changed.
12450 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12451 extern when possible. Remove unused initializations.
12452
b0937b22
AD
124532002-11-16 Akim Demaille <akim@epita.fr>
12454
12455 Augment the similarity between GLR and LALR traces.
12456
12457 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12458 (YY_REDUCE_PRINT): New.
12459 (yyparse): Use them.
12460 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12461 YYDPRINT here.
12462 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12463 state reached after the reduction/recovery, since...
12464 (yyparse, yyprocessOneStack): Report the state we are entering in.
12465
c5e3e510
AD
124662002-11-16 Akim Demaille <akim@epita.fr>
12467
12468 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12469 Add support for --trace=skeleton.
12470 * src/scan-skel.l: %option debug.
12471 Scan strings of non-@ or \n instead of character by character.
12472 (scan_skel): Handle trace_skeleton.
12473 (QPUTS): New.
12474 (@output_parser_name@, @output_header_name@): ``Restore'' their
12475 support (used to be M4 macros).
12476 * data/yacc.c: Quote larger chunks, a la glr.c.
12477 * data/lalr1.cc: Likewise.
12478 The header guards are no longer available, so use some other
12479 string than `YYLSP_NEEDED'.
12480
4c6cc1db
AD
124812002-11-16 Akim Demaille <akim@epita.fr>
12482
12483 Make the ``Printers and Destructors'' test more verbose, taking
12484 `yacc.c''s behavior as (possibly wrong) reference.
12485
12486 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12487 instead of fprint on stdout.
12488 Set and report the last_line of the symbols.
12489 Consistently display values and locations.
12490
6d9e8019
PE
124912002-11-16 Paul Eggert <eggert@twinsun.com>
12492
12493 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12494
6e649e65
PE
124952002-11-15 Paul Eggert <eggert@twinsun.com>
12496
b25d88f6
PE
12497 * tests/actions.at (Actions after errors): New test case.
12498
6e649e65
PE
12499 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12500 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12501 tests/action.at, tests/calc.at, tests/conflicts.at,
12502 tests/cxx-type.at, tests/regression.at:
12503 "parse error" -> "syntax error" for POSIX compatibility.
12504 "parsing stack overflow..." -> "parser stack overflow" so
12505 that code matches Bison documentation.
12506
0f39aab9
AD
125072002-11-15 Akim Demaille <akim@epita.fr>
12508
12509 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12510 take two BRACED_CODE, not two string_content.
12511 Free the scanner's obstack when we are done.
12512 (code_content): New.
12513 * tests/calc.at: Adjust.
12514 * doc/bison.texinfo: Adjust.
12515 Also, make sure to include the `,' for these declarations.
12516
761c1926
AD
125172002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12518
12519 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12520 definition; avoids potential autoreconf problems.
12521
b0f98b10
AD
125222002-11-15 Akim Demaille <akim@epita.fr>
12523
12524 Always check the value returned by yyparse.
12525
12526 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12527 returned by yyparse.
12528 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12529 Adjust calls.
12530 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12531 returned by yyparse.
12532
970785f1
PH
125332002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12534
12535 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12536 on input.at test.
12537
8fcc7db1
PE
125382002-11-14 Paul Eggert <eggert@twinsun.com>
12539
7ec1b48e
PE
12540 * src/output.c (output_skeleton): Call xfopen instead of
12541 duplicating xfopen's body.
12542
cfff7583 12543 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 12544 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 12545
8fcc7db1
PE
12546 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12547 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12548 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12549 file twice in the grammar, as an extra check.
12550
12551 * tests/input.at (Torturing the Scanner): Surround the
12552 backslash-newline tests with "#if 0", to make it less likely that
12553 we'll run into compiler bugs. Bring back solitary \ inside
12554 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 12555 test backslash-newline in C character constant.
8fcc7db1 12556
4e8d992c
AD
125572002-11-14 Akim Demaille <akim@epita.fr>
12558
12559 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12560 status of the compiler.
f32b346d 12561 Calling `exit 1' is no longer needed.
4e8d992c
AD
12562 Reported by Nelson H. F. Beebe.
12563
9501dc6e
AD
125642002-11-14 Akim Demaille <akim@epita.fr>
12565
12566 * tests/atlocal.in (CPPFLAGS): We have config.h.
12567 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12568 New.
12569 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12570 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12571 * tests/regression.at, tests/torture.at: Use them for all the
12572 grammars that are to be compiled.
12573 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12574 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12575 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12576
18b519c0
AD
125772002-11-14 Akim Demaille <akim@epita.fr>
12578
12579 * doc/bison.texinfo: Various formatting changes (alignments in
12580 samples, additional @group/@end group, GCS in samples.
12581 Use @deffn instead of simple @table to define the directives,
12582 macros, variables etc.
12583
9a86cdb9
PE
125842002-11-13 Paul Eggert <eggert@twinsun.com>
12585
daa33def 12586 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 12587 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 12588
daa33def 12589 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 12590 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
12591 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12592 * tests/headers.at (export YYLTYPE): Likewise.
12593
12594 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 12595 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 12596
9a86cdb9
PE
12597 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12598 comments, since they're not portable. Use GNU coding style.
12599
9c1e26bd
AD
126002002-11-13 Akim Demaille <akim@epita.fr>
12601
12602 * data/yacc.c: Leave bigger chunks of quoted text.
12603 (YYDSYMPRINTF): New.
12604 Use it to report symbol activities.
12605 * data/glr.c (YYDSYMPRINTF): New.
12606 Use it.
12607
87f721cc
PE
126082002-11-12 Paul Eggert <eggert@twinsun.com>
12609
12610 Version 1.75b.
12611
12612 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12613 (yyglrReduce): Return yyok, not 0.
12614 This should avoid the enumerated-type warnings reported
464c6927 12615 by Nelson H. F. Beebe in
161a71f3 12616 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
12617
12618 * lib/bbitset.h (BITSET_INLINE): Remove.
12619 * lib/bitset.h [! BITSET_INLINE]: Remove.
12620 (bitset_set, bitset_reset, bitset_test): Rename local vars
12621 to avoid shadowing warnings by GCC.
12622
12623 * data/glr.c (inline): Remove #define. It's the user's
12624 responsibility to #define it away, just like 'const'.
464c6927 12625 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 12626 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 12627
87f721cc
PE
12628 * Makefile.maint (po-check): Scan .l and .y files instead of the
12629 .c and the .h files that they generate. This fixes the bug
12630 reported by Tim Van Holder in:
161a71f3 12631 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
12632 Look for N_ as well as for _. Try to avoid matching #define for
12633 N_ and _.
12634 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12635 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12636 * src/scan-gram.l: Revamp regular expressions so that " and '
12637 do not confuse xgettext.
12638
12639 * src/struniq.h (struniq_new): Do not declare the return type
12640 to be 'const'; this violates the C standard.
12641 * src/struniq.c (struniq_new): Likewise.
12642
be14ade5
AD
126432002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12644
12645 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12646 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12647 linker.
12648
05291fbc
AD
126492002-11-12 Akim Demaille <akim@epita.fr>
12650
12651 * Makefile.maint: Sync with Autoconf:
12652 (local_updates): New.
12653
1f5fd52e
AD
126542002-11-12 Akim Demaille <akim@epita.fr>
12655
12656 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12657
283f1e64
AD
126582002-11-12 Akim Demaille <akim@epita.fr>
12659
12660 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12661 locations.
12662
886b69d1
AD
126632002-11-12 Akim Demaille <akim@epita.fr>
12664
12665 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12666 not yyvalue.
12667
3df37415
AD
126682002-11-12 Akim Demaille <akim@epita.fr>
12669
12670 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12671 Use it to test the GLR parser.
12672
7bd6c77e
AD
126732002-11-12 Akim Demaille <akim@epita.fr>
12674
12675 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12676 defines it.
12677 * data/glr.c (yystos): New.
12678 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12679 (YYDSYMPRINT): New.
12680 (yyval): Don't define it, it is handled via M4.
12681 (yyrecoverParseError): Free verbosely the discarded symbols.
12682 * data/yacc.c (yysymprint): Remove, rather...
12683 (b4_yysymprint_generate): invoke.
12684 * data/c.m4 (b4_yysymprint_generate): New.
12685 Accept pointers as arguments, as opposed to the version from
12686 yacc.c.
12687 (b4_yydestruct_generate): Likewise.
12688 * tests/cations.at (Printers and Destructors): Use Bison directives
12689 instead of CPP macros.
12690 Don't rely on internal details.
12691
b0400cc6
AD
126922002-11-12 Akim Demaille <akim@epita.fr>
12693
12694 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12695 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12696 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12697 it against YYEMPTY and so forth), work on yytoken (i.e., set
12698 it to YYEMPTY etc.).
12699 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12700 (b4_symbol_actions): Remove.
12701 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12702 for 0, end-of-input.
12703
72f889cc
AD
127042002-11-12 Akim Demaille <akim@epita.fr>
12705
12706 * doc/bison.texinfo (Destructor Decl): New.
12707
b1ae9233
AD
127082002-11-12 Akim Demaille <akim@epita.fr>
12709
12710 * src/tables.c (tables_generate): Use free for pointers that
12711 cannot be NULL, not XFREE.
12712 (pack_vector): Use assert, not fatal, for bound violations.
12713 * src/state.c (state_new): Likewise.
12714 * src/reader.c (reader): Likewise.
12715 * src/lalr.c (set_goto_map): Likewise.
72f889cc 12716 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
12717 the file name.
12718
7ec2d4cd
AD
127192002-11-12 Akim Demaille <akim@epita.fr>
12720
12721 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12722 Restore.
12723 * src/scan-gram.l (last_string): Is global to the file, not to
12724 yylex.
12725 * src/parse-gram.y (input): Don't append the epilogue here,
12726 (epilogue.opt): do it here, and free the scanner's obstack.
12727 * src/reader.c (epilogue_set): Rename as...
12728 (epilogue_augment): this.
12729 * data/c.m4 (b4_epilogue): Defaults to empty.
12730
573a6cd3
AD
127312002-11-12 Akim Demaille <akim@epita.fr>
12732
12733 * src/getargs.c (long_options): Remove duplicates.
12734 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12735 Remove.
12736 * doc/bison.rnh: Remove.
12737 * doc/bison.texinfo (VMS Invocation): Remove.
12738
95612cfa
AD
127392002-11-12 Akim Demaille <akim@epita.fr>
12740
12741 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12742 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12743
12744 Use struniq for symbols.
12745
12746 * src/symtab.h (symbol_t): The tag member is a struniq.
12747 (symbol_type_set): Adjust.
12748 * src/symtab.c (symbol_new): Takes a struniq.
12749 (symbol_free): Don't free the tag member.
12750 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12751 (hash_compare_symbol, hash_symbol): these.
12752 Use the fact that tags as struniqs.
12753 (symbol_get): Use struniq_new.
12754 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12755 Returns a strniq.
12756 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12757 and type members are struniqs.
12758 * src/reader.c (get_merge_function)
12759 (grammar_current_rule_merge_set): Adjust.
12760 (TYPE, current_type): Are struniq.
12761
12762 Use struniq for file names.
12763
12764 * src/files.h, src/files.c (infile): Split into...
12765 (grammar_file, current_file): these.
12766 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12767 * src/reduce.c (reduce_print): Likewise.
12768 * src/getargs.c (getargs): Likewise.
12769 * src/complain.h, src/complain.c: Likewise.
12770 * src/main.c (main): Call struniqs_new early enough to use it for
12771 file names.
12772 Don't free the input file name.
12773
3e6656f9
AD
127742002-11-12 Akim Demaille <akim@epita.fr>
12775
12776 * src/symtab.c (symbol_free): Remove dead deactivated code:
12777 type_name are properly removed.
12778 Don't use XFREE to free items that cannot be NULL.
12779 * src/struniq.h, src/struniq.c: New.
12780 * src/main.c (main): Initialize/free struniqs.
12781 * src/parse-gram.y (%union): Add astruniq member.
12782 (yyprint): Adjust.
12783 * src/scan-gram.l (<{tag}>): Return a struniq.
12784 Free the obstack bit that used to store it.
12785 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12786
7672019c
PE
127872002-11-11 Paul Eggert <eggert@twinsun.com>
12788
12789 Revamp to fix many (but not all) of the C- and M4-related quoting
12790 problems. Among other things, this fixes the Bison bug reported
12791 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 12792 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
12793
12794 Use new @ escapes consistently. Represent brackets with @{ and @}
12795 rather than @<:@ and @:>@, since this works a bit better with dumb
12796 editors like vi. Represent @ with @@, since @ is now consistently
12797 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12798 __ofile__, to avoid unexpected expansions. Similarly, use @output
12799 rather than #output.
12800
12801 * data/c.m4 (b4_copyright): Omit file name from comment, since
12802 the file name could contain "*/".
12803 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12804 be quoted. All uses changed.
12805
12806 * data/glr.c: Use new @ escapes consistently.
12807 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12808 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12809 Remove, since they couldn't handle arbitrary characters in file
12810 names.
12811 * data/lalr1.cc: Likewise.
12812 * data/yacc.c: Likewise.
12813
12814 * src/files.c (output_infix): Remove; all uses removed.
12815 * src/files.h: Likewise.
12816
12817 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12818 mishandled funny characters in file names, and anyway it isn't
12819 needed any more.
12820 * data/yacc.c: Likewise.
12821 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12822
12823 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12824 * data/yacc.c: Likewise.
12825
12826 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12827 strings now.
12828 (muscle_init): Quote filename as a C string.
12829 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12830 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12831 * src/output.c (escaped_file_name_output): New function.
12832 (prepare_symbols): Quote tokens for M4.
12833 (prepare): Don't insert output_infix, output_prefix,
12834 output_parser_name, output_header_name; this is now down by scan-skel.
12835 Insert skeleton as a C string.
12836
12837 * src/output.c (user_actions_output, symbol_destructors_output,
12838 symbol_printers_output): Quote filenames for C and M4.
12839 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12840
12841 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12842 escapes other than \\ and \'; this simplifies the code.
12843 (<SC_STRING>): Likewise, for \\ and \".
12844 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12845 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12846 Use new escapes @{ and @} for [ and ].
12847
12848 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12849 them with auto vars.
12850 Switch to new escape scheme, where @ is the escape character uniformly.
12851 Abort if a stray escape character is found. Avoid unbounded input
12852 buffer when parsing non-escaped text.
12853
12854 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12855 __oline__, #output, $@, and @{ do not have unintended meanings.
12856
acea4f3b
PE
128572002-11-09 Paul Eggert <eggert@twinsun.com>
12858
12859 Fix the test failure due to GCC warnings described in
161a71f3 12860 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
12861 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12862 evaluate to 0 if it's impossible for NINF to be in the respective
12863 table.
12864 (yygetLRActions, yyrecoverParseError): Use them.
12865
12866 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12867 counted in the token inserted at end of file. Now takes
12868 location_t *, not location_t, so that the location can be
12869 adjusted. All uses changed.
12870
12871 * tests/regression.at (Invalid inputs): Adjust wording in
12872 diagnostic to match the new behavior.
12873
12874 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12875 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12876 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12877 abort ();'. This reduces the runtime of the "Many lookaheads"
12878 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12879 GCC 3.2.
12880
20ef1ad5
PE
128812002-11-07 Paul Eggert <eggert@twinsun.com>
12882
12883 * src/parse-gram.y (CHARACTER): Remove unused token.
12884 All uses removed.
12885
12886 * src/scan-gram.l: Remove stack option. We no longer use the
12887 stack, since the stack was never deeper than 1; instead, use the
12888 new auto var c_context to record the stacked value.
12889
12890 Remove nounput option. At an unexpected end of file, we now unput
12891 the minimal input necessary to end cleanly; this simplifies the
12892 code.
12893
12894 Avoid unbounded token sizes where this is easy.
12895
12896 (unexpected_end_of_file): New function.
12897 Use it to systematize the error message on unexpected EOF.
12898 (last-string): Now auto, not static.
12899 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12900 (scanner_last_string_free): Remove; not used.
12901 (percent_percent_count): Move decl to just before use.
12902 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12903 not the (never otherwised-used) CHARACTER.
12904
93724f13
AD
129052002-11-07 Akim Demaille <akim@epita.fr>
12906
12907 Let yyerror always receive the msg as last argument, so that
12908 yyerror can be variadic.
12909
12910 * data/yacc.c (b4_yyerror_args): New.
12911 Use it when calling yyerror.
12912 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12913 Use it when calling yyerror.
12914 * doc/bison.texinfo (Error Reporting): Adjust.
12915 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12916 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12917
6e40b4eb
AD
129182002-11-06 Akim Demaille <akim@epita.fr>
12919
12920 #line should have quoted strings.
12921 Ideally, this should be done by m4_quotearg.
12922
12923 * src/scan-skel.l: Include quotearg.h.
12924 Quote __ofile__.
12925 * src/output.c (symbol_printers_output)
12926 (symbol_destructors_output): Quote the file name.
12927
2dfbfc12
AD
129282002-11-06 Akim Demaille <akim@epita.fr>
12929
12930 * tests/regression.at (Invalid inputs): Adjust to the recent
12931 messages.
12932
437c2d80
AD
129332002-11-06 Akim Demaille <akim@epita.fr>
12934
12935 Restore --no-lines.
12936 Reported by Jim Kent.
12937
12938 * data/c.m4 (b4_syncline): New.
12939 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12940 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12941 * src/output.c (user_actions_output): Likewise.
12942 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 12943 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 12944
900c5db5
AD
129452002-11-06 Akim Demaille <akim@epita.fr>
12946
12947 * src/main.c (main): Free `infile'.
12948 * src/scan-gram.l (handle_syncline): New.
12949 Recognize `#line'.
12950 * src/output.c (user_actions_output, symbol_destructors_output)
12951 (symbol_printers_output): Use the location's file name, not
12952 infile.
12953 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12954
e183b123 129552002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 12956
e183b123 12957 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 12958 either has GLR conflict entries.
e183b123 12959
193eb6b7
PE
129602002-11-05 Paul Eggert <eggert@twinsun.com>
12961
e183b123
PE
12962 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12963 "integer out of range" rather than "invalid value".
12964 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12965 accordingly.
12966
193eb6b7
PE
12967 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12968 Also, remove one static variable in the scanner.
12969
12970 * src/scan-gram.l (braces_level): Now auto, not static.
12971 Initialize to zero if the compiler is being picky.
12972 (INITIAL): Clear braces_level instead of incrementing it.
12973 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12974 as POSIX 1003.1-2001 requires.
12975 * src/system.h (IF_LINT): New macro, taken from coreutils.
12976 * configure.ac: Define "lint" if --enable-gcc-warnings.
12977
29c01725
AD
129782002-11-05 Akim Demaille <akim@epita.fr>
12979
12980 * src/scan-gram.l: When it starts with `%', complain about the
12981 whole directive, not just that `invalid character: %'.
12982
8aeac3ca
AD
129832002-11-04 Akim Demaille <akim@epita.fr>
12984
12985 * Makefile.maint: Update from Autoconf.
12986 (update, cvs-update, po-update, do-po-update): New.
12987
793a58bb
AD
129882002-11-04 Akim Demaille <akim@epita.fr>
12989
12990 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
12991 and yyerror.
12992 Have yyerror `use' its arguments.
12993 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
12994 returns true when location & yacc & pure & parse-param.
12995 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
12996
c4d720cd
AD
129972002-11-04 Akim Demaille <akim@epita.fr>
12998
12999 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13000 clashes.
13001 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13002 font-lock-mode.
13003 Use complain_at.
13004 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13005 slot 0.
13006
613a0dc5
PE
130072002-11-03 Paul Eggert <eggert@twinsun.com>
13008
13009 * src/reader.c (get_merge_function, grammar_current_rule_check):
13010 Use consistent diagnostics for reporting type name clashes.
13011 Quote the types with <>, for consistency with Yacc.
13012 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13013
2a8d363a
AD
130142002-11-03 Akim Demaille <akim@epita.fr>
13015
13016 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13017 New.
13018 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13019 (b4_parse_param): Remove.
13020 Use b4_identification.
13021 Propagate b4_pure_args where needed to pass them to yyerror.
13022 * data/glr.m4 (b4_parse_param): Remove.
13023 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13024 (b4_lpure_formals): New.
13025 Use b4_identification.
13026 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13027 b4_user_formals and b4_user_args.
13028 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13029 (yyreportAmbiguity): When using a pure parser, also need
13030 the location, and the parse-params.
13031 Adjust callers.
13032 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13033 When using a pure parser, also need the parse-params.
13034 Adjust callers.
13035 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13036 (%pure-parser + %parse-param) LALR and GLR parsers.
13037 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13038 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13039 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13040 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13041 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13042 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13043 * doc/bison.texinfo: Untabify the whole file.
13044 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13045 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13046 (Error Reporting): Adjust to these new directives.
13047 Document %error-verbose, deprecate YYERROR_VERBOSE.
13048
9e32add8
AD
130492002-11-03 Akim Demaille <akim@epita.fr>
13050
13051 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13052 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13053 command line options.
13054 * tests/cxx-type.at: Formatting changes.
13055
b02d90a5
PE
130562002-11-03 Paul Eggert <eggert@twinsun.com>
13057
13058 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13059 to count columns correctly, and to check for invalid inputs.
9e32add8 13060
b02d90a5
PE
13061 Use mbsnwidth to count columns correctly. Account for tabs, too.
13062 Include mbswidth.h.
13063 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13064 (extend_location): New function.
13065 (YY_LINES): Remove.
13066
13067 Handle CRLF in C code rather than in Lex code.
13068 (YY_INPUT): New macro.
13069 (no_cr_read): New function.
13070
13071 Scan UCNs, even though we don't fully handle them yet.
13072 (convert_ucn_to_byte): New function.
13073
13074 Handle backslash-newline correctly in C code.
13075 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13076 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13077 all uses changed.
13078 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13079 Use {splice} wherever C allows backslash-newline.
13080 YY_STEP after space, newline, vertical-tab.
13081 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 13082
b02d90a5
PE
13083 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13084
13085 ({int}, handle_action_dollar, handle_action_at): Check for integer
13086 overflow.
9e32add8 13087
b02d90a5
PE
13088 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13089
13090 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13091 as well as \000. Check for UCHAR_MAX, not 255.
13092 Allow \x with an arbitrary positive number of digits, as in C.
13093 Check for overflow here.
13094 Allow \? and UCNs, for compatibility with C.
13095
13096 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13097 with quote slot used by complain_at.
13098
13099 * tests/input.at: Add tests for backslash-newline, m4 quotes
13100 in symbols, long literals, and funny escapes in strings.
13101
13102 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13103 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13104 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13105 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13106 * m4/mbswidth.m4: New file, from GNU coreutils.
13107
13108 * doc/bison.texinfo (Grammar Outline): Document // comments.
13109 (Symbols): Document that trigraphs have no special meaning in Bison,
13110 nor is backslash-newline allowed.
13111 (Actions): Document that trigraphs have no special meaning.
13112
13113 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13114 no longer used.
13115
131162002-11-02 Paul Eggert <eggert@twinsun.com>
13117
13118 * src/reader.c: Don't include quote.h; not needed.
13119 (get_merge_function): Reword warning to be consistent with
13120 type clash diagnostic in grammar_current_rule_check.
13121
13122 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13123 bug in trigraph handling.
13124
13125 * src/output.c (prepare_symbols): When printing token names,
13126 escape "[" as "@<:@" and likewise for "]".
13127
13128 * src/system.h (errno): Remove declaration, as we are now
13129 assuming C89 or better, and C89 guarantees errno.
13130
762b212b
PE
131312002-10-30 Paul Eggert <eggert@twinsun.com>
13132
13133 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13134 Check for close failures.
13135 * src/files.h (xfclose): Return void, not int, since it always
13136 returned zero.
13137 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13138 indicates one.
13139 * src/output.c (output_skeleton): Use xfclose rather than fclose
13140 and ferror. xfclose now checks ferror.
13141
13142 * data/glr.c (YYLEFTMOST_STATE): Remove.
13143 (yyreportTree): Use a stack-based leftmost state. This avoids
13144 our continuing battles with bogus warnings about initializers.
13145
56100c60
AD
131462002-10-30 Akim Demaille <akim@epita.fr>
13147
13148 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13149 #if.
13150
51b4a04c
PH
131512002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13152
13153 * tests/glr-regr1.at: New test for reported regressions.
13154 * tests/testsuite.at: Add glr-regr1.at test.
13155 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 13156
bf1ebda2
PE
131572002-10-24 Paul Eggert <eggert@twinsun.com>
13158
5c16c6b1
PE
13159 Version 1.75a.
13160
bf1ebda2
PE
13161 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13162 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13163 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13164 Don't assume strdup exists; POSIX says its an XSI extension.
13165 Check for buffer overflow on input.
13166
b526ee61
AD
131672002-10-24 Akim Demaille <akim@epita.fr>
13168
13169 * src/output.c (output_skeleton): Don't disable M4sugar comments
13170 too soon: it results in comments being expanded.
13171 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13172 first output.
13173
f1886bb2
AD
131742002-10-24 Akim Demaille <akim@epita.fr>
13175
13176 * data/yacc.c (m4_int_type): New.
13177 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13178 char' as only yacc.c wants K&R portability.
13179 * data/glr.c (yysigned_char): Remove.
13180 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13181 Reported by Quoc Peyrot.
13182
c5576256
PE
131832002-10-23 Paul Eggert <eggert@twinsun.com>
13184
13185 * src/main.c (main): With --trace=time, report times even if a
13186 non-fatal error occurs. Formerly, the times were reported in some
13187 such cases but not in others.
13188 * src/reader.c (reader): Just return if a complaint has been issued,
13189 instead of exiting, so that 'main' can report times.
13190
27b0ffea
AD
131912002-10-22 Akim Demaille <akim@epita.fr>
13192
13193 * src/system.h: Include sys/types.
13194 Reported by Bert Deknuydt.
13195
223a7883
PE
131962002-10-23 Paul Eggert <eggert@twinsun.com>
13197
13198 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13199 Suggested by Art Haas.
13200
132012002-10-22 Paul Eggert <eggert@twinsun.com>
13202
13203 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13204 decl; not needed any more.
13205 * src/main.c (main): Use return to exit, undoing yesterday's change.
13206 The last OS that we could find where this wouldn't work is
13207 SunOS 3.5, and that's too old to worry about now.
13208
13209 * data/glr.c (struct yyltype): Define members even when not
13210 doing locations. This is more consistent with yacc.c, and it
13211 works around the following bug reports:
161a71f3
PE
13212 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13213 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 13214
223a7883
PE
13215 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13216 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13217 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13218
8b76775a
AD
132192002-10-22 Akim Demaille <akim@epita.fr>
13220
13221 * data/README: New.
13222
6db10d14
PE
132232002-10-21 Paul Eggert <eggert@twinsun.com>
13224
13225 Be consistent about 'bool'; the old code used an enum in one
13226 module and an int in another, and this violates the C standard.
13227 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13228 * configure.ac (AC_HEADER_STDBOOL): Add.
13229 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13230 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13231 * src/symtab.c (hash_compare_symbol_t): Likewise.
13232 * src/system.h (bool, false, true): Use a definition consistent
13233 with ../lib/hash.c. All uses changed.
13234
13235 * src/complain.c (warning_issued): Renamed from warn_message_count,
13236 so that we needn't worry about integer overflow (!).
13237 Now of type bool. All uses changed.
13238 (complaint_issued): Renamed from complain_message_count; likewise.
13239
13240 * src/main.c (main): Use exit to exit with failure.
27b0ffea 13241
6db10d14
PE
13242 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13243 rather than 1 and 0.
13244 * src/main.c (main): Likewise.
13245 * src/getargs.c (getargs): Likewise.
13246 * src/reader.c (reader): Likewise.
13247
13248 * src/getarg.c (getargs): Remove duplicate code for
13249 "Try `bison --help'".
13250
13251 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13252 What was that "2" for?
13253
13254 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13255 * src/getargs.c (usage): Likewise.
13256
13257 * src/getargs.c (getargs): When there are too few operands, report
13258 the last one. When there are too many, report the first extra
13259 one. This is how diffutils does it.
13260
92a060fd
PE
132612002-10-20 Paul Eggert <eggert@twinsun.com>
13262
13263 Remove K&R vestiges.
13264 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13265 * src/complain.c (VA_START): Remove. Assume prototypes.
13266 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13267 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13268 fatal): Assume prototypes.
13269 * src/complain.h: Assume prototypes.
13270 * src/system.h (PARAMS): Remove.
13271 Include <limits.h> unconditionally, since it's guaranteeed even
13272 for a freestanding C89 compiler.
13273 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13274 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 13275
e7cb57c0
AD
132762002-10-20 Akim Demaille <akim@epita.fr>
13277
13278 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13279 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13280 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13281 (yyresolveStates, yyresolveAction, yyresolveStack)
13282 (yyprocessOneStack): Use them.
13283 (yy_reduce_print): New.
13284 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13285
0245f82d
AD
132862002-10-20 Akim Demaille <akim@epita.fr>
13287
13288 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13289 arguments and output `void'.
13290 (b4_c_function): Rename as...
13291 (b4_c_function_def): this.
13292 (b4_c_function_decl, b4_c_ansi_function_def)
13293 (b4_c_ansi_function_decl): New.
13294 Change the interpretation of the arguments: before `int, foo', now
13295 `int foo, foo'.
13296 * data/yacc.c (yyparse): Prototype and define thanks to these.
13297 Adjust b4_c_function_def uses.
13298 * data/glr.c (yyparse): Likewise, but ANSI only.
13299
39912f52
AD
133002002-10-20 Akim Demaille <akim@epita.fr>
13301
13302 * src/output.c (prepare): Move the definition of `tokens_number',
13303 `nterms_number', `undef_token_number', `user_token_number_max'
13304 to...
13305 (prepare_tokens): Here.
13306 (prepare_tokens): Rename as...
13307 (prepare_symbols): this.
13308 (prepare): Move the definition of `rules_number' to...
13309 (prepare_rules): here.
13310 (prepare): Move the definition of `last', `final_state_number',
13311 `states_number' to...
13312 (prepare_states): here.
13313 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13314
20c1e2ad
AD
133152002-10-20 Akim Demaille <akim@epita.fr>
13316
13317 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13318
21964f43
AD
133192002-10-20 Akim Demaille <akim@epita.fr>
13320
13321 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13322 * data/c.m4: here.
13323
66d30cd4
AD
133242002-10-20 Akim Demaille <akim@epita.fr>
13325
13326 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13327 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13328 `pair'.
13329 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13330 `name' to...
13331 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13332 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13333 These.
13334
95f2c9fe
PE
133352002-10-19 Paul Eggert <eggert@twinsun.com>
13336
13337 Do not create a temporary file, as that involves security and
13338 cleanup headaches. Instead, use a pair of pipes.
13339 Derived from a suggestion by Florian Krohm.
13340 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13341 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13342 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13343 (BISON_PREREQ_SUBPIPE): Add.
13344 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13345 Add subpipe.h, subpipe.c.
13346 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13347 * po/POTFILES.in: Add lib/subpipe.c.
13348 * src/output.c: Include "subpipe.h".
13349 (m4_invoke): Remove decl.
13350 (scan_skel): New decl.
13351 (output_skeleton): Use pipe rather than temporary file for m4 input.
13352 Check that m4sugar.m4 is readable, to avoid deadlock.
13353 Check for pipe I/O error.
13354 * src/scan-skel.l (readpipe): Remove decl.
13355 (scan_skel): New function, to be used in place of m4_invoke.
13356 Read from stream rather than file.
66d30cd4 13357
95f2c9fe
PE
13358 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13359 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13360 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13361 this generates a more-accurate value anyway.
13362
13363 * lib/timevar.c (timervar_accumulate): Rename locals to
13364 avoid confusion with similarly-named more-global.
13365 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13366
13367 * src/output.c (prepare): Use xstrdup to convert char const *
13368 to char *, to avoid GCC warning.
13369
c19988b7
AD
133702002-10-19 Akim Demaille <akim@epita.fr>
13371
13372 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13373 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13374 Use them to have `calc.y' ready for %pure-parser.
13375 * data/yacc.c (YYLEX): Pass a yylex return type to
13376 b4_c_function_call.
13377
ae7453f2
AD
133782002-10-19 Akim Demaille <akim@epita.fr>
13379
13380 Prototype support of %lex-param and %parse-param.
13381
13382 * src/parse-gram.y: Add the definition of the %lex-param and
13383 %parse-param tokens, plus their rules.
13384 Drop the `_' version of %glr-parser.
13385 Add the "," token.
13386 * src/scan-gram.l (INITIAL): Scan them.
13387 * src/muscle_tab.c: Comment changes.
13388 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13389 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13390 (muscle_entry_s): The `value' member is no longer const.
13391 Adjust all dependencies.
13392 * src/muscle_tab.c (muscle_init): Adjust: use
13393 MUSCLE_INSERT_STRING.
13394 Initialize the obstack earlier.
13395 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13396 (muscle_pair_list_grow): New.
13397 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13398 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13399 * tests/calc.at: Use %locations, not --locations.
13400 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13401
0e575721
AD
134022002-10-19 Akim Demaille <akim@epita.fr>
13403
13404 * src/getargs.c (usage): Take status as argument and exit
13405 accordingly.
13406 Report the traditional `Try ... --help' message when status != 0.
13407 (usage, version): Don't take a FILE * as arg, it is pointless.
13408 (getargs): When there is an incorrect number of arguments, make it
13409 an error, and report it GNUlically thanks to `usage ()'.
13410
724ce7f5
PE
134112002-10-18 Paul Eggert <eggert@twinsun.com>
13412
3a781eb2
PE
13413 * data/glr.c (yyreportParseError): Don't assume that sprintf
13414 yields the length of the printed string, as this is not true
13415 on SunOS 4.1.4. Reported by Peter Klein.
13416
724ce7f5
PE
13417 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13418 * tests/conflicts.at (%nonassoc and eof): Likewise.
13419 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13420
473d0a75
AD
134212002-10-17 Akim Demaille <akim@epita.fr>
13422
13423 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13424 * src/getargs.c (trace_types, trace_args): Adjust.
13425 * src/reader.c (grammar_current_rule_prec_set)
13426 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13427 Standardize error messages.
13428 And s/@prec/%prec/!
13429 (reader): Use trace_flag to enable scanner/parser debugging,
13430 instead of an adhoc scheme.
13431 * src/scan-gram.l: Remove trailing debugging code.
13432
e76d2469
PE
134332002-10-16 Paul Eggert <eggert@twinsun.com>
13434
93e2236a
PE
13435 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13436 MUSCLE_TAB_H.
13437
e76d2469
PE
13438 * NEWS: Officially drop support for building Bison with K&R C,
13439 since it didn't work anyway and it's not worth worrying about.
13440 * Makefile.maint (wget_files): Remove ansi2knr.c.
13441 (ansi2knr.c-url_prefix): Remove.
13442 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13443 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13444 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13445
5bd1c419
PE
134462002-10-15 Paul Eggert <eggert@twinsun.com>
13447
13448 Stop using the "enum_" trick for K&R-style function definitions;
13449 it confused me, and I was the author! Instead, assume that people
13450 who want to use K&R C compilers (when using these modules in GCC,
13451 perhaps?) will run ansi2knr.
13452
13453 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13454 All uses of "enum_" changed to "enum ".
13455 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13456 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 13457
5bd1c419
PE
13458 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13459 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13460 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13461 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13462 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13463 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13464 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13465 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13466 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13467 Use function prototypes; this removes the need for declaring
13468 static functions simply to provide their prototypes.
13469 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13470 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13471 bitset_count_, bitset_create, bitset_dump, bitset_first,
13472 bitset_free, bitset_init, bitset_last, bitset_next,
13473 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13474 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13475 bitset_print, bitset_release_memory, bitset_toggle_,
13476 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13477 debug_bitset): Likewise.
13478 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13479 * lib/bitset_stats.c (bitset_log_histogram_print,
13480 bitset_percent_histogram_print, bitset_stats_and,
13481 bitset_stats_and_cmp, bitset_stats_and_or,
13482 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13483 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13484 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13485 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13486 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13487 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13488 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13489 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13490 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13491 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13492 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13493 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13494 bitset_stats_zero): Likewise.
13495 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13496 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13497 bitsetv_dump, debug_bitsetv): Likewise.
13498 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13499 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13500 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13501 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13502 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13503 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13504 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13505 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13506 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13507 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13508 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13509 Likewise.
13510 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13511 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13512 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13513 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13514 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13515 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13516 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13517 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13518 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13519 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13520 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 13521
ae26e1f0
AD
135222002-10-14 Akim Demaille <akim@epita.fr>
13523
13524 Version 1.75.
13525
d43baf71
AD
135262002-10-14 Akim Demaille <akim@epita.fr>
13527
13528 * tests/Makefile.am (maintainer-check-posix): New.
13529
7ebc83e3
AD
135302002-10-14 Akim Demaille <akim@epita.fr>
13531
13532 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13533 member.
13534
05846dae
AD
135352002-10-14 Akim Demaille <akim@epita.fr>
13536
13537 * src/tables.c (table_ninf_remap): base -> tab.
13538 Reported by Matt Rosing.
13539
1318e37d
PE
135402002-10-14 Paul Eggert <eggert@twinsun.com>
13541
447fbb17
PE
13542 * tests/action.at, tests/calc.at, tests/conflicts.at,
13543 tests/cxx-type.at, tests/headers.at, tests/input.at,
13544 tests/regression.at, tests/synclines.at, tests/torture.at:
13545 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13546 so that the tests still work even if POSIXLY_CORRECT is set.
13547 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 13548
1318e37d
PE
13549 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13550 for portability to K&R hosts. Fix typo: signed char is guaranteed
13551 only to 127, not to 128.
13552 * data/glr.c (yysigned_char): New type.
13553 * data/yacc.c (yysigned_char): Likewise.
13554 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13555
cc0f0794
PE
135562002-10-13 Paul Eggert <eggert@twinsun.com>
13557
5038f418
PE
13558 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13559 true due to limited range of data type" warning from GCC.
13560
cc0f0794
PE
13561 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13562 by wrapping enum yytokentype's definition inside #ifndef
13563 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13564
6fed0802
AD
135652002-10-13 Akim Demaille <akim@epita.fr>
13566
13567 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13568 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13569
32f0598d
AD
135702002-10-13 Akim Demaille <akim@epita.fr>
13571
13572 * Makefile.maint: Update from Autoconf 2.54.
13573 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13574
7ea9a33f
AD
135752002-10-13 Akim Demaille <akim@epita.fr>
13576
13577 * src/print.c (print_state): Separate the list of solved conflicts
13578 from the other items.
13579 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13580
ea99527d
AD
135812002-10-13 Akim Demaille <akim@epita.fr>
13582
13583 Let nondeterministic skeletons be usable with deterministic
13584 tables.
13585
13586 With the patch, GAWK compiled by GCC without -O2 passes its test
13587 suite using a GLR parser driven by LALR tables. It fails with -O2
13588 because `struct stat' gives two different answers on my machine:
13589 88 (definition of an auto var) and later 96 (memset on this var).
13590 Hence the stack is badly corrumpted. The headers inclusion is to
13591 blame: if I move the awk.h inclusion before GLR's system header
13592 inclusion, the two struct stat have the same size.
13593
13594 * src/tables.c (pack_table): Always create conflict_table.
13595 (token_actions): Always create conflict_list.
13596 * data/glr.c (YYFLAG): Remove, unused.
13597
f377f69f
AD
135982002-10-13 Akim Demaille <akim@epita.fr>
13599
13600 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13601 (O0FLAGS): New.
13602 (VALGRIND, GXX): New.
13603 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13604 * tests/bison.in: Run $PREBISON a pre-command.
13605 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13606 (maintainer-check-g++): New.
13607 * Makefile.am (maintainer-check): New.
13608
2a1fe6ed
AD
136092002-10-13 Akim Demaille <akim@epita.fr>
13610
13611 * data/glr.c: Formatting changes.
13612 Tweak some trace messages to match yacc.c's.
13613
f50adbbd
AD
136142002-10-13 Akim Demaille <akim@epita.fr>
13615
13616 GLR parsers sometimes raise parse errors instead of performing the
13617 default reduction.
13618 Reported by Charles-Henry de Boysson.
13619
13620 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 13621 check the length of the traces when %glr.
f50adbbd
AD
13622 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13623 GLR's traces.
13624 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13625 Test GLR parsers.
13626 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13627 (yyltype): Remove the yy prefix from the member names.
13628 (yytable): Complete its comment.
13629 (yygetLRActions): Map error action number from YYTABLE from
13630 YYTABLE_NINF to 0.
13631 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13632 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13633 not satisfying as we could compare an YYACTION computed from
13634 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13635 only value for error actions.
13636 (yyreportParseError): In verbose parse error messages, don't issue
13637 `error' in the list of expected tokens.
13638 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13639 next action to perform to match glr.c's decoding.
13640 (yytable): Complete its comment.
13641
bcbad5b9
PE
136422002-10-13 Paul Eggert <eggert@twinsun.com>
13643
13644 Fix problem reported by Henrik Grubbstroem in
161a71f3 13645 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
13646 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13647 because the Bison parser reads the second action before reducing
13648 the first one.
13649 * src/scan-gram.l (rule_length): New static var.
13650 Use it to keep track of the rule length in the scanner, since
13651 we can't expect the parser to be in lock-step sync with the scanner.
13652 (handle_action_dollar, handle_action_at): Use this var.
13653 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 13654
14904b89
PE
136552002-10-12 Paul Eggert <eggert@twinsun.com>
13656
1fe611e5
PE
13657 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13658 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13659 Include <sys/time.h> when checking for clock_t and struct tms.
13660 Use same include order as source.
13661 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 13662 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 13663
1fe611e5
PE
13664 * lib/timevar.c: Update copyright date and clarify comments.
13665 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 13666
1fe611e5
PE
13667 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13668 GCC version as of today, then merge Bison's changes.
13669 Change "GCC" to "Bison" in copyright notice. timevar.def's
13670 author is Akim, so change that too.
13671
98194095
PE
13672 * src/reader.c (grammar_current_rule_check):
13673 Don't worry about the default action if $$ is untyped.
13674 Prevents bogus warnings reported by Jim Gifford in
161a71f3 13675 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 13676
14904b89
PE
13677 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13678 * data/glr.c, data/lalr1.cc, data/yacc.c:
13679 Output token definitions before the first part of user declarations.
13680 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 13681 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 13682
ff6dca18
PE
136832002-10-11 Paul Eggert <eggert@twinsun.com>
13684
13685 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13686 (yyparse): here. This undoes some of the 2002-07-25 change.
13687 Compatibility problem reported by Ralf S. Engelschall with
13688 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13689
eb714592
AD
136902002-10-11 Akim Demaille <akim@epita.fr>
13691
13692 * tests/regression.at Characters Escapes): New.
13693 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13694 characters.
13695 Reported by Jan Nieuwenhuizen.
13696
b7195100
AD
136972002-10-11 Akim Demaille <akim@epita.fr>
13698
13699 * po/id.po: New.
13700
f28a0f2d
PE
137012002-10-10 Paul Eggert <eggert@twinsun.com>
13702
13703 Portability fixes for bitsets; this also avoids several GCC
13704 warnings.
13705
13706 * lib/abitset.c: Include <stddef.h>, for offsetof.
13707 * lib/lbitset.c: Likewise.
13708
13709 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13710 properly for vectors of objects. Do not assume that adding a
13711 header size to a multiple of a word size yields a value that is
13712 properly aligned for the whole union.
13713 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13714
13715 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13716 unique names for structures.
13717 * lib/ebitset.c (ebitset_bytes): Likewise.
13718 * lib/lbitset.c (lbitset_bytes): Likewise.
13719
13720 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13721 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13722 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13723 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13724 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13725 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13726 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13727 to improve the type-checking that GCC can do.
13728 * lib/bitset.c (bitset_op4_cmp): Likewise.
13729 * lib/bitset_stats.c (bitset_stats_count,
13730 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13731 bitset_stats_copy, bitset_stats_disjoint_p,
13732 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13733 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13734 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13735 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13736 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13737 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13738 bitset_stats_or_and_cmp): Likewise.
13739 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13740 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13741 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13742 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13743
13744 * lib/abitset.h: Include bitset.h, not bbitset.h.
13745 * lib/ebitset.h: Likewise.
13746 * lib/lbitset.h: Likewise.
13747
13748 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13749 All instances of parameters of type enum bitset_opts are now of
13750 type enum_bitset_opts, to conform to the C Standard, and similarly
13751 for enum_bitset_type.
13752 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13753 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13754
13755 Do not use "struct bitset_struct" to mean different things in
13756 different modules. Not only is this confusing, it violates
13757 the C Standard, which requires that structure types in different
13758 modules must be compatible if one is to be passed to the other.
13759 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13760 All instances of "struct bitset_struct *" replaced with "bitset".
13761 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13762 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13763 struct lbitset_struct, struct bitset_stats_struct): New types.
13764 All uses of struct bitset_struct changed to union bitset_union,
13765 etc.
ba0fe3c7 13766 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
13767 struct bitset_struct): Remove.
13768 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13769 struct bitset_struct): Remove.
13770 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13771 bitset_struct): Remove.
13772 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13773 Likewise.
13774
13775 Do not call a function of type T using a call that assumes the
13776 function is of a different type U. Standard C requires that a
13777 function must be called with a type that is compatible with its
13778 definition.
13779 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13780 New decls.
13781 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13782 New functions.
13783 * lib/ebitset.c (PFV): Remove.
13784 * lib/lbitset.c (PFV): Likewise.
13785 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13786 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13787 decls.
13788 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13789 (ebitset_vtable): Use them.
13790 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13791 lbitset_xor): New functions.
13792 (lbitset_vtable): Use them.
13793
13794 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13795 Declare.
13796
13797 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13798 GCC warning.
13799 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13800 Use offsetof, for simplicity.
13801
6fbe4984
PE
138022002-10-06 Paul Eggert <eggert@twinsun.com>
13803
13804 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13805 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 13806 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
13807 which was inadvertently undone by the 2002-09-30 patch.
13808 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13809 the same width as int.
13810
420f93c8
PE
138112002-10-04 Paul Eggert <eggert@twinsun.com>
13812
13813 Version 1.50.
13814
13815 * configure.ac (AC_INIT), NEWS: Increment version number.
13816
13817 * doc/bison.texinfo: Minor spelling, grammar, and white space
13818 fixes.
13819 (Symbols): Mention that any negative value returned from yylex
13820 signifies end-of-input. Warn about negative chars. Mention
13821 the portable Standard C character set.
13822
13823 The GNU coding standard says CFLAGS and YFLAGS are reserved
13824 for the installer to set.
13825 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13826 * src/Makefile.am (AM_CFLAGS): Likewise.
13827 (AM_YFLAGS): Renamed from YFLAGS.
13828
13829 Fix some MAX and MIN problems.
13830 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13831 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13832 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13833 * src/reader.c (reader): Use it.
13834
13835 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13836 POSIX 1003.1-2001 has removed fgrep.
13837
138382002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13839
13840 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13841 interpreted as signed.
13842 * lib/ebitset.c (ebitset_list): Fix bug.
13843
ff68026d
PE
138442002-10-01 Paul Eggert <eggert@twinsun.com>
13845
13846 More fixes for 64-bit hosts and large bitsets.
13847
13848 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13849 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13850 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13851 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13852 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13853 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13854 bitset_count_): Likewise.
13855 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13856 bitset_first, bitset_last): Likewise.
13857 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13858 bitset_stats_list_reverse, bitset_stats_size,
13859 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13860 Likewise.
13861 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13862 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13863 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13864 bitsetv_reflexive_transitive_closure): Likewise.
13865 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13866 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13867 Likewise.
13868 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13869 Likewise.
420f93c8 13870
ff68026d
PE
13871 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13872 Use size_t, not unsigned int, to count bytes.
13873 * lib/abitset.h (abitset_bytes): Likewise.
13874 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13875 Likewise.
13876 * lib/bitset.h (bitset_bytes): Likewise.
13877 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13878 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13879 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13880 * lib/ebitset.c (ebitset_bytes): Likewise.
13881 * lib/ebitset.h (ebitset_bytes): Likewise.
13882 * lib/lbitset.c (lbitset_bytes): Likewise.
13883 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 13884
ff68026d
PE
13885 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13886 abitset_subset_p, abitset_disjoint_p, abitset_and,
13887 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13888 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13889 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13890 abitset_or_and, abitset_or_and_cmp):
13891 Use bitset_windex instead of unsigned int.
13892 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13893 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13894 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13895 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13896 Likewise.
13897 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 13898
ff68026d
PE
13899 * lib/bitset.c (bitset_print):
13900 Use proper printf formats for widths of integer types.
13901 * lib/bitset_stats.c (bitset_percent_histogram_print,
13902 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13903 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13904 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13905 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 13906
ff68026d
PE
13907 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13908 BITSET_SIZE_MAX): New macros.
13909 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13910 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13911 to BITSET_WINDEX_MAX.
13912
13913 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13914 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13915 since we now return the bitset_bindex type (not int).
13916
13917 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13918 when computing sizes.
13919 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13920
13921 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13922 and avoid cast to unsigned.
13923
6aa452a6
AD
139242002-09-30 Akim Demaille <akim@epita.fr>
13925
13926 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13927 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13928 Updates from Michael Hayes.
13929
927f7817
AD
139302002-09-30 Art Haas <ahaas@neosoft.com>
13931
13932 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13933 invocations.
13934 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13935 defined.
13936
9738f41e
AD
139372002-09-27 Akim Demaille <akim@epita.fr>
13938
13939 Version 1.49c.
13940
a5c75d7f
AD
139412002-09-27 Akim Demaille <akim@epita.fr>
13942
13943 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13944 (Because of AC_LIBSOURCE).
13945
8280e179
AD
139462002-09-27 Akim Demaille <akim@epita.fr>
13947
13948 Playing with Autoscan.
13949
13950 * configure.ac: Remove the old LIBOBJ tweaks.
13951 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13952 * lib/strrchr.c: New.
13953 * lib/strtol.c: New, from the Coreutils 4.5.1.
13954
ae64af35
AD
139552002-09-27 Akim Demaille <akim@epita.fr>
13956
13957 Playing with Autoscan.
13958
13959 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13960 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13961 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13962 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13963 Coreutils 4.5.1.
13964
d1a1114f
AD
139652002-09-24 Akim Demaille <akim@epita.fr>
13966
13967 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13968 (Frequently Asked Questions, Parser Stack Overflow): New.
13969
b906441c
AD
139702002-09-13 Akim Demaille <akim@epita.fr>
13971
13972 Playing with autoscan.
13973
13974 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13975 * src/files.c (skeleton_find): Remove, unused.
13976 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13977 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13978
bd701811
AD
139792002-09-13 Akim Demaille <akim@epita.fr>
13980
13981 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13982 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13983
e0a13e7b
AD
139842002-09-13 Akim Demaille <akim@epita.fr>
13985
13986 * configure.ac: Require 2.54.
13987 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
13988 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
13989 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
13990 Remove, provided by Autoconf macros.
13991
c97011bf
AD
139922002-09-12 Akim Demaille <akim@epita.fr>
13993
13994 * m4/prereq.m4: Update, from Coreutils 4.5.1.
13995
d862b1be
AD
139962002-09-12 Akim Demaille <akim@epita.fr>
13997
13998 * m4/prereq.m4: Update, from Fileutils 4.1.5.
13999 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14000 Reported by Martin Mokrejs.
14001
3d38c03a
AD
140022002-09-10 Akim Demaille <akim@epita.fr>
14003
14004 * src/parse-gram.y: Associate a human readable string to each
14005 token type.
14006 * tests/regression.at (Invalid inputs): Adjust.
14007
b6347355
AD
140082002-09-10 Gary V. Vaughan <gary@gnu.org>
14009
14010 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14011 with an Autoconf-2.5x style configure.ac.
14012
09ba4ab2
PE
140132002-09-06 Paul Eggert <eggert@twinsun.com>
14014
14015 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14016 exception applies only to yacc.c. This is a modification of a
14017 patch originally suggested by Akim Demaille.
14018
21846f69
AD
140192002-09-06 Akim Demaille <akim@epita.fr>
14020
09ba4ab2
PE
14021 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14022 here to...
14023 * data/yacc.c: here.
14024
21846f69
AD
14025 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14026 LocationType.
14027 (b4_ltype): Default to yy::Location from location.hh.
14028
c0ad8bf3
AD
140292002-09-04 Jim Meyering <jim@meyering.net>
14030
14031 * data/yacc.c: Guard the declaration of yytoknum also with
14032 `#ifdef YYPRINT', so it is declared only when used.
14033
3a93251e
AD
140342002-09-04 Akim Demaille <akim@epita.fr>
14035
14036 * configure.in: Rename as...
14037 * configure.ac: this.
14038 Bump to 1.49c.
14039
427c0dda
AD
140402002-09-04 Akim Demaille <akim@epita.fr>
14041
14042 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14043 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14044 translate maintainer only messages.
14045
6a254321
PE
140462002-08-12 Paul Eggert <eggert@twinsun.com>
14047
645e30d1
PE
14048 Version 1.49b.
14049
6a254321
PE
14050 * Makefile.am (SUBDIRS): Remove intl.
14051 (DISTCLEANFILES): Remove.
14052 * NEWS: Mention that GNU M4 is now required. Clarify what is
14053 meant by "larger grammars". Mention the pt_BR translation.
14054 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14055 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14056 Bump version from 0.11.2 to 0.11.5.
14057 (BISON_PREREQ_STAGE): Remove.
14058 (AM_GNU_GETTEXT): Use external gettext.
14059 (AC_OUTPUT): Remove intl/Makefile.
14060
14061 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14062
14063 * data/glr.c: Include string.h, for strlen.
14064 (yyreportParseError): Use size_t for yysize.
14065 (yy_yypstack): No longer nested inside yypstates, as nested
14066 functions are not portable. Do not assume size_t is the
14067 same width as int.
14068 (yypstates): Do not assume that ptrdiff_t is the same width
14069 as int, and similarly for yyposn and YYINDEX.
14070
14071 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14072
14073 * lib/Makefile.am (INCLUDES): Do not include from the intl
14074 directory, which has been removed.
14075 * src/Makefile.am (INCLUDES): Likewise.
14076
14077 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14078 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14079 New vars.
14080
14081 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14082 * tests/Makefile.am (EXTRA_DIST): Likewise.
14083
14084 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14085 Do not assume that bitset_windex is the same width as unsigned.
14086
14087 * lib/abitset.c (abitset_unused_clear): Do not assume that
14088 bitset_word is the same width as int.
14089 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14090 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14091 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14092 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14093 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14094
14095 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14096 portability to one's complement hosts!).
14097 * lib/ebitset.c (ebitset_op1): Likewise.
14098 * lib/lbitset.c (lbitset_op1): Likewise.
14099
14100 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14101 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14102 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14103 Sync with fileutils.
14104 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14105 lib/gettext.h: Sync with diffutils.
14106
14107 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14108 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14109
14110 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14111 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14112 check for void *.
14113
14114 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14115 size_t; the old version tried to do this but casted improperly.
14116 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14117 (bitset_test): Now returns int, not unsigned long.
14118
14119 * lib/bitset_stats.c: Include "gettext.h".
14120 (_): New macro.
14121 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14122 name locals "index", as it generates unnecessary warnings on some
14123 hosts that have an "index" function.
14124
14125 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14126 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14127 they need translation.
14128 * src/LR0.c (state_list_append, new_itemsets, get_state,
14129 append_states, generate_states): Likewise.
14130 * src/assoc.c (assoc_to_string): Likewise.
14131 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14132 * src/gram.c (grammar_dump): Likewise.
14133 * src/injections.c (injections_compute): Likewise.
14134 * src/lalr.c (lookaheads_print): Likewise.
14135 * src/relation.c (relation_transpose): Likewise.
14136 * src/scan-gram.l: Likewise.
14137 * src/tables.c (table_grow, pack_vector): Likewise.
14138
14139 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14140 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14141 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14142 * m4/mbstate_t.m4: Sync with fileutils.
14143 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14144
14145 * po/LINGUAS: Add pt_BR.
14146 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14147 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14148 lib/timevar.c.
14149 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14150 manual recommends.
14151 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14152
14153 * src/complain.c (strerror_r): Remove decl; not needed.
14154 (strerror): Use same pattern as ../lib/error.c.
14155
14156 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14157
14158 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14159
14160 * src/main.c (main): Cast result of bindtextdomain and textdomain
14161 to void, to avoid a GCC warning when --disable-nls is in effect.
14162
14163 * src/scan-gram.l: Use strings rather than escapes when possible,
14164 to minimize the number of warnings from xgettext.
14165 (handle_action_dollar, handle_action_at): Don't use isdigit,
14166 as it mishandles negative chars and it may not work as expected
14167 outside the C locale.
14168
14169 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14170 this is a GCC extension and is not portable to other compilers.
14171
14172 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14173 Do not include <ctype.h>; no longer needed.
14174 Do not include <malloc.h>; no longer needed (and generates
14175 warnings on OpenBSD 3.0).
14176
14177 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14178 it's not portable.
14179
14180 * tests/regression.at: Do not use 'cc -c input.c -o input';
14181 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14182
14183 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14184 exit status as failure, not just exit status 1. Sun C exits
14185 with status 2 sometimes.
14186
14187 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14188 Use it for the two large tests.
14189
c8f002c7
AD
141902002-08-02 Akim Demaille <akim@epita.fr>
14191
14192 * src/conflicts.c (conflicts_output): Don't output rules never
14193 reduced here, since anyway that computation doesn't work.
14194 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14195 (rule_useless_p, rule_never_reduced_p): New.
14196 (grammar_rules_partial_print): Use a filter instead of a range.
14197 Display the title only if needed.
14198 (grammar_rules_print): Adjust.
14199 (grammar_rules_never_reduced_report): New.
14200 * src/tables.c (action_row): Move the computation of rules never
14201 reduced to...
14202 (token_actions): here.
14203 * src/main.c (main): Make the parser before making the report, so
14204 that rules never reduced are computed.
14205 Call grammar_rules_never_reduced_report.
14206 * src/print.c (print_results): Report rules never reduced.
14207 * tests/conflicts.at, tests/reduce.at: Adjust.
14208
cd08e51e
AD
142092002-08-01 Akim Demaille <akim@epita.fr>
14210
14211 Instead of attaching lookaheads and duplicating the rules being
14212 reduced by a state, attach the lookaheads to the reductions.
14213
14214 * src/state.h (state_t): Remove the `lookaheads',
14215 `lookaheads_rule' member.
14216 (reductions_t): Add a `lookaheads' member.
14217 Use a regular array for the `rules'.
14218 * src/state.c (reductions_new): Initialize the lookaheads member
14219 to 0.
14220 (state_rule_lookaheads_print): Adjust.
14221 * src/state.h, src/state.c (state_reductions_find): New.
14222 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14223 (count_rr_conflicts): Adjust.
14224 * src/lalr.c (LArule): Remove.
14225 (add_lookback_edge): Adjust.
14226 (state_lookaheads_count): New.
14227 (states_lookaheads_initialize): Merge into...
14228 (initialize_LA): this.
14229 (lalr_free): Adjust.
14230 * src/main.c (main): Don't free nullable and derives too early: it
14231 is used by --verbose.
14232 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14233
bb0027a9
AD
142342002-08-01 Akim Demaille <akim@epita.fr>
14235
14236 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14237 `rule_number_t**'.
14238 (set_derives, free_derives): Rename as...
14239 (derives_compute, derives_free): this.
14240 Adjust all dependencies.
14241 * src/nullable.c (set_nullable, free_nullable): Rename as...
14242 (nullable_compute, nullable_free): these.
14243 (rule_list_t): Store rule_t *, not rule_number_t.
14244 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14245 pointers, instead of their numbers.
14246 * src/main.c (main): Call nullable_free, and derives_free earlier,
14247 as they were lo longer used.
14248
3325ddc4
AD
142492002-08-01 Akim Demaille <akim@epita.fr>
14250
14251 * lib/timevar.c (get_time): Include children time.
14252 * src/lalr.h (LA, LArule): Don't export them: used with the
14253 state_t.
14254 * src/lalr.c (LA, LArule): Static.
14255 * src/lalr.h, src/lalr.c (lalr_free): New.
14256 * src/main.c (main): Call it.
14257 * src/tables.c (pack_vector): Check whether loc is >= to the
14258 table_size, not >.
14259 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14260 (tables_generate): do it, since that's also it which allocates
14261 them.
14262 Don't free LA and LArule, main does.
14263
c6f1a33c
AD
142642002-07-31 Akim Demaille <akim@epita.fr>
14265
14266 Separate parser tables computation and output.
14267
14268 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14269 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14270 (yydefgoto, yydefact, high): Move to...
14271 * src/tables.h, src/tables.c: here.
14272 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14273 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14274 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14275 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14276 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14277 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14278 (action_row, save_row, token_actions, save_column, default_goto)
14279 (goto_actions, sort_actions, matching_state, pack_vector)
14280 (table_ninf_remap, pack_table, prepare_actions): Move to...
14281 * src/tables.c: here.
14282 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14283 * src/output.c (token_actions, output_base, output_conflicts)
14284 (output_check): Merge into...
14285 (prepare_actions): this.
14286 (actions_output): Rename as...
14287 (user_actions_output): this.
14288 * src/main.c (main): Call tables_generate and tables_free.
14289
1509d42f
AD
142902002-07-31 Akim Demaille <akim@epita.fr>
14291
14292 Steal GCC's --time-report support.
14293
14294 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14295 stolen/adjusted from GCC.
14296 * m4/stage.m4: Remove time related checks.
14297 * m4/timevar.m4: New.
14298 * configure.in: Adjust.
14299 * src/system.h: Adjust to using timevar.h.
14300 * src/getargs.h, src/getargs.c: Support trace_time for
14301 --trace=time.
14302 * src/main.c (stage): Remove.
14303 (main): Replace `stage' invocations with timevar calls.
14304 * src/output.c: Insert pertinent timevar calls.
14305
273a74fa
AD
143062002-07-31 Akim Demaille <akim@epita.fr>
14307
14308 Let --trace have arguments.
14309
14310 * src/getargs.h (enum trace_e): New.
14311 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14312 (long_options, short_options): --trace/-T takes an optional
14313 argument.
14314 Change all the uses of trace_flag to reflect the new flags.
14315 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14316
14317 Strengthen `stage' portability.
14318
14319 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14320 * configure.in: Use it.
14321 Don't check for malloc.h and sys/times.h.
14322 * src/system.h: Include them when appropriate.
14323 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14324 times and struct tms are available.
14325
217598da
AD
143262002-07-30 Akim Demaille <akim@epita.fr>
14327
14328 In verbose parse error message, don't report `error' as an
14329 expected token.
14330 * tests/actions.at (Printers and Destructors): Adjust.
14331 * tests/calc.at (Calculator $1): Adjust.
14332 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14333 error message, do not report the parser accepts the error token in
14334 that state.
14335
52489d44
AD
143362002-07-30 Akim Demaille <akim@epita.fr>
14337
14338 Normalize conflict related messages.
14339
14340 * src/complain.h, src/complain.c (warn, complain): New.
14341 * src/conflicts.c (conflicts_print): Use them.
14342 (conflict_report_yacc): New, extracted from...
14343 (conflicts_print): here.
14344 * tests/conflicts.at, tests/existing.at: Adjust.
14345
e8832397
AD
143462002-07-30 Akim Demaille <akim@epita.fr>
14347
14348 Report rules which are never reduced by the parser: those hidden
14349 by conflicts.
14350
14351 * src/LR0.c (save_reductions): Don't make the final state too
14352 different: save its reduction (accept) instead of having a state
14353 without any action (no shift or goto, no reduce).
14354 Note: the final state is now a ``regular'' state, i.e., the
14355 parsers now contain `reduce 0' as default reduction.
14356 Nevertheless, since they decide to `accept' when yystate =
14357 final_state, they still will not reduce rule 0.
14358 * src/print.c (print_actions, print_reduction): Adjust.
14359 * src/output.c (action_row): Track reduced rules.
14360 (token_actions): Report rules never reduced.
14361 * tests/conflicts.at, tests/regression.at: Adjust.
14362
caf23d24
AD
143632002-07-30 Akim Demaille <akim@epita.fr>
14364
14365 `stage' was accidently included in a previous patch.
14366 Initiate its autoconfiscation.
14367
14368 * configure.in: Look for malloc.h and sys/times.h.
14369 * src/main.c (stage): Adjust.
14370 Report only when trace_flag.
14371
640748ee
AD
143722002-07-29 Akim Demaille <akim@epita.fr>
14373
14374 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14375 state_number_t.
14376 (errs_t): symbol_t*, not symbol_number_t.
14377 (reductions_t): rule_t*, not rule_number_t.
14378 (FOR_EACH_SHIFT): New.
14379 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14380 * src/print.c, src/print_graph.c: Adjust.
14381
88bce5a2
AD
143822002-07-29 Akim Demaille <akim@epita.fr>
14383
14384 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14385
14386 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14387 (endtoken, accept): these.
14388 * src/reader.c (reader): Set endtoken's default tag to "$end".
14389 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14390 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14391 Adjust.
14392
1bfb97db
AD
143932002-07-29 Akim Demaille <akim@epita.fr>
14394
14395 * src/reduce.c (reduce_grammar): When the language is empty,
14396 complain about the start symbol, not the axiom.
14397 Use its location.
14398 * tests/reduce.at (Empty Language): New.
14399
fc5734fe
AD
144002002-07-26 Akim Demaille <akim@epita.fr>
14401
14402 * src/reader.h, src/reader.c (gram_error): ... can't get
14403 yycontrol without making too strong assumptions on the parser
14404 itself.
14405 * src/output.c (prepare_tokens): Use the real 0th value of
14406 token_translations instead of `0'.
14407 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14408 visible here.
14409 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14410 for the time being: %locations ought to provide it to yyerror.
14411
3650b4b8
AD
144122002-07-25 Akim Demaille <akim@epita.fr>
14413
14414 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14415 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14416 * tests/regression.at (Web2c Actions): Adjust.
14417
4b3d3a8e
AD
144182002-07-25 Akim Demaille <akim@epita.fr>
14419
14420 Stop storing rules from 1 to nrules + 1.
14421
14422 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14423 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14424 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14425 Iterate from 0 to nrules.
14426 Use rule_number_as_item_number and item_number_as_rule_number.
14427 Adjust to `derive' now containing possibly 0.
14428 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14429 Handle the `- 1' part in rule numbers from/to item numbers.
14430 * src/conflicts.c (log_resolution): Fix the message which reversed
14431 shift and reduce.
14432 * src/output.c (action_row): Initialize default_rule to -1.
14433 (token_actions): Adjust.
14434 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14435 expected output.
14436 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14437
4a2a22f4
AD
144382002-07-25 Akim Demaille <akim@epita.fr>
14439
14440 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14441 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14442 (b4_c_knr_arg_decl): New.
14443 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14444 yyreport_parse_error.
14445
b8df3223
AD
144462002-07-25 Akim Demaille <akim@epita.fr>
14447
14448 * data/yacc.c (yyreport_parse_error): New, extracted from...
14449 (yyparse): here.
14450 (yydestruct, yysymprint): Move above yyparse.
14451 Be K&R compliant.
14452
a762e609
AD
144532002-07-25 Akim Demaille <akim@epita.fr>
14454
14455 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14456 replace...
14457 (b4_sint_type, b4_uint_type): these.
14458 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14459 * tests/regression.at (Web2c Actions): Adjust.
14460
12b0043a
AD
144612002-07-25 Akim Demaille <akim@epita.fr>
14462
14463 * src/gram.h (TIEM_NUMBER_MAX): New.
14464 (item_number_of_rule_number, rule_number_of_item_number): Rename
14465 as...
14466 (rule_number_as_item_number, item_number_as_rule_number): these.
14467 Adjust dependencies.
14468 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14469 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14470 (symbol_number_to_vector_number): New.
14471 (order): Of vector_number_t* type.
14472 (base_t, BASE_MAX, BASE_MIN): New.
14473 (froms, tos, width, pos, check): Of base_t type.
14474 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14475 (actrow): Of action_number_t type.
14476 (conflrow): Of unsigned int type.
14477 (table_ninf, base_ninf): New.
14478 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14479 (muscle_insert_int_table, muscle_insert_base_table)
14480 (muscle_insert_rule_number_table): New.
14481 (prepare_tokens): Output `toknum' as int_table.
14482 (action_row): Returns a rule_number_t.
14483 Use ACTION_MIN, not SHRT_MIN.
14484 (token_actions): yydefact is rule_number_t*.
14485 (table_ninf_remap): New.
14486 (pack_table): Use it for `base' and `table'.
14487 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14488 replaced with...
14489 (YYPACT_NINF, YYTABLE_NINF): these.
14490 (yypact, yytable): Compute their types instead of hard-coded
14491 `short'.
14492 * tests/regression.at (Web2c Actions): Adjust.
14493
5dde258a
AD
144942002-07-19 Akim Demaille <akim@epita.fr>
14495
14496 * src/scan-gram.l (id): Can start with an underscore.
14497
a945ec39
AD
144982002-07-16 Akim Demaille <akim@epita.fr>
14499
14500 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14501 Adjust all former `associativity' dependencies.
14502 * src/symtab.c (symbol_new): Default associativity is `undef', not
14503 `right'.
14504 (symbol_check_alias_consistence): Adjust.
14505
fae437e8
AD
145062002-07-09 Akim Demaille <akim@epita.fr>
14507
14508 * doc/bison.texinfo: Properly set the ``header'' part.
14509 Use @dircategory ``GNU programming tools'' as per Texinfo's
14510 documentation.
14511 Use @copying.
14512
1a715ef2
AD
145132002-07-09 Akim Demaille <akim@epita.fr>
14514
14515 * lib/quotearg.h: Protect against multiple inclusions.
14516 * src/location.h (location_t): Add a `file' member.
14517 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14518 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14519 `error_one_per_line' support.
14520
a5d50994
AD
145212002-07-09 Akim Demaille <akim@epita.fr>
14522
14523 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14524 * src/reader.c (lineno): Remove.
14525 Adjust all dependencies.
14526 (get_merge_function): Take a location and use complain_at.
14527 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14528 * tests/regression.at (Invalid inputs, Mixing %token styles):
14529 Adjust.
14530
b275314e
AD
145312002-07-09 Akim Demaille <akim@epita.fr>
14532
14533 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14534 recovery rule, and forbid extensions when --yacc.
14535 (gram_error): Use complain_at.
14536 * src/reader.c (reader): Exit if there were parse errors.
14537
865b9df1
AD
145382002-07-09 Akim Demaille <akim@epita.fr>
14539
14540 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14541 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14542 Reported by R Blake <blakers@mac.com>.
14543
c76e14da
AD
145442002-07-09 Akim Demaille <akim@epita.fr>
14545
14546 * data/yacc.c: Output the copyright notive in the header.
14547
7db2ed2d
AD
145482002-07-03 Akim Demaille <akim@epita.fr>
14549
14550 * src/output.c (froms, tos): Are state_number_t.
14551 (save_column): sp, sp1, and sp2 are state_number_t.
14552 (prepare): Rename `final' as `final_state_number', `nnts' as
14553 `nterms_number', `nrules' as `rules_number', `nstates' as
14554 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14555 unused.
14556 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14557 * data/lalr1.cc (nsym_): Remove, unused.
14558
e68e0410
AD
145592002-07-03 Akim Demaille <akim@epita.fr>
14560
14561 * src/lalr.h, src/lalr.c (goto_number_t): New.
14562 * src/lalr.c (goto_list_t): New.
14563 Propagate them.
14564 * src/nullable.c (rule_list_t): New.
14565 Propagate.
14566 * src/types.h: Remove.
14567
e1a4f3a4
AD
145682002-07-03 Akim Demaille <akim@epita.fr>
14569
14570 * src/closure.c (print_fderives): Use rule_rhs_print.
14571 * src/derives.c (print_derives): Use rule_rhs_print.
14572 (rule_list_t): New, replaces `shorts'.
14573 (set_derives): Add comments.
14574 * tests/sets.at (Nullable, Firsts): Adjust.
14575
536545f3
AD
145762002-07-03 Akim Demaille <akim@epita.fr>
14577
14578 * src/output.c (prepare_actions): Free `tally' and `width'.
14579 (prepare_actions): Allocate and free `order'.
14580 * src/symtab.c (symbols_free): Free `symbols'.
14581 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14582 * src/output.c (m4_invoke): Move to...
14583 * src/scan-skel.l: here.
14584 (<<EOF>>): Close yyout, and free its name.
14585
8b752b00
AD
145862002-07-03 Akim Demaille <akim@epita.fr>
14587
14588 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14589
14590 * src/LR0.c (new_state): Merge into...
14591 (state_list_append): this.
14592 (new_states): Merge into...
14593 (generate_states): here.
14594 (set_states): Don't ensure a proper `errs' state member here, do it...
14595 * src/conflicts.c (conflicts_solve): here.
14596 * src/state.h, src/state.c: Comment changes.
14597 (state_t): Rename member `shifts' as `transitions'.
14598 Adjust all dependencies.
14599 (errs_new): For consistency, also take the values as argument.
14600 (errs_dup): Remove.
14601 (state_errs_set): New.
14602 (state_reductions_set, state_transitions_set): Assert that no
14603 previous value was assigned.
14604 (state_free): New.
14605 (states_free): Use it.
14606 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14607 temporary storage: use `errs' and `nerrs' as elsewhere.
14608 (set_conflicts): Allocate and free this `errs'.
14609
613f5e1a
AD
146102002-07-02 Akim Demaille <akim@epita.fr>
14611
14612 * lib/libiberty.h: New.
14613 * lib: Update the bitset implementation from upstream.
14614 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14615 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14616 * src/main.c: Adjust bitset stats calls.
14617
26e0cadc
PE
146182002-07-01 Paul Eggert <eggert@twinsun.com>
14619
14620 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14621 char, so that negative chars don't collide with $.
14622
1154cced
AD
146232002-06-30 Akim Demaille <akim@epita.fr>
14624
14625 Have the GLR tests be `warning' checked, and fix the warnings.
14626
14627 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14628 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14629 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14630 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14631 (yyaddDeferredAction): static.
14632 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14633 (yyreportParseError): yyprefix is const.
14634 yytokenp is used only when verbose.
14635 (yy__GNUC__): Replace with __GNUC__.
14636 (yypdumpstack): yyi is size_t.
14637 (yypreference): Un-yy local variables and arguments, to avoid
14638 clashes with `yyr1'. Anyway, we are not in the user name space.
14639 (yytname_size): be an int, as is compared with ints.
14640 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14641 Use them.
14642 * tests/cxx-gram.at: Use quotation to protect $1.
14643 Use AT_COMPILE to enable warnings hunts.
14644 Prototype yylex and yyerror.
14645 `Use' argc.
14646 Include `string.h', not `strings.h'.
14647 Produce and prototype stmtMerge only when used.
14648 yylex takes a location.
14649
97650f4e
AD
146502002-06-30 Akim Demaille <akim@epita.fr>
14651
14652 We spend a lot of time in quotearg, in particular when --verbose.
14653
14654 * src/symtab.c (symbol_get): Store a quoted version of the key.
14655 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14656 Adjust all callers.
14657
d2576365
AD
146582002-06-30 Akim Demaille <akim@epita.fr>
14659
14660 * src/state.h (reductions_t): Rename member `nreds' as num.
14661 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14662 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14663
ccaf65bc
AD
146642002-06-30 Akim Demaille <akim@epita.fr>
14665
14666 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14667 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14668 (shifts_to): Rename as...
14669 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14670 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14671 (TRANSITION_IS_DISABLED, transitions_to): these.
14672
87675353
AD
146732002-06-30 Akim Demaille <akim@epita.fr>
14674
14675 * src/print.c (print_shifts, print_gotos): Merge into...
14676 (print_transitions): this.
14677 (print_transitions, print_errs, print_reductions): Align the
14678 lookaheads columns.
14679 (print_core, print_transitions, print_errs, print_state,
14680 print_grammar): Output empty lines separator before, not after.
14681 (state_default_rule_compute): Rename as...
14682 (state_default_rule): this.
14683 * tests/conflicts.at (Defaulted Conflicted Reduction),
14684 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14685 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14686
ce4ccb4b
AD
146872002-06-30 Akim Demaille <akim@epita.fr>
14688
14689 Display items as we display rules.
14690
14691 * src/gram.h, src/gram.c (rule_lhs_print): New.
14692 * src/gram.c (grammar_rules_partial_print): Use it.
14693 * src/print.c (print_core): Likewise.
14694 * tests/conflicts.at (Defaulted Conflicted Reduction),
14695 (Unresolved SR Conflicts): Adjust.
14696 (Unresolved SR Conflicts): Adjust and rename as...
14697 (Resolved SR Conflicts): this, as was meant.
14698 * tests/regression.at (Web2c Report): Adjust.
14699
bc933ef1
AD
147002002-06-30 Akim Demaille <akim@epita.fr>
14701
14702 * src/print.c (state_default_rule_compute): New, extracted from...
14703 (print_reductions): here.
14704 Pessimize, but clarify the code.
14705 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14706
53d4308d
AD
147072002-06-30 Akim Demaille <akim@epita.fr>
14708
14709 * src/output.c (action_row): Let default_rule be always a rule
14710 number.
14711
574fb2d5
AD
147122002-06-30 Akim Demaille <akim@epita.fr>
14713
14714 * src/closure.c (print_firsts, print_fderives, closure):
14715 Use BITSET_EXECUTE.
14716 * src/lalr.c (lookaheads_print): Likewise.
14717 * src/state.c (state_rule_lookaheads_print): Likewise.
14718 * src/print_graph.c (print_core): Likewise.
14719 * src/print.c (print_reductions): Likewise.
14720 * src/output.c (action_row): Likewise.
14721 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14722
05811fd7
AD
147232002-06-30 Akim Demaille <akim@epita.fr>
14724
14725 * src/print_graph.c: Use report_flag.
14726
0e4d5753
AD
147272002-06-30 Akim Demaille <akim@epita.fr>
14728
14729 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14730 to...
14731 * src/relation.h, src/relation.c (traverse, relation_digraph)
14732 (relation_print, relation_transpose): New.
14733
24c7d800
AD
147342002-06-30 Akim Demaille <akim@epita.fr>
14735
14736 * src/state.h, src/state.c (shifts_to): New.
14737 * src/lalr.c (build_relations): Use it.
14738
9222837b
AD
147392002-06-30 Akim Demaille <akim@epita.fr>
14740
14741 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14742 (item_number_of_rule_number, rule_number_of_item_number): New.
14743 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14744 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14745 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14746 Propagate their use.
14747 Much remains to be done, in particular wrt `shorts' from types.h.
14748
260008e5
AD
147492002-06-30 Akim Demaille <akim@epita.fr>
14750
14751 * src/symtab.c (symbol_new): Initialize the `printer' member.
14752
8a731ca8
AD
147532002-06-30 Akim Demaille <akim@epita.fr>
14754
14755 * src/LR0.c (save_reductions): Remove, replaced by...
14756 * src/state.h, src/state.c (state_reductions_set): New.
14757 (reductions, errs): Rename as...
14758 (reductions_t, errs_t): these.
14759 Adjust all dependencies.
14760
32e1e0a4
AD
147612002-06-30 Akim Demaille <akim@epita.fr>
14762
14763 * src/LR0.c (state_list_t, state_list_append): New.
14764 (first_state, last_state): Now symbol_list_t.
14765 (this_state): Remove.
14766 (new_itemsets, append_states, save_reductions): Take a state_t as
14767 argument.
14768 (set_states, generate_states): Adjust.
14769 (save_shifts): Remove, replaced by...
14770 * src/state.h, src/state.c (state_shifts_set): New.
14771 (shifts): Rename as...
14772 (shifts_t): this.
14773 Adjust all dependencies.
14774 * src/state.h (state_t): Remove the `next' member.
14775
e5fb6710
AD
147762002-06-30 Akim Demaille <akim@epita.fr>
14777
14778 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14779 escaped in slot 0.
14780
c7ca99d4
AD
147812002-06-30 Akim Demaille <akim@epita.fr>
14782
14783 Use hash.h for the state hash table.
14784
14785 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14786 (allocate_storage): Use state_hash_new.
14787 (free_storage): Use state_hash_free.
14788 (new_state, get_state): Adjust.
14789 * src/lalr.h, src/lalr.c (states): Move to...
14790 * src/states.h (state_t): Remove the `link' member, no longer
14791 used.
14792 * src/states.h, src/states.c: here.
14793 (state_hash_new, state_hash_free, state_hash_lookup)
14794 (state_hash_insert, states_free): New.
14795 * src/states.c (state_table, state_compare, state_hash): New.
14796 * src/output.c (output_actions): Do not free states now, since we
14797 still need to know the final_state number in `prepare', called
14798 afterwards. Do it...
14799 * src/main.c (main): here: call states_free after `output'.
14800
df0e7316
AD
148012002-06-30 Akim Demaille <akim@epita.fr>
14802
14803 * src/state.h, src/state.c (state_new): New, extracted from...
14804 * src/LR0.c (new_state): here.
14805 * src/state.h (STATE_ALLOC): Move to...
14806 * src/state.c: here.
14807 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14808 * src/state.h, src/state.c: here.
14809
39f41916
AD
148102002-06-30 Akim Demaille <akim@epita.fr>
14811
14812 * src/reader.c (gensym): Rename as...
14813 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14814 (getsym): Rename as...
14815 (symbol_get): this.
14816
d57650a5
AD
148172002-06-30 Akim Demaille <akim@epita.fr>
14818
14819 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14820 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14821 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14822 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14823
5a08f1ce
AD
148242002-06-30 Akim Demaille <akim@epita.fr>
14825
14826 Make the test suite pass with warnings checked.
14827
14828 * tests/actions.at (Printers and Destructors): Improve.
14829 Avoid unsigned vs. signed issues.
14830 * tests/calc.at: Don't exercise the scanner here, do it...
14831 * tests/input.at (Torturing the Scanner): here.
14832
720623af
PH
148332002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14834
88e7e941 14835 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
14836 reorganize first lines parallel to yacc.c.
14837
fb8135fa
AD
148382002-06-28 Akim Demaille <akim@epita.fr>
14839
14840 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14841 (b4_token_enum, b4_token_defines): New, factored from...
14842 * data/lalr1.cc, data/yacc.c, glr.c: here.
14843
41442480
AD
148442002-06-28 Akim Demaille <akim@epita.fr>
14845
14846 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14847 unused variables.
14848 * src/output.c (merger_output): static.
14849
e0e5bf84
AD
148502002-06-28 Akim Demaille <akim@epita.fr>
14851
ba0fe3c7 14852 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
14853 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14854 pacify GCC.
14855 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 14856
676385e2
PH
148572002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14858
14859 Accumulated changelog for new GLR parsing features.
14860
6a254321 14861 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
14862 conflicts_total_count.
14863 * src/conflicts.h: Ditto.
14864 * src/output.c (token_actions): Use the new name.
14865 (output_conflicts): Change conflp => conflict_list_heads, and
14866 confl => conflict_list for better readability.
14867 * data/glr.c: Use the new names.
14868 * NEWS: Add self to GLR announcement.
e0e5bf84 14869
676385e2
PH
14870 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14871
14872 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14873 Akim Demaille.
14874
14875 * data/bison.glr: Change name to glr.c
14876 * data/glr.c: Renamed from bison.glr.
14877 * data/Makefile.am: Add glr.c
e0e5bf84
AD
14878
14879 * src/getargs.c:
14880
676385e2 14881 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 14882 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 14883
676385e2
PH
14884 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14885
14886 * data/bison.glr: Be sure to restore the
14887 current #line when returning to the skeleton contents after having
14888 exposed the input file's #line.
14889
14890 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14891
14892 * data/bison.glr: Bring up to date with changes to bison.simple.
14893
14894 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14895
14896 * data/bison.glr: Correct definitions that use b4_prefix.
14897 Various reformatting.
14898 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14899 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14900 yytokenp argument; now part of stack.
14901 (yychar): Define to behave as documented.
14902 (yyclearin): Ditto.
e0e5bf84 14903
676385e2
PH
14904 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14905
14906 * src/reader.h: Add declaration for free_merger_functions.
14907
14908 * src/reader.c (merge_functions): New variable.
14909 (get_merge_function): New function.
14910 (free_merger_functions): New function.
14911 (readgram): Check for %prec that is not followed by a symbol.
14912 Handle %dprec and %merge declarations.
14913 (packgram): Initialize dprec and merger fields in rules array.
14914
14915 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14916 conflict_list_cnt, conflict_list_free): New variables.
14917 (table_grow): Also grow conflict_table.
e0e5bf84 14918 (prepare_rules): Output dprec and merger tables.
676385e2 14919 (conflict_row): New function.
e0e5bf84 14920 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
14921 default reduction in conflicted states for GLR parser so that there
14922 are spaces for the conflict lists.
14923 (save_row): Also save conflict information.
14924 (token_actions): Allocate conflict list.
14925 (merger_output): New function.
14926 (pack_vector): Pack conflict table, too.
14927 (output_conflicts): New function to output yyconflp and yyconfl.
14928 (output_check): Allocate conflict_tos.
14929 (output_actions): Output conflict tables, also.
14930 (output_skeleton): Output b4_mergers definition.
14931 (prepare): Output b4_max_rhs_length definition.
14932 Use 'bison.glr' as default skeleton for GLR parsers.
14933
14934 * src/gram.c (glr_parser): New flag.
14935 (grammar_free): Call free_merger_functions.
14936
14937 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14938 all pairs of conflicting reductions, rather than just all tokens
14939 causing conflicts. Needed to size conflict tables.
e0e5bf84 14940 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
14941 interface.
14942 (conflicts_print): Ditto.
14943 (count_total_conflicts): New function.
14944
14945 * src/reader.h (merger_list): New type.
14946 (merge_functions): New variable.
14947
14948 * src/lex.h (tok_dprec, tok_merge): New token types.
14949
14950 * src/gram.h (rule_s): Add dprec and merger fields.
14951 (glr_parser): New flag.
14952
14953 * src/conflicts.h (count_total_conflicts): New function.
14954
14955 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14956
14957 * doc/bison.texinfo (Generalized LR Parsing): New section.
14958 (GLR Parsers): New section.
14959 (Language and Grammar): Mention GLR parsing.
14960 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14961 Correct typo ("tge" -> "the").
14962
14963 * data/bison.glr: New skeleton for GLR parsing.
14964
14965 * tests/cxx-gram.at: New tests for GLR parsing.
14966
14967 * tests/testsuite.at: Include cxx-gram.at.
14968
14969 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 14970
676385e2
PH
14971 * src/parse-gram.y:
14972
14973 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14974
14975 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 14976
b5480d74 149772002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
14978
14979 * src/options.h, src/options.c: Remove.
14980 * src/getargs.c (short_options, long_options): New.
14981
60491a94
AD
149822002-06-27 Akim Demaille <akim@epita.fr>
14983
14984 * data/bison.simple, data/bison.c++: Rename as...
14985 * data/yacc.c, data/lalr1.cc: these.
14986 * doc/bison.texinfo (Environment Variables): Remove.
14987
9be0c25b
AD
149882002-06-25 Raja R Harinath <harinath@cs.umn.edu>
14989
14990 * src/getargs.c (report_argmatch): Initialize strtok().
14991
1ae72863
AD
149922002-06-20 Akim Demaille <akim@epita.fr>
14993
14994 * data/bison.simple (b4_symbol_actions): New, replaces...
14995 (b4_symbol_destructor, b4_symbol_printer): these.
14996 (yysymprint): Be sure to call YYPRINT only for tokens, and using
14997 user token numbers.
14998
87542d29
AD
149992002-06-20 Akim Demaille <akim@epita.fr>
15000
15001 * data/bison.simple (yydestructor): Rename as...
15002 (yydestruct): this.
15003
1a31ed21
AD
150042002-06-20 Akim Demaille <akim@epita.fr>
15005
15006 * src/symtab.h, src/symtab.c (symbol_type_set)
15007 (symbol_destructor_set, symbol_precedence_set): The location is
15008 the last argument.
15009 Adjust all callers.
15010
e776192e
AD
150112002-06-20 Akim Demaille <akim@epita.fr>
15012
15013 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15014 internals.
15015 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15016 Takes a location.
15017 * src/symtab.h, src/symtab.c (symbol_class_set)
15018 (symbol_user_token_number_set): Likewise.
15019 Adjust all callers.
15020 Promote complain_at.
15021 * tests/input.at (Type Clashes): Adjust.
15022
5c1180b3
AD
150232002-06-20 Akim Demaille <akim@epita.fr>
15024
15025 * data/bison.simple (YYLEX): Fix the declaration when
15026 %pure-parser.
15027
e3170060
AD
150282002-06-20 Akim Demaille <akim@epita.fr>
15029
15030 * data/bison.simple (yysymprint): Don't print the token number,
15031 just its name.
15032 * tests/actions.at (Destructors): Rename as...
15033 (Printers and Destructors): this.
15034 Also exercise %printer.
15035
253862fd
AD
150362002-06-20 Akim Demaille <akim@epita.fr>
15037
15038 * data/bison.simple (YYDSYMPRINT): New.
15039 Use it to remove many of the #if YYDEBUG/if (yydebug).
15040
366eea36
AD
150412002-06-20 Akim Demaille <akim@epita.fr>
15042
15043 * src/symtab.h, src/symtab.c (symbol_t): printer and
15044 printer_location are new members.
15045 (symbol_printer_set): New.
15046 * src/parse-gram.y (PERCENT_PRINTER): New token.
15047 Handle its associated rule.
15048 * src/scan-gram.l: Adjust.
15049 (handle_destructor_at, handle_destructor_dollar): Rename as...
15050 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15051 * src/output.c (symbol_printers_output): New.
15052 (output_skeleton): Call it.
15053 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15054 since there are already many grammar files with a user `yyprint'.
15055 Replace the calls to YYPRINT to calls to yysymprint.
15056 * tests/calc.at: Adjust.
15057 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15058 taking advantage of parser very internal details (stack size!).
15059
4f25ebb0
AD
150602002-06-20 Akim Demaille <akim@epita.fr>
15061
15062 * src/scan-gram.l: Complete the scanner with the missing patterns
15063 to pacify Flex.
15064 Use `quote' and `symbol_tag_get' where appropriate.
15065
93b68a0e
AD
150662002-06-19 Akim Demaille <akim@epita.fr>
15067
15068 * tests/actions.at (Destructors): Augment to test locations.
15069 * data/bison.simple (yydestructor): Pass it the current location
15070 if locations are enabled.
15071 Prototype only when __STDC__ or C++.
15072 Change the argument names to move into the yy name space: there is
15073 user code here.
15074
58612f1d
AD
150752002-06-19 Akim Demaille <akim@epita.fr>
15076
74310291
AD
15077 * data/bison.simple (b4_pure_if): New.
15078 Use it instead of #ifdef YYPURE.
15079
150802002-06-19 Akim Demaille <akim@epita.fr>
15081
15082 * data/bison.simple (b4_location_if): New.
58612f1d
AD
15083 Use it instead of #ifdef YYLSP_NEEDED.
15084
f25bfb75
AD
150852002-06-19 Akim Demaille <akim@epita.fr>
15086
15087 Prepare @$ in %destructor, but currently don't bind it in the
15088 skeleton, as %location use is not cleaned up yet.
15089
15090 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15091 (handle_action_at): New.
15092 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15093 a braced_code_t and a location as additional arguments.
15094 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15095 unquote one when outputting `b4_dollar_dollar'.
15096 Adjust callers.
15097 * data/bison.simple (b4_eval): Remove.
15098 (b4_symbol_destructor): Adjust.
15099 * tests/input.at (Invalid @n): Adjust.
15100
c732d2c6
AD
151012002-06-19 Zack Weinberg <zack@codesourcery.com>
15102
15103 * doc/bison.texinfo: Document ability to have multiple
15104 prologue sections.
15105
8c165d89
AD
151062002-06-18 Akim Demaille <akim@epita.fr>
15107
15108 * src/files.c (compute_base_names): When computing the output file
15109 names from the input file name, strip the directory part.
15110
ca98bf57
AD
151112002-06-18 Akim Demaille <akim@epita.fr>
15112
15113 * data/bison.simple.new: Comment changes.
15114 Reported by Andreas Schwab.
15115
0bfb02ff
AD
151162002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15117
15118 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15119 there are no `label `yyoverflowlab' defined but not used' warnings
15120 when yyoverflow is defined.
15121
24c0aad7
AD
151222002-06-18 Akim Demaille <akim@epita.fr>
15123
15124 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15125 new member.
15126 (symbol_destructor_set): Adjust.
15127 * src/output.c (symbol_destructors_output): Output the destructor
15128 locations.
15129 Output the symbol name.
15130 * data/bison.simple (b4_symbol_destructor): Adjust.
15131
5719c109
AD
151322002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15133 and Akim Demaille <akim@epita.fr>
15134
15135 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15136 what's left on the stack when the error recovery hits EOF.
15137 * tests/actions.at (Destructors): Complete to exercise this case.
15138
9280d3ef
AD
151392002-06-17 Akim Demaille <akim@epita.fr>
15140
15141 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15142 arguments is really empty, not only equal to `[]'.
15143 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15144 member.
15145 (symbol_destructor_set): New.
15146 * src/output.c (symbol_destructors_output): New.
15147 * src/reader.h (brace_code_t, current_braced_code): New.
15148 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15149 (handle_dollar): Rename as...
15150 (handle_action_dollar): this.
15151 (handle_destructor_dollar): New.
15152 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15153 (grammar_declaration): Use it.
15154 * data/bison.simple (yystos): Is always defined.
15155 (yydestructor): New.
15156 * tests/actions.at (Destructors): New.
15157 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15158
dafdc66f
AD
151592002-06-17 Akim Demaille <akim@epita.fr>
15160
15161 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15162 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15163 rule_length only when needed.
15164 * src/output.c (actions_output, token_definitions_output): Output
15165 the full M4 block.
15166 * src/symtab.c: Don't access directly to the symbol tag, use
15167 symbol_tag_get.
15168 * src/parse-gram.y: Use symbol_list_free.
15169
56c47203
AD
151702002-06-17 Akim Demaille <akim@epita.fr>
15171
15172 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15173 (symbol_list_prepend, get_type_name): Move to...
15174 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15175 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15176 Adjust all callers.
15177 (symbol_list_free): New.
15178 * src/scan-gram.l (handle_dollar): Takes a location.
15179 * tests/input.at (Invalid $n): Adjust.
15180
1e0bab92
AD
151812002-06-17 Akim Demaille <akim@epita.fr>
15182
15183 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15184 (symbol_list_prepend): New.
15185 * src/parse-gram.y (%union): `list' is a new member.
15186 (symbols.1): New, replaces...
15187 (terms_to_prec.1, nterms_to_type.1): these.
15188 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15189 Take a location as additional argument.
15190 Adjust all callers.
15191
04e60654
AD
151922002-06-15 Akim Demaille <akim@epita.fr>
15193
15194 * src/parse-gram.y: Move %token in the declaration section so that
15195 we don't depend upon CVS Bison.
15196
10e5b8bd
AD
151972002-06-15 Akim Demaille <akim@epita.fr>
15198
15199 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15200 * src/print.c (print_core): Use it.
15201
9801d40c
AD
152022002-06-15 Akim Demaille <akim@epita.fr>
15203
15204 * src/conflicts.c (log_resolution): Accept the rule involved in
15205 the sr conflicts instead of the lookahead number that points to
15206 that rule.
15207 (flush_reduce): Accept the current lookahead vector as argument,
15208 instead of the index in LA.
15209 (resolve_sr_conflict): Accept the current number of lookahead
15210 bitset to consider for the STATE, instead of the index in LA.
15211 (set_conflicts): Adjust.
15212 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15213
c0263492
AD
152142002-06-15 Akim Demaille <akim@epita.fr>
15215
15216 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15217 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15218 Adjust all dependencies.
15219 * src/lalr.c (initialize_lookaheads): Split into...
15220 (states_lookaheads_count, states_lookaheads_initialize): these.
15221 (lalr): Adjust.
15222
9757c359
AD
152232002-06-15 Akim Demaille <akim@epita.fr>
15224
15225 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15226 out of...
15227 (grammar_rules_print): here.
15228 * src/reduce.c (reduce_output): Use it.
15229 * tests/reduce.at (Useless Rules, Reduced Automaton)
15230 (Underivable Rules): Adjust.
15231
6b98e4b5
AD
152322002-06-15 Akim Demaille <akim@epita.fr>
15233
15234 Copy BYacc's nice way to report the grammar.
15235
15236 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15237 New.
15238 Don't print the rules' location, it is confusing and useless.
15239 (rule_print): Use grammar_rhs_print.
15240 * src/print.c (print_grammar): Use grammar_rules_print.
15241
6b98e4b5
AD
152422002-06-15 Akim Demaille <akim@epita.fr>
15243
15244 Complete and rationalize `useless thing' warnings.
15245
15246 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15247 (symbol_tag_print): New.
15248 Use them everywhere in place of accessing directly the tag member.
15249 * src/gram.h, src/gram.c (rule_print): New.
15250 Use it where a rule used to be printed `by hand'.
15251 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15252 (reduce_grammar_tables): Report the useless rules.
15253 (reduce_print): Useless things are a warning, not an error.
15254 Report it as such.
15255 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15256 (Reduced Automaton, Underivable Rules): Adjust.
15257 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15258 * tests/conflicts.at (Unresolved SR Conflicts)
15259 (Solved SR Conflicts): Adjust.
15260
ee000ba4
AD
152612002-06-15 Akim Demaille <akim@epita.fr>
15262
15263 Let symbols have a location.
15264
15265 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15266 (getsym): Adjust.
15267 Adjust all callers.
15268 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15269 Use location_t, not int.
15270 * src/symtab.c (symbol_check_defined): Take advantage of the
15271 location.
15272 * tests/regression.at (Invalid inputs): Adjust.
15273
8efe435c
AD
152742002-06-15 Akim Demaille <akim@epita.fr>
15275
15276 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15277 (input): Don't try to initialize yylloc here, do it in the
15278 scanner.
15279 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15280 * src/gram.h (rule_t): Change line and action_line into location
15281 and action_location, of location_t type.
15282 Adjust all dependencies.
15283 * src/location.h, src/location.c (empty_location): New.
15284 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15285 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15286 (grammar_current_rule_symbol_append)
15287 (grammar_current_rule_action_append): Expect a location as argument.
15288 * src/reader.c (grammar_midrule_action): Adjust to attach an
15289 action's location as dummy symbol location.
15290 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15291 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15292 the line numbers.
15293
1921f1d7
AD
152942002-06-14 Akim Demaille <akim@epita.fr>
15295
15296 Grammar declarations may be found in the grammar section.
15297
15298 * src/parse-gram.y (rules_or_grammar_declaration): New.
15299 (declarations): Each declaration may end with a semicolon, not
15300 just...
15301 (grammar_declaration): `"%union"'.
15302 (grammar): Branch to rules_or_grammar_declaration.
15303
4515534c
AD
153042002-06-14 Akim Demaille <akim@epita.fr>
15305
15306 * src/main.c (main): Invoke scanner_free.
15307
f958596b
AD
153082002-06-14 Akim Demaille <akim@epita.fr>
15309
15310 * src/output.c (m4_invoke): Extracted from...
15311 (output_skeleton): here.
15312 Free tempfile.
15313
2c569025
AD
153142002-06-14 Akim Demaille <akim@epita.fr>
15315
15316 * src/parse-gram.y (directives, directive, gram)
15317 (grammar_directives, precedence_directives, precedence_directive):
15318 Rename as...
15319 (declarations, declaration, grammar, grammar_declaration)
15320 (precedence_declaration, precedence_declarator): these.
15321 (symbol_declaration): New.
15322
592e8d4d
AD
153232002-06-14 Akim Demaille <akim@epita.fr>
15324
15325 * src/files.c (action_obstack): Remove, unused.
15326 (output_obstack): Remove it, and all its dependencies, as it is no
15327 longer needed.
15328 * src/reader.c (epilogue_set): Build the epilogue in the
15329 muscle_obstack.
15330 * src/output.h, src/output.c (muscle_obstack): Move to...
15331 * src/muscle_tab.h, src/muscle_tab.h: here.
15332 (muscle_init): Initialize muscle_obstack.
15333 (muscle_free): New.
15334 * src/main.c (main): Call it.
15335
0c15323d
AD
153362002-06-14 Akim Demaille <akim@epita.fr>
15337
15338 * src/location.h: New, extracted from...
15339 * src/reader.h: here.
15340 * src/Makefile.am (noinst_HEADERS): Merge into
15341 (bison_SOURCES): this.
15342 Add location.h.
15343 * src/parse-gram.y: Use location_t instead of Bison's.
15344 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15345 Use location_t instead of ints.
15346
e96c9728
AD
153472002-06-14 Akim Demaille <akim@epita.fr>
15348
15349 * data/bison.simple, data/bison.c++: Be sure to restore the
15350 current #line when returning to the skeleton contents after having
15351 exposed the input file's #line.
15352
75d1fe16
AD
153532002-06-12 Akim Demaille <akim@epita.fr>
15354
15355 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15356 eager.
15357 * tests/actions.at (Exotic Dollars): New.
15358
6c35d22c
AD
153592002-06-12 Akim Demaille <akim@epita.fr>
15360
15361 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15362 ['"/] too eagerly.
15363 * tests/input.at (Torturing the Scanner): New.
15364
1d6412ad
AD
153652002-06-11 Akim Demaille <akim@epita.fr>
15366
15367 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15368 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15369 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15370 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15371 * src/reader.c (reader): Use it.
15372
4cdb01db
AD
153732002-06-11 Akim Demaille <akim@epita.fr>
15374
15375 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15376 Adjust all callers.
15377 (scanner_last_string_free): New.
15378
44995b2e
AD
153792002-06-11 Akim Demaille <akim@epita.fr>
15380
15381 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15382 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15383 (last_string, YY_OBS_FREE): New.
15384 Use them when returning an ID.
15385
e9955c83
AD
153862002-06-11 Akim Demaille <akim@epita.fr>
15387
15388 Have Bison grammars parsed by a Bison grammar.
15389
15390 * src/reader.c, src/reader.h (prologue_augment): New.
15391 * src/reader.c (copy_definition): Remove.
15392
15393 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15394 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15395 (grammar_current_rule_prec_set, grammar_current_rule_check)
15396 (grammar_current_rule_symbol_append)
15397 (grammar_current_rule_action_append): Export.
15398 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15399 (symbol_list_action_append): Remove.
15400 Hook the routines from reader.
15401 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15402 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15403
15404 * src/reader.c (read_declarations): Remove, unused.
15405
15406 * src/parse-gram.y: Handle the epilogue.
15407 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15408 (grammar_start_symbol_set): this.
15409 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15410 * src/reader.c (readgram): Remove, unused.
15411 (reader): Adjust to insert eoftoken and axiom where appropriate.
15412
15413 * src/reader.c (copy_dollar): Replace with...
15414 * src/scan-gram.h (handle_dollar): this.
15415 * src/parse-gram.y: Remove `%thong'.
15416
15417 * src/reader.c (copy_at): Replace with...
15418 * src/scan-gram.h (handle_at): this.
15419
15420 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15421 New.
15422
15423 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15424 time being.
15425
15426 * src/reader.h, src/reader.c (grammar_rule_end): New.
15427
15428 * src/parse.y (current_type, current_class): New.
15429 Implement `%nterm', `%token' support.
15430 Merge `%term' into `%token'.
15431 (string_as_id): New.
15432 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15433 type name.
15434
15435 * src/parse-gram.y: Be sure to handle properly the beginning of
15436 rules.
15437
15438 * src/parse-gram.y: Handle %type.
15439 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15440
15441 * src/parse-gram.y: More directives support.
15442 * src/options.c: No longer handle source directives.
15443
15444 * src/parse-gram.y: Fix %output.
15445
15446 * src/parse-gram.y: Handle %union.
15447 Use the prologue locations.
15448 * src/reader.c (parse_union_decl): Remove.
15449
15450 * src/reader.h, src/reader.c (epilogue_set): New.
15451 * src/parse-gram.y: Use it.
15452
15453 * data/bison.simple, data/bison.c++: b4_stype is now either not
15454 defined, then default to int, or to the contents of %union,
15455 without `union' itself.
15456 Adjust.
15457 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15458
15459 * src/output.c (actions_output): Don't output braces, as they are
15460 already handled by the scanner.
15461
15462 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15463 characters to themselves.
15464
15465 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15466 that the epilogue has a proper #line.
15467
15468 * src/parse-gram.y: Handle precedence/associativity.
15469
15470 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15471 a terminal.
15472 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15473 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15474 at all to define terminals that cannot be emitted.
15475
15476 * src/scan-gram.l: Escape M4 characters.
15477
15478 * src/scan-gram.l: Working properly with escapes in user
15479 strings/characters.
15480
15481 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15482 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15483 grammar.
15484 Use more modest sizes, as for the time being the parser does not
15485 release memory, and therefore the process swallows a huge amount
15486 of memory.
15487
15488 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15489 stricter %token grammar.
15490
15491 * src/symtab.h (associativity): Add `undef_assoc'.
15492 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15493 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15494
15495 * tests/regression.at (Invalid %directive): Remove, as it is now
15496 meaningless.
15497 (Invalid inputs): Adjust to the new error messages.
15498 (Token definitions): The new grammar doesn't allow too many
15499 eccentricities.
15500
15501 * src/lex.h, src/lex.c: Remove.
15502 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15503 (copy_character, copy_string2, copy_string, copy_identifier)
15504 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15505 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15506 (parse_action): Remove.
15507 * po/POTFILES.in: Adjust.
15508
2e047461
AD
155092002-06-11 Akim Demaille <akim@epita.fr>
15510
cd05d13c 15511 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
15512 rule's action member: return the action as a string.
15513 Don't require `rule_length' as an argument: compute it.
15514 (grammar_current_rule_symbol_append)
15515 (grammar_current_rule_action_append): New, eved out from
15516 (readgram): here.
15517 Remove `action_flag', `rulelength', unused now.
15518
9af3fbce
AD
155192002-06-11 Akim Demaille <akim@epita.fr>
15520
15521 * src/reader.c (grammar_current_rule_prec_set).
15522 (grammar_current_rule_check): New, eved out from...
15523 (readgram): here.
15524 Remove `xaction', `first_rhs': useless.
15525 * tests/input.at (Type clashes): New.
15526 * tests/existing.at (GNU Cim Grammar): Adjust.
15527
1485e106
AD
155282002-06-11 Akim Demaille <akim@epita.fr>
15529
15530 * src/reader.c (grammar_midrule_action): New, Eved out from
15531 (readgram): here.
15532
da4160c3
AD
155332002-06-11 Akim Demaille <akim@epita.fr>
15534
15535 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15536 New.
15537 (readgram): Use them as replacement of inlined code, crule and
15538 crule1.
15539
f6d0f937
AD
155402002-06-11 Akim Demaille <akim@epita.fr>
15541
15542 * src/reader.c (grammar_end, grammar_symbol_append): New.
15543 (readgram): Use them.
15544 Make the use of `p' as local as possible.
15545
69078d4b
AD
155462002-06-10 Akim Demaille <akim@epita.fr>
15547
15548 GCJ's parser requires the tokens to be defined before the prologue.
15549
15550 * data/bison.simple: Output the token definition before the user's
15551 prologue.
15552 * tests/regression.at (Braces parsing, Duplicate string)
15553 (Mixing %token styles): Check the output from bison.
15554 (Early token definitions): New.
15555
5e424082
AD
155562002-06-10 Akim Demaille <akim@epita.fr>
15557
15558 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15559 assigning twice the same user number to a token, so that we can
15560 use it in...
15561 * src/lex.c (lex): here.
15562 Also use `symbol_class_set' instead of hand written code.
15563 * src/reader.c (parse_assoc_decl): Likewise.
15564
44536b35
AD
155652002-06-10 Akim Demaille <akim@epita.fr>
15566
15567 * src/symtab.c, src/symtab.c (symbol_class_set)
15568 (symbol_user_token_number_set): New.
15569 * src/reader.c (parse_token_decl): Use them.
15570 Use a switch instead of ifs.
15571 Use a single argument.
15572
8b9f2372
AD
155732002-06-10 Akim Demaille <akim@epita.fr>
15574
15575 Remove `%thong' support as it is undocumented, unused, duplicates
15576 `%token's job, and creates useless e-mail traffic with people who
15577 want to know what it is, why it is undocumented, unused, and
15578 duplicates `%token's job.
15579
15580 * src/reader.c (parse_thong_decl): Remove.
15581 * src/options.c (option_table): Remove "thong".
15582 * src/lex.h (tok_thong): Remove.
15583
3ae2b51f
AD
155842002-06-10 Akim Demaille <akim@epita.fr>
15585
15586 * src/symtab.c, src/symtab.c (symbol_type_set)
15587 (symbol_precedence_set): New.
15588 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15589 (value_components_used): Remove, unused.
15590
2f1afb73
AD
155912002-06-09 Akim Demaille <akim@epita.fr>
15592
15593 Move symbols handling code out of the reader.
15594
15595 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15596 (axiom): Move to...
15597 * src/symtab.h, src/symtab.c: here.
15598
15599 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15600 * src/reader.c (startval): Rename as...
15601 * src/symtab.h, src/symtab.c (startsymbol): this.
15602 * src/reader.c: Adjust.
15603
15604 * src/reader.c (symbol_check_defined, symbol_make_alias)
15605 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15606 (token_translations_init)
15607 Move to...
15608 * src/symtab.c: here.
15609 * src/reader.c (packsymbols): Move to...
15610 * src/symtab.h, src/symtab.c (symbols_pack): here.
15611 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15612 argument.
15613
e9bca3ad
AD
156142002-06-03 Akim Demaille <akim@epita.fr>
15615
15616 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15617 then statements.
15618
86eff183
AD
156192002-06-03 Akim Demaille <akim@epita.fr>
15620
15621 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15622 structs with non literals.
15623 * src/scan-skel.l: never-interactive.
15624 * src/conflicts.c (enum conflict_resolution_e): No trailing
15625 comma.
15626 * src/getargs.c (usage): Split long literal strings.
15627 Reported by Hans Aberg.
15628
717be197
AD
156292002-05-28 Akim Demaille <akim@epita.fr>
15630
15631 * data/bison.c++: Use C++ ostreams.
15632 (cdebug_): New member.
15633
670ddffd
AD
156342002-05-28 Akim Demaille <akim@epita.fr>
15635
15636 * src/output.c (output_skeleton): Be sure to allocate enough room
15637 for `/' _and_ for `\0' in full_skeleton.
15638
769b430f
AD
156392002-05-28 Akim Demaille <akim@epita.fr>
15640
15641 * data/bison.c++: Catch up with bison.simple:
15642 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15643 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15644 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15645 and popping traces.
15646
7067cb36
PH
156472002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15648
15649 * src/output.c (output_skeleton): Put an explicit path in front of
15650 the skeleton file name, rather than relying on the -I directory,
15651 to partially alleviate effects of having a skeleton file lying around
15652 in the current directory.
769b430f 15653
4a713ec2
PH
156542002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15655
769b430f 15656 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
15657 obstack_printf should be obstack_fgrow1.
15658
b408954b
AD
156592002-05-26 Akim Demaille <akim@epita.fr>
15660
15661 * src/state.h (state_t): `solved_conflicts' is a new member.
15662 * src/LR0.c (new_state): Set it to 0.
15663 * src/conflicts.h, src/conflicts.c (print_conflicts)
15664 (free_conflicts, solve_conflicts): Rename as...
15665 (conflicts_print, conflicts_free, conflicts_solve): these.
15666 Adjust callers.
15667 * src/conflicts.c (enum conflict_resolution_e)
15668 (solved_conflicts_obstack): New, used by...
15669 (log_resolution): this.
15670 Adjust to attach the conflict resolution to each state.
15671 Complete the description with the precedence/associativity
15672 information.
15673 (resolve_sr_conflict): Adjust.
15674 * src/print.c (print_state): Output its solved_conflicts.
15675 * tests/conflicts.at (Unresolved SR Conflicts)
15676 (Solved SR Conflicts): Exercise --report=all.
15677
a49aecd5
AD
156782002-05-26 Akim Demaille <akim@epita.fr>
15679
15680 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15681 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15682 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15683 (token_number_t, item_number_as_token_number)
15684 (token_number_as_item_number, muscle_insert_token_number_table):
15685 Rename as...
15686 (symbol_number_t, item_number_as_symbol_number)
15687 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15688 these, since it is more appropriate.
15689
5504898e
AD
156902002-05-26 Akim Demaille <akim@epita.fr>
15691
15692 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15693 `Error:' lines.
15694 * data/bison.simple (yystos) [YYDEBUG]: New.
15695 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15696 error recovery.
15697 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15698
ec3bc396
AD
156992002-05-25 Akim Demaille <akim@epita.fr>
15700
15701 * doc/bison.texinfo (Debugging): Split into...
15702 (Tracing): this new section, its former contents, and...
15703 (Understanding): this new section.
15704 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15705 by...
15706 (report_flag): this.
15707 Adjust all dependencies.
15708 (report_args, report_types, report_argmatch): New.
15709 (usage, getargs): Report/support -r, --report.
15710 * src/options.h
15711 (struct option_table_struct): Rename as..,
15712 (struct option_table_s): this.
15713 Rename the `set_flag' member to `flag' to match with getopt_long's
15714 struct.
15715 * src/options.c (option_table): Split verbose into an entry for
15716 %verbose, and another for --verbose.
15717 Support --report/-r, so remove -r from the obsolete --raw.
15718 * src/print.c: Attach full item sets and lookaheads reports to
15719 report_flag instead of trace_flag.
15720 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15721
78df8250
PE
157222002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15723 and Paul Eggert <eggert@twinsun.com>
769b430f 15724
78df8250
PE
15725 * data/bison.simple (yyparse): Correct error handling to conform to
15726 POSIX and yacc. Specifically, after syntax error is discovered,
15727 do not reduce further before shifting the error token.
15728 Clean up the code a bit by removing the labels yyerrdefault,
15729 yyerrhandle, yyerrpop.
15730 * NEWS: Document the above.
15731
c0c9ea05
PH
157322002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15733
15734 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15735 type; it isn't always big enough, since it doesn't necessarily
15736 include non-terminals.
769b430f 15737 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
15738 the latter can be removed.
15739 (yy_token_number_type): Remove, only one use.
15740 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15741 don't use TokenNumberType as element type.
769b430f 15742
c0c9ea05
PH
15743 * tests/regression.at: Modify expected output to agree with change
15744 to yyr1 and yytranslate.
769b430f 15745
6390a83f
FK
157462002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15747
15748 * src/reader.c (parse_action): Use copy_character instead of
15749 obstack_1grow.
15750
db7c8e9a
AD
157512002-05-13 Akim Demaille <akim@epita.fr>
15752
15753 * tests/regression.at (Token definitions): Prototype yylex and
15754 yyerror.
15755
fcc61800
PH
157562002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15757
158c687b 15758 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
15759 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15760 32-bit arithmetic.
15761 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15762
5683e9b2
AD
157632002-05-07 Akim Demaille <akim@epita.fr>
15764
15765 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15766 avoid GCC warnings.
15767
0c2d3f4c
AD
157682002-05-07 Akim Demaille <akim@epita.fr>
15769
15770 Kill GCC warnings.
15771
15772 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15773 over the RHS of each rule.
15774 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15775 * src/state.h (state_t): Member `nitems' is unsigned short.
15776 * src/LR0.c (get_state): Adjust.
15777 * src/reader.c (packgram): Likewise.
15778 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15779 `Type'.
15780 (muscle_insert_int_table): Remove, unused.
15781 (prepare_rules): Remove `max'.
15782
1565b720
AD
157832002-05-06 Akim Demaille <akim@epita.fr>
15784
15785 * src/closure.c (print_firsts): Display of the symbol tags.
15786 (bitmatrix_print): Move to...
15787 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15788 here.
15789 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15790
cfaee611
AD
157912002-05-06 Akim Demaille <akim@epita.fr>
15792
15793 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15794 hash_do_for_each.
15795
458be8e0
AD
157962002-05-06 Akim Demaille <akim@epita.fr>
15797
15798 * src/LR0.c (new_state, get_state): Instead of using the global
15799 `kernel_size' and `kernel_base', have two new arguments:
15800 `core_size' and `core'.
15801 Adjust callers.
15802
a900a624
AD
158032002-05-06 Akim Demaille <akim@epita.fr>
15804
15805 * src/reader.c (packgram): No longer end `ritem' with a 0
15806 sentinel: it is not used.
15807
d4e7d3a1
AD
158082002-05-05 Akim Demaille <akim@epita.fr>
15809
15810 New experimental feature: display the lookaheads in the report and
15811 graph.
15812
15813 * src/print (print_core): When --trace-flag, display the rules
15814 lookaheads.
15815 * src/print_graph.c (print_core): Likewise.
15816 Swap the arguments.
15817 Adjust caller.
15818
39ceb25b
AD
158192002-05-05 Akim Demaille <akim@epita.fr>
15820
15821 * tests/torture.at (Many lookaheads): New test.
15822
5372019f
AD
158232002-05-05 Akim Demaille <akim@epita.fr>
15824
15825 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15826 (GENERATE_MUSCLE_INSERT_TABLE): this.
15827 (output_int_table, output_unsigned_int_table, output_short_table)
15828 (output_token_number_table, output_item_number_table): Replace with...
15829 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15830 (muscle_insert_short_table, muscle_insert_token_number_table)
15831 (muscle_insert_item_number_table): these.
15832 Adjust all callers.
15833 (prepare_tokens): Don't free `translations', since...
15834 * src/reader.h, src/reader.c (grammar_free): do it.
15835 Move to...
15836 * src/gram.h, src/gram.c (grammar_free): here.
15837 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15838 b4_translate_max.
15839
5df5f6d5
AD
158402002-05-05 Akim Demaille <akim@epita.fr>
15841
15842 * src/output.c (output_unsigned_int_table): New.
15843 (prepare_rules): `i' is unsigned.
15844 `prhs', `rline', `r2' are unsigned int.
15845 Rename muscle `rhs_number_max' as `rhs_max'.
15846 Output muscles `prhs_max', `rline_max', and `r2_max'.
15847 Free rline and r1.
15848 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15849 to compute types instead of constant types.
15850 * tests/regression.at (Web2c Actions): Adjust.
15851
b87f8b21
AD
158522002-05-04 Akim Demaille <akim@epita.fr>
15853
15854 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15855 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15856 Adjust dependencies.
15857 * src/output.c (token_definitions_output): Be sure not to output a
15858 `#define 'a'' when fed with `%token 'a' "a"'.
15859 * tests/regression.at (Token definitions): New.
15860
8bb936e4
PE
158612002-05-03 Paul Eggert <eggert@twinsun.com>
15862
15863 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15864 for K&R C.
15865
158662002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15867
15868 * Makefile.am (SUBDIRS): Remove intl.
15869 (EXTRA_DIST): Add config/config.rpath.
15870
53c71a12
AD
158712002-05-03 Akim Demaille <akim@epita.fr>
15872
15873 * data/bison.simple (m4_if): Don't output empty enums.
15874 And actually, output valid enum definitions :(.
15875
289dd0cf
AD
158762002-05-03 Akim Demaille <akim@epita.fr>
15877
15878 * configure.bat: Remove, completely obsolete.
15879 * Makefile.am (EXTRA_DIST): Adjust.
15880 Don't distribute config.rpath...
15881 * config/Makefile.am (EXTRA_DIST): Do it.
15882
db85e524
AD
158832002-05-03 Akim Demaille <akim@epita.fr>
15884
15885 * configure.in (GETTEXT_VERSION): New.
15886 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15887
83ccf991
AD
158882002-05-03 Akim Demaille <akim@epita.fr>
15889
15890 * data/bison.simple (b4_token_enum): New.
15891 (b4_token_defines): Use it to output tokens both as #define and
15892 enums.
15893 Suggested by Paul Eggert.
15894 * src/output.c (token_definitions_output): Don't output spurious
15895 white spaces.
15896
1f418995
AD
158972002-05-03 Akim Demaille <akim@epita.fr>
15898
15899 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15900
45119f04
RA
159012002-05-02 Robert Anisko <robert@lrde.epita.fr>
15902
15903 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15904 Update the stack class, give a try to deque as the default container.
15905
b2d52318
AD
159062002-05-02 Akim Demaille <akim@epita.fr>
15907
15908 * data/bison.simple (yyparse): Do not implement @$ = @1.
15909 (YYLLOC_DEFAULT): Adjust to do it.
15910 * doc/bison.texinfo (Location Default Action): Fix.
15911
3a8b4109
AD
159122002-05-02 Akim Demaille <akim@epita.fr>
15913
15914 * src/reader.c (parse_braces): Merge into...
15915 (parse_action): this.
15916
84614e13
AD
159172002-05-02 Akim Demaille <akim@epita.fr>
15918
15919 * configure.in (ALL_LINGUAS): Remove.
15920 * po/LINGUAS, hr.po: New.
15921
fdbcd8e2
AD
159222002-05-02 Akim Demaille <akim@epita.fr>
15923
15924 Remove the so called hairy (semantic) parsers.
15925
15926 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15927 * src/gram.h, src/gram.c (semantic_parser): Remove.
15928 (rule_t): Remove the guard and guard_line members.
15929 * src/lex.h (token_t): remove tok_guard.
15930 * src/options.c (option_table): Remove %guard and %semantic_parser
15931 support.
15932 * src/output.c, src/output.h (guards_output): Remove.
15933 (prepare): Adjust.
15934 (token_definitions_output): Don't output the `T'
15935 tokens (???).
15936 (output_skeleton): Don't output the guards.
15937 * src/files.c, src/files.c (attrsfile): Remove.
15938 * src/reader.c (symbol_list): Remove the guard and guard_line
15939 members.
15940 Adjust dependencies.
15941 (parse_guard): Remove.
15942 * data/bison.hairy: Remove.
15943 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15944 BISON_HAIRY.
15945
82b6cb3f
AD
159462002-05-02 Akim Demaille <akim@epita.fr>
15947
15948 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15949 (parse_guard): Rename the formal argument `stack_offset' as
15950 `rule_length', which is more readable.
15951 Adjust callers.
15952 (copy_at, copy_dollar): Instead of outputting the hard coded
15953 values of $$, $n and so forth, output invocation to b4_lhs_value,
15954 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
15955 Note: this patch partially drops `semantic-parser' support: it
15956 always does `rule_length - n', where semantic parsers ought to
15957 always use `-n'.
82b6cb3f
AD
15958 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15959 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15960
6cbfbcc5
AD
159612002-05-02 Akim Demaille <akim@epita.fr>
15962
15963 * configure.in (AC_INIT): Bump to 1.49b.
15964 (AM_INIT_AUTOMAKE): Short invocation.
15965
b8548114
AD
159662002-05-02 Akim Demaille <akim@epita.fr>
15967
15968 Version 1.49a.
15969
c20cd1fa
AD
159702002-05-01 Akim Demaille <akim@epita.fr>
15971
15972 * src/skeleton.h: Remove.
15973
8a9566d4
AD
159742002-05-01 Akim Demaille <akim@epita.fr>
15975
15976 * src/skeleton.h: Fix the #endif.
15977 Reported by Magnus Fromreide.
15978
8c6d399a
PE
159792002-04-26 Paul Eggert <eggert@twinsun.com>
15980
15981 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15982 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 15983 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 15984
2b7ed18a
RA
159852002-04-25 Robert Anisko <robert@lrde.epita.fr>
15986
15987 * src/scan-skel.l: Postprocess quadrigraphs.
15988
15989 * src/reader.c (copy_character): New function, used to output
15990 single characters while replacing `[' and `]' with quadrigraphs, to
15991 avoid troubles with M4 quotes.
15992 (copy_comment): Output characters with copy_character.
15993 (read_additionnal_code): Likewise.
15994 (copy_string2): Likewise.
15995 (copy_definition): Likewise.
15996
15997 * tests/calc.at: Exercise M4 quoting.
15998
34a89c50
AD
159992002-04-25 Akim Demaille <akim@epita.fr>
16000
16001 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16002 between `!' and the command.
16003 Reported by Paul Eggert.
16004
0dd1580a
RA
160052002-04-24 Robert Anisko <robert@lrde.epita.fr>
16006
16007 * tests/calc.at: Exercise prologue splitting.
16008
16009 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16010 `b4_post_prologue' instead of `b4_prologue'.
16011
16012 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16013 muscles.
16014 (output): Free pre_prologue_obstack and post_prologue_obstack.
16015 * src/files.h, src/files.c (attrs_obstack): Remove.
16016 (pre_prologue_obstack, post_prologue_obstack): New.
16017 * src/reader.c (copy_definition): Add a parameter to specify the
16018 obstack to fill, instead of using attrs_obstack unconditionally.
16019 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16020 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16021
83c1796f
PE
160222002-04-23 Paul Eggert <eggert@twinsun.com>
16023
16024 * data/bison.simple: Remove unnecessary commentary and white
16025 space differences from 1_29-branch.
16026 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16027
16028 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16029 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16030 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16031 constructors or destructors.
16032
16033 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16034
1207eeac
AD
160352002-04-23 Akim Demaille <akim@epita.fr>
16036
16037 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16038 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16039 location with columns.
16040 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16041 All reported by Paul Eggert.
16042
78ab8f67
AD
160432002-04-22 Akim Demaille <akim@epita.fr>
16044
16045 * src/reduce.c (dump_grammar): Move to...
16046 * src/gram.h, src/gram.c (grammar_dump): here.
16047 Be sure to separate long item numbers.
16048 Don't read the members of a rule's prec if its nil.
16049
133c20e2
AD
160502002-04-22 Akim Demaille <akim@epita.fr>
16051
16052 * src/output.c (table_size, table_grow): New.
16053 (MAXTABLE): Remove, replace uses with table_size.
16054 (pack_vector): Instead of dying when the table is too big, grow it.
16055
9515e8a7
AD
160562002-04-22 Akim Demaille <akim@epita.fr>
16057
16058 * data/bison.simple (yyr1): Its type is that of a token number.
16059 * data/bison.c++ (r1_): Likewise.
16060 * tests/regression.at (Web2c Actions): Adjust.
16061
23c5a174
AD
160622002-04-22 Akim Demaille <akim@epita.fr>
16063
16064 * src/reader.c (token_translations_init): 256 is now the default
16065 value for the error token, i.e., it will be assigned another
16066 number if the user assigned 256 to one of her tokens.
16067 (reader): Don't force 256 to error.
16068 * doc/bison.texinfo (Symbols): Adjust.
16069 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16070 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16071 etc. instead of 10, 20, 30 (which was used to `jump' over error
16072 (256) and undefined (2)).
16073
5fbb0954
AD
160742002-04-22 Akim Demaille <akim@epita.fr>
16075
16076 Propagate more token_number_t.
16077
16078 * src/gram.h (token_number_as_item_number)
16079 (item_number_as_token_number): New.
16080 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16081 Use it to create output_item_number_table and
16082 output_token_number_table.
16083 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16084 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16085 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16086 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16087
4f940944
AD
160882002-04-22 Akim Demaille <akim@epita.fr>
16089
16090 * src/output.h, src/output.c (get_lines_number): Remove.
16091
3ded9a63
AD
160922002-04-19 Akim Demaille <akim@epita.fr>
16093
16094 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16095 as Lex/Flex'.
16096 (Debugging): More details about enabling the debugging features.
16097 (Table of Symbols): Describe $$, $n, @$, and @n.
16098 Suggested by Tim Josling.
16099
e0c471a9
AD
161002002-04-19 Akim Demaille <akim@epita.fr>
16101
16102 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16103
fecc10cd
AD
161042002-04-10 Akim Demaille <akim@epita.fr>
16105
16106 * src/system.h: Rely on HAVE_LIMITS_H.
16107 Suggested by Paul Eggert.
16108
51dec47b
AD
161092002-04-09 Akim Demaille <akim@epita.fr>
16110
16111 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16112 full stderr, and strip it according to the bison options, instead
16113 of composing the error message from different bits.
16114 This makes it easier to check for several error messages.
16115 Adjust all the invocations.
16116 Add an invocation exercising the error token.
16117 Add an invocation demonstrating a stupid error message.
16118 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16119 Adjust the tests.
16120 Error message are for stderr, not stdout.
16121
007a50a4
AD
161222002-04-09 Akim Demaille <akim@epita.fr>
16123
16124 * src/gram.h, src/gram.c (error_token_number): Remove, use
16125 errtoken->number.
16126 * src/reader.c (reader): Don't specify the user token number (2)
16127 for $undefined, as it uselessly prevents using it.
16128 * src/gram.h (token_number_t): Move to...
16129 * src/symtab.h: here.
16130 (state_t.number): Is a token_number_t.
16131 * src/print.c, src/reader.c: Use undeftoken->number instead of
16132 hard coded 2.
16133 (Even though this 2 is not the same as above: the number of the
16134 undeftoken remains being 2, it is its user token number which
16135 might not be 2).
16136 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16137 `user_token_number_max'.
16138 Output `undef_token_number'.
16139 * data/bison.simple, data/bison.c++: Use them.
16140 Be sure to map invalid yylex return values to
16141 `undef_token_number'. This saves us from gratuitous SEGV.
16142
16143 * tests/conflicts.at (Solved SR Conflicts)
16144 (Unresolved SR Conflicts): Adjust.
16145 * tests/regression.at (Web2c Actions): Adjust.
16146
06446ccf
AD
161472002-04-08 Akim Demaille <akim@epita.fr>
16148
16149 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16150 Adding #line.
16151 Remove the duplicate `typedefs'.
16152 (RhsNumberType): Fix the declaration and various other typos.
16153 Use __ofile__.
16154 * data/bison.simple: Use __ofile__.
16155 * src/scan-skel.l: Handle __ofile__.
16156
62a3e4f0
AD
161572002-04-08 Akim Demaille <akim@epita.fr>
16158
16159 * src/gram.h (item_number_t): New, the type of item numbers in
16160 RITEM. Note that it must be able to code symbol numbers as
16161 positive number, and the negation of rule numbers as negative
16162 numbers.
16163 Adjust all dependencies (pretty many).
16164 * src/reduce.c (rule): Remove this `short *' pointer: use
16165 item_number_t.
16166 * src/system.h (MINSHORT, MAXSHORT): Remove.
16167 Include `limits.h'.
16168 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16169 (shortcpy): Remove.
16170 (MAXTABLE): Move to...
16171 * src/output.c (MAXTABLE): here.
16172 (prepare_rules): Use output_int_table to output rhs.
16173 * data/bison.simple, data/bison.c++: Adjust.
16174 * tests/torture.at (Big triangle): Move the limit from 254 to
16175 500.
16176 * tests/regression.at (Web2c Actions): Ajust.
16177
16178 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16179 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16180 passes, but produces negative #line number, once fixed, GCC is
16181 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16182 C), it passes.
16183 * src/state.h (state_h): Code input lines on ints, not shorts.
16184
bb88b0fc
AD
161852002-04-08 Akim Demaille <akim@epita.fr>
16186
16187 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16188 and then the grammar.
16189
9a636f47
AD
161902002-04-08 Akim Demaille <akim@epita.fr>
16191
16192 * src/system.h: No longer using strndup.
16193
680e8701
AD
161942002-04-07 Akim Demaille <akim@epita.fr>
16195
16196 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16197 * src/output.c (output_table_data): Return the longest number.
16198 (prepare_tokens): Output `token_number_max').
16199 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16200 New.
16201 Use them to define yy_token_number_type/TokenNumberType.
16202 Use this type for yytranslate.
16203 * tests/torture.at (Big triangle): Push the limit from 124 to
16204 253.
16205 * tests/regression.at (Web2c Actions): Adjust.
16206
817e9f41
AD
162072002-04-07 Akim Demaille <akim@epita.fr>
16208
16209 * tests/torture.at (Big triangle): New.
16210 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16211 * tests/existing.at: here.
16212
5123689b
AD
162132002-04-07 Akim Demaille <akim@epita.fr>
16214
16215 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16216 nritems.
16217 Adjust dependencies.
16218
f3849179
AD
162192002-04-07 Akim Demaille <akim@epita.fr>
16220
16221 * src/reader.c: Normalize increments to prefix form.
16222
bd02036a
AD
162232002-04-07 Akim Demaille <akim@epita.fr>
16224
16225 * src/reader.c, symtab.c: Remove debugging code.
16226
db8837cb
AD
162272002-04-07 Akim Demaille <akim@epita.fr>
16228
16229 Rename all the `bucket's as `symbol_t'.
16230
16231 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16232 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16233 * src/symtab.c, src/symtab.h (bucket): Rename as...
16234 (symbol_t): this.
16235 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16236 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16237 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16238 (buckets_new, buckets_free, buckets_do): Rename as...
16239 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16240 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16241 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16242 (symbols_new, symbols_free, symbols_do): these.
16243
72a23c97
AD
162442002-04-07 Akim Demaille <akim@epita.fr>
16245
16246 Use lib/hash for the symbol table.
16247
16248 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16249 EOF.
16250 * src/lex.c (lex): Set the `number' member of new terminals.
16251 * src/reader.c (bucket_check_defined, bucket_make_alias)
16252 (bucket_check_alias_consistence, bucket_translation): New.
16253 (reader, grammar_free, readgram, token_translations_init)
16254 (packsymbols): Adjust.
16255 (reader): Number the predefined tokens.
16256 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16257 for predefined tokens.
16258 * src/symtab.h (bucket): Remove all the hash table related
16259 members.
16260 * src/symtab.c (symtab): Replace by...
16261 (bucket_table): this.
16262 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16263 (buckets_new, buckets_do): New.
16264
280a38c3
AD
162652002-04-07 Akim Demaille <akim@epita.fr>
16266
16267 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16268 (start_symbol, max_user_token_number, semantic_parser)
16269 (error_token_number): Initialize.
16270 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16271 Initialize.
16272 (reader): Don't.
16273 (errtoken, eoftoken, undeftoken, axiom): Extern.
16274
03b31c0c
AD
162752002-04-07 Akim Demaille <akim@epita.fr>
16276
16277 * src/gram.h (rule_s): prec and precsym are now pointers
16278 to the bucket giving the priority/associativity.
16279 Member `associativity' removed: useless.
16280 * src/reduce.c, src/conflicts.c: Adjust.
16281
8b3df748
AD
162822002-04-07 Akim Demaille <akim@epita.fr>
16283
16284 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16285 Properly escape the symbols' TAG when outputting them.
16286
e601aa1d
AD
162872002-04-07 Akim Demaille <akim@epita.fr>
16288
16289 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16290
b0299a2e
AD
162912002-04-07 Akim Demaille <akim@epita.fr>
16292
16293 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16294 (LArule): this, which is an array to rule_t*.
16295 * src/print.c, src/conflicts.c: Adjust.
16296
d7e1f00c
AD
162972002-04-07 Akim Demaille <akim@epita.fr>
16298
16299 * src/gram.h (rule_t): Rename `number' as `user_number'.
16300 `number' is a new member.
16301 Adjust dependencies.
16302 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16303
cc9305dd
AD
163042002-04-07 Akim Demaille <akim@epita.fr>
16305
16306 As a result of the previous patch, it is no longer needed
16307 to reorder ritem itself.
16308
16309 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16310
b0940840
AD
163112002-04-07 Akim Demaille <akim@epita.fr>
16312
16313 Be sure never to walk through RITEMS, but use only data related to
16314 the rules themselves. RITEMS should be banished.
16315
16316 * src/output.c (output_token_translations): Rename as...
16317 (prepare_tokens): this.
16318 In addition to `translate', prepare the muscles `tname' and
16319 `toknum', which were handled by...
16320 (output_rule_data): this.
16321 Remove, and move the remainder of its outputs into...
16322 (prepare_rules): this new routines, which also merges content from
16323 (output_gram): this.
16324 (prepare_rules): Be sure never to walk through RITEMS.
16325 (output_stos): Rename as...
16326 (prepare_stos): this.
16327 (output): Always invoke prepare_states, after all, just don't use it
16328 in the output if you don't need it.
16329
643a5994
AD
163302002-04-07 Akim Demaille <akim@epita.fr>
16331
16332 * src/LR0.c (new_state): Display `nstates' as the name of the
16333 newly created state.
16334 Adjust to initialize first_state and last_state if needed.
16335 Be sure to distinguish the initial from the final state.
16336 (new_states): Create the itemset of the initial state, and use
16337 new_state.
16338 * src/closure.c (closure): Now that the initial state has its
16339 items properly set, there is no need for a special case when
16340 creating `ruleset'.
16341
16342 As a result, now the rule 0, reducing to $axiom, is visible in the
16343 outputs. Adjust the test suite.
16344
16345 * tests/conflicts.at (Solved SR Conflicts)
16346 (Unresolved SR Conflicts): Adjust.
16347 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16348 * tests/conflicts.at (S/R in initial): New.
16349
b4c4ccc2
AD
163502002-04-07 Akim Demaille <akim@epita.fr>
16351
16352 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16353 the RHS of the rules.
16354 * src/output.c (output_gram): Likewise.
16355
bba97eb2
AD
163562002-04-07 Akim Demaille <akim@epita.fr>
16357
16358 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16359 bucket.
16360 Adjust all dependencies.
16361 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16362 `number' of the buckets too.
16363 * src/gram.h: Include `symtab.h'.
16364 (associativity): Move to...
16365 * src/symtab.h: here.
16366 No longer include `gram.h'.
16367
c3b407f4
AD
163682002-04-07 Akim Demaille <akim@epita.fr>
16369
16370 * src/gram.h, src/gram.c (rules_rhs_length): New.
16371 (ritem_longest_rhs): Use it.
16372 * src/gram.h (rule_t): `number' is a new member.
16373 * src/reader.c (packgram): Set it.
16374 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16375 the end of `rules', and count them out of `nrules'.
16376 (reduce_output, dump_grammar): Adjust.
16377 * src/print.c (print_grammar): It is no longer needed to check for
16378 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16379 * tests/reduce.at (Reduced Automaton): New test.
16380
11652ab3
AD
163812002-04-07 Akim Demaille <akim@epita.fr>
16382
16383 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16384 lacking `+ 1' to nrules, Bison reported as useless a token if it
16385 was used solely to set the precedence of the last rule...
16386
26b23c1a
AD
163872002-04-07 Akim Demaille <akim@epita.fr>
16388
16389 * data/bison.c++, data/bison.simple: Don't output the current file
16390 name in #line, to avoid useless diffs between two identical
16391 outputs under different names.
16392
18bcecb0
AD
163932002-04-07 Akim Demaille <akim@epita.fr>
16394
16395 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16396 Normalize loops to using `< nrules + 1', not `<= nrules'.
16397
fa770c86
AD
163982002-04-07 Akim Demaille <akim@epita.fr>
16399
16400 * TODO: Update.
16401
d9b739c3
AD
164022002-04-07 Akim Demaille <akim@epita.fr>
16403
16404 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16405 bucket.value as bucket.number.
16406
99013900
AD
164072002-04-07 Akim Demaille <akim@epita.fr>
16408
16409 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16410 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16411 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16412 RHS, instead of being an index in RITEMS.
16413
e966383b
PE
164142002-04-04 Paul Eggert <eggert@twinsun.com>
16415
16416 * doc/bison.texinfo: Update copyright date.
16417 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16418 (Symbols): Warn about running Bison in one character set,
16419 but compiling and/or running in an incompatible one.
16420 Warn about character code 256, too.
16421
164222002-04-03 Paul Eggert <eggert@twinsun.com>
16423
16424 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16425 YYERROR_VERBOSE is nonzero, not whether it is defined.
16426
16427 Merge changes from bison-1_29-branch.
c307773e 16428
8d6c48b9
PE
164292002-03-20 Paul Eggert <eggert@twinsun.com>
16430
16431 Merge fixes from Debian bison_1.34-1.diff.
16432
16433 * configure.in (AC_PREREQ): 2.53.
16434
e53c6322
AD
164352002-03-20 Akim Demaille <akim@epita.fr>
16436
16437 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16438
9ffbeca7
PE
164392002-03-19 Paul Eggert <eggert@twinsun.com>
16440
21db0b2a
PE
16441 * src/bison.simple (YYCOPY): New macro.
16442 (YYSTACK_RELOCATE): Use it.
16443 Remove Type arg; no longer needed. All callers changed.
16444 (yymemcpy): Remove; no longer needed.
16445
9ffbeca7
PE
16446 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16447 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16448
642cb8f8
AD
164492002-03-19 Akim Demaille <akim@epita.fr>
16450
16451 Test and fix the #line outputs.
16452
16453 * tests/atlocal.at (GCC): New.
16454 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 16455 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
16456 (Action synch line, Epilogue synch line): New tests.
16457 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16458 * data/bison.simple, data/bison.c++: Use it.
16459
3c31a486
AD
164602002-03-19 Akim Demaille <akim@epita.fr>
16461
16462 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16463 (Solved SR Conflicts, %expect not enough, %expect right)
16464 (%expect too much): Move to...
16465 * tests/conflicts.at: this new file.
16466
0d8bed56
AD
164672002-03-19 Akim Demaille <akim@epita.fr>
16468
16469 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16470 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16471 that we can move to enums for instance.
16472 * src/output.c (token_definitions_output): Output a list of
16473 `token-name, token-number' instead of the #define.
16474 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16475
9208d17f
AD
164762002-03-14 Akim Demaille <akim@epita.fr>
16477
16478 Use Gettext 0.11.1.
16479
af27eacb
RA
164802002-03-09 Robert Anisko <robert@lrde.epita.fr>
16481
16482 * data/bison.c++: Make the user able to add members to the generated
16483 parser by subclassing.
16484
9101a310
RA
164852002-03-05 Robert Anisko <robert@lrde.epita.fr>
16486
16487 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16488 a character.
16489 Reported by Nicolas Tisserand and Nicolas Burrus.
16490
fff9bf0b
RA
164912002-03-04 Robert Anisko <robert@lrde.epita.fr>
16492
16493 * src/reader.c: Warn about lacking semi-colons, do not complain.
16494
64dba31e
RA
164952002-03-04 Robert Anisko <robert@lrde.epita.fr>
16496
16497 * data/bison.c++: Remove a debug line.
16498
374f5a14
RA
164992002-03-04 Robert Anisko <robert@lrde.epita.fr>
16500
16501 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16502 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16503 provide a default implementation.
16504
bfcf1f3a
AD
165052002-03-04 Akim Demaille <akim@epita.fr>
16506
16507 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16508 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16509 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16510 * tests/semantic.at (Parsing Guards): Similarly.
16511 * src/reader.at (readgram): Complain if the last rule is not ended
16512 with a semi-colon.
16513
65ccf9fc
AD
165142002-03-04 Akim Demaille <akim@epita.fr>
16515
16516 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16517 * src/closure.c: here.
16518 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16519 RTC.
16520 * src/warshall.h, src/warshall.c: Remove.
16521 * tests/sets.at (Broken Closure): Adjust.
16522
d0039cbc
AD
165232002-03-04 Akim Demaille <akim@epita.fr>
16524
16525 * src/output.c (output_skeleton): tempdir is const.
16526 bytes_read is unused.
16527
345cea78
AD
165282002-03-04 Akim Demaille <akim@epita.fr>
16529
16530 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16531 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16532 Update.
16533 From Michael Hayes.
16534
564801f7
AD
165352002-03-04 Akim Demaille <akim@epita.fr>
16536
16537 * src/closure.c (closure): `r' is unused.
16538
e5352bc7
AD
165392002-03-04 Akim Demaille <akim@epita.fr>
16540
16541 * tests/sets.at (Broken Closure): Add the ending `;'.
16542 * src/reader.at (readgram): Complain if a rule is not ended with a
16543 semi-colon.
16544
914feea9
AD
165452002-03-04 Akim Demaille <akim@epita.fr>
16546
16547 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16548 (count_sr_conflicts): Use bitset_count.
16549 * src/reduce.c (inaccessable_symbols): Ditto.
16550 (bits_size): Remove.
16551 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16552
f0250de6
AD
165532002-03-04 Akim Demaille <akim@epita.fr>
16554
16555 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16556 * src/reduce.c: Remove the `bitset_zero's following the
16557 `bitset_create's, as now it is performed by the latter.
16558
ef017502
AD
165592002-03-04 Akim Demaille <akim@epita.fr>
16560
16561 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16562 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16563 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16564 latest sources from Michael.
16565
76514394
AD
165662002-03-04 Akim Demaille <akim@epita.fr>
16567
16568 * src/output.c (output): Don't free the grammar.
16569 * src/reader.c (grammar_free): New.
16570 * src/main.c (main): Call it and don't free symtab here.
16571
55024580
AD
165722002-03-04 Akim Demaille <akim@epita.fr>
16573
16574 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16575 before returning.
16576 Reported by Benoit Perrot.
16577
f9abaa2c
AD
165782002-03-04 Akim Demaille <akim@epita.fr>
16579
16580 Use bitset operations when possible, not loops over bits.
16581
16582 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16583 bitset_or.
16584 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16585 * src/reduce.c (useless_nonterminals): Formatting changes.
16586 * src/warshall.c (TC): Use bitset_or.
16587
0e721e75
AD
165882002-03-04 Akim Demaille <akim@epita.fr>
16589
16590 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16591 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16592 Ditto.
16593
0fb1ffb1
AD
165942002-03-04 Akim Demaille <akim@epita.fr>
16595
16596 * src/lalr.c (F): Now a bitset*.
16597 Adjust all dependencies.
16598
b86796bf
AD
165992002-03-04 Akim Demaille <akim@epita.fr>
16600
16601 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16602 Adjust all dependencies.
16603
602bbf31
AD
166042002-03-04 Akim Demaille <akim@epita.fr>
16605
16606 * src/L0.c, src/LR0.h (nstates): Be size_t.
16607 Adjust comparisons (signed vs unsigned).
16608 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16609 bitset*.
16610 Adjust all dependencies.
16611
d8a0245c
AD
166122002-03-04 Akim Demaille <akim@epita.fr>
16613
16614 * src/closure.c (firsts): Now, also a bitset.
16615 Adjust all dependencies.
16616 (varsetsize): Remove, now unused.
16617 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16618
34ba9743
AD
166192002-03-04 Akim Demaille <akim@epita.fr>
16620
16621 * src/print.c: Convert to use bitset.h, not hand coded iterations
16622 over ints.
16623
ed86e78c
AD
166242002-03-04 Akim Demaille <akim@epita.fr>
16625
16626 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16627
dfdb1797
AD
166282002-03-04 Akim Demaille <akim@epita.fr>
16629
16630 * src/closure.c (ruleset): Be a bitset.
16631 (rulesetsize): Remove.
16632
7086e707
AD
166332002-03-04 Akim Demaille <akim@epita.fr>
16634
16635 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16636 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16637 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16638 * src/closure.c (fderives): Be an array of bitsets.
16639
98254360
RA
166402002-02-28 Robert Anisko <robert@lrde.epita.fr>
16641
16642 * data/bison.c++: Merge the two generated headers. Insert a copyright
16643 notice in each output file.
16644
a75c057f
AD
166452002-02-28 Akim Demaille <akim@epita.fr>
16646
16647 * data/bison.c++: Copy the prologue of bison.simple to fetch
16648 useful M4 definitions, such as b4_header_guard.
16649
06b00abc
AD
166502002-02-25 Akim Demaille <akim@epita.fr>
16651
16652 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
16653 translator friendly scheme for the bgr
16654 copyright notice.
06b00abc 16655
70e7d534
AD
166562002-02-25 Akim Demaille <akim@epita.fr>
16657
16658 * src/output.c (header_output): Remove, now handled completely via
16659 M4.
16660
abe017f6
AD
166612002-02-25 Akim Demaille <akim@epita.fr>
16662
16663 * m4/m4.m4: New, from CVS Autoconf.
16664 * configure.in: Invoke it.
16665 * src/output.c (output_skeleton): Use its result instead of the
16666 hard coded name.
16667
381fb12e
AD
166682002-02-25 Akim Demaille <akim@epita.fr>
16669
16670 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16671 Fileutils 4.1.5.
16672 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16673 * src/output.c (output_skeleton): Use mkstemp to create a real
16674 temporary file.
16675 Move the filling of `skeleton' and its muscle to...
16676 (prepare): here.
16677 (output): Move the definition of the prologue muscle to...
16678 (prepare): here.
16679 * src/system.h (DEFAULT_TMPDIR): New.
16680
6f38107f
PE
166812002-02-14 Paul Eggert <eggert@twinsun.com>
16682
16683 Remove the support for C++ namespace cleanliness; it was
16684 causing more problems than it was curing, since it didn't work
16685 properly on some nonstandard C++ compilers. This can wait
16686 for a proper C++ parser.
16687
16688 * NEWS: Document this.
16689 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16690 of C++, as it's treated like C now.
16691 * src/bison.simple (YYSTD): Remove.
16692 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16693 Treat C++ just like Standard C instead of trying to support
16694 namespace cleanliness.
16695
80cce3da
AD
166962002-02-14 Akim Demaille <akim@epita.fr>
16697
16698 * tests/regression.at (else): Adjust to Andreas' change.
16699
842e8679
AD
167002002-02-14 Akim Demaille <akim@epita.fr>
16701
16702 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16703
4bda3f10
AD
167042002-02-13 Andreas Schwab <schwab@suse.de>
16705
16706 * src/output.c (output_rule_data): Don't output NULL, it might
16707 not be defined yet.
16708
4162fa07 167092002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 16710
4162fa07
RA
16711 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16712 (Copyright notice): Update.
b418ecd8 16713
bd16a5dc
AD
167142002-02-11 Akim Demaille <akim@epita.fr>
16715
16716 * tests/regression.at (%nonassoc and eof): Don't include
16717 nonportable headers.
16718
8d69a1a3
RA
167192002-02-08 Robert Anisko <robert@lrde.epita.fr>
16720
16721 * data/bison.c++: Correct error recovery. Make the user able to
16722 initialize the starting location.
16723
9b2d0677
AD
167242002-02-07 Akim Demaille <akim@epita.fr>
16725
16726 * tests/input.at: New.
16727
69e2658b
RA
167282002-02-07 Robert Anisko <robert@lrde.epita.fr>
16729
16730 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 16731 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
16732 directives around tables only needed for debugging.
16733
4aacc3a7
RA
167342002-02-07 Robert Anisko <robert@lrde.epita.fr>
16735
16736 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16737 C++ parsers.
16738 (yy::b4_name::parse): Use print_.
16739
762a801e
RA
167402002-02-07 Robert Anisko <robert@lrde.epita.fr>
16741
16742 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16743
4bb2bc3f
RA
167442002-02-07 Robert Anisko <robert@lrde.epita.fr>
16745
16746 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16747 C++ parsers.
16748 (yy::b4_name::parse): Build verbose error messages, and use error_.
16749
6b45a3ca
RA
167502002-02-06 Robert Anisko <robert@lrde.epita.fr>
16751
16752 * data/bison.c++: Fix m4 quoting in comments.
16753
50997c6e
RA
167542002-02-06 Robert Anisko <robert@lrde.epita.fr>
16755
16756 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16757 not expanded by m4.
16758
3f3eed27
AD
167592002-02-05 Akim Demaille <akim@epita.fr>
16760
16761 * data/bison.c++: Adjust to the M4 back end.
16762 More is certainly needed.
16763
be2a1a68
AD
167642002-02-05 Akim Demaille <akim@epita.fr>
16765
16766 Give a try to M4 as a back end.
16767
16768 * lib/readpipe.c: New, from wdiff.
16769 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16770 BISON_HAIRY.
16771 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16772 specific values. Now it is m4 that performs the lookup.
16773 * src/parse-skel.y: Remove.
16774 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16775 * src/output.c (actions_output, guards_output)
16776 (token_definitions_output): No longer keeps track of the output
16777 line number, hence remove the second argument.
16778 (guards_output): Check against the guard member of a rule, not the
16779 action member.
16780 Adjust callers.
16781 (output_skeleton): Don't look for the skeleton location, let m4 do
16782 that.
16783 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16784 file will be used.
16785 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16786 (prepare): Given that for the time being changesyntax is not
16787 usable in M4, rename the muscles using `-' to `_'.
16788 Define `defines_flag', `output_parser_name' and `output_header_name'.
16789 * src/output.h (actions_output, guards_output)
16790 (token_definitions_output): Adjust prototypes.
16791 * src/scan-skel.l: Instead of scanning the skeletons, it now
16792 processes the output of m4: `__oline__' and `#output'.
16793 * data/bison.simple: Adjust to be used by M4(sugar).
16794 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16795 to date.
16796 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16797 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16798 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16799 shamelessly stolen from CVS Autoconf.
16800
beda758b
AD
168012002-02-05 Akim Demaille <akim@epita.fr>
16802
16803 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16804 * configure.in: Check for the declarations of free and malloc.
16805 * src/muscle_tab.c: Adjust.
16806
5ece6d43
AD
168072002-02-05 Akim Demaille <akim@epita.fr>
16808
16809 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16810 which have no values.
16811
5bb18f9a
AD
168122002-02-05 Akim Demaille <akim@epita.fr>
16813
16814 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16815 * data/: here.
16816
894dd62e
PE
168172002-01-29 Paul Eggert <eggert@twinsun.com>
16818
16819 * src/bison.simple (YYSIZE_T): Do not define merely because
16820 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16821 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16822
82841af7
AD
168232002-01-27 Akim Demaille <akim@epita.fr>
16824
16825 Fix `%nonassoc and eof'.
16826
16827 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16828 which were not properly copied! Replace
16829 memcpy (res->errs, src->errs, src->nerrs);
16830 with
16831 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16832 !!!
16833 * tests/regression.at (%nonassoc and eof): Adjust to newest
16834 Autotest: `.' is not in the PATH.
16835
318b76e9
AD
168362002-01-27 Akim Demaille <akim@epita.fr>
16837
16838 * tests/sets.at (AT_EXTRACT_SETS): New.
16839 (Nullable): Use it.
16840 (Firsts): New.
16841
30d2f3d5
AD
168422002-01-26 Akim Demaille <akim@epita.fr>
16843
16844 * tests/actions.at, tests/calc.at, tests/headers.at,
16845 * tests/torture.at: Adjust to the newest Autotest which no longer
16846 forces `.' in the PATH.
16847
30f8c395
AD
168482002-01-25 Akim Demaille <akim@epita.fr>
16849
16850 * tests/regression.at (%nonassoc and eof): New.
16851 Suggested by Robert Anisko.
16852
29ae55f1
AD
168532002-01-24 Akim Demaille <akim@epita.fr>
16854
16855 Bison dumps core when trying to complain about broken input files.
16856 Reported by Cris van Pelt.
16857
16858 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16859 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16860 into...
16861 (Invalid inputs): Strengthen: exercise parse_percent_token.
16862
2b548aa6
RA
168632002-01-24 Robert Anisko <robert.anisko@epita.fr>
16864
16865 * src/Makefile.am: Add bison.c++.
16866 * src/bison.c++: New skeleton.
16867
bb0146c2
AD
168682002-01-21 Paolo Bonzini <bonzini@gnu.org>
16869
16870 * po/it.po: New.
16871
bec30531
AD
168722002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16873
16874 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16875
fc6edc45
MA
168762002-01-20 Marc Autret <marc@gnu.org>
16877
16878 * src/files.c (compute_output_file_names): Fix
16879
5e5d5415
MA
168802002-01-20 Marc Autret <marc@gnu.org>
16881
16882 * tests/output.at: New test.
16883 * src/files.c (compute_base_names): Don't map extensions when
16884 the YACC flag is set, use defaults.
16885 Reported by Evgeny Stambulchik.
16886
44ea3fbd
MA
168872002-01-20 Marc Autret <marc@gnu.org>
16888
ba0fe3c7
PE
16889 * src/system.h: Need to define __attribute__ away for non-GCC
16890 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
16891 Suggested by Albert Chin-A-Young.
16892
338963d1
TVH
168932002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16894
16895 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16896 canonical definition.
16897 * src/system.h: Use the canonical definition for PARAMS (avoids
16898 a conflict with the macro from lib/hash.h).
16899
c57b2479
AD
169002002-01-11 Akim Demaille <akim@epita.fr>
16901
16902 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 16903 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 16904
b85810ae
AD
169052002-01-09 Akim Demaille <akim@epita.fr>
16906
16907 * src/files.c, src/files.h (output_infix): New.
16908 (tab_extension): Remove.
16909 (compute_base_names): Compute the former, drop the latter.
16910 * src/output.c (prepare): Insert the muscles `output-infix', and
16911 `output-suffix'.
16912 * src/parse-skel.y (string, string.1): New.
16913 (section.header): Use it.
16914 (section.yacc): Remove.
16915 (prefix): Remove too.
16916 * src/scan-skel.l: Adjust.
16917 * src/bison.simple, src/bison.hairy: Adjust.
16918
cae60122
AD
169192002-01-09 Akim Demaille <akim@epita.fr>
16920
16921 * configure.in (WERROR_CFLAGS): Compute it.
16922 * src/Makefile.am (CFLAGS): Pass it.
16923 * tests/atlocal.in (CFLAGS): Idem.
16924 * src/files.c: Fix a few warnings.
16925 (get_extension_index): Remove, unused.
16926
ae404801
AD
169272002-01-08 Akim Demaille <akim@epita.fr>
16928
16929 * src/getargs.c (AS_FILE_NAME): New.
16930 (getargs): Use it to convert DOSish file names.
16931 * src/files.c (base_name): Rename as full_base_name to avoid
16932 clashes with `base_name ()'.
16933 (filename_split): New.
16934 (compute_base_names): N-th rewrite, using filename_split.
16935
22312b71
AD
169362002-01-08 Akim Demaille <akim@epita.fr>
16937
16938 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16939 New, stolen from the Fileutils 4.1.
16940 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16941 * configure.in: Check for the presence of memrchr, and of its
16942 prototype.
16943
a67cef01
TVH
169442002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16945
16946 * lib/hash.h (__P): Added definition for this macro.
16947 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16948 BUILT_SOURCES, to ensure they are generated first.
16949 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16950 %error-verbose to allow bootstrapping with bison 1.30x.
16951
2b25d624
AD
169522002-01-06 Akim Demaille <akim@epita.fr>
16953
16954 * src/reader.c (parse_braces): Don't fetch the next char, the
16955 convention is to fetch on entry.
16956 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16957 'switch' without a following semicolon.
16958 * tests/regression.at (braces parsing): New.
16959
3460813b
AD
169602002-01-06 Akim Demaille <akim@epita.fr>
16961
16962 Bison is dead wrong in its RR conflict reports.
16963
16964 * tests/torture.at (GNU Cim Grammar): New.
16965 * src/conflicts.c (count_rr_conflicts): Fix.
16966
73784c64
AD
169672002-01-06 Akim Demaille <akim@epita.fr>
16968
16969 Creating package.m4 from configure.ac causes too many problems.
16970
16971 * tests/Makefile.am (package.m4): Create it by hand,
16972 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16973
25d81090
AD
169742002-01-06 Akim Demaille <akim@epita.fr>
16975
16976 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16977 skeleton.h.
16978
a9b8959e
PE
169792002-01-04 Paul Eggert <eggert@twinsun.com>
16980
16981 * doc/bison.texinfo (Debugging):
16982 Remove YYSTDERR; it's no longer defined or used.
16983 Also, s/cstdio.h/cstdio/.
16984
25d81090
AD
169852002-01-03 Akim Demaille <akim@epita.fr>
16986
16987 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
16988
1109455c
AD
169892002-01-03 Akim Demaille <akim@epita.fr>
16990
16991 * src/parse-skel.y (process_skeleton): Don't bind the parser's
16992 tracing code to --trace, wait for a better --trace option, with
16993 args.
16994
7ea5e977
AD
169952002-01-03 Akim Demaille <akim@epita.fr>
16996
16997 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
16998 The ISO C++ standard is extremely clear about it: stderr is
16999 considered a macro, not a regular symbol (see table 94 `Header
17000 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17001 Therefore std:: does not apply to it. It still does with fprintf.
17002 Also, s/cstdio.h/cstdio/.
17003
fab5b110
AD
170042002-01-03 Akim Demaille <akim@epita.fr>
17005
17006 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17007 for non system headers.
17008
aed7fd9b
AD
170092002-01-02 Akim Demaille <akim@epita.fr>
17010
17011 Equip the skeleton chain with location tracking, runtime trace,
17012 pure parser and scanner.
17013
17014 * src/parse-skel.y: Request a pure parser, locations, and prefix
17015 renaming.
17016 (%union): Having several members with the same type does not help
17017 type mismatches, simplify.
17018 (YYPRINT, yyprint): New.
17019 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17020 (skel_error): this.
17021 Handle locations.
17022 * src/scan-skel.l: Adjust to these changes.
17023 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17024 (LOCATION_PRINT, skel_control_t): New.
17025
24fad99e
AD
170262001-12-30 Akim Demaille <akim@epita.fr>
17027
17028 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17029 replace `gb' with BLANKS.
17030 * src/scan-skel.l: Adjust.
17031
a4b36db4
AD
170322001-12-30 Akim Demaille <akim@epita.fr>
17033
17034 * src/system.h: We don't need nor want bcopy.
17035 Throw away MS-DOS crap: we don't need getpid.
17036 * configure.in: We don't need strndup. It was even causing
17037 problems: because Flex includes the headers *before* us,
17038 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17039 not visible.
17040 * lib/xstrndup.c: New.
17041 * src/scan-skel.l: Use it.
17042 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17043 * src/parse-skel.y: Use %directives instead of #defines.
17044
1239777d
AD
170452001-12-30 Akim Demaille <akim@epita.fr>
17046
17047 * src/skeleton.h: New.
17048 * src/output.c (output_parser, output_master_parser): Remove, dead
17049 code.
17050 * src/output.h (get_lines_number, actions_output, guards_output)
17051 (token_definitions_output): Prototype them.
17052 * src/parse-skel.y: Add the license notice.
17053 Include output.h and skeleton.h.
17054 (process_skeleton): Returns void, and takes a single parameter.
17055 * src/scan-skel.l: Add the license notice.
17056 Include skeleton.h.
17057 Don't use %option yylineno: it seems that then Flex imagines
17058 REJECT has been used, and therefore it won't reallocate its
17059 buffers (which makes no other sense to me than a bug). It results
17060 in warnings for `unused: yy_flex_realloc'.
17061
9b3add5b
RA
170622001-12-30 Robert Anisko <robert.anisko@epita.fr>
17063
17064 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17065 (MUSCLE_INSERT_PREFIX): ...to there.
17066 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17067 (MUSCLE_INSERT_PREFIX): Move from here...
17068
17069 * src/bison.hairy: Add a section directive. Put braces around muscle
17070 names. This parser skeleton is still broken, but Bison should not
17071 choke on a bad muscle 'syntax'.
17072 * src/bison.simple: Add a section directive. Put braces around muscle
17073 names.
17074
17075 * src/files.h (strsuffix, stringappend): Add declarations.
17076 (tab_extension): Add declaration.
17077 (short_base_name): Add declaration.
17078
17079 * src/files.c (strsuffix, stringappend): No longer static. These
17080 functions are used in the skeleton parser.
17081 (tab_extension): New.
17082 (compute_base_names): Use the computations done in this function
fab5b110 17083 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
17084 names.
17085 (short_base_name): No longer static.
17086
17087 * src/output.c (output_skeleton): New.
17088 (output): Disable call to output_master_parser, and give a try to
17089 a new skeleton handling system.
17090 (guards_output, actions_output): No longer static.
17091 (token_definitions_output, get_lines_number): No longer static.
17092
17093 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17094
fab5b110 17095 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
17096 parse-skel.y.
17097
17098 * src/parse-skel.y: New file.
17099 * src/scan-skel.l: New file.
17100
b5b61c61
AD
171012001-12-29 Akim Demaille <akim@epita.fr>
17102
17103 %name-prefix is broken.
17104
17105 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17106 Adjust all dependencies.
17107 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17108 %name-prefix.
17109
17110 Renaming yylval but not yylloc is not consistent. Now we do.
17111
17112 * src/bison.simple: Prefix yylloc if used.
17113 * doc/bison.texinfo (Decl Summary): Document that.
17114
8c9a50be
AD
171152001-12-29 Akim Demaille <akim@epita.fr>
17116
17117 * doc/bison.texinfo: Promote `%long-directive' over
17118 `%long_directive'.
17119 Remove all references to fixed-output-files, yacc is enough.
17120
d99361e6
AD
171212001-12-29 Akim Demaille <akim@epita.fr>
17122
17123 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17124 user prologue. These are defaults.
17125 * tests/actions.at (Mid-rule actions): Make sure the user can
17126 define YYDEBUG and YYERROR_VERBOSE.
17127
b9cecb91
AD
171282001-12-29 Akim Demaille <akim@epita.fr>
17129
17130 * src/output.c (header_output): Don't forget to export YYLTYPE and
17131 yylloc.
17132 * tests/headers.at (export YYLTYPE): New, make sure it does.
17133 * tests/regression.at (%union and --defines, Invalid CPP headers):
17134 Move to...
17135 * tests/headers.at: here.
17136
aea13e97
AD
171372001-12-29 Akim Demaille <akim@epita.fr>
17138
17139 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17140
931394cb
AD
171412001-12-29 Akim Demaille <akim@epita.fr>
17142
17143 * tests/actions.at (Mid-rule actions): Output on a single line
17144 instead of several.
17145
704a47c4
AD
171462001-12-29 Akim Demaille <akim@epita.fr>
17147
17148 * doc/bison.texinfo: Formatting changes.
17149
091e20bb
AD
171502001-12-29 Akim Demaille <akim@epita.fr>
17151
17152 Don't store the token defs in a muscle, just be ready to output it
17153 on command. Now possible via `symbols'. Fixes a memory leak.
17154
17155 * src/output.c (token_definitions_output): New.
17156 (output_parser, header_output): Use it.
17157 * src/reader.c (symbols_save): Remove.
17158
cce71710
AD
171592001-12-29 Akim Demaille <akim@epita.fr>
17160
17161 * src/bison.simple: Do not provide a default for YYSTYPE and
17162 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17163 default.
17164
82c035a8
AD
171652001-12-29 Akim Demaille <akim@epita.fr>
17166
17167 Mid-rule actions are simply... ignored!
17168
17169 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17170 the empty-rule associated to the dummy symbol, not to the host
17171 rule.
17172 * tests/actions.at (Mid-rule actions): New.
17173
8419d367
AD
171742001-12-29 Akim Demaille <akim@epita.fr>
17175
17176 Memory leak.
17177
17178 * src/reader.c (reader): Free grammar.
17179
375d5806
AD
171802001-12-29 Akim Demaille <akim@epita.fr>
17181
17182 Memory leak.
17183
17184 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17185 since it allocates it for each state, although only one is needed.
17186 (allocate_storage): Do it here.
17187
f51cb8ff
AD
171882001-12-29 Akim Demaille <akim@epita.fr>
17189
17190 * src/options.h, src/options.c (create_long_option_table): Rename
17191 as...
17192 (long_option_table_new): this, with a clearer prototype.
17193 (percent_table): Remove, unused,
17194 * src/getargs.c (getargs): Adjust.
17195
29e88316
AD
171962001-12-29 Akim Demaille <akim@epita.fr>
17197
17198 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17199 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17200 as states.
17201
b9f71f19
AD
172022001-12-29 Akim Demaille <akim@epita.fr>
17203
17204 * src/lalr.c (build_relations): Rename `states' as `states1'.
17205 Sorry, I don't understand exactly what it is, no better name...
17206
1a2b5d37
AD
172072001-12-29 Akim Demaille <akim@epita.fr>
17208
17209 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17210 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17211 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17212 as rules.
17213
1cca533e
AD
172142001-12-29 Akim Demaille <akim@epita.fr>
17215
17216 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17217 ago.
17218
c03ae966
AD
172192001-12-29 Akim Demaille <akim@epita.fr>
17220
17221 * src/reader.c, src/reader.h (user_toknums): Remove.
17222 Adjust all users to use symbols[i]->user_token_number.
17223
5a670b1e
AD
172242001-12-29 Akim Demaille <akim@epita.fr>
17225
17226 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17227 Adjust all users to use symbols[i]->prec or ->assoc.
17228
ad949da9
AD
172292001-12-29 Akim Demaille <akim@epita.fr>
17230
17231 * src/reader.c, src/reader.h (tags): Remove.
17232 Adjust all users to use symbols[i]->tag.
17233
0e78e603
AD
172342001-12-29 Akim Demaille <akim@epita.fr>
17235
17236 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17237 and rule_table.
17238 * src/reader.c (packsymbols): Fill this table.
17239 Drop sprec.
17240 * src/conflicts.c (resolve_sr_conflict): Adjust.
17241 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17242 single table.
17243 Use symbols[i]->tag instead of tags[i].
17244
213e640e
AD
172452001-12-29 Akim Demaille <akim@epita.fr>
17246
17247 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17248 In addition, put a comment in there, to replace...
17249 * tests/regression.at (%union and C comments): Remove.
17250
e7b8bef1
AD
172512001-12-29 Akim Demaille <akim@epita.fr>
17252
17253 * tests/regression.at (Web2c Actions): Blindly move the actual
17254 output as expected output. The contents *seem* right to me, but I
17255 can't pretend reading perfectly parser tables... Nonetheless, all
17256 the other tests pass correctly, the table look OK, even though the
17257 presence of `$axiom' is to be noted: AFAICS it is useless (but
17258 harmless).
17259
b68e7744
AD
172602001-12-29 Akim Demaille <akim@epita.fr>
17261
17262 * src/reader.c (readgram): Don't add the rule 0 if there were no
17263 rules read. In other words, add it _after_ having performed
17264 grammar sanity checks.
17265 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17266
78d5bae9
AD
172672001-12-29 Akim Demaille <akim@epita.fr>
17268
17269 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17270 visible, and some states have now a different number.
17271
ff442794
AD
172722001-12-29 Akim Demaille <akim@epita.fr>
17273
17274 * src/reader.c (readgram): Bind the initial rule's lineno to that
17275 of the first rule.
17276 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17277 (Solved SR Conflicts): Adjust rule 0's line number.
17278
610ab194
AD
172792001-12-29 Akim Demaille <akim@epita.fr>
17280
17281 Fix the `GAWK Grammar' failure.
17282
17283 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17284 the reductions of the first state which was mistakenly confused
17285 with the final state because precisely final_state was initialized
17286 to 0.
17287 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17288 now noticed by Bison.
17289 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17290 have a reduction on $default.
17291
29d29c8f
AD
172922001-12-29 Akim Demaille <akim@epita.fr>
17293
17294 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17295 rule line numbers.
17296 * src/closure.c (print_closure): Likewise.
17297 * src/derives.c (print_derives): Likewise.
17298 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17299 now.
17300
7c6b64d0
AD
173012001-12-29 Akim Demaille <akim@epita.fr>
17302
17303 * src/lalr.c (lookaheads_print): New.
17304 (lalr): Call it when --trace-flag.
17305 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17306 are dumped.
17307
3d4daee3
AD
173082001-12-29 Akim Demaille <akim@epita.fr>
17309
17310 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17311 when walking through ritem, even via rule->rhs.
17312 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17313 (useful_production, useless_nonterminals): Likewise.
17314 (reduce_grammar_tables): Likewise, plus update nritems.
17315 * src/nullable.c (set_nullable): Likewise.
17316 * src/lalr.c (build_relations): Likewise.
17317 * tests/sets.at (Nullable): Adjust.
17318 Fortunately, now, the $axiom is no longer nullable.
17319
9e7f6bbd
AD
173202001-12-29 Akim Demaille <akim@epita.fr>
17321
17322 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17323 the 0-sentinel.
17324 * src/gram.c (ritem_longest_rhs): Likewise.
17325 * src/reduce.c (nonterminals_reduce): Likewise.
17326 * src/print_graph.c (print_graph): Likewise.
17327 * src/output.c (output_rule_data): Likewise.
17328 * src/nullable.c (set_nullable): Likewise.
17329
255ef638
AD
173302001-12-29 Akim Demaille <akim@epita.fr>
17331
17332 * src/output.c: Comment changes.
17333
0d8a7363
AD
173342001-12-27 Paul Eggert <eggert@twinsun.com>
17335
17336 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17337 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17338 Sparc, as they were causing more porting problems than the
17339 (minor) performance improvement was worth.
17340
17341 Also, catch up with 1.31's YYSTD.
17342
3db472b9
AD
173432001-12-27 Akim Demaille <akim@epita.fr>
17344
17345 * src/output.c (output_gram): Rely on nritems, not the
17346 0-sentinel. See below.
17347 Use -1 as separator, not 0.
17348 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17349 Rely on -1 as separator in yyrhs, instead of 0.
17350 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17351 twice `Now at end of input', therefore there are two lines less to
17352 expect.
17353
b365aa05
AD
173542001-12-27 Akim Demaille <akim@epita.fr>
17355
17356 * tests/regression.at (Unresolved SR Conflicts):
17357 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17358 below.
17359
30171f79
AD
173602001-12-27 Akim Demaille <akim@epita.fr>
17361
17362 * src/LR0.c (new_state): Recognize the final state by the fact it
17363 is reached by eoftoken.
17364 (insert_start_shifting_state, insert_eof_shifting_state)
17365 (insert_accepting_state, augment_automaton): Remove, since now
17366 these states are automatically computed from the initial state.
17367 (generate_states): Adjust.
17368 * src/print.c: When reporting a rule number to the user, substract
17369 1, so that the axiom rule is rule 0, and the first user rule is 1.
17370 * src/reduce.c: Likewise.
17371 * src/print_graph.c (print_core): For the time being, just as for
17372 the report, depend upon --trace-flags to dump the full set of
17373 items.
17374 * src/reader.c (readgram): Once the grammar read, insert the rule
17375 0: `$axiom: START-SYMBOL $'.
17376 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17377 number of the states has changed (the final state is no longer
17378 necessarily the last), catch up.
17379
75142d45
AD
173802001-12-27 Akim Demaille <akim@epita.fr>
17381
17382 Try to make the use of the eoftoken valid. Given that its value
17383 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17384 is used instead of > 0 where appropriate, (ii), depend upon nritems
17385 instead of the 0-sentinel.
17386
17387 * src/gram.h, src/gram.c (nritems): New.
17388 Expected to be duplication of nitems, but for the time being...
17389 * src/reader.c (packgram): Assert nritems and nitems are equal.
17390 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17391 * src/closure.c (print_closure, print_fderives): Likewise.
17392 * src/gram.c (ritem_print): Likewise.
17393 * src/print.c (print_core, print_grammar): Likewise.
17394 * src/print_graph.c: Likewise.
17395
b7c49edf
AD
173962001-12-27 Akim Demaille <akim@epita.fr>
17397
17398 * src/main.c (main): If there are complains after grammar
17399 reductions, then output the report anyway if requested, then die.
17400 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17401 * src/reader.c (eoftoken): New.
17402 (parse_token_decl): If the token being defined has value `0', it
17403 is the eoftoken.
17404 (packsymbols): No longer hack `tags' to insert `$' by hand.
17405 Be sure to preserve the value of the eoftoken.
17406 (reader): Make sure eoftoken is defined.
17407 Initialize nsyms to 0: now eoftoken is created just like the others.
17408 * src/print.c (print_grammar): Don't special case the eof token.
17409 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17410 lie anyway, albeit pleasant.
17411 * tests/calc.at: Exercise error messages with eoftoken.
17412 Change the grammar so that empty input is invalid.
17413 Adjust expectations.
17414 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17415
ec2da99f
AD
174162001-12-27 Akim Demaille <akim@epita.fr>
17417
17418 * configure.in: Check the protos of strchr ans strspn.
17419 Replace strchr if needed.
17420 * src/system.h: Provide the protos of strchr, strspn and memchr if
17421 missing.
17422 * lib/strchr.c: New.
17423 * src/reader.c (symbols_save): Use strchr.
17424
8adfa272
AD
174252001-12-27 Akim Demaille <akim@epita.fr>
17426
17427 * src/print.c, src/print_graph.c (escape): New.
17428 Use it to quote the TAGS outputs.
17429 * src/print_graph.c (print_state): Now errors are in red, and
17430 reductions in green.
17431 Prefer high to wide: output the state number on a line of its own.
17432
80dac38c
AD
174332001-12-27 Akim Demaille <akim@epita.fr>
17434
17435 * src/state.h, src/state.c (reductions_new): New.
17436 * src/LR0.c (set_state_table): Let all the states have a
17437 `reductions', even if reduced to 0.
17438 (save_reductions): Adjust.
17439 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17440 * src/print.c (print_reductions, print_actions): Adjust.
17441 * src/output.c (action_row): Adjust.
17442
2cec70b9
AD
174432001-12-27 Akim Demaille <akim@epita.fr>
17444
17445 * src/state.h, src/state.c (errs_new, errs_dup): New.
17446 * src/LR0.c (set_state_table): Let all the states have an errs,
17447 even if reduced to 0.
17448 * src/print.c (print_errs, print_reductions): Adjust.
17449 * src/output.c (output_actions, action_row): Adjust.
17450 * src/conflicts.c (resolve_sr_conflict): Adjust.
17451
13ca549a
AD
174522001-12-27 Akim Demaille <akim@epita.fr>
17453
17454 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17455
5092aba5
AD
174562001-12-27 Akim Demaille <akim@epita.fr>
17457
17458 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17459 * src/print.c: here.
17460 (lookaheadset, shiftset): New, used as additional storage by
17461 print_reductions.
17462 (print_results): Adjust.
17463 (print_shifts, print_gotos, print_errs): New, extracted from...
17464 (print_actions): here.
17465 * src/print_graph.c (print_actions): Remove dead code.
17466
11e2beca
AD
174672001-12-27 Akim Demaille <akim@epita.fr>
17468
17469 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17470 `$n' and `@n'.
17471
dac3c910
AD
174722001-12-27 Akim Demaille <akim@epita.fr>
17473
17474 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17475 (build_relations): Adjust.
17476
d0b0fefa
AD
174772001-12-27 Akim Demaille <akim@epita.fr>
17478
17479 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17480 duplication.
17481
adc8c848
AD
174822001-12-27 Akim Demaille <akim@epita.fr>
17483
17484 * src/reader.c (packgram): Catch nitems overflows.
17485
14d293ac
AD
174862001-12-27 Akim Demaille <akim@epita.fr>
17487
17488 * src/files.c, src/files.h (guard_obstack): Remove.
17489 * src/output.c (output): Adjust.
17490 * src/reader.c (parse_braces): New, factoring...
17491 (copy_action, copy_guard): these two which are renamed as...
17492 (parse_action, parse_guard): these.
17493 As a voluntary consequence, using braces around guards is now
17494 mandatory.
17495
f499b062
AD
174962001-12-27 Akim Demaille <akim@epita.fr>
17497
17498 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17499 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17500 members.
17501 (symbol_list_new): Adjust.
17502 (copy_action): action_line is the first line, not the last.
17503 (copy_guard): Just as for actions, store the `action' only, not
17504 the switch/case/break flesh.
17505 Don't parse the user action that might follow the guard, let...
17506 (readgram): do it, i.e., now, there can be an action after a
17507 guard.
17508 In other words the guard is just explicitly optional.
17509 (packgram): Adjust.
17510 * src/output.c (guards_output): New.
17511 (output_parser): Call it when needed.
17512 (output): Also free the guard and attrs obstacks.
17513 * src/files.c, src/files.h (obstack_save): Remove.
17514 (output_files): Remove.
17515 As a result, if one needs the former `.act' file, using an
17516 appropriate skeleton which requires actions and guards is now
17517 required.
17518 * src/main.c (main): Adjust.
17519 * tests/semantic.at: New.
17520 * tests/regression.at: Use `input.y' as input file name.
17521 Avoid 8+3 problems by requiring input.c when the test needs the
17522 parser.
17523
d945f5cd
AD
175242001-12-27 Akim Demaille <akim@epita.fr>
17525
17526 * src/reader.c (symbol_list_new): Be sure to initialize all the
17527 fields.
17528
d200e455
AD
175292001-12-27 Akim Demaille <akim@epita.fr>
17530
17531 All the hacks using a final pseudo state are now useless.
17532
17533 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17534 * src/lalr.c (nLA): New.
17535 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17536 instead of lookaheadsp from the pseudo state (nstate + 1).
17537
f9507c28
AD
175382001-12-27 Akim Demaille <akim@epita.fr>
17539
17540 * src/output.c (action_row, token_actions): Use a state_t instead
17541 of a integer, and nlookaheads instead of the following state's
17542 lookaheadsp.
17543
065fbd27
AD
175442001-12-27 Akim Demaille <akim@epita.fr>
17545
17546 * src/conflicts.c (log_resolution, flush_shift)
17547 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17548 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17549 (conflicts_print, print_reductions): Use a state_t instead of an
17550 integer when referring to a state.
17551 As much as possible, depend upon nlookaheads, instead of the
17552 `lookaheadsp' member of the following state (since lookaheads of
17553 successive states are successive, the difference between state n + 1
17554 and n served as the number of lookaheads for state n).
17555 * src/lalr.c (add_lookback_edge): Likewise.
17556 * src/print.c (print_core, print_actions, print_state)
17557 (print_results): Likewise.
17558 * src/print_graph.c (print_core, print_actions, print_state)
17559 (print_graph): Likewise.
17560 * src/conflicts.h: Adjust.
17561
1b177bd7
AD
175622001-12-27 Akim Demaille <akim@epita.fr>
17563
17564 * src/bison.hairy: Formatting/comment changes.
17565 ANSIfy.
17566 Remove `register' indications.
17567 Add plenty of `static'.
17568
7742ddeb
AD
175692001-12-27 Akim Demaille <akim@epita.fr>
17570
17571 * src/output.c (prepare): Drop the muscle `ntbase' which
17572 duplicates ntokens.
17573 * src/bison.simple: Formatting/comment changes.
17574 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17575 is an undocumented synonym.
17576
1fa14068
AD
175772001-12-22 Akim Demaille <akim@epita.fr>
17578
17579 * src/output.c (output_table_data): Change the prototype to use
17580 `int' for array ranges: some invocations do pass an int, not a
17581 short.
17582 Reported by Wayne Green.
17583
b9752825
AD
175842001-12-22 Akim Demaille <akim@epita.fr>
17585
17586 Some actions of web2c.y are improperly triggered.
17587 Reported by Mike Castle.
17588
17589 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17590 * tests/regression.at (Web2c): Rename as...
17591 (Web2c Report): this.
17592 (Web2c Actions): New.
17593
776209d6
AD
175942001-12-22 Akim Demaille <akim@epita.fr>
17595
17596 Reductions in web2c.y are improperly reported.
17597 Reported by Mike Castle.
17598
17599 * src/conflicts.c (print_reductions): Fix.
17600 * tests/regression.at (Web2c): New.
17601
275fc3ad
AD
176022001-12-18 Akim Demaille <akim@epita.fr>
17603
17604 Some host fail on `assert (!"foo")', which expands to
17605 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17606 Reported by Nelson Beebee.
17607
17608 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17609 `#define it_succeeded 0' and `assert (it_succeeded)'.
17610
897668ee
MA
176112001-12-17 Marc Autret <autret_m@epita.fr>
17612
17613 * src/bison.simple: Don't hard code the skeleton line and filename.
17614 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17615 New line counter 'skeleton_line' (skeleton-line muscle).
17616
ab3399e0
PE
176172001-12-17 Paul Eggert <eggert@twinsun.com>
17618
17619 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17620 YYDEBUG must be defined to a nonzero value.
17621
17622 * src/bison.simple (yytname): Do not assume that the user defines
17623 YYDEBUG to a properly parenthesized expression.
17624
3877f72b
AD
176252001-12-17 Akim Demaille <akim@epita.fr>
17626
17627 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17628 nlookaheads is a new member.
17629 Adjust all users.
17630 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17631 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17632 state.
776209d6 17633
331dbc1b
AD
176342001-12-17 Akim Demaille <akim@epita.fr>
17635
17636 * src/files.h, src/files.c (open_files, close_files): Remove.
17637 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17638 let...
17639 * src/reader.c (reader): Do it.
776209d6 17640
be750e4c
AD
176412001-12-17 Akim Demaille <akim@epita.fr>
17642
17643 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 17644
709ae8c6
AD
176452001-12-17 Akim Demaille <akim@epita.fr>
17646
17647 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17648 (flush_reduce): New.
17649 (resolve_sr_conflict): Adjust.
776209d6 17650
f87685c3
AD
176512001-12-17 Akim Demaille <akim@epita.fr>
17652
17653 * src/output.c (output_obstack): Be static and rename as...
17654 (format_obstack): this, to avoid any confusion with files.c's
17655 output_obstack.
17656 * src/reader.h (muscle_obstack): Move to...
17657 * src/output.h: here, since it's defined in output.c.
17658
837491d8
AD
176592001-12-17 Akim Demaille <akim@epita.fr>
17660
17661 * src/output.c (action_row, save_column, default_goto)
17662 (sort_actions, matching_state, pack_vector): Better variable
17663 locality.
17664
796d61fb
AD
176652001-12-17 Akim Demaille <akim@epita.fr>
17666
17667 * src/output.c: Various formatting changes.
776209d6 17668
64d15509
AD
176692001-12-17 Akim Demaille <akim@epita.fr>
17670
17671 * src/files.c (output_files): Free the output_obstack.
17672 * src/main.c (main): Call print and print_graph conditionally.
17673 * src/print.c (print): Work unconditionally.
17674 * src/print_graph.c (print_graph): Work unconditionally.
17675 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17676
fbc8ecb7
MA
176772001-12-16 Marc Autret <autret_m@epita.fr>
17678
17679 * src/output.c (actions_output): Fix. When we use %no-lines,
17680 there is one less line per action.
17681
f0440388
MA
176822001-12-16 Marc Autret <autret_m@epita.fr>
17683
17684 * src/bison.simple: Remove a useless #line directive.
17685 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17686 * src/output.c (get_lines_number): New.
776209d6 17687 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
17688 output muscles.
17689 Fix line numbering.
17690 (actions_output): Computes the number of lines taken by actions.
17691 (output_master_parser): Insert new skeleton which is the name of
17692 the output parser file name.
17693
a79986b8
MA
176942001-12-15 Marc Autret <autret_m@epita.fr>
17695
17696 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17697
4ec8e00f
MA
176982001-12-15 Marc Autret <autret_m@epita.fr>
17699
17700 * src/output.c (output_gram): Keep track of the hairy one.
17701
1a4648ff
AD
177022001-12-15 Akim Demaille <akim@epita.fr>
17703
17704 Make `make distcheck' work.
17705
17706 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17707 system.h which uses libgettext.h.
17708
9c2c67e6
AD
177092001-12-15 Akim Demaille <akim@epita.fr>
17710
17711 * src/nullable.c (set_nullable): Useless rules must be skipped,
17712 otherwise, since we range over their symbols, we might look at a
17713 nonterminal which no longer ``exists'', i.e., it is not counted in
17714 `nvars', hence we overflow our arrays.
17715
93ede233
AD
177162001-12-15 Akim Demaille <akim@epita.fr>
17717
17718 The header can also be produced directly, without any obstack!
17719 Yahoo!
17720
17721 * src/files.c, src/files.h (defines_obstack): Remove.
17722 (compute_header_macro): Global.
17723 (defines_obstack_save): Remove.
17724 * src/reader.c (parse_union_decl): No longer output to
17725 defines_obstack: its content can be found in the `stype' muscle
17726 anyway.
17727 (output_token_translations): Merge into...
17728 (symbols_output): this.
17729 Rename as...
17730 (symbols_save): this.
17731 (reader): Adjust.
17732 * src/output.c (header_output): New.
17733 (output): Call it.
17734
2666f928
AD
177352001-12-15 Akim Demaille <akim@epita.fr>
17736
17737 * src/reader.c (parse_union_decl): Instead of handling two obstack
17738 simultaneously, use one to define the `stype' muscle, and use the
17739 value of the latter to fill defines_obstack.
17740 (copy_comment): Remove.
17741 (copy_comment2): Work for a single obstack.
17742 Rename as...
17743 (copy_comment): this.
17744
428046f8
AD
177452001-12-15 Akim Demaille <akim@epita.fr>
17746
17747 * src/lex.c, src/lex.h (xgetc): No longer static.
17748 * src/reader.c (parse_union_decl): Revamp.
17749
ea52d706
AD
177502001-12-15 Akim Demaille <akim@epita.fr>
17751
17752 Still making progress in separating Bison into (i) input, (ii)
17753 process, (iii) output: now we can directly output the parser file
17754 without using table_obstack at all.
17755
17756 * src/files.c, src/files.h (table_obstack): Bye bye.
17757 (parser_file_name): New.
17758 * src/files.c (compute_output_file_names): Compute it.
17759 * src/output.c (actions_output, output_parser)
17760 (output_master_parser): To a file instead of an obstack.
17761
3f96f4dc
AD
177622001-12-15 Akim Demaille <akim@epita.fr>
17763
17764 Attach actions to rules, instead of pre-outputting them to
17765 actions_obstack.
17766
17767 * src/gram.h (rule_t): action and action_line are new members.
17768 * src/reader.c (symbol_list): Likewise.
17769 (copy_action): Save the actions within the rule.
17770 (packgram): Save them in rule_table.
17771 * src/output.c (actions_output): New.
17772 (output_parser): Use it on `%%actions'.
17773 (output_rule_data): Don't free rule_table.
17774 (output): Do it.
17775 (prepare): Don't save the `action' muscle.
17776 * src/bison.simple: s/%%action/%%actions/.
17777
51576fb3
AD
177782001-12-15 Akim Demaille <akim@epita.fr>
17779
17780 * src/reader.c (copy_action): When --yacc, don't append a `;'
17781 to the user action: let it fail if lacking.
dee049eb 17782 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 17783
2648a72d
AD
177842001-12-14 Akim Demaille <akim@epita.fr>
17785
17786 * src/lex.c (literalchar): Simply return the char you decoded, non
17787 longer mess around with obstacks and int pointers.
17788 Adjust all callers.
17789
92790e5b
AD
177902001-12-14 Akim Demaille <akim@epita.fr>
17791
17792 * src/lex.c (literalchar): Don't escape the special characters,
17793 just decode them, and keep them as char (before, eol was output as
17794 the 2 char string `\n' etc.).
17795 * src/output.c (output_rule_data): Use quotearg to output the
17796 token strings.
17797
927c1557
PE
177982001-12-13 Paul Eggert <eggert@twinsun.com>
17799
17800 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17801 Do not infringe on the global user namespace when using C++.
17802 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17803 All uses of `fprintf' and `stderr' changed.
17804
17805 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17806
ed8e1f68
AD
178072001-12-13 Akim Demaille <akim@epita.fr>
17808
17809 The computation of nullable is broken: it doesn't handle empty
17810 RHS's properly.
17811
17812 * tests/torture.at (GNU AWK Grammar): New.
17813 * tests/sets.at (Nullable): New.
17814 * src/nullable.c (set_nullable): Instead of blindly looping over
17815 `ritems', loop over the rules, and then over their rhs's.
17816
17817 Work around Autotest bugs.
17818
17819 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17820 frame, because Autotest understand lines starting with a `+' as
17821 traces from the shell. Then, they are not processed properly.
17822 Admittedly an Autotest bug, but we don't have time to wait for
17823 Autotest to catch up.
17824 * tests/regression.at (Broken Closure): Adjust to the new table
17825 frames.
17826 Move to...
17827 * tests/sets.at: here.
17828
cb581495
AD
178292001-12-13 Akim Demaille <akim@epita.fr>
17830
17831 * src/closure.c (closure): Use nrules instead of playing tricks
17832 with BITS_PER_WORD.
17833
2e729273
AD
178342001-12-13 Akim Demaille <akim@epita.fr>
17835
17836 * src/print.c (print_actions): Output the handling of `$' as the
17837 traces do: shifting the token EOF. Before EOF was treated as a
17838 nonterminal.
17839 * tests/regression.at: Adjust some tests.
17840 * src/print_graph.c (print_core): Complete the set of items via
17841 closure. The next-to-final and final states are still unsatisfying,
17842 but that's to be addressed elsewhere.
17843 No longer output the rule numbers, but do output the state number.
17844 A single loop for the shifts + gotos is enough, but picked a
17845 distinct color for each.
17846 (print_graph): Initialize and finalize closure.
17847
107f7dfb
AD
178482001-12-13 Akim Demaille <akim@epita.fr>
17849
17850 * src/reader.c (readgram): Remove dead code, an strip useless
17851 braces.
17852 (get_type): Remove, unused.
17853
9b53a24f
AD
178542001-12-12 Akim Demaille <akim@epita.fr>
17855
17856 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17857 on that of lib/error.c.
17858
dbfb6dcd
AD
178592001-12-12 Akim Demaille <akim@epita.fr>
17860
17861 Some hosts don't like `/' in includes.
17862
17863 * src/system.h: Include libgettext.h without qualifying the path.
17864 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17865 $(top_srcdir).
17866
c25fb648
MA
178672001-12-11 Marc Autret <autret_m@epita.fr>
17868
17869 * src/output.c (output_parser): Remove useless muscle.
17870
710ddc4f
MA
178712001-12-11 Marc Autret <autret_m@epita.fr>
17872
17873 * src/bison.simple: Remove #line just before %%epilogue. It
17874 is now handled in ...
17875 * src/reader.c (read_additionnal_code): Add the output of a
17876 #line for the epilogue.
17877
e83d80b8
MA
178782001-12-10 Marc Autret <autret_m@epita.fr>
17879
927c1557 17880 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
17881 replace precedent remove.
17882 * src/bison.simple: Remove #line before %%prologue because
17883 %%input-line is wrong at this time.
17884
971d5158
MA
178852001-12-10 Marc Autret <autret_m@epita.fr>
17886
17887 * src/reader.c (symbols_output): Clean up.
927c1557 17888 * src/output.c (output_gram, output): Clean up.
971d5158 17889
5edafffd
AD
178902001-12-10 Akim Demaille <akim@epita.fr>
17891
17892 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17893 * src/LR0.c (set_state_table): here.
17894 * src/lalr.c (lalr): Call it.
17895
0279f8e9
AD
178962001-12-10 Akim Demaille <akim@epita.fr>
17897
17898 * src/state.h (shifts): Remove the `number' member: shifts are
17899 attached to state, hence no longer need to be labelled with a
17900 state number.
17901
190c4f5f
AD
179022001-12-10 Akim Demaille <akim@epita.fr>
17903
17904 Now that states have a complete set of members, the linked list of
17905 shifts is useless: just fill directly the state's shifts member.
17906
17907 * src/state.h (shifts): Remove the `next' member.
17908 * src/LR0.c (first_state, last_state): Remove.
17909 Adjust the callers.
17910 (augment_automaton): Don't look for the shifts that must be added
17911 a shift on EOF: it is those of the state we looked for! But now,
17912 since shifts are attached, it is no longer needed to looking
17913 merely by its id: its number.
17914
2a73b93d
AD
179152001-12-10 Akim Demaille <akim@epita.fr>
17916
17917 * src/LR0.c (augment_automaton): Better variable locality.
17918 Remove an impossible branch: if there is a state corresponding to
17919 the start symbol being shifted, then there is shift for the start
17920 symbol from the initial state.
17921
74392f6a
AD
179222001-12-10 Akim Demaille <akim@epita.fr>
17923
17924 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17925 only when appropriate: when insert_start_shifting_state' is not
17926 invoked.
17927 * tests/regression.at (Rule Line Numbers): Adjust.
17928
37c82725
AD
179292001-12-10 Akim Demaille <akim@epita.fr>
17930
17931 * src/LR0.c (augment_automaton): Now that all states have shifts,
17932 merge the two cases addition shifts to the initial state.
17933
6a164e0c
AD
179342001-12-10 Akim Demaille <akim@epita.fr>
17935
17936 * src/lalr.c (set_state_table): Move to...
17937 * src/LR0.c: here.
17938 * src/lalr.c (lalr): Don't call it...
17939 * src/LR0.c (generate_states): do it.
17940 * src/LR0.h (first_state): Remove, only the table is used.
17941
7215de24
AD
179422001-12-10 Akim Demaille <akim@epita.fr>
17943
17944 * src/LR0.h (first_shift, first_reduction): Remove.
17945 * src/lalr.c: Don't use first_shift: find shifts through the
17946 states.
17947
80e25d4d
AD
179482001-12-10 Akim Demaille <akim@epita.fr>
17949
17950 * src/LR0.c: Attach shifts to states as soon as they are
17951 computed.
17952 * src/lalr.c (set_state_table): Instead of assigning shifts to
17953 state, just assert that the mapping was properly done.
17954
0ab3728b
AD
179552001-12-10 Akim Demaille <akim@epita.fr>
17956
17957 * src/LR0.c (insert_start_shift): Rename as...
17958 (insert_start_shifting_state): this.
17959 (insert_eof_shifting_state, insert_accepting_state): New.
17960 (augment_automaton): Adjust.
17961 Better locality of the variables.
17962 When looking if the start_symbol is shifted from the initial
17963 state, using `while (... symbol != start_symbol ...)' sounds
17964 better than `while (... symbol < start_symbol ...)': If fail
17965 to see how the order between symbols could be relevant!
17966
78af9bbc
AD
179672001-12-10 Akim Demaille <akim@epita.fr>
17968
17969 * src/getargs.h: Don't declare `spec_name_prefix' and
17970 `spec_file_prefix', declared by src/files.h.
17971 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17972 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17973 * src/output.c (prepare): Adjust.
17974 * src/reader.c (symbols_output): Likewise.
17975 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17976
bdef2a41
AD
179772001-12-10 Akim Demaille <akim@epita.fr>
17978
17979 * src/muscle_tab.c (muscle_init): NULL is a better default than
17980 `"0"'.
17981
3735969c
AD
179822001-12-10 Akim Demaille <akim@epita.fr>
17983
17984 * src/reader.c (reader): Calling symbols_output once is enough.
17985
49701457
AD
179862001-12-10 Akim Demaille <akim@epita.fr>
17987
17988 Now that states have a complete set of members, the linked list of
17989 reductions is useless: just fill directly the state's reductions
17990 member.
17991
17992 * src/state.h (struct reductions): Remove member `number' and
17993 `next'.
17994 * src/LR0.c (first_reduction, last_reduction): Remove.
17995 (save_reductions): Don't link the new reductions, store them in
17996 this_state.
17997 * src/lalr.c (set_state_table): No need to attach reductions to
17998 states, it's already done.
17999 * src/output.c (output_actions): No longer free the shifts, then
18000 the reductions, then the states: free all the states and their
18001 members.
18002
0edad749
AD
180032001-12-10 Akim Demaille <akim@epita.fr>
18004
18005 * src/options.c (OPTN, DRTV, BOTH): New.
18006 (option_table): Use them.
18007
0edad749
AD
18008 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18009 the job of system.h.
18010 * src/options.c: Don't include stdio.h and xalloc.h for the same
18011 reasons.
18012
5449dd0f
AD
180132001-12-10 Akim Demaille <akim@epita.fr>
18014
18015 * src/output.c (output, prepare): Make sure the values of the
18016 muscles `action' and `prologue' are 0-terminated.
18017
a870c567
AD
180182001-12-10 Akim Demaille <akim@epita.fr>
18019
18020 Clean up GCC warnings.
18021
18022 * src/reader.c (copy_action): `buf' is not used.
18023 (parse_skel_decl): Be static.
18024 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18025 * src/options.h (create_long_option_table): Have a real prototype.
18026 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18027 (hash_delete_at): Return const void *.
18028 Adjust casts to preserve the const.
18029
80df8768
AD
180302001-12-10 Akim Demaille <akim@epita.fr>
18031
18032 * configure.in: Require 2.52g.
18033 M4 is not needed, but AUTOM4TE is.
18034 * m4/m4.m4: Remove.
18035 * tests/Makefile.am: Adjust.
18036
f693ad14
AD
180372001-12-10 Akim Demaille <akim@epita.fr>
18038
18039 One structure for states is enough, even though theoretically
18040 there are LR(0) states and LALR(1) states.
18041
18042 * src/lalr.h (state_t): Remove.
18043 (state_table): Be state_t **, not state_t *.
18044 * src/state.h (core, CORE_ALLOC): Rename as...
18045 (state_t, STATE_ALLOC): this.
18046 Add the LALR(1) members: shifts, reductions, errs.
18047 * src/LR0.c (state_table): Rename as...
18048 (state_hash): this, to avoid name clashes with the global
18049 `state_table'.
18050 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18051 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18052
74ffbcb6
AD
180532001-12-10 Akim Demaille <akim@epita.fr>
18054
18055 Bison dumps core on bash.y.
18056 Reported by Pascal Bart.
18057
18058 * src/warshall.c (bitmatrix_print): New.
18059 (TC): Use it.
ba0fe3c7 18060 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
18061 j must be the outer loop.
18062 * tests/regression.at (Broken Closure): New.
18063
07708e19
AD
180642001-12-05 Akim Demaille <akim@epita.fr>
18065
18066 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18067 its argument.
ba1ecc07 18068 Reported by Peter Hamorsky.
07708e19 18069
92b16366
AD
180702001-12-05 Akim Demaille <akim@epita.fr>
18071
18072 * src/conflicts.c (err_table): Remove.
18073 (resolve_sr_conflict): Adjust.
18074 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18075 Rename as...
18076 (state_t.reductions, state_t.shifts): this.
18077
076ab033
AD
180782001-12-05 Akim Demaille <akim@epita.fr>
18079
18080 * src/reduce.c (reduce_grammar_tables): No longer disable the
18081 removal of useless rules via CPP but via `if (0)', so that the
18082 compiler still check the code is valid.
18083 For instance, it should have noticed `rline' no longer exists: use
18084 the `line' member of rule_t.
18085 * src/gram.c (dummy, rline): Remove, unused.
18086
3843c413
AD
180872001-12-05 Akim Demaille <akim@epita.fr>
18088
18089 * src/output.c (pack_vector): Use assert, not berror.
18090 * src/main.c (berror): Remove, unused.
18091
43168960
AD
180922001-12-05 Akim Demaille <akim@epita.fr>
18093
18094 New experimental feature: if --verbose --trace output all the
18095 items of a state, not only its kernel.
18096
18097 * src/print.c (print_core): If `trace_flag', then invoke closure
18098 before outputting the items of the state (print_core is no longer
18099 a correct name them).
18100 (print_results): Invoke new_closure/free_closure if needed.
18101
b2872512
AD
181022001-12-05 Akim Demaille <akim@epita.fr>
18103
18104 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18105 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18106 (nitemset): for consistency with the rest of the project.
18107
23cbcc6c
AD
181082001-12-05 Akim Demaille <akim@epita.fr>
18109
18110 * src/closure.c (print_closure): Improve.
18111 (closure): Use it for printing input and output.
18112
03ec521c
AD
181132001-12-05 Akim Demaille <akim@epita.fr>
18114
18115 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18116 indexed by nonterminals.
18117
3a7456dd
AD
181182001-12-05 Akim Demaille <akim@epita.fr>
18119
18120 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18121 what it was!).
18122 * src/warshall.h: Remove accidental duplication of the content.
18123
1cbcf2e7
AD
181242001-12-05 Akim Demaille <akim@epita.fr>
18125
18126 * src/closure.c (set_fderives): De-obfuscate.
18127
84182270
AD
181282001-12-05 Akim Demaille <akim@epita.fr>
18129
18130 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18131
3f6f053c
AD
181322001-12-05 Akim Demaille <akim@epita.fr>
18133
18134 * src/closure.c (set_firsts): De-obfuscate.
18135
7a5350ba
AD
181362001-12-05 Akim Demaille <akim@epita.fr>
18137
18138 * src/output.c (action_row): De-obfuscate
18139 using the good o' techniques: arrays not pointers, variable
18140 locality, BITISSET, RESETBIT etc.
18141
d954473d
AD
181422001-12-05 Akim Demaille <akim@epita.fr>
18143
18144 Pessimize the code to simplify it: from now on, all the states
18145 have a valid SHIFTS, which NSHIFTS is possibly 0.
18146
18147 * src/LR0.c (shifts_new): Be global and move to..
18148 * src/state.c, src/state.h: here.
18149 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18150 * src/print_graph: Adjust.
18151
9839bbe5
AD
181522001-12-05 Akim Demaille <akim@epita.fr>
18153
18154 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18155 * src/conflicts.c: Use it.
18156 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18157 incorrectly ``simplified''.
18158
9f136c07
AD
181592001-12-05 Akim Demaille <akim@epita.fr>
18160
18161 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18162 using the good o' techniques: arrays not pointers, variable
18163 locality, BITISSET, RESETBIT etc.
18164
b608206e
AD
181652001-12-05 Akim Demaille <akim@epita.fr>
18166
18167 * src/state.h (SHIFT_SYMBOL): New.
18168 * src/conflicts.c: Use it to deobfuscate.
18169
52afa962
AD
181702001-12-05 Akim Demaille <akim@epita.fr>
18171
18172 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18173 (print_reductions): De-obfuscate using the good o' techniques:
18174 arrays not pointers, variable locality, BITISSET.
18175
e74dc321
AD
181762001-12-05 Akim Demaille <akim@epita.fr>
18177
18178 * src/conflicts.c (print_reductions): Arrays, not pointers.
18179 Use BITISSET.
18180
768fca83
AD
181812001-12-05 Akim Demaille <akim@epita.fr>
18182
18183 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18184
a17e599f
AD
181852001-12-05 Akim Demaille <akim@epita.fr>
18186
18187 * src/conflicts.c (print_reductions): Improve variable locality.
18188
a04bc341
AD
181892001-12-05 Akim Demaille <akim@epita.fr>
18190
18191 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18192
c8ea038e
AD
181932001-12-05 Akim Demaille <akim@epita.fr>
18194
18195 * src/conflicts.c (print_reductions): Improve variable locality.
18196
aa2aab3c
AD
181972001-12-05 Akim Demaille <akim@epita.fr>
18198
18199 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18200 * src/lalr.c: Use them.
18201
b178c8cc
AD
182022001-12-05 Akim Demaille <akim@epita.fr>
18203
18204 * src/LR0.c (augment_automaton): Formatting changes.
18205 Better variable locality.
18206
f67d13aa
AD
182072001-12-05 Akim Demaille <akim@epita.fr>
18208
18209 * src/lalr.c (matrix_print): New.
18210 (transpose): Use it.
18211 Use arrays instead of pointers.
18212
c2713865
AD
182132001-12-05 Akim Demaille <akim@epita.fr>
18214
18215 * src/lalr.c (maxrhs): Move to...
18216 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18217 * src/lalr.c (build_relations): Adjust.
18218
9887c18a
AD
182192001-12-05 Akim Demaille <akim@epita.fr>
18220
18221 * src/lalr.c (transpose): Free the memory allocated to the
18222 argument, as it is replaced by the results by the unique caller.
18223 (build_relations): Merely invoke transpose: it handles the memory
18224 deallocation.
18225 Improve variable locality.
18226 Avoid variables used as mere abbreviations.
18227 (compute_lookaheads): Use arrays instead of pointers.
18228
4d4f699c
AD
182292001-12-05 Akim Demaille <akim@epita.fr>
18230
18231 * src/lalr.c (initialize_F): Improve variable locality.
18232 Avoid variables used as mere abbreviations.
18233
80a69750
AD
182342001-12-05 Akim Demaille <akim@epita.fr>
18235
18236 * src/derives.c (print_derives): Display the ruleno.
18237 * src/lalr.c (initialize_F, transpose): Better variable locality
18238 to improve readability.
18239 Avoid variables used as mere abbreviations.
18240
fe961097
AD
182412001-12-05 Akim Demaille <akim@epita.fr>
18242
18243 * src/lalr.c (traverse): Use arrays instead of pointers.
18244
e3e4e814
AD
182452001-12-05 Akim Demaille <akim@epita.fr>
18246
18247 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18248 the handling of squeue.
18249 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18250
630e182b
AD
182512001-12-05 Akim Demaille <akim@epita.fr>
18252
18253 Because useless nonterminals are now kept alive (instead of being
18254 `destroyed'), we now sometimes examine them, and store information
18255 related to them. Hence we need to know their number, and adjust
18256 memory allocations.
18257
18258 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18259 static.
18260 * src/LR0.c (allocate_itemsets): The memory allocated to
18261 `symbol_count' was used for two different purpose: once to count
18262 the number of occurrences of each symbol, and later reassigned to
18263 `shift_symbol', containing the symbol that can be shifted from a
18264 given state.
18265 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18266 only, and...
18267 (new_itemsets): Allocate `shift_symbol' here.
18268 (allocate_itemsets): symbol_count includes useless nonterminals.
18269 Make room for them.
18270 (free_storage): Use `free', not `XFREE', for pointers that cannot
18271 be null.
18272
81b51460
AD
182732001-12-05 Akim Demaille <akim@epita.fr>
18274
18275 * src/nullable.c (set_nullable): Deobfuscate the handling of
18276 ritem.
18277 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18278
3067fbef
AD
182792001-12-05 Akim Demaille <akim@epita.fr>
18280
18281 * src/gram.c, src/gram.h (ritem_print): New.
18282 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18283 (This useless function was defined only to work around VMS linkers
18284 that can't handle compilation units with variables only).
18285 * src/reduce.c (dump_grammar): Use it to trace the construction of
18286 ritem.
18287
c2bea5f9
PE
182882001-12-04 Paul Eggert <eggert@twinsun.com>
18289
7d27c823
PE
18290 * src/bison.simple (union yyalloc): Change member names
18291 to be the same as the stack names.
18292 (yyparse): yyptr is now union yyalloc *, not char *.
18293 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18294 and may generate better code on some machines.
c2bea5f9
PE
18295 (yystpcpy): Use prototype if __STDC__ is defined, not just
18296 if __cplusplus is defined.
35687a9d 18297
2c8a9dfa
AD
182982001-11-30 Akim Demaille <akim@epita.fr>
18299
18300 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18301 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18302 Gettext doesn't compile cleanly, and dies with -Werror.
18303 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18304 Include WARNING_CFLAGS here.
18305 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18306 before being defined.
18307
f4e421e6
AD
183082001-11-27 Paul Eggert <eggert@twinsun.com>
18309
18310 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18311 First arg is int, not unsigned.
18312 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18313 (SIZE_MAX, UINT_MAX): New macros.
18314 (quotearg_n_options): Abort if N is negative.
18315 Avoid overflow check on hosts where size_t is 64 bits and int
18316 is 32 bits, as overflow is impossible there.
18317 Fix off-by-one typo that caused unnecessary reallocation.
18318
7093d0f5
AD
183192001-11-29 Paul Eggert <eggert@twinsun.com>
18320
18321 Name space cleanup in generated parser.
18322
18323 * doc/bison.texinfo (Bison Parser): Discuss system headers
18324 and their effect on the user name space.
18325
18326 * src/bison.simple:
18327 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18328 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18329 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18330
18331 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18332 on user names when possible.
18333
18334 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18335 Simplify test for whather <alloca.h> exists.
18336
18337 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18338
18339 (<stdio.h>): Include if YYDEBUG.
18340
18341 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18342 ! defined (yyoverflow) && ! defined (yymemcpy).
18343
18344 (yymemcpy, yyparse): Rename local variables as needed so that
18345 they all begin with 'yy'.
18346
18347 (yystrlen, yystpcpy): New functions.
18348
18349 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18350 All uses changed.
18351
18352 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18353 instead of relying on string.h functions. Use YYSTACK_ALLOC
18354 and YYSTACK_FREE instead of malloc and free.
18355
fd51e5ff
AD
183562001-11-30 Akim Demaille <akim@epita.fr>
18357
18358 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18359 before their first uses.
18360 (YYBISON, YYPURE): Move to the top of the output.
18361
7d13ff5f
AD
183622001-11-30 Akim Demaille <akim@epita.fr>
18363
18364 * tests/reduce.at (Useless Nonterminals): Fix.
18365
892a3995
AD
183662001-11-30 Akim Demaille <akim@epita.fr>
18367
18368 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18369 if body instead of `;' to pacify GCC's warnings.
18370
68f1e3ed
AD
183712001-11-30 Akim Demaille <akim@epita.fr>
18372
18373 Instead of mapping the LHS of unused rules to -1, keep the LHS
18374 valid, but flag the rules as invalid.
18375
18376 * src/gram.h (rule_t): `useful' is a new member.
18377 * src/print.c (print_grammar): Adjust.
18378 * src/derives.c (set_derives): Likewise.
18379 * src/reader.c (packgram, reduce_output): Likewise.
18380 * src/reduce.c (reduce_grammar_tables): Likewise.
18381 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18382
d2d1b42b
AD
183832001-11-30 Akim Demaille <akim@epita.fr>
18384
18385 * src/reduce.c (reduce_output): Formatting changes.
18386 * src/print.c (print_results, print_grammar): Likewise.
18387 * tests/regression.at (Rule Line Numbers)
18388 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18389
760b53a8
AD
183902001-11-30 Akim Demaille <akim@epita.fr>
18391
18392 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18393 useless nonterminals, move them at the end of the symbol arrays.
18394 (reduce_output): Adjust.
18395 * tests/reduce.at (Useless Nonterminals): Adjust.
18396
00238958
AD
183972001-11-30 Akim Demaille <akim@epita.fr>
18398
18399 * src/reduce.c: Various comment/formatting changes.
18400 (nonterminals_reduce): New, extracted from...
18401 (reduce_grammar_tables): here.
18402 (reduce_grammar): Call nonterminals_reduce.
18403
396452de
PE
184042001-11-29 Paul Eggert <eggert@twinsun.com>
18405
18406 * src/bison.simple (YYSTACK_REALLOC): Remove.
18407 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18408 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18409 New macros.
18410 (union yyalloc): New type.
18411 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18412 an arbitrary restriction on hosts where size_t is wider than int.
18413
18414 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18415 a parser stack overflow. Allocate just one block of memory for all
18416 three stacks, instead of allocating three blocks; this typically is
18417 faster and reduces fragmentation.
18418
18419 Do not limit the number of items in the stack to a value that fits
18420 in 'int', as this is an arbitrary limit on hosts with 64-bit
18421 size_t and 32-bit int.
18422
147e184c
MA
184232001-11-29 Marc Autret <autret_m@epita.fr>
18424
18425 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18426 of defining YYERROR_VERBOSE.
18427 [AT_DATA]: $4 is now out of C declarations in the prologue.
18428
426cf563
MA
184292001-11-28 Marc Autret <autret_m@epita.fr>
18430
18431 * src/reader.c (parse_dquoted_param): New.
18432 (parse_skel_decl): Use it.
18433 * src/lex.h: Add its prototype.
18434 * src/lex.c (literalchar): Become not static.
18435
c7925b99
MA
184362001-11-28 Marc Autret <autret_m@epita.fr>
18437
18438 * src/output.h: And put its extern declaration here.
18439 * src/output.c (error_verbose): Define here.
18440 (prepare): Echo name modification.
18441 * src/getargs.h: Clean its extern declaration.
18442 * src/getargs.c (error_verbose_flag): Remove.
18443 (getargs): Remove case 'e'.
18444 * src/options.c (option_table): 'error-verbose' is now seen as simple
18445 percent option.
18446 Include output.h.
18447
18448 * src/reader.c (read_declarations): Remove case tok_include.
18449 (parse_include_decl): Remove.
18450 * src/lex.h (token_t): Remove tok_include.
18451 * src/options.c (option_table): 'include' is now a simple command line
18452 option.
18453
5b5d1929
MA
184542001-11-28 Marc Autret <autret_m@epita.fr>
18455
18456 * src/bison.simple: Adjust muscle names.
18457 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18458 * src/output.c (prepare): s/_/-/ for the muscles names.
18459 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18460
8850be4b
MA
184612001-11-28 Marc Autret <autret_m@epita.fr>
18462
18463 * src/bison.simple: Fix debug.
18464 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18465
4a38e613
AD
184662001-11-28 Akim Demaille <akim@epita.fr>
18467
18468 * src/LR0.c (shifts_new): New.
18469 (save_shifts, insert_start_shift, augment_automaton): Use it.
18470
4b35e1c1
AD
184712001-11-28 Akim Demaille <akim@epita.fr>
18472
18473 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18474 keep ruleno only.
18475
d2b04478
AD
184762001-11-28 Akim Demaille <akim@epita.fr>
18477
18478 * src/closure.c (closure): Instead of looping over word in array
18479 then bits in words, loop over bits in array.
18480
2c4c30aa
AD
184812001-11-28 Akim Demaille <akim@epita.fr>
18482
18483 * src/closure.c (closure): No longer optimize the special case
18484 where all the bits of `ruleset[r]' are set to 0, to make the code
18485 clearer.
18486
576890b7
AD
184872001-11-28 Akim Demaille <akim@epita.fr>
18488
18489 * src/closure.c (closure): `r' and `c' are new variables, used to
18490 de-obfuscate accesses to RULESET and CORE.
18491
cb487d7d
AD
184922001-11-28 Akim Demaille <akim@epita.fr>
18493
18494 * src/reduce.c (reduce_print): Use ngettext.
18495 (dump_grammar): Improve the trace accuracy.
18496
6013d43f
AD
184972001-11-28 Akim Demaille <akim@epita.fr>
18498
18499 * src/reduce.c (dump_grammar): Don't translate trace messages.
18500
cb4956ee
AD
185012001-11-28 Akim Demaille <akim@epita.fr>
18502
18503 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18504 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18505 as all tags are free'ed afterwards.
18506 From Enrico Scholz.
18507
648185ab
PE
185082001-11-27 Paul Eggert <eggert@twinsun.com>
18509
18510 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18511 use alloca when we didn't want to, and vice versa.
18512
68254a03
MA
185132001-11-27 Marc Autret <autret_m@epita.fr>
18514
9113b58f
AD
18515 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18516 initialization.
68254a03
MA
18517 * src/output.c (prepare): Remove its update.
18518
04d843a2
MA
185192001-11-27 Marc Autret <autret_m@epita.fr>
18520
18521 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18522 Use %error-verbose.
18523
d2079671 185242001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
18525
18526 * src/bison.simple: Remove YYERROR_VERBOSE using.
18527 Use %%error_verbose.
18528 (yyparse): Likewise.
18529 * src/output.c (prepare): Give its final value.
18530 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18531 * src/getargs.h: Add its extern declaration.
18532 * src/getargs.c (error_verbose_flag): New int.
18533 (getargs): Update to catch new case.
18534 * src/options.c (option_table): 'error-verbose' is a new option.
18535 (shortopts): Update.
18536
e0327bc8
AD
185372001-11-27 Akim Demaille <akim@epita.fr>
18538
18539 * src/system.h: Use intl/libgettext.h.
18540 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18541
000f1a3c
AD
185422001-11-27 Akim Demaille <akim@epita.fr>
18543
18544 * tests/torture.at (Exploding the Stack Size with Malloc):
18545 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18546
26cfe0be
AD
185472001-11-27 Akim Demaille <akim@epita.fr>
18548
18549 * src/files.c: Include error.h.
18550 Reported by Hans Aberg.
18551
f6bd5427
MA
185522001-11-26 Marc Autret <autret_m@epita.fr>
18553
d2079671 18554 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
18555 (read_declarations): Add case tok_include.
18556 * src/getargs.h (include): Add its extern definition.
18557 * src/getargs.c (include): New const char *.
18558 (getargs): Add case '-I'.
18559 * src/options.c (option_table): Add include as command line and
18560 percent option.
18561 * src/lex.h (token_t): Add tok_include.
18562
2ca209c1
AD
185632001-11-26 Akim Demaille <akim@epita.fr>
18564
18565 * src/reader.c (readgram): Make sure rules for mid-rule actions
18566 have a lineno equal to that of their host rule.
18567 Reported by Hans Aberg.
18568 * tests/regression.at (Rule Line Numbers): New.
18569
0e41b407
AD
185702001-11-26 Akim Demaille <akim@epita.fr>
18571
18572 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18573 size_ts.
18574
185752001-11-26 Akim Demaille <akim@epita.fr>
18576
18577 * src/complain.c, src/complain.h (error): Remove, provided by
18578 lib/error.[ch].
18579
e0c40012
AD
185802001-11-26 Akim Demaille <akim@epita.fr>
18581
18582 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18583 issue an error message.
18584 * tests/regression.at (Invalid %directive): New.
18585 Reported by Hans Aberg.
18586
5e147124
AD
185872001-11-26 Akim Demaille <akim@epita.fr>
18588
18589 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18590 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18591
a034c8b8
AD
185922001-11-26 Akim Demaille <akim@epita.fr>
18593
18594 * src/conflicts.c (conflicts_print): Don't complain at all when
18595 there are no reduce/reduce conflicts, and as many shift/reduce
18596 conflicts as expected.
18597 * tests/regression.at (%expect right): Adjust.
18598
c64a20f3
AD
185992001-11-23 Akim Demaille <akim@epita.fr>
18600
18601 * lib/alloca.c: Update, from fileutils.
18602
5b0d29bb
AD
186032001-11-23 Akim Demaille <akim@epita.fr>
18604
18605 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18606
722c4bfe
AD
186072001-11-23 Akim Demaille <akim@epita.fr>
18608
18609 * src/system.h: Include alloca.h.
18610 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18611
6255b435
AD
186122001-11-23 Akim Demaille <akim@epita.fr>
18613
18614 * src/print_graph.c (print_actions): Remove `rule', unused.
18615 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18616 pacify GCC's signed < unsigned warnings.
18617 * src/closure.c (itemsetsize): Likewise.
18618 * src/reader.c (symbol_list_new): Static.
18619
b29b2ed5
AD
186202001-11-23 Akim Demaille <akim@epita.fr>
18621
18622 Attaching lineno to buckets is stupid, since only one copy of each
18623 symbol is kept, only the line of the first occurrence is kept too.
18624
18625 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18626 * src/reader.c (rline_allocated): Remove, unused.
18627 (symbol_list): Have a `line' member.
18628 (symbol_list_new): New.
18629 (readgram): Use it.
18630 * src/print.c (print_grammar): Output the rule line numbers.
18631 * tests/regression.at (Solved SR Conflicts)
18632 (Unresolved SR Conflicts): Adjust.
18633 Reported by Hans Aberg.
18634
a81b1d4a
MA
186352001-11-22 Marc Autret <autret_m@epita.fr>
18636
18637 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18638
c1ecb3c1
MA
186392001-11-22 Marc Autret <autret_m@epita.fr>
18640
18641 * src/muscle_tab.c (muscle_init): Remove initialization of
18642 skeleton muscle.
18643 * src/output.c (output_master_parser): Do it here.
18644
fbe01355
AD
186452001-11-20 Akim Demaille <akim@epita.fr>
18646
18647 * po/sv.po: New.
18648 * configure.in (ALL_LINGUAS): Adjust.
18649 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18650 longer contains strings to translate.
18651
81e895c0
AD
186522001-11-19 Akim Demaille <akim@epita.fr>
18653
18654 * src/conflicts.c (conflicts_print): Add a missing \n.
18655
6bb1878b
AD
186562001-11-19 Akim Demaille <akim@epita.fr>
18657
18658 * src/nullable.c (nullable_print): New.
18659 (set_nullable): Call it when tracing.
18660 Better locality of variables.
18661
d9ec2d07
AD
186622001-11-19 Akim Demaille <akim@epita.fr>
18663
18664 * src/print.c (print_actions): Better locality of variables.
18665
720e5c1b
AD
186662001-11-19 Akim Demaille <akim@epita.fr>
18667
18668 * src/derives.c (print_derives): Fix and enrich.
18669 * src/closure.c (print_fderives): Likewise.
18670
fb908786
AD
186712001-11-19 Akim Demaille <akim@epita.fr>
18672
18673 * src/closure.c (itemsetend): Remove, replaced with...
18674 (itemsetsize): new.
18675
125ecb56
AD
186762001-11-19 Akim Demaille <akim@epita.fr>
18677
18678 * src/LR0.c (kernel_end): Remove, replaced with...
18679 (kernel_size): new.
18680
d8cf039f
AD
186812001-11-19 Akim Demaille <akim@epita.fr>
18682
18683 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18684 to clarify.
18685
7bec0760
AD
186862001-11-19 Akim Demaille <akim@epita.fr>
18687
18688 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18689
c87d4863
AD
186902001-11-19 Akim Demaille <akim@epita.fr>
18691
18692 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18693 trace messages.
18694 * src/LR0.c: Likewise.
18695 (allocate_itemsets): Use arrays instead of pointers to clarify.
18696
9bfe901c
AD
186972001-11-19 Akim Demaille <akim@epita.fr>
18698
18699 * src/getargs.c (statistics_flag): Replace with...
18700 (trace_flag): New.
18701 (longopts): Accept --trace instead of --statistics.
18702 * src/getargs.h, src/options.c: Adjust.
18703 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18704 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18705
97db7bd4
AD
187062001-11-19 Akim Demaille <akim@epita.fr>
18707
cc72668c 18708 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
18709 pointers to clarify the code.
18710 (save_reductions, save_shifts): Factor common parts of alternatives.
18711
2c5f66ed
AD
187122001-11-19 Akim Demaille <akim@epita.fr>
18713
18714 * src/LR0.c (new_state, get_state): Complete TRACE code.
18715 * src/closure.c: Include `reader.h' to get `tags', needed by the
18716 trace code.
18717 Rename the conditional DEBUG as TRACE.
18718 Output consistently TRACEs to stderr, not stdout.
18719 * src/derives.c: Likewise.
18720 * src/reduce.c: (inaccessable_symbols): Using if is better style
18721 than goto.
18722 Use `#if TRACE' instead of `#if 0' for tracing code.
18723
300f275f
AD
187242001-11-19 Akim Demaille <akim@epita.fr>
18725
18726 * src/system.h (LIST_FREE, shortcpy): New.
18727 * src/LR0.c: Use them.
18728 * src/output.c (free_itemsets, free_reductions, free_shifts):
18729 Remove, replaced by LIST_FREE.
18730
f59c437a
AD
187312001-11-19 Akim Demaille <akim@epita.fr>
18732
18733 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18734 (REDUCTIONS_ALLOC): New.
18735 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18736 allocation.
18737
6986fd9e
AD
187382001-11-19 Akim Demaille <akim@epita.fr>
18739
18740 * src/LR0.c (new_state): Complete trace code.
18741 * src/nullable.c (set_nullable): Don't translate traces.
18742
4bc30f78
AD
187432001-11-19 Akim Demaille <akim@epita.fr>
18744
18745 * src/print_graph.c (print_core): Better locality of variables.
18746 * src/print.c (print_core): Likewise.
18747
08a946e0
AD
187482001-11-19 Akim Demaille <akim@epita.fr>
18749
18750 * src/vcg.c: You do the output, so you are responsible of the
18751 handling of VCG syntax, in particular: use quotearg.
18752 * src/print_graph.c: Don't.
18753 (print_actions): Don't output the actions as part of the nodes,
18754 since that's the job of the edges.
18755 (print_state): Don't output by hand: fill the node description,
9bfe901c 18756 and ask for its output.
08a946e0 18757
f0473484
AD
187582001-11-19 Akim Demaille <akim@epita.fr>
18759
cc72668c
AD
18760 * src/bison.simple (yyparse): When verbosely reporting an error,
18761 no longer put additional quotes around token names.
f0473484
AD
18762 * tests/calc.at: Adjust.
18763
e41dc700
AD
187642001-11-19 Akim Demaille <akim@epita.fr>
18765
18766 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18767 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18768 * src/output.c: Adjust.
18769
652a871c
AD
187702001-11-19 Akim Demaille <akim@epita.fr>
18771
18772 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18773 (rule_t): this.
18774 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18775
b2ed6e58
AD
187762001-11-19 Akim Demaille <akim@epita.fr>
18777
18778 * src/gram.h (rule_t): New.
18779 (rule_table): New.
18780 (rrhs, rlhs): Remove, part of state_t.
18781 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18782 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18783 * src/reader.c, src/reduce.c: Adjust.
18784
edad7067
AD
187852001-11-19 Akim Demaille <akim@epita.fr>
18786
18787 * src/reader.c (symbols_output): New, extracted from...
18788 (packsymbols): Here.
18789 (reader): Call it.
18790
3feec034
AD
187912001-11-19 Akim Demaille <akim@epita.fr>
18792
18793 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18794 (maxrhs): this new function.
18795
ddcd5fdf
AD
187962001-11-19 Akim Demaille <akim@epita.fr>
18797
cc72668c 18798 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
18799 Adjust.
18800
bb527fc2
AD
188012001-11-19 Akim Demaille <akim@epita.fr>
18802
cc72668c 18803 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
18804 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18805 * src/lalr.c: Adjust.
18806
a845a697
AD
188072001-11-19 Akim Demaille <akim@epita.fr>
18808
18809 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18810 (set_state_table): handle the `lookaheads' members.
18811
f004bf6a
AD
188122001-11-19 Akim Demaille <akim@epita.fr>
18813
cc72668c
AD
18814 * src/lalr.h (lookaheads): Removed array, whose contents is now
18815 a member of...
f004bf6a
AD
18816 (state_t): this structure.
18817 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18818 Adjust.
18819
de326cc0
AD
188202001-11-19 Akim Demaille <akim@epita.fr>
18821
cc72668c
AD
18822 * src/lalr.h (consistent): Removed array, whose contents is now
18823 a member of...
de326cc0
AD
18824 (state_t): this structure.
18825 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18826 Adjust.
18827
90b4416b
AD
188282001-11-19 Akim Demaille <akim@epita.fr>
18829
cc72668c
AD
18830 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18831 contents are now members of...
90b4416b
AD
18832 (state_t): this structure.
18833 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18834 Adjust.
18835
9703cc49
AD
188362001-11-19 Akim Demaille <akim@epita.fr>
18837
18838 * src/lalr.h (state_t): New.
18839 (state_table): Be a state_t * instead of a core **.
18840 (accessing_symbol): Remove, part of state_t.
18841 * src/lalr.c: Adjust.
18842 (set_accessing_symbol): Merge into...
18843 (set_state_table): this.
18844 * src/print_graph.c, src/conflicts.c: Adjust.
18845
d803322e
AD
188462001-11-14 Akim Demaille <akim@epita.fr>
18847
18848 * tests/calc.at, tests/output.at, tests/regression.at,
18849 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18850 now the tests are run in private dirs, therefore AC_CLEANUP and
18851 family can be simplified to 0-ary.
18852 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18853 use abs. path to find config.h.
18854 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18855 stderr, there can be way too much random noise.
18856 Instead pass -Werror to GCC and rely on the exit status.
18857 Reported by Wolfram Wagner.
18858
3d76b07d
AD
188592001-11-14 Akim Demaille <akim@epita.fr>
18860
18861 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18862 defined only if yyoverflow is defined, to avoid `warning: unused
18863 variable `yyvs1''.
18864 Reported by The Test Suite.
18865
09b503c8
AD
188662001-11-14 Akim Demaille <akim@epita.fr>
18867
18868 * src/print.c: Include reduce.h.
18869 Reported by Hans Aberg.
18870
188712001-11-14 Akim Demaille <akim@epita.fr>
18872
18873 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18874 Revert a previous patch: these are really const.
18875 * src/conflicts.c (conflict_report): Additional useless pair of
18876 braces to pacify GCC's warnings for `if () if () {} else {}'.
18877 * src/lex.c (parse_percent_token): Replace equal_offset with
18878 arg_offset.
18879 arg is const.
18880 Be sure to strdup `arg' when used, since there is no reason for
18881 token_buffer not to change.
18882
0f37a994
AD
188832001-11-14 Akim Demaille <akim@epita.fr>
18884
18885 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18886 definition.
18887 * src/main.c (main): Use them.
18888 Suggested by Hans Aberg.
18889
d39d93b8
AD
188902001-11-12 Akim Demaille <akim@epita.fr>
18891
18892 * src/system.h (ngettext): Now that we use ngettext, be sure to
18893 provide a default definition when NLS are not used.
18894
9edcd895
AD
188952001-11-12 Akim Demaille <akim@epita.fr>
18896
18897 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18898 Use @kbd to denote user input.
18899 (Language and Grammar): ANSIfy the example.
18900 Adjust its layout for info/notinfo.
18901 (Location Tracking Calc): Output error messages to stderr.
18902 Output locations in a more GNUtically correct way.
18903 Fix a couple of Englishos.
18904 Adjust @group/@end group pairs.
18905
7da99ede
AD
189062001-11-12 Akim Demaille <akim@epita.fr>
18907
e3aa65c5 18908 %expect was not functioning at all.
7da99ede
AD
18909
18910 * src/conflicts.c (expected_conflicts): Set to -1.
18911 (conflict_report): Use ngettext.
18912 (conflicts_print): Check %expect and make its violation an error.
18913 * doc/bison.texinfo (Expect Decl): Adjust.
18914 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18915 * tests/regression.at (%expect not enough, %expect right)
18916 (%expect too much): New.
18917
ba9dda1a
AD
189182001-11-12 Akim Demaille <akim@epita.fr>
18919
18920 * tests/regression.at (Conflicts): Rename as...
18921 (Unresolved SR Conflicts): this.
18922 (Solved SR Conflicts): New.
18923
337c5bd1
AD
189242001-11-12 Akim Demaille <akim@epita.fr>
18925
18926 * src/reduce.c (print_results): Rename as...
18927 (reduce_output): This.
18928 Output to OUT, passed as argument, instead of output_obstack.
18929 (dump_grammar): Likewise.
18930 (reduce_free): New.
18931 Also free V1.
18932 (reduce_grammar): No longer call reduce_output, since...
18933 * src/print.c (print_results): do it.
18934 * src/main.c (main): Call reduce_free;
18935
c73a41af
AD
189362001-11-12 Akim Demaille <akim@epita.fr>
18937
18938 * src/conflicts.c (print_reductions): Accept OUT as argument.
18939 Output to it, not to output_obstack.
18940 * src/print.c (print_actions): Adjust.
18941
0df87bb6
AD
189422001-11-12 Akim Demaille <akim@epita.fr>
18943
18944 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18945 the result instead of using...
18946 (src_total, rrc_total, src_count, rrc_count): Remove.
18947 (any_conflicts): Remove.
18948 (print_conflicts): Split into...
18949 (conflicts_print, conflicts_output): New.
18950 * src/conflicts.h: Adjust.
18951 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 18952 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
18953 * tests/regression.at (Conflicts): New.
18954 Reported by Tom Lane.
18955
e4d3d4de
AD
189562001-11-12 Akim Demaille <akim@epita.fr>
18957
18958 * tests/regression.at (Invalid input): Remove, duplicate with
18959 ``Invalid input: 1''.
18960
6d7d248e
AD
189612001-11-12 Akim Demaille <akim@epita.fr>
18962
18963 * tests/torture.at (AT_DATA_STACK_TORTURE)
18964 (Exploding the Stack Size with Alloca)
18965 (Exploding the Stack Size with Malloc): New.
18966
e9e4c321
AD
189672001-11-12 Akim Demaille <akim@epita.fr>
18968
18969 * src/bison.simple (YYSTACK_REALLOC): New.
18970 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 18971 Reported by Per Allansson.
e9e4c321 18972
5f7e0832
AD
189732001-11-12 Pascal Bart <pascal.bart@epita.fr>
18974
18975 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18976 define CPP macro, which substitute YYSTYPE by yystype.
18977 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18978 with yyltype/YYLTYPE. This allows inclusion of the generated
18979 header within the parser if the compiler, such as GGC, accepts
18980 multiple equivalent #defines.
18981 From Akim.
18982
e3f1699f
AD
189832001-11-05 Akim Demaille <akim@epita.fr>
18984
18985 * src/reader.c (symbols_output): New, extracted from...
18986 (packsymbols): here.
18987 (reader): Adjust.
18988
65be0866
AD
189892001-11-05 Akim Demaille <akim@epita.fr>
18990
18991 * src/lex.c (parse_percent_token): s/quotearg/quote/.
18992
e4d910bf
AD
189932001-11-05 Akim Demaille <akim@epita.fr>
18994
18995 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
18996 pattern.
18997
951366c1
AD
189982001-11-05 Akim Demaille <akim@epita.fr>
18999
19000 * src/options.h (struct option_table_struct): set_flags is void*.
19001 * src/options.c (longopts): Support `--output' and `%output'.
19002 (usage): Adjust.
19003 * src/lex.h (tok_setopt): Remove, replaced with...
19004 (tok_intopt, tok_stropt): these new guys.
19005 * src/lex.c (getopt.h): Not needed.
19006 (token_buffer, unlexed_token_buffer): Not const.
19007 (percent_table): Promote `-' over `_' in directive names.
19008 Active `%name-prefix', `file-prefix', and `output'.
19009 (parse_percent_token): Accept possible arguments to directives.
19010 Promote `-' over `_' in directive names.
19011
d8988b2f
AD
190122001-11-04 Akim Demaille <akim@epita.fr>
19013
19014 * doc/bison.texinfo (Decl Summary): Split the list into
19015 `directives for grammars' and `directives for bison'.
19016 Sort'em.
19017 Add description of `%name-prefix', `file-prefix', and `output'.
19018 Promote `-' over `_' in directive names.
19019 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19020 Simplify the description of `--name-prefix'.
19021 Promote `-' over `_' in directive names.
19022 Promote `--output' over `--output-file'.
19023 Fix the description of `--defines'.
19024 * tests/output.at: Exercise %file-prefix and %output.
19025
6468d18e
AD
190262001-11-02 Akim Demaille <akim@epita.fr>
19027
19028 * doc/refcard.tex: Update.
19029
6b7e85b9
AD
190302001-11-02 Akim Demaille <akim@epita.fr>
19031
19032 * src/symtab.h (SUNDEF): New.
19033 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19034 stand for `uninitialized', instead of 0.
19035 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19036 * src/lex.c (lex): Adjust.
19037
19038 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19039 Number it 0.
19040 Let yylex return it instead of a plain 0.
19041 Reported by Dick Streefland.
19042
cd5aafcf
AD
190432001-11-02 Akim Demaille <akim@epita.fr>
19044
19045 * tests/regression.at (Mixing %token styles): New test.
19046
037ca2f1
AD
190472001-11-02 Akim Demaille <akim@epita.fr>
19048
19049 * src/reader.c (parse_thong_decl): Formatting changes.
19050 (token_translations_init): New, extracted from...
19051 (packsymbols): Here.
19052 Adjust.
19053
270a173c
AD
190542001-11-01 Akim Demaille <akim@epita.fr>
19055
19056 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19057 Check that `9foo.y' produces correct cpp guards.
19058 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19059 guards.
19060 Reported by Wwp.
19061
561f9a30
AD
190622001-11-01 Akim Demaille <akim@epita.fr>
19063
19064 * tests/regression.at (Invalid input: 2): New.
19065 * src/lex.c (unlexed_token_buffer): New.
19066 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19067 too.
19068 Reported by Wwp.
19069
f987e9d2
AD
190702001-11-01 Akim Demaille <akim@epita.fr>
19071
19072 * tests/calc.at: Catch up with 1.30.
19073 * configure.in: Bump to 1.49a.
19074 Adjust to newer Autotest.
19075
0846f581
PB
190762001-10-19 Pascal Bart <pascal.bart@epita.fr>
19077
19078 * src/conflicts.c: Move global variables rrc_total and src_total ...
19079 (print_conflicts): here.
19080 * src/output.c (output): Free global variable user_toknums.
19081 * src/lex.c (token_obstack): Become static.
19082
3c1a79b3
AD
190832001-10-18 Akim Demaille <akim@epita.fr>
19084
19085 * tests/atlocal.in (GCC): Add.
19086 * tests/calc.at: s/m4_match/m4_bmatch/.
19087 s/m4_patsubst/m4_bpatsubst/.
19088 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19089 * configure.in: AC_SUBST(GCC).
19090
5d52e7d0
MA
190912001-10-14 Marc Autret <autret_m@epita.fr>
19092
19093 * src/options.c (create_long_option_table): Fix.
19094
631aa1d3
AD
190952001-10-10 Akim Demaille <akim@epita.fr>
19096
19097 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19098
f6ec6d13
AD
190992001-10-04 Akim Demaille <akim@epita.fr>
19100
19101 * src/reader.c (parse_union_decl): Push the caracters in
19102 union_obstack, not attrs_obstack.
19103
342b8b6e
AD
191042001-10-04 Akim Demaille <akim@epita.fr>
19105
19106 Merge in the branch 1.29.
19107
19108 * src/reader.c (packsymbols): Use a temporary obstack for
19109 `%%tokendef', since output_stack is already used elsewhere.
19110
19111 2001-10-02 Akim Demaille <akim@epita.fr>
19112
19113 Bump 1.29d.
19114
19115 2001-10-02 Akim Demaille <akim@epita.fr>
19116
19117 Version 1.29c.
19118
19119 2001-10-02 Akim Demaille <akim@epita.fr>
19120
19121 * tests/regression.at (Invalid CPP headers): New.
19122 From Alexander Belopolsky.
19123 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19124
19125 2001-10-02 Akim Demaille <akim@epita.fr>
19126
19127 * tests/regression.at (Invalid input): New.
19128 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19129 Reported by Shura.
19130
19131 2001-10-02 Akim Demaille <akim@epita.fr>
19132
19133 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19134
19135 2001-10-02 Akim Demaille <akim@epita.fr>
19136
19137 * src/output.c (output_parser): Assert `skeleton'.
19138 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19139 systems.
19140 From Shura.
19141
19142 2001-10-01 Marc Autret <autret_m@epita.fr>
19143
19144 * src/lex.h: Echo modifications.
19145 * src/lex.c (unlex): Parameter is now token_t.
19146 From Hans Aberg.
19147
19148 2001-10-01 Marc Autret <autret_m@epita.fr>
19149
19150 * src/main.c: Include lex.h.
19151 From Hans Aberg.
19152
19153 2001-09-29 Akim Demaille <akim@epita.fr>
19154
19155 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19156
19157 2001-09-28 Akim Demaille <akim@epita.fr>
19158
19159 * tests/testsuite.at: Update to newer Autotest.
19160 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19161
19162 2001-09-27 Akim Demaille <akim@epita.fr>
19163
19164 Position independent wrapper.
19165
19166 * tests/bison: Remove.
19167 * tests/bison.in: New.
19168 * configure.in: Adjust.
19169
19170 2001-09-27 Paul Eggert <eggert@twinsun.com>
19171
19172 Port quotearg fixes from tar 1.13.24.
19173
19174 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19175 tm to be declared.
19176 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19177 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19178
19179 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19180 * m4/mbrtowc.m4: New file.
19181 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19182 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19183
19184 2001-09-27 Akim Demaille <akim@epita.fr>
19185
19186 Bump to 1.29c.
19187
19188 2001-09-27 Akim Demaille <akim@epita.fr>
19189
19190 Version 1.29b.
19191
19192 2001-09-25 Akim Demaille <akim@epita.fr>
19193
19194 * src/system.h: Include `xalloc.h'.
19195 Remove it from the C files.
19196 * src/files.c (output_files): Free the obstacks.
19197 * src/lex.c (init_lex): Rename as...
19198 (lex_init): this.
19199 (lex_free): New.
19200 * src/main.c (main): Use it.
19201
19202 2001-09-24 Marc Autret <autret_m@epita.fr>
19203
19204 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19205 to output informations in fout (FILE*).
19206 (open_graph, close_graph): Likewise.
19207 (output_graph, output_edge, output_node): Likewise.
19208 * src/vcg.h: Update function prototypes.
19209 * src/print_graph.c (print_graph): Open output graph file.
19210 (print_actions): Adjust.
19211 * src/files.h: Remove extern declaration.
19212 * src/files.c: Remove graph_obstack declaration.
19213 (open_files): Remove graph_obstack initialization.
19214 (output_files): Remove graph_obstack saving.
19215
19216 2001-09-24 Marc Autret <autret_m@epita.fr>
19217
19218 * src/files.c (compute_output_file_names): Fix.
19219
19220 2001-09-24 Marc Autret <autret_m@epita.fr>,
19221 Akim Demaille <akim@epita.fr>
19222
19223 * src/reader.c (reader): Remove call to free_symtab ().
19224 * src/main.c (main): Call it here.
19225 Include symtab.h.
19226 * src/conflicts.c (initialize_conflicts): Rename as...
19227 (solve_conflicts): this.
19228 * src/print.c (print_core, print_actions, print_state)
19229 (print_grammar): Dump to a file instead a `output_obstack'.
19230 (print_results): Dump `output_obstack', and then proceed with the
19231 FILE *.
19232 * src/files.c (compute_output_file_names, close_files): New.
19233 (output_files): Adjust.
19234 * src/main.c (main): Adjust.
19235
19236 2001-09-23 Marc Autret <autret_m@epita.fr>
19237
19238 * src/files.c (compute_header_macro): Computes header macro name
19239 from spec_defines_file when given.
19240
19241 2001-09-23 Marc Autret <autret_m@epita.fr>
19242
19243 * src/files.c (output_files): Add default extensions.
19244
19245 2001-09-22 Akim Demaille <akim@epita.fr>
19246
19247 * src/conflicts.c (finalize_conflicts): Rename as...
19248 (free_conflicts): this.
19249
19250 2001-09-22 Akim Demaille <akim@epita.fr>
19251
19252 * src/gram.c (gram_free): Rename back as...
19253 (dummy): this.
19254 (output_token_translations): Free `token_translations'.
19255 * src/symtab.c (free_symtab): Free the tag field.
19256
19257 2001-09-22 Akim Demaille <akim@epita.fr>
19258
19259 Remove `translations' as it is always set to true.
19260
19261 * src/gram.h: Adjust.
19262 * src/reader.c (packsymbols, parse_token_decl): Adjust
19263 * src/print.c (print_grammar): Adjust.
19264 * src/output.c (output_token_translations): Adjust.
19265 * src/lex.c (lex): Adjust.
19266 * src/gram.c: Be sure the set pointers to NULL.
19267 (dummy): Rename as...
19268 (gram_free): this.
19269
19270 2001-09-22 Akim Demaille <akim@epita.fr>
19271
19272 * configure.in: Invoke AM_LIB_DMALLOC.
19273 * src/system.h: Use dmalloc.
19274 * src/LR0.c: Be sure to have pointers initialized to NULL.
19275 (allocate_itemsets): Allocate kernel_items only if needed.
19276
19277 2001-09-22 Akim Demaille <akim@epita.fr>
19278
19279 * configure.in: Bump to 1.29b.
19280 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19281 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19282 need xmalloc.c in calc.y.
19283 From Pascal Bart.
19284
19285 2001-09-21 Akim Demaille <akim@epita.fr>
19286
19287 Version 1.29a.
19288 * Makefile.maint, config/config.guess, config/config.sub,
19289 * config/missing: Update from masters.
19290 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19291 upon package.m4.
19292 * configure.in (ALL_LINGUAS): Add `tr'.
19293
19294 2001-09-21 Akim Demaille <akim@epita.fr>
19295
19296 * tests/Makefile.am (package.m4): Move to...
19297 ($(srcdir)/$(TESTSUITE)): here.
19298
19299 2001-09-20 Akim Demaille <akim@epita.fr>
19300
19301 * src/complain.c: No longer try to be standalone: use system.h.
19302 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19303 * src/complain.h: Likewise.
19304 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19305 Remove the unused variable `n'.
19306 From Albert Chin-A-Young.
19307
19308 2001-09-18 Marc Autret <autret_m@epita.fr>
19309
19310 * doc/bison.1: Update.
19311 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19312 descriptions.
19313 (Option Cross Key): Update.
19314 Add --graph.
19315
19316 2001-09-18 Marc Autret <autret_m@epita.fr>
19317
19318 * tests/regression.at: New test (comment in %union).
19319
19320 2001-09-18 Marc Autret <autret_m@epita.fr>
19321
19322 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19323 do that.
19324 Reported by Keith Browne.
19325
19326 2001-09-18 Marc Autret <autret_m@epita.fr>
19327
19328 * tests/output.at: Add tests for --defines and --graph.
19329
19330 2001-09-18 Marc Autret <autret_m@epita.fr>
19331
19332 * tests/output.at: Removes tests of %{header,src}_extension features.
19333
19334 2001-09-18 Akim Demaille <akim@epita.fr>
19335
19336 * tests/Makefile.am (package.m4): New.
19337 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19338 (_AT_CHECK_CALC_ERROR): Likewise.
19339 Factor the `, ' part of verbose error messages.
19340
19341 2001-09-18 Marc Autret <autret_m@epita.fr>
19342
19343 * src/getargs.c (longopts): Declare --defines and --graph as options
19344 with optional arguments.
19345 * src/files.h: Add extern declarations.
19346 * src/files.c (spec_graph_file, spec_defines_file): New.
19347 (output_files): Update.
19348 Remove CPP-outed code.
19349
19350 2001-09-18 Marc Autret <autret_m@epita.fr>
19351
19352 Turn off %{source,header}_extension feature.
19353
19354 * src/files.c (compute_exts_from_gf): Update.
19355 (compute_exts_from_src): Update.
19356 (output_files): CPP-out useless code.
19357 * src/files.h: Remove {header,source}_extension extern declarations.
19358 * src/reader.c (parse_dquoted_param): CPP-out.
19359 (parse_header_extension_decl): Remove.
19360 (parse_source_extension_decl): Remove.
19361 (read_declarations): Remove cases tok_{hdrext,srcext}.
19362 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19363 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19364
19365 2001-09-10 Akim Demaille <akim@epita.fr>
19366
19367 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19368 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19369 (AT_CHECK_OUTPUT): this.
19370 Merely check ls' exit status, its output is useless.
19371
19372 2001-09-10 Akim Demaille <akim@epita.fr>
19373
19374 * tests/calc.at: Use m4_match.
19375 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19376
19377 2001-09-10 Marc Autret <autret_m@epita.fr>,
19378 Akim Demaille <akim@epita.fr>
19379
19380 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19381 enum color_e.
19382 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19383 to `normal'.
19384 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19385 * src/lex.h: Adjust prototype.
19386 (token_t): Add `tok_undef'.
19387 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19388 (parse_percent_token): Now returns token_t.
19389 Add default statement in switch.
19390 (lex): Separate `c' as an input variable, from the token_t result
19391 part.
19392 (unlexed): Is a token_t.
19393
19394 2001-09-10 Akim Demaille <akim@epita.fr>
19395
19396 * configure.in: Bump to 1.29a.
19397
19398 2001-09-07 Akim Demaille <akim@epita.fr>
19399
19400 Version 1.29.
19401
19402 2001-08-30 Akim Demaille <akim@epita.fr>
19403
19404 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19405 * m4/atconfig.m4: Remove.
19406 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19407 * tests/bison: New.
19408 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19409 m4_if, m4_patsubst, and m4_regexp.
19410 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19411 `input' file instead of echo.
19412
19413 2001-08-29 Akim Demaille <akim@epita.fr>
19414
19415 Bump to 1.28e.
19416
19417 2001-08-29 Akim Demaille <akim@epita.fr>
19418
19419 Version 1.28d.
19420
19421 2001-08-29 Paul Eggert <eggert@twinsun.com>
19422
19423 * src/bison.simple (yyparse): Don't take the address of an
19424 item before the start of an array, as that doesn't conform to
19425 the C Standard.
19426
19427 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19428
19429 * doc/bison.texinfo (Location Tracking Calc): New node.
19430
19431 2001-08-29 Paul Eggert <eggert@twinsun.com>
19432
19433 * src/output.c (output): Do not define const, as this now
19434 causes more problems than it cures.
19435
19436 2001-08-29 Akim Demaille <akim@epita.fr>
19437
19438 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19439 the nodes.
19440 Be sure to tag the `detailmenu'.
19441
19442 2001-08-29 Akim Demaille <akim@epita.fr>
19443
19444 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19445 download in a tmp dir.
19446
19447 2001-08-28 Marc Autret <autret_m@epita.fr>
19448
19449 * config/depcomp: New file.
19450
19451 2001-08-28 Marc Autret <autret_m@epita.fr>
19452
19453 * doc/bison.1 (mandoc): Adjust.
19454 From Juan Manuel Guerrero.
19455
19456 2001-08-28 Marc Autret <autret_m@epita.fr>
19457
19458 * src/print_graph.c (print_state): Fix.
19459
19460 2001-08-27 Marc Autret <autret_m@epita.fr>
19461
19462 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19463 char * members.
19464 Echo modifications to the functions prototypes.
19465 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19466
19467 2001-08-27 Marc Autret <autret_m@epita.fr>
19468
19469 * src/vcg.c: Include `xalloc.h'.
19470 (add_colorentry): New.
19471 (add_classname): New.
19472 (add_infoname): New.
19473 * src/vcg.h: Add new prototypes.
19474
19475 2001-08-27 Akim Demaille <akim@epita.fr>
19476
19477 * Makefile.maint: Sync. again with CVS Autoconf.
19478
19479 2001-08-27 Akim Demaille <akim@epita.fr>
19480
19481 * Makefile.maint: Formatting changes.
19482 (po-update, cvs-update, update): New targets.
19483 (AMTAR): Remove.
19484
19485 2001-08-27 Akim Demaille <akim@epita.fr>
19486
19487 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19488 * Makefile.maint: Sync. with CVS Autoconf.
19489
19490 2001-08-27 Marc Autret <autret_m@epita.fr>
19491
19492 * src/vcg.h (struct infoname_s): New.
19493 (struct colorentry_s): New.
19494 (graph_s): New fields {vertical,horizontal}_order in structure.
19495 Add `infoname' field.
19496 Add `colorentry' field;
19497 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19498 (G_HORIZONTAL_ORDER): New.
19499 (G_INFONAME): New.
19500 (G_COLORENTRY): New.
19501 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19502 Add output of `infoname'.
19503 Add output of `colorentry'.
19504
19505 2001-08-27 Marc Autret <autret_m@epita.fr>
19506
19507 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19508 This one shadowed a global parameter.
19509
19510 2001-08-24 Marc Autret <autret_m@epita.fr>
19511
19512 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19513 instead of `unsigned'.
19514 (print_state): Do not call obstack_object_size () in obstack_grow ()
19515 to avoid macro variables shadowing.
19516
19517 2001-08-23 Marc Autret <autret_m@epita.fr>
19518
19519 * src/lex.c (percent_table): Typo: s/naem/name/.
19520 Add graph option.
19521 Normalize new options declarations.
19522
19523 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19524
19525 * tests/suite.at: Exercise %header_extension and %source_extension.
19526
19527 2001-08-16 Marc Autret <autret_m@epita.fr>
19528
19529 * src/reader.c (parse_dquoted_param): New.
19530 (parse_header_extension_decl): Use it.
19531 (parse_source_extension_decl): Likewise.
19532
19533 2001-08-16 Marc Autret <autret_m@epita.fr>
19534
19535 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19536 (get_xxxx_str): Use assert () instead of complain ().
19537 Remove return invokations in default cases.
19538 (get_decision_str): Modify default behaviour. Remove second argument.
19539 Echo modifications on calls.
19540 (output_graph): Fix.
19541
19542 2001-08-16 Marc Autret <autret_m@epita.fr>
19543
19544 * src/getargs.c (usage): Update with ``-g, --graph''.
19545
19546 2001-08-16 Marc Autret <autret_m@epita.fr>
19547
19548 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19549 (Option Cross Key): Likewise.
19550 * doc/bison.1: Update.
19551
1c8c2190
PB
195522001-09-25 Pascal Bart <pascal.bart@epita.fr>
19553
19554 * src/output.c (output_master_parser): Don't finish action_obstack.
19555 (output_parser): Don't care about the muscle action, here.
19556 (prepare): Copy the action_obstack in the action muscle.
19557 (output): Free action_obstack.
19558
180d45ba
PB
195592001-09-23 Pascal Bart <pascal.bart@epita.fr>
19560
19561 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19562 will contain `%union' declaration.
19563 (parse_union_decl): Delete #line directive output.
19564 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19565 informations about %union.
19566 (parse_union_decl): Copy the union_obstack in the muscle stype.
19567 * src/bison.simple: Add new #line directive.
19568 Add typdef %%stype YYSTYPE.
19569
c51d1a19
PB
195702001-09-23 Pascal Bart <pascal.bart@epita.fr>
19571
19572 * src/bison.simple: Add new `#line' directive.
19573
6f9344da
PB
195742001-09-22 Pascal Bart <pascal.bart@epita.fr>
19575
19576 * src/bison.simple: New `#line' directive.
19577 * src/output.c (output_parser): Support new dynamic muscle input_line.
19578
652def80
MA
195792001-09-22 Marc Autret <autret_m@epita.fr>
19580
19581 * src/output.c (output_master_parser): New.
19582 (output_parser): Be more re-entrant.
19583
25b222fa
MA
195842001-09-21 Marc Autret <autret_m@epita.fr>
19585
19586 * src/reader.c (copy_definition, parse_union_decl): Update and use
19587 `linef' muscle.
19588 (copy_action): Likewise.
19589 Use obstack_1grow ().
19590 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19591
6bc35ae5
MA
195922001-09-21 Marc Autret <autret_m@epita.fr>
19593
19594 * src/options.c (option_table): Adjust.
19595 * src/lex.c (parse_percent_token): Fix.
19596
c0629aa1
PB
195972001-09-20 Pascal Bart <pascal.bart@epita.fr>
19598
19599 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 19600
82b6d266
PB
196012001-09-20 Pascal Bart <pascal.bart@epita.fr>
19602
19603 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19604 is now an option_table_struct*.
19605 (option_strcmp): New function option_strcmp.
19606 (parse_percent_token): Call option_strcmp.
19607 * src/getargs.c (xalloc.h, options.h): Include it.
19608 (getargs): Call create_long_option_table.
19609 (getargs): Free longopts at the end of the function.
19610 (shortopts): Move in options.c.
19611 * src/options.c (create_long_option_table): New function. Convert
19612 information from option_table to option structure.
19613 * src/reader.c (options.h): Include it.
19614
19615 * src/Makefile.am: Adjust.
19616 * src/options.c (option_table): Create from longopts and percent_table.
19617 * src/getargs.c (longopts): Delete.
19618 * src/lex.c (struct percent_table_struct): Delete.
19619 (percent_table): Delete.
19620 (options.h): Include it.
19621 * src/options.c: Create.
19622 * src/options.h: Create.
19623 Declare enum opt_access_e.
19624 Define struct option_table_struct.
19625
75f5aaea
MA
196262001-09-20 Marc Autret <autret_m@epita.fr>
19627
19628 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19629 sections of Bison.
19630
f508cb0a
PB
196312001-09-19 Pascal Bart <pascal.bart@epita.fr>
19632
19633 * src/bison.simple: s/%%filename/%%skeleton.
19634 * src/muscle_tab.c (getargs.h): Include it.
19635 (muscle_init): Insert new muscle skeleton.
19636
13105fc1
PB
196372001-09-18 Pascal Bart <pascal.bart@epita.fr>
19638
19639 * src/output.c (output_parser): Delete unused variable actions_dumped.
19640
b0c4483e
PB
196412001-09-07 Pascal Bart <pascal.bart@epita.fr>
19642
19643 * src/output.c (output): Delete call to reader_output_yylsp.
19644 * src/reader.c (reader): Likewise.
ba0fe3c7 19645 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 19646
11d82f03
MA
196472001-09-02 Marc Autret <autret_m@epita.fr>
19648
19649 * src/reader.c: Include muscle_tab.h.
19650 (parse_union_decl): Update.
19651 (parse_macro_decl): Rename parse_muscle_decl.
19652 Update to use renamed functions and variable.
19653 (read_declarations, copy_action, read_additionnal_code, : Updated
19654 with correct variables and functions names.
19655 (packsymbols, reader): Likewise.
342b8b6e 19656
11d82f03 19657 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 19658
11d82f03
MA
19659 * src/output.c: Include muscle_tab.h
19660 In all functions using macro_insert, change by using muscle_insert ().
19661 (macro_obstack): Rename muscle_obstack.
19662 Echo modifications in the whole file.
19663 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19664 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19665 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19666
19667 * src/muscle_tab.h: Update double inclusion macros.
19668 (macro_entry_s): Rename muscle_entry_s.
19669 Update prototypes.
342b8b6e 19670
11d82f03
MA
19671 * src/muscle_tab.c: Include muscle_tab.h.
19672 Rename macro_tabble to muscle_table.
19673 (mhash1, mhash2, mcmp): Use muscle_entry.
19674 (macro_init): Rename muscle_init. Update.
19675 (macro_insert): Rename muscle_insert. Update.
19676 (macro_find): Rename muscle_find. Update.
19677
19678 * src/main.c: Include muscle_tab.h.
19679 (main): Call muscle_init ().
19680 * src/Makefile.am (bison_SOURCES): Echo modifications.
19681
93a37297
MA
196822001-09-02 Marc Autret <autret_m@epita.fr>
19683
f753cd62 19684 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 19685
f753cd62
MA
19686 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19687
196882001-09-02 Marc Autret <autret_m@epita.fr>
19689
19690 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 19691
682d48cd
PB
196922001-09-01 Pascal Bart <pascal.bart@epita.fr>
19693
342b8b6e 19694 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
19695 filename.
19696
087c8fda
MA
196972001-09-01 Marc Autret <autret_m@epita.fr>
19698
19699 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19700 to an explicit value to activate the feature. We do it here.
19701
dda680cb
PB
197022001-08-31 Pascal Bart <pascal.bart@epita.fr>
19703
19704 * src/output.c (prepare): Delete the `filename' muscule insertion.
19705 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19706 (parse_union_decl): Likewise.
19707 * src/macrotab.c (macro_init): Initialize filename by infile.
19708
9e644e64
MA
197092001-08-31 Marc Autret <autret_m@epita.fr>
19710
19711 * src/bison.simple (YYLSP_NEEDED): New definition.
19712 * src/output.c (prepare): Add macro insertion of `locations_flag'
19713
17da6427
PB
197142001-08-31 Pascal Bart <pascal.bart@epita.fr>
19715
19716 * src/output.c (prepare): Delete insertion of previous muscles,
19717 and insert the `prefix' muscles.
19718 * src/macrotab.c (macro_init): Likewise.
19719 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 19720 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
19721 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19722 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 19723 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
19724 name_prefix.
19725
e8cb70b9
PB
197262001-08-31 Pascal Bart <pascal.bart@epita.fr>
19727
19728 * src/main.c (main): Standardize.
19729 * src/output.c (output_table_data, output_parser): Likewise.
19730 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19731
63c2d5de
MA
197322001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19733
342b8b6e 19734 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
19735 %%epilogue.
19736 * src/output.c (output): Rename %%declarations to %%prologue.
19737 * src/bison.simple: Echo modifications.
342b8b6e 19738
d8cb5183
MA
197392001-08-31 Marc Autret <autret_m@epita.fr>
19740
19741 * src/reader.c (readgram): CleanUp.
19742 (output_token_defines): Likewise.
19743 (packsymbols): Likewise.
19744 (reader): Likewise.
19745 * src/output.c (output): CPP-out useless code.
19746
6c686258
PB
197472001-08-31 Pascal Bart <pascal.bart@epita.fr>
19748
342b8b6e 19749 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
19750 output_trailers and output_headers.
19751 * src/output.h: Remove obsolete functions prototypes of output_headers
19752 and output_trailers.
19753
8f451ef7
PB
197542001-08-30 Pascal Bart <pascal.bart@epita.fr>
19755
19756 * src/main.c: Include macrotab.h.
342b8b6e 19757 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
19758 Adjust functions prototypes.
19759 * src/macrotab.c (macro_insert): Constify key and value.
19760 (macro_find): Constify key.
19761 (macro_insert): Include 'xalloc.h'
19762 (macro_insert): Use XMALLOC.
19763 (macro_find): Constify return value.
19764 * src/output.c (output_table_data): Rename table to table_data.
19765 (output_parser): Constify macro_key, macro_value.
19766
997b6fd0 197672001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
19768
19769 * src/reader.c (parse_skel_decl): New.
342b8b6e 19770 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
19771 * src/lex.h (token_t): New token `tok_skel'.
19772 * src/lex.c (percent_table): Add skeleton option entry.
19773 Standardize.
19774
ff48177d
MA
197752001-08-29 Marc Autret <autret_m@epita.fr>
19776
19777 * src/bison.simple: Add %%user_code directive at the end.
19778 * src/reader.c (read_additionnal_code): New.
19779 (reader): Use it.
19780 * src/output.c (output_program): Remove.
19781 (output): Update.
19782
b33160bf
MA
197832001-08-28 Marc Autret <autret_m@epita.fr>
19784
19785 * src/output.c (output_actions): Clean up.
4e5caae2 19786 (output_gram): CPP-out useless code.
b33160bf
MA
19787 * src/reader.c (reader): Clean up, CPP-out useless code.
19788
d1a2daf7
PB
197892001-08-28 Pascal Bart <pascal.bart@epita.fr>
19790
342b8b6e 19791 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 19792 directive.
d1a2daf7
PB
19793 * src/bison.simple: Add `%%definitions'.
19794
2b763dfe
MA
197952001-08-28 Marc Autret <autret_m@epita.fr>
19796
19797 * config/depcomp: New file.
19798
f1a87ef6
PE
197992001-08-27 Paul Eggert <eggert@twinsun.com>
19800
19801 * src/bison.simple (yyparse): Don't take the address of an
19802 item before the start of an array, as that doesn't conform to
19803 the C Standard.
19804
82e236e2
RA
198052001-08-27 Robert Anisko <robert.anisko@epita.fr>
19806
f1a87ef6 19807 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
19808 obstack. It was done too late here.
19809
19810 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19811 completely wrong.
19812 (reader): Initialize the macro obstack here, since we need it to grow
19813 '%define' directives.
19814
19815 * src/reader.h: Declare the macro obstack as extern.
19816
b0cfa28a
RA
198172001-08-27 Robert Anisko <robert.anisko@epita.fr>
19818
19819 * src/output.c (output_parser): Fix. Store single '%' characters in
19820 the output obstack instead of throwing them away.
19821
6fc74234
AD
198222001-08-27 Akim Demaille <akim@epita.fr>
19823
19824 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19825
9c76d118
RA
198262001-08-25 Robert Anisko <robert.anisko@epita.fr>
19827
19828 * lib/Makefile.am: Adjust.
19829
a8289c62
RA
198302001-08-25 Robert Anisko <robert.anisko@epita.fr>
19831
19832 * src/bison.simple: Update and add '%%' directives.
19833
b6610515
RA
198342001-08-25 Robert Anisko <robert.anisko@epita.fr>
19835
19836 * src/reader.c (reader): Remove calls to 'output_headers' and
19837 'output_trailers'. Remove some C output.
19838 (readgram): Disable a piece of code that was writing a default
19839 definition for 'YYSTYPE'.
19840 (reader_output_yylsp): Remove.
19841 (packsymbols): Output token defintions to a macro.
19842 (copy_definition): Disable C output.
6fc74234 19843
b6610515
RA
19844 * src/reader.c (parse_macro_decl): New function used to parse macro
19845 declarations.
19846 (copy_string2): Put the body of copy_string into this new function.
19847 Add a parameter to let the caller choose whether he wants to copy the
19848 string delimiters or not.
19849 (copy_string): Be a simple call to copy_string2 with the last argument
19850 bound to true.
19851 (read_declarations): Add case for macro definition.
19852 (copy_identifier): New.
6fc74234 19853 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
19854 rather than lex.
19855
26f609ff
RA
198562001-08-25 Robert Anisko <robert.anisko@epita.fr>
19857
19858 * src/output.c (prepare): Add prefixed names.
19859 (output_parser): Output semantic actions.
19860 (output_parser): Fix bug on '%%line' directives.
6fc74234 19861
26f609ff
RA
19862 * src/output.c (output_headers): Remove. The C code printed by this
19863 function should now be in the skeletons.
19864 (output_trailers): Remove.
19865 (output): Disable call to 'reader_output_yylsp'.
19866 (output_rule_data): Do not output tables to the table obstack.
19867
19868 * src/output.c: Remove some C dedicated output.
19869 Improve the use of macro and output obstacks.
19870 (output_defines): Remove.
6fc74234 19871
26f609ff
RA
19872 * src/output.c (output_token_translations): Associate 'translate'
19873 table with a macro. No output to the table obstack.
19874 (output_gram): Same for 'rhs' and 'prhs'.
19875 (output_stos): Same for 'stos'.
19876 (output_rule_data): Same for 'r1' and 'r2'.
19877 (token_actions): Same for 'defact'.
19878 (goto_actions): Same for 'defgoto'.
19879 (output_base): Same for 'pact' and 'pgoto'.
19880 (output_table): Same for 'table'.
19881 (output_check): Same for 'check'.
6fc74234 19882
26f609ff
RA
19883 * src/output.c (output_table_data): New function.
19884 (output_short_table): Remove.
19885 (output_short_or_char_table): Remove.
6fc74234 19886
26f609ff
RA
19887 * src/output.c (output_parser): Replace most of the skeleton copy code
19888 with something new. Skeletons are now processed character by character
19889 rather than line by line, and Bison looks for '%%' macros. This is the
19890 first step in making Bison's output process (a lot) more flexible.
19891 (output_parser): Use the macro table.
19892
6f43b113
RA
198932001-08-25 Robert Anisko <robert.anisko@epita.fr>
19894
19895 * src/main.c (main): Initialize the macro table.
19896
dd3127cf
RA
198972001-08-25 Robert Anisko <robert.anisko@epita.fr>
19898
19899 * src/lex.c (percent_table): Add tok_define.
19900 * src/lex.h: Add tok_define.
19901
aa321494
RA
199022001-08-25 Robert Anisko <robert.anisko@epita.fr>
19903
19904 * src/macrotab.c: New file.
19905 * src/macrotab.h: New file.
19906 * src/Makefile.am: Update.
19907
68bd3b6b
RA
199082001-08-25 Robert Anisko <robert.anisko@epita.fr>
19909
19910 * lib/hash.c: New file.
19911 * lib/hash.h: New file.
19912 * lib/Makefile.am: Update.
19913
45f8dd1e
AD
199142001-08-15 Akim Demaille <akim@epita.fr>
19915
19916 Version 1.28c.
19917
40a64a7a 199182001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
19919
19920 * src/reader.c (readgram): Indent output macro YYSTYPE.
19921 (packsymbols): Likewise.
19922 (output_token_defines): Likewise.
19923 * src/files.c: Standardize.
19924 (compute_header_macro): New.
19925 (defines_obstack_save): New. Use compute_header_macro.
19926 (output_files): Update. Use defines_obstack_save.
19927
f9a8293a
AD
199282001-08-15 Akim Demaille <akim@epita.fr>
19929
19930 * doc/bison.texinfo (Table of Symbols): Document
19931 YYSTACK_USE_ALLOCA.
19932
150ca7a7
AD
199332001-08-15 Akim Demaille <akim@epita.fr>
19934
19935 * missing: Update from CVS Automake.
19936 * config/config.guess, config/config.sub, config/texinfo.tex:
19937 Update from gnu.org.
19938
69b5cec4
AD
199392001-08-15 Akim Demaille <akim@epita.fr>
19940
19941 * Makefile.maint: Sync with CVS Autoconf.
19942
f2b5126e
PB
199432001-08-14 Pascal Bart <pascal.bart@epita.fr>
19944
69b5cec4 19945 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
19946 `fdl.texi'.
19947 * doc/fdl.texi: Add to package.
19948
4ecbf796
MA
199492001-08-14 Marc Autret <autret_m@epita.fr>
19950
19951 Turn on %{source,header}_extension features.
19952
69b5cec4 19953 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
19954 source_extension.
19955 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 19956 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
19957 between options.
19958
95fb5662
MA
199592001-08-14 Marc Autret <autret_m@epita.fr>
19960
19961 * src/files.c (compute_base_names): Add extensions computing when
19962 `--file-prefix' used.
19963 Standardize function calls.
19964
78d09da9
MA
199652001-08-13 Marc Autret <autret_m@epita.fr>
19966
69b5cec4 19967 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
19968 defining it (defined but null disables alloca).
19969
5a009f2c
MA
199702001-08-13 Marc Autret <autret_m@epita.fr>
19971
19972 * src/bison.simple (_yy_memcpy): CPP reformat.
19973
1e41465a
PB
199742001-08-13 Pascal Bart <pascal.bart@epita.fr>
19975
19976 * tests/atconfig.in (CPPFLAGS): Fix.
19977
c67a198d
PB
199782001-08-10 Pascal Bart <pascal.bart@epita.fr>
19979
79282c6c 19980 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
19981 `gpl.texi'.
19982 * doc/gpl.texi: Add to package.
19983
09a6de7e
MA
199842001-08-10 Marc Autret <autret_m@epita.fr>
19985
19986 * src/print_graph.h: Fix.
19987 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
19988
b77b9ee0
AD
199892001-08-10 Akim Demaille <akim@epita.fr>
19990
19991 * src/system.h: Provide default declarations for stpcpy, strndup,
19992 and strnlen.
19993
3e259915
MA
199942001-08-10 Robert Anisko <anisko_r@epita.fr>
19995
19996 * doc/bison.texinfo (Locations): Update @$ stuff.
19997
ca96bc2d
MA
199982001-08-09 Robert Anisko <anisko_r@epita.fr>
19999
20000 * src/bison.simple (YYLLOC_DEFAULT): Update.
20001 (yyparse): Adjust.
20002
fdc6758b
MA
200032001-08-08 Marc Autret <autret_m@epita.fr>
20004
b77b9ee0 20005 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
20006 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20007 Reported by Fabrice Bauzac.
957d4dbf 20008
600cad3b
MA
200092001-08-08 Marc Autret <autret_m@epita.fr>
20010
20011 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20012 * src/vcg.c (output_node): Fix.
20013 * src/vcg.h: Cleanup.
20014 * src/print_graph.c: Add comments.
b77b9ee0 20015 (node_output_size): New global variable. Simplify the formatting of
600cad3b 20016 the VCG graph output.
b77b9ee0 20017 (print_actions): Unused code is now used. It notifies the final state
600cad3b 20018 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 20019 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
20020 blue.
20021 Get the current node name and node_obstack by argument.
20022 (node_obstack): New variable.
20023 (print_state): Manage node_obstack.
20024 (print_core): Use node_obstack given by argument.
20025 A node is not only computed here but in print_actions also.
20026 (print_graph): CPP out useless code instead of commenting it.
20027
976e528f
AD
200282001-08-07 Pascal Bart <pascal.bart@epita.fr>
20029
20030 * tests/atconfig.in (CPPFLAGS): Fix.
20031
20e8e5ca
AD
200322001-08-07 Akim Demaille <akim@epita.fr>
20033
20034 * src/print_graph.c (quote): New.
20035 (print_core): Use it.
20036
957d4dbf 200372001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 20038
3e3da797
AD
20039 * src/vcg.c (complain.h): Include it.
20040 Unepitaize `return' invocations.
c4b66126 20041 [NDEBUG] (main): Remove.
79282c6c 20042 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
20043 * src/files.c (open_files): Initialize graph_obstack.
20044 * src/print_graph.c (print_actions): CPP out useless code.
20045 (print_core): Don't output the last `\n' in labels.
20046 Use `quote'.
20047 * src/files.c (output_files): Output the VCG file.
20048 * src/main.c (main): Invoke print_graph ();
3e3da797 20049
957d4dbf 200502001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
20051
20052 Automaton VCG graph output.
20053 Using option ``-g'' or long option ``--graph'', you can generate
20054 a gram_filename.vcg file containing a VCG description of the LALR (1)
20055 automaton of your grammar.
20056
20057 * src/main.c: Call to print_graph() function.
20058 * src/getargs.h: Update.
20059 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20060 (graph_flag): New flag.
20061 (longopts): Update.
20062 (getargs): Add case `g'.
20063 * src/files.c (graph_obstack): New obstack struct.
20064 (open_files): Initialize new obstack.
20065 (output_files): Saves graph_obstack if required.
20066 * src/files.h (graph_obstack): New extern declaration.
20067 * src/Makefile.am: Add new source files.
20068
927c1557 200692001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
20070
20071 * src/print_graph.c, src/print_graph.h (graph): New.
20072 * src/vcg.h: New file.
20073 * src/vcg.c: New file, VCG graph handling.
20074
7333d403
AD
200752001-08-06 Marc Autret <autret_m@epita.fr>
20076
20077 Add of %source_extension and %header_extension which specify
20078 the source or/and the header output file extension.
20079
20080 * src/files.c (compute_base_names): Remove initialisation of
20081 src_extension and header_extension.
20082 (compute_exts_from_gf): Update.
20083 (compute_exts_from_src): Update.
20084 (output_files): Update.
20085 * src/reader.c (parse_header_extension_decl): New.
20086 (parse_source_extension_decl): New.
20087 (read_declarations): New case statements for the new tokens.
20088 * src/lex.c (percent_table): Add entries for %source_extension
20089 and %header_extension.
20090 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20091
84163231
AD
200922001-08-06 Marc Autret <autret_m@epita.fr>
20093
20094 * configure.in: Bump to 1.28c.
20095 * doc/bison.texinfo: Texinfo thingies.
20096
8303fc42
AD
200972001-08-04 Pascal Bart <pascal.bart@epita.fr>
20098
20099 * tests/atconfig.in (CPPFLAGS): Add.
20100 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20101
70a84437
AD
201022001-08-03 Akim Demaille <akim@epita.fr>
20103
20104 Version 1.28b.
20105
2ce10144
AD
201062001-08-03 Akim Demaille <akim@epita.fr>
20107
20108 * tests/Makefile.am (check-local): Ship testsuite.
20109 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20110 Include `string.h'.
20111
1e3e4bc1
AD
201122001-08-03 Akim Demaille <akim@epita.fr>
20113
20114 * configure.in: Try using -Wformat when compiling.
20115
42b45b7f
AD
201162001-08-03 Akim Demaille <akim@epita.fr>
20117
20118 * configure.in: Bump to 1.28b.
20119
8f13fe33
AD
201202001-08-03 Akim Demaille <akim@epita.fr>
20121
20122 * src/complain.c: Adjust strerror_r portability issues.
20123
b37ba92c
AD
201242001-08-03 Akim Demaille <akim@epita.fr>
20125
20126 Version 1.28a.
20127
b0ce6046
AD
201282001-08-03 Akim Demaille <akim@epita.fr>
20129
20130 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20131 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20132 * src/getargs.c: Include complain.h.
20133 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20134 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20135
d01c415b
AD
201362001-08-03 Akim Demaille <akim@epita.fr>
20137
20138 * src/reader.c (readgram): Display hidden chars in error messages.
20139
459dd1a6
AD
201402001-08-03 Akim Demaille <akim@epita.fr>
20141
20142 Update to gettext 0.10.39.
20143
53b74c0c
AD
201442001-08-03 Akim Demaille <akim@epita.fr>
20145
20146 * lib/strspn.c: New.
20147
234a3be3
AD
201482001-08-01 Marc Autret <autret_m@epita.fr>
20149
20150 * doc/bison.texinfo: Update.
20151 * doc/bison.1 (mandoc): Update.
20152 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20153 * src/files.c: Support output files extensions computing.
20154 (src_extension): New static variable.
20155 (header_extension): New static variable.
20156 (tr): New function.
20157 (get_extension_index): New function, gets the index of an extension
20158 filename in a string.
20159 (compute_exts_from_gf): New function, computes extensions from the
20160 grammar file extension.
20161 (compute_exts_from_src): New functions, computes extensions from the
20162 C source file extension, file given by ``-o'' option.
20163 (compute_base_names): Update.
20164 (output_files): Update.
20165
847bf1f5
AD
201662001-08-01 Robert Anisko <anisko_r@epita.fr>
20167
d995fee7 20168 * doc/bison.texi: Document @$.
847bf1f5
AD
20169 (Locations): New section.
20170
d074a105
AD
201712001-07-18 Akim Demaille <akim@epita.fr>
20172
20173 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20174 * config/prev-version.txt, config/move-if-change: New.
20175 * Makefile.am: Adjust.
20176
3419715d
AD
201772001-07-08 Pascal Bart <pascal.bart@epita.fr>
20178
20179 * src/bison.simple (yyparse): Suppress warning `comparaison
20180 between signed and unsigned'.
20181
62ab6972
AD
201822001-07-05 Pascal Bart <pascal.bart@epita.fr>
20183
20184 * src/getargs.h (raw_flag): Remove.
20185 * src/getargs.c: Die on `-r'/`--raw'.
20186 * src/lex.c (parse_percent_token): Die on `%raw'.
20187 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20188 * tests/calc.at: Suppress test with option `--raw'.
20189
1e24cc5b
AD
201902001-07-14 Akim Demaille <akim@epita.fr>
20191
20192 * config/: New.
20193 * configure.in: Require Autoconf 2.50.
20194 Update to gettext 0.10.38.
20195
32dfccf8
AD
201962001-03-16 Akim Demaille <akim@epita.fr>
20197
20198 * doc/bison.texinfo: ANSIfy the examples.
20199
cd5bd6ac
AD
202002001-03-16 Akim Demaille <akim@epita.fr>
20201
20202 * getargs.c (skeleton): New variable.
20203 (longopts): --skeleton is a new option.
20204 (shortopts, getargs): -S is a new option.
20205 * getargs.h: Declare skeleton.
20206 * output.c (output_parser): Use it.
20207
5141b016
AD
202082001-03-16 Akim Demaille <akim@epita.fr>
20209
20210 * m4/strerror_r.m4: New.
20211 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20212 * lib/error.h, lib/error.c: Update.
20213
447992b9
AD
202142001-03-16 Akim Demaille <akim@epita.fr>
20215
20216 * src/getargs.c (longopts): Clean up.
20217
274d42ce
AD
202182001-02-21 Akim Demaille <akim@epita.fr>
20219
20220 * src/reader.c (gensym): `gensym_count' is your own.
20221 Use a static buf to create the symbol name, as token_buffer is no
20222 longer a buffer.
20223
22c821f3
AD
202242001-02-08 Akim Demaille <akim@epita.fr>
20225
20226 * src/conflicts.c (conflict_report): Be sure not to append to res
20227 between two calls, which could happen if both first sprintf were
20228 skipped, but not the first cp += strlen.
20229
18569462
AD
202302001-02-08 Akim Demaille <akim@epita.fr>
20231
20232 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20233 New, from fileutils 4.0.37.
20234 * configure.in: Require Autoconf 2.49c. I took some time before
20235 making this decision. This is the only way out for portability
20236 issues in Bison, it would mean way too much duplicate effort to
20237 import in Bison features implemented in 2.49c since 2.13.
20238 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20239
0d8f3c8a
AD
202402001-02-02 Akim Demaille <akim@epita.fr>
20241
20242 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 20243 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 20244
f17bcd1f
AD
202452001-01-19 Akim Demaille <akim@epita.fr>
20246
20247 Get rid of the ad hoc handling of token_buffer in the scanner: use
20248 the obstacks.
20249
20250 * src/lex.c (token_obstack): New.
20251 (init_lex): Initialize it. No longer call...
20252 (grow_token_buffer): this. Remove it.
20253 Adjust all the places which used it to use the obstack.
20254
511e79b3
AD
202552001-01-19 Akim Demaille <akim@epita.fr>
20256
20257 * src/lex.h: Rename all the tokens:
20258 s/\bENDFILE\b/tok_eof/g;
20259 s/\bIDENTIFIER\b/tok_identifier/g;
20260 etc.
20261 Let them be enums, not #define, to ease debugging.
20262 Adjust all the code.
20263
0d6508ef
AD
202642001-01-18 Akim Demaille <akim@epita.fr>
20265
20266 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20267 * src/lex.c (maxtoken, grow_token_buffer): Static.
20268
6deb4447
AD
202692001-01-18 Akim Demaille <akim@epita.fr>
20270
20271 Since we now use obstacks, more % directives can be enabled.
20272
20273 * src/lex.c (percent_table): Also accept `%yacc',
20274 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20275 `%debug'.
20276 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20277 instead of returning a token.
20278 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20279 * src/reader.c (read_declarations): Adjust.
20280 * src/files.c (open_files): Don't call `compute_base_names', don't
20281 compute `attrsfile' since they depend upon data which might be
20282 *in* the input file now.
20283 (output_files): Do it here.
20284 * src/output.c (output_headers): Document the fact that this patch
20285 introduces a guaranteed SEGV for semantic parsers.
20286 * doc/bison.texinfo: Document them.
20287 * tests/suite.at: Exercise these %options.
20288
ff4423cc
AD
202892000-12-20 Akim Demaille <akim@epita.fr>
20290
20291 Also handle the output file (--verbose) with obstacks.
20292
20293 * files.c (foutput): Remove.
20294 (output_obstack): New.
20295 Adjust all dependencies.
20296 * src/conflicts.c: Return a string.
20297 * src/system.h (obstack_grow_string): Rename as...
20298 (obstack_sgrow): this. Be ready to work with non literals.
20299 (obstack_fgrow4): New.
20300
956dba3a
AD
203012000-12-20 Akim Demaille <akim@epita.fr>
20302
20303 * src/files.c (open_files): Fix the computation of short_base_name
20304 in the case of `-o foo.tab.c'.
20305
337bab46
AD
203062000-12-20 Akim Demaille <akim@epita.fr>
20307
20308 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20309 (copy_dollar): Now that everything uses obstacks, get rid of the
20310 FILE * parameters.
20311
5d3214b8
AD
203122000-12-20 Akim Demaille <akim@epita.fr>
20313
20314 * src/files.c (open_files): Actually the `.output' file is based
20315 on the short_base_name, not base_name.
20316 * tests/suite.at (Checking output file names): Adjust.
20317
29092a57
AD
203182000-12-20 Akim Demaille <akim@epita.fr>
20319
20320 * src/bison.s1: Remove, we now use directly...
20321 * src/bison.simple: this.
20322 * src/Makefile.am: Use pkgdata instead of data.
20323
ea5607fd
AD
203242000-12-20 Akim Demaille <akim@epita.fr>
20325
20326 * src/files.c (guard_obstack): New.
20327 (open_files): Initialize it.
20328 (output_files): Dump it...
20329 * src/files.h: Export it.
20330 * src/reader.c (copy_guard): Use it.
20331
27110317
AD
203322000-12-19 Akim Demaille <akim@epita.fr>
20333
20334 * src/files.c (outfile, defsfile, actfile): Removed as global
20335 vars.
20336 (open_files): Don't compute them.
20337 (output_files): Adjust.
20338 (base_name, short_base_name): Be global.
20339 Adjust dependencies.
20340
19c50364
AD
203412000-12-19 Akim Demaille <akim@epita.fr>
20342
20343 * src/files.c (strsuffix): New.
20344 (stringappend): Be just like strcat but allocate.
20345 (base_names): Eve out from open_files.
20346 Try to simplify the rather hairy computation of base_name and
20347 short_base_name.
20348 (open_files): Use it.
20349 * tests/suite.at (Checking output file names): New test.
20350
573c1d9f
AD
203512000-12-19 Akim Demaille <akim@epita.fr>
20352
20353 * src/system.h (obstack_grow_literal_string): Rename as...
20354 (obstack_grow_string): this.
20355 * src/output.c (output_parser): Recognize `%% actions' instead of
20356 `$'.
20357 * src/bison.s1: s/$/%% actions/.
20358 * src/bison.hairy: Likewise.
20359
ef7ddedd
AD
203602000-12-19 Akim Demaille <akim@epita.fr>
20361
20362 * src/output.c (output_parser): Compute the `#line' lines when
20363 there are.
20364 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20365 Suggested by Hans Aberg.
20366
ff61dabd
AD
203672000-12-19 Akim Demaille <akim@epita.fr>
20368
20369 Let the handling of the skeleton files be local to the procedures
20370 that use it.
20371
20372 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20373 longer static.
20374 (fparser, open_extra_files): Remove.
20375 (open_files, output_files): Don't take care of fparser.
20376 * src/files.h: Adjust.
20377 * src/output.c (output_parser): Open and close the file to the
20378 skeleton.
20379 * src/reader.c (read_declarations): When %semantic_parser, open
20380 fguard.
20381
55b96341
AD
203822000-12-19 Akim Demaille <akim@epita.fr>
20383
20384 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20385 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20386
358c15b7
AD
203872000-12-19 Akim Demaille <akim@epita.fr>
20388
20389 * src/files.c (open_files): Yipee! We no longer need all the code
20390 looking for `/tmp' since we have no tmp file.
20391
7de3329e
AD
203922000-12-19 Akim Demaille <akim@epita.fr>
20393
20394 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20395 New macros.
20396 * src/files.c (open_files): Less dependency on MSDOS etc.
20397
3abcd459
AD
203982000-12-14 Akim Demaille <akim@epita.fr>
20399
20400 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20401 Provide a default definition.
20402 Use it when executing the default @ action.
20403 * src/reader.c (reader_output_yylsp): No longer include
20404 `timestamp' and `text' in the default YYLTYPE.
20405
2a91a95e
AD
204062000-12-12 Akim Demaille <akim@epita.fr>
20407
20408 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20409 (copy_guard): Quote the file names.
20410 Reported by Laurent Mascherpa.
20411
14d3eb9b
AD
204122000-12-12 Akim Demaille <akim@epita.fr>
20413
20414 * src/output.c (output_headers, output_program, output): Be sure
20415 to escape special characters when outputting filenames.
20416 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20417 (output_headers): Don't depend on them, Use ACTSTR.
20418
d7045ec6
AD
204192000-11-17 Akim Demaille <akim@epita.fr>
20420
20421 * lib/obstack.h: Formatting changes.
20422 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20423 prevents type checking.
20424 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20425 cast the value to (void *): assigning a `foo *' to a `void *'
20426 variable is valid.
20427 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20428 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20429 append characters.
20430
6fd54b73
AD
204312000-11-17 Akim Demaille <akim@epita.fr>
20432
20433 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20434 as...
20435 (suite.m4, regression.m4, calc.m4): these.
20436 * tests/atgeneral.m4: Update from CVS Autoconf.
20437
4c50eae6
AD
204382000-11-17 Akim Demaille <akim@epita.fr>
20439
20440 * tests/regression.m4 (%union and --defines): New test,
20441 demonstrating a current bug in the obstack implementation.
20442
a35f64ea
AD
204432000-11-17 Akim Demaille <akim@epita.fr>
20444
20445 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20446 macros.
20447 Use them to declare the variables which are global or local to
20448 `yyparse'.
20449
7de23534
AD
204502000-11-17 Akim Demaille <akim@epita.fr>
20451
20452 * acconfig.h: Remove, no longer used.
20453
aa7815f5
AD
204542000-11-07 Akim Demaille <akim@epita.fr>
20455
20456 * src: s/Copyright (C)/Copyright/g.
20457
5af1f549
AD
204582000-11-07 Akim Demaille <akim@epita.fr>
20459
20460 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20461 defining.
20462 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20463
553e2b22
AD
204642000-11-07 Akim Demaille <akim@epita.fr>
20465
20466 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20467 Merge in a single CPP if/else.
20468
8a4f41d6
AD
204692000-11-07 Akim Demaille <akim@epita.fr>
20470
20471 * src/output.c (output): Remove useless variables.
20472 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20473 argument `data' for consistency with the prototypes.
20474 Qualify it `const'.
20475 (obstack_copy, obstack_copy0): Rename the second argument as
20476 `address' for consistency. Qualify it `const'.
20477 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20478 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20479 `const' their input argument (`data' or `address').
20480 Adjust the corresponding macros to include `const' in casts.
20481
095a3fb5
AD
204822000-11-03 Akim Demaille <akim@epita.fr>
20483
20484 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20485 s/PFILE1/BISON_HAIRY/.
20486 Adjust dependencies.
20487
d1cdce7c
AD
204882000-11-03 Akim Demaille <akim@epita.fr>
20489
090c5ebf 20490 For some reason, this was not applied.
d1cdce7c
AD
20491
20492 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20493 `unlink': it's no longer used.
20494
9311529b
AD
204952000-11-03 Akim Demaille <akim@epita.fr>
20496
20497 * src/files.c (skeleton_find): New function, eved out of...
20498 (open_files, open_extra_files): here.
20499
d8880f69
AD
205002000-11-03 Akim Demaille <akim@epita.fr>
20501
20502 Don't use `atexit'.
20503
20504 * src/files.c (obstack_save): New function.
20505 (done): Rename as...
20506 (output_files): this.
20507 Use `obstack_save'.
20508 * src/main.c (main): Don't use `atexit' to register `done', since
20509 it no longer has to remove tmp files, just call `output_files'
20510 when there are no errors.
20511
0dbb648e
AD
205122000-11-02 Akim Demaille <akim@epita.fr>
20513
20514 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20515 `unlink': it's no longer used.
20516 * src/files.h: Formatting changes.
20517
896fe5c1
AD
205182000-11-02 Akim Demaille <akim@epita.fr>
20519
20520 Remove the last uses of mktemp and unlink/delete.
20521
20522 * src/files.c (fdefines, ftable): Removed.
20523 (defines_ostack, table_obstack): New.
20524 Adjust dependencies of the former into uses of the latter.
20525 * src/output.c (output_short_or_char_table, output_short_table):
20526 Convert to using obstacks.
20527 * src/reader.c (copy_comment2): Accept one FILE * and two
20528 obstacks.
20529 (output_token_defines, reader_output_yylsp): Use obstacks.
20530 * src/system.h (obstack_fgrow3): New.
1f65350a 20531 * po/POTFILES.in: Adjust.
896fe5c1 20532
dd60faec
AD
205332000-11-01 Akim Demaille <akim@epita.fr>
20534
20535 Change each use of `fattrs' into a use of `attrs_obstack'.
20536
20537 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20538 * src/files.c (fattrs): Remove.
20539 (attrs_obstack): New.
20540 Adjust all dependencies.
20541 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20542
8c7ebe49
AD
205432000-11-01 Akim Demaille <akim@epita.fr>
20544
20545 Introduce obstacks.
20546 Change each use of `faction' into a use of `action_obstack'.
20547
20548 * lib/obstack.h, lib/obstack.c: New files.
20549 * src/files.c (faction): Remove.
20550 (action_obstack): New.
20551 Adjust all dependencies.
20552
77aee789
AD
205532000-10-20 Akim Demaille <akim@epita.fr>
20554
20555 * lib/quote.h (PARAMS): New macro. Use it.
20556
43591cec
AD
205572000-10-16 Akim Demaille <akim@epita.fr>
20558
20559 * src/output.c (output_short_or_char_table): New function.
20560 (output_short_table, output_token_translations): Use it.
20561 (goto_actions): Use output_short_table.
20562
1e9798d5
AD
205632000-10-16 Akim Demaille <akim@epita.fr>
20564
20565 * src/symtab.c (bucket_new): New function.
20566 (getsym): Use it.
20567
20568 * src/output.c (output_short_table): New argument to display the
20569 comment associated with the table.
20570 Adjust dependencies.
20571 (output_gram): Use it.
20572 (output_rule_data): Nicer output layout for YYTNAME.
20573
f282676b
AD
205742000-10-16 Akim Demaille <akim@epita.fr>
20575
20576 * src/lex.c (read_typename): New function.
20577 (lex): Use it.
20578 * src/reader.c (copy_dollar): Likewise.
20579
550a72a3
AD
205802000-10-16 Akim Demaille <akim@epita.fr>
20581
20582 * src/reader.c (copy_comment2): Expect the input stream to be on
20583 the `/' which is suspected to open a comment, instead of being
20584 called after `//' or `/*' was read.
20585 (copy_comment, copy_definition, parse_union_decl, copy_action)
20586 (copy_guard): Adjust.
20587
131e2fef
AD
205882000-10-16 Akim Demaille <akim@epita.fr>
20589
20590 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20591 `read_signed_integer'.
20592
79282c5a
AD
205932000-10-16 Akim Demaille <akim@epita.fr>
20594
20595 * src/reader.c (copy_dollar): New function.
20596 (copy_guard, copy_action): Use it.
20597
ff4a34be
AD
205982000-10-16 Akim Demaille <akim@epita.fr>
20599
20600 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20601 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20602 New files, from Fileutils 4.0.27.
20603 * src/main.c (printable_version): Remove.
20604 * src/lex.c, src/reader.c: Use `quote'.
20605
206062000-10-04 Akim Demaille <akim@epita.fr>
20607
20608 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20609
14ded682
AD
206102000-10-04 Akim Demaille <akim@epita.fr>
20611
20612 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20613
8e03724b
AD
206142000-10-04 Akim Demaille <akim@epita.fr>
20615
20616 When a literal string is used to define two different tokens,
20617 `bison -v' segfaults.
20618 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20619
20620 * tests/regression.m4: New file.
20621 Include the core of the sample provided by Piotr Gackiewicz.
20622 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20623 properly.
20624
a9e64249
AD
206252000-10-04 Akim Demaille <akim@epita.fr>
20626
20627 * src/reader.c (parse_expect_decl): Keep `count' within the size
20628 of `buffer'.
20629 From Neil Booth.
20630
da9abf43
AD
206312000-10-02 Paul Eggert <eggert@twinsun.com>
20632
20633 * bison.s1 (yyparse): Assign the default value
20634 unconditionally, to avoid a GCC warning and make the parser a
20635 tad smaller.
20636
c33638bb
AD
206372000-10-02 Akim Demaille <akim@epita.fr>
20638
20639 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20640 options.
20641
444c570a
AD
206422000-10-02 Akim Demaille <akim@epita.fr>
20643
20644 * src/derives.c, src/print.c, src/reduce.c: To ease the
20645 translation, move some `\n' out of the translated strings.
20646
89cab50d
AD
206472000-10-02 Akim Demaille <akim@epita.fr>
20648
20649 The location tracking mechanism is precious for parse error
20650 messages. Nevertheless, it is enabled only when `@n' is used in
20651 the grammar, which is a different issue (you can use it in error
20652 message, but not in the grammar per se). Therefore, there should
20653 be another means to enable it.
20654
20655 * src/getargs.c (getargs): Support `--locations'.
20656 (usage): Report it.
20657 * src/getargs.h (locationsflag): Export it.
20658 * src/lex.c (percent_table): Support `%locations'.
20659 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20660 with `locationsflag'.
20661 * doc/bison.texinfo: Document `--locations' and `%locations'.
20662 Sort the options.
20663 * tests/calc.m4: Test it.
20664
20665 For regularity of the names, replace each
20666 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20667 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20668 In addition replace each `flag' with `_flag'.
20669
d6c2cba0
AD
206702000-10-02 Akim Demaille <akim@epita.fr>
20671
20672 Also test parse error messages, including with YYERROR_VERBOSE.
20673
20674 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20675 associative).
20676 Use it to check the computations.
20677 Use it to check `nonassoc' is honored.
20678 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20679 `--yyerror-verbose'.
20680 (_AT_CHECK_CALC): Adjust to this option.
20681 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20682
5a35a6cb
AD
206832000-10-02 Akim Demaille <akim@epita.fr>
20684
20685 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20686 the latter demonstrates a flaw in the handling of non debugging
20687 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20688 was used in order to simplify:
20689
20690 #if YYDEBUG
20691 if (yydebug)
20692 {
20693 ...
20694 }
20695 #endif
20696
20697 into
20698
20699 if (yydebug)
20700 {
20701 ...
20702 }
20703
20704 unfortunately this leads to a CPP conflict when
20705 `--name-prefix=foo' is used since it produces `#define yydebug
20706 foodebug'.
20707
20708 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20709 (YYDPRINTF): New macro.
20710 Spread its use.
20711 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20712 the bison options.
20713 Also test `--verbose', `--defines' and `--name-prefix'.
20714
71da9eea
AD
207152000-10-02 Akim Demaille <akim@epita.fr>
20716
20717 Improve the readability of the produced parsers.
20718
20719 * src/bison.s1: Formatting changes.
20720 Improve the comment related to the `$' mark.
20721 (yydefault): Don't fall through to `yyresume': `goto' there.
20722 * src/output.c (output_parser): When the `$' is met, skip the end
20723 of its line.
20724 New variable, `number_of_dollar_signs', to check there's exactly
20725 one `$' in the parser skeleton.
20726
95e36146
AD
207272000-10-02 Akim Demaille <akim@epita.fr>
20728
20729 * lib/xstrdup.c: New file, from the fileutils.
20730 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20731 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20732 instead of strlen + xmalloc + strcpy.
20733 * src/symtab.c (copys): Remove, use xstrdup instead.
20734
d7020c20
AD
207352000-10-02 Akim Demaille <akim@epita.fr>
20736
20737 * src/gram.h (associativity): New enum type which replaces the
20738 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20739 `right_assoc', `left_assoc' and `non_assoc'.
20740 Adjust all dependencies.
20741 * src/reader.c: Formatting changes.
20742 (LTYPESTR): Don't define it, use it as a literal in
20743 `reader_output_yylsp'.
20744 * src/symtab.h (symbol_class): New enum type which replaces the
20745 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20746 `sunknown', `stoken and `snterm'.
20747
1916f98e
AD
207482000-10-02 Akim Demaille <akim@epita.fr>
20749
20750 * src/getargs.c (fixed_outfiles): Rename as...
20751 (yaccflag): for consistency and accuracy.
20752 Adjust dependencies.
20753
d7913476
AD
207542000-10-02 Akim Demaille <akim@epita.fr>
20755
20756 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20757 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20758 difficult and introduced a lot of core dump. It turns out that
20759 Bison used an implementation of `xmalloc' based on `calloc', and
20760 at various places it does depend upon the initialization to 0. I
20761 have not tried to isolate the pertinent places, and all the former
20762 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20763 someone should address this issue.
20764
20765 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20766 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20767 files.
20768 Adjust dependencies.
20769 * src/warshall.h: New file.
20770 Propagate.
20771
340ef489
AD
207722000-10-02 Akim Demaille <akim@epita.fr>
20773
20774 Various anti-`extern in *.c' changes.
20775
20776 * src/system.h: Include `assert.h'.
20777
b2ca4022
AD
207782000-10-02 Akim Demaille <akim@epita.fr>
20779
20780 * src/state.h (nstates, final_state, first_state, first_shift)
20781 (first_reduction): Move their exportation from here...
20782 * src/LR0.h: to here.
20783 Adjust dependencies.
20784 * src/getargs.c (statisticsflag): New variable.
20785 Add support for `--statistics'.
20786 Adjust dependencies.
20787
20788 Remove a lot of now useless `extern' statements in most files.
20789
403b315b
AD
207902000-10-02 Akim Demaille <akim@epita.fr>
20791
20792 * src/LR0.h: New file.
20793 Propagate its use.
20794
07a58c13
AD
207952000-10-02 Akim Demaille <akim@epita.fr>
20796
20797 * src/print.h: New file.
20798 Propagate its use.
20799 * src/print.c: Formatting and ordering changes.
20800 (verbose, terse): Replace with...
20801 (print_results): this new function.
20802 Adjust dependencies.
20803
0619caf0
AD
208042000-10-02 Akim Demaille <akim@epita.fr>
20805
20806 * src/conflicts.c (conflict_report): New function.
20807 (conflict_log, verbose_conflict_log): Replace with...
20808 (print_conflicts): this function.
20809 Adjust dependencies.
20810 * src/conflicts.h: New file.
20811 Propagate its inclusion.
20812
3519ec76
AD
208132000-10-02 Akim Demaille <akim@epita.fr>
20814
20815 * src/nullable.h: New file.
20816 Propagate its inclusion.
20817 * src/nullable.c: Formatting changes.
20818
015acc48
AD
208192000-10-02 Akim Demaille <akim@epita.fr>
20820
20821 * src/reduce.h: New file.
20822 Propagate its inclusion.
20823 * src/reduce.c: Topological sort and other formatting changes.
20824 (bool, TRUE, FALSE): Move their definition to...
20825 * src/system.h: here.
20826
8963a27b
AD
208272000-10-02 Akim Demaille <akim@epita.fr>
20828
20829 * src/files.c: Formatting changes.
20830 (tryopen, tryclose, openfiles): Rename as...
20831 (xfopen, xfclose, open_files): this.
20832 (stringappend): static.
20833 * src/files.h: Complete the list of exported symbols.
20834 Propagate its use.
20835
a70083a3
AD
208362000-10-02 Akim Demaille <akim@epita.fr>
20837
20838 * src/reader.h: New file.
20839 Propagate its use instead of tedious list of `extern' and
20840 prototypes.
20841 * src/reader.c: Formatting changes, topological sort,
20842 s/register//.
20843
abadc117
AD
208442000-10-02 Akim Demaille <akim@epita.fr>
20845
20846 * src/lex.h: Prototype `lex.c' exported functions.
20847 * src/reader.c: Adjust.
20848 * src/lex.c: Formatting changes.
20849 (safegetc): Rename as...
20850 (xgetc): this.
20851
720d742f
AD
208522000-10-02 Akim Demaille <akim@epita.fr>
20853
20854 * src/lalr.h: New file.
20855 Propagate its inclusion instead of prototypes and `extern'.
20856 * src/lalr.c: Formatting changes, topological sorting etc.
20857
f2acea59
AD
208582000-10-02 Akim Demaille <akim@epita.fr>
20859
20860 * src/output.c (token_actions): Introduce a temporary array,
20861 YYDEFACT, that makes it possible for this function to use
20862 output_short_table.
20863
d019d655
AD
208642000-10-02 Akim Demaille <akim@epita.fr>
20865
20866 `user_toknums' is output as a `short[]' in `output.c', while it is
20867 defined as a `int[]' in `reader.c'. For consistency with the
20868 other output tables, `user_toknums' is now defined as a table of
20869 shorts.
20870
20871 * src/reader.c (user_toknums): Be a short table instead of an int
20872 table.
20873 Adjust dependencies.
20874
20875 Factor the short table outputs.
20876
20877 * src/output.c (output_short_table): New function.
20878 * src/output.c (output_gram, output_stos, output_rule_data)
20879 (output_base, output_table, output_check): Use it.
20880
6c89f1c1
AD
208812000-10-02 Akim Demaille <akim@epita.fr>
20882
20883 * src/output.c (output): Topological sort of the functions, in
20884 order to get rid of the `static' prototypes.
20885 No longer use `register'.
20886 * src/output.h: New file.
20887 Propagate its inclusion in files explicitly prototyping functions
20888 from output.c.
20889
d9efd181
AD
208902000-09-21 Akim Demaille <akim@epita.fr>
20891
20892 * src/atgeneral.m4: Update from Autoconf.
20893
c29240e7 208942000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
20895
20896 * src/closure.h: New file.
20897 * src/closure.c: Formatting changes, topological sort over the
20898 functions, use of closure.h.
20899 (initialize_closure, finalize_closure): Rename as...
20900 (new_closure, free_closure): these. Adjust dependencies.
20901 * src/LR0.c: Formatting changes, topological sort, use of
20902 cloture.h.
20903 (initialize_states): Rename as...
20904 (new_states): this.
20905 * src/Makefile.am (noinst_HEADERS): Adjust.
20906
499daa50
AD
209072000-09-20 Akim Demaille <akim@epita.fr>
20908
20909 * src/acconfig.h: Don't protect config.h against multiple
20910 inclusion.
20911 Don't define PARAMS.
20912 * src/system.h: Define PARAMS.
20913 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20914 purpose of config.h. system.h must not try to fix wrong
20915 definitions in config.h.
20916
cc84fd5d
AD
209172000-09-20 Akim Demaille <akim@epita.fr>
20918
20919 * src/derives.h: New file.
20920 * src/main.c, src/derives.h: Use it.
20921 Formatting changes.
20922 * src/Makefile.am (noinst_HEADERS): Adjust.
20923
db5b3a89
AD
209242000-09-20 Akim Demaille <akim@epita.fr>
20925
20926 * tests/atgeneral.m4: Update from Autoconf.
20927 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20928 (AT_CHECK_CALC): New macros.
20929 Use these macros to test bison with options `', `--raw',
20930 `--debug', `--yacc', `--yacc --debug'.
20931
ceed8467
AD
209322000-09-19 Akim Demaille <akim@epita.fr>
20933
20934 * src/output.c: Formatting changes.
20935 * src/machine.h: Remove, leaving its contents in...
20936 * src/system.h: here.
20937 Include stdio.h.
20938 Adjust all dependencies on stdio.h and machine.h.
20939 * src/getargs.h: New file.
20940 Let all `extern' declarations about getargs.c be replaced with
20941 inclusion of `getargs.h'.
20942 * src/Makefile.am (noinst_HEADERS): Adjust.
20943
20944 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20945 scope.
20946 (yyerror): Returns void, not int.
20947 * doc/bison.texinfo: Formatting changes.
20948
05a1d24b
AD
209492000-09-19 Akim Demaille <akim@epita.fr>
20950
20951 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20952 portable.
20953
cbd25751
AD
209542000-09-18 Akim Demaille <akim@epita.fr>
20955
20956 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20957 * src/Makefile.am (INCLUDES): Don't.
20958 Be ready to fetch headers in lib/.
20959
13863333
AD
209602000-09-18 Akim Demaille <akim@epita.fr>
20961
20962 * doc/bison.texinfo: Update the copyright.
20963 ANSIfy and GNUify the examples.
20964 Remove the old menu.
20965
0d533154
AD
209662000-09-18 Akim Demaille <akim@epita.fr>
20967
20968 First set of tests: use the `calc' example from the documentation.
20969
20970 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20971 is defined only when YYDEBUG is.
20972 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20973 * src/files.c (tryopen, tryclose): Formatting changes.
20974 Move to the top and be static.
20975 * src/reader.c (read_signed_integer): Likewise.
20976 * tests/calc.m4: New file.
20977 * Makefile.am, suite.m4: Adjust.
20978 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20979
e79137ac
AD
209802000-09-18 Akim Demaille <akim@epita.fr>
20981
20982 Add support for an Autotest test suite for Bison.
20983
20984 * m4/m4.m4, m4/atconfig.m4: New files.
20985 * m4/Makefile.am (EXTRA_DIST): Adjust.
20986 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
20987 files.
20988 * src/getargs.c: Display a more standard --version message.
20989 * src/reader.c (reader): Formatting changes.
20990 No longer depend upon VERSION_STRING.
20991 * configure.in: No longer use `dnl'.
20992 Set up the test suite and the new directory `tests/.
20993 (VERSION_STRING): Remove.
20994
27821bff
AD
209952000-04-14 Akim Demaille <akim@epita.fr>
20996
20997 * src/reader.c (copy_comment2): New function, same as former
20998 `copy_comment', but outputs into two FILE *.
20999 (copy_comment): Use it.
21000 (parse_union_decl): Use it.
21001 (get_type, parse_start_decl): Use the same `invalid' message.
21002 (parse_start_decl, parse_union_decl): Use the same `multiple'
21003 message.
21004 (parse_union_decl, copy_guard, copy_action): Use the same
21005 `unmatched' message.
21006 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21007
cfe5fbc0
AD
210082000-03-31 Akim Demaille <akim@epita.fr>
21009
21010 * src/files.c (tryopen, tryclose): Move to the top.
21011 Be static.
21012
cb7db13e
AD
210132000-03-31 Akim Demaille <akim@epita.fr>
21014
21015 * src/main.c (main): Don't call `done', exit does it.
21016
a0f6b076
AD
210172000-03-31 Akim Demaille <akim@epita.fr>
21018
36281465
AD
21019 * allocate.c: s/return (foo)/return foo/.
21020 * lalr.c: Likewise.
21021 * LR0.c: Likewise.
21022 * output.c: Likewise.
21023 * reader.c: Likewise.
21024 * symtab.c: Likewise.
21025 * vmsgetargs.c: Likewise.
21026
210272000-03-31 Akim Demaille <akim@epita.fr>
21028
21029 Clean up the error reporting functions.
a0f6b076
AD
21030
21031 * src/report.c: New file.
21032 * src/report.h: Likewise.
21033 * src/Makefile.am: Adjust.
21034 * m4/error.m4: New file.
21035 * m4/Makefile.am: Adjust.
21036 * configure.in (jm_PREREQ_ERROR): Call it.
21037 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21038 Remove.
21039 (fatal, fatals): Remove. All callers use complain.c::fatal.
21040 (warn, warni, warns, warnss, warnss): Remove. All callers use
21041 complain.c::complain.
21042 (toomany): Remove, use fatal instead.
21043 * src/files.c (done): No argument, use complain_message_count.
21044 * src/main.c (main): Register `done' to `atexit'.
21045
21046 * src/getargs.c (usage): More `fputs', less `fprintf'.
21047
18539825
AD
210482000-03-28 Akim Demaille <akim@epita.fr>
21049
21050 * lib/: New directory.
21051 * Makefile.am (SUBDIRS): Adjust.
21052 * configure.in: Adjust.
21053 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21054 useless.
21055 * src/alloca.c: Moved to lib/.
21056 * src/getopt.c: Likewise.
21057 * src/getopt1.c: Likewise.
21058 * src/getopt.h: Likewise.
21059 * src/ansi2knr.c: Likewise.
21060 * src/ansi2knr.1: Likewise.
21061 * src/Makefile.am: Adjust.
21062 * lib/Makefile.am: New file.
21063
9f306f2a
AD
210642000-03-28 Akim Demaille <akim@epita.fr>
21065
21066 * src/getargs.c (usage): Refresh the help message.
21067
0ba347b6
AD
210682000-03-17 Akim Demaille <akim@epita.fr>
21069
21070 * src/getopt1.c: Updated from textutils 2.0e
21071 * src/getopt.c: Likewise.
21072 * src/getopt.h: Likewise.
21073
dbe7f271
AD
210742000-03-17 Akim Demaille <akim@epita.fr>
21075
21076 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21077 the file name, not the whole `#line LINE FILE'.
21078
75bbe78d
AD
210792000-03-17 Akim Demaille <akim@epita.fr>
21080
21081 On syntax errors, report the token on which we choked.
21082
aa5fd0ee
AD
21083 * src/bison.s1 (yyparse): In the label yyerrlab, when
21084 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 21085
7b306f52
AD
210862000-03-17 Akim Demaille <akim@epita.fr>
21087
aa5fd0ee 21088 * src/reader.c (copy_at): New function.
7b306f52
AD
21089 (copy_guard): Use it.
21090 (copy_action): Use it.
21091
e87b5700
AD
210922000-03-17 Akim Demaille <akim@epita.fr>
21093
21094 Be kind to translators, save some useless translations.
21095
aa5fd0ee 21096 * src/main.c (banner): New function.
e87b5700
AD
21097 (fatal_banner): Use it.
21098 (warn_banner): Use it.
21099
ae3c3164
AD
211002000-03-17 Akim Demaille <akim@epita.fr>
21101
aa5fd0ee
AD
21102 * src/reader.c (copy_definition): Use copy_string and
21103 copy_comment. Removed now unused `match', `ended',
21104 `cplus_comment'.
ae3c3164
AD
21105 (copy_comment, copy_string): Moved, to be visible from
21106 copy_definition.
21107
4dc58e7c
AD
211082000-03-17 Akim Demaille <akim@epita.fr>
21109
aa5fd0ee
AD
21110 * src/reader.c (copy_string): Declare `static inline'. No
21111 problems with inline, since it is checked by configure.
4dc58e7c
AD
21112 (copy_comment): Likewise.
21113
0a6384c4
AD
211142000-03-17 Akim Demaille <akim@epita.fr>
21115
aa5fd0ee 21116 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 21117
3cef001a
AD
211182000-03-17 Akim Demaille <akim@epita.fr>
21119
aa5fd0ee 21120 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
21121 (copy_action): Use it. Removed now unused `match', `ended',
21122 `cplus_comment'.
21123 (copy_guard): Likewise.
21124
ca36d2ef
AD
211252000-03-17 Akim Demaille <akim@epita.fr>
21126
aa5fd0ee 21127 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
21128 (copy_action): Use it.
21129 (copy_guard): Likewise.
21130
6666f98f
AD
211312000-03-17 Akim Demaille <akim@epita.fr>
21132
21133 Change the handling of @s so that they behave exactly like $s.
21134 There is now a pseudo variable @$ (readble and writable), location
21135 of the lhs of the rule (by default ranging from the location of
21136 the first symbol of the rhs, to the location of the last symbol,
21137 or, if the rhs is empty, YYLLOC).
21138
21139 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21140 yyval.
21141 (yyparse): When providing a default semantic action, provide a
21142 default location action.
21143 (after the $): No longer change `*YYLSP', just stack YYLOC the
21144 same way you stack YYVAL.
21145 * src/reader.c (read_declarations): Use warns.
21146 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21147 (copy_action, case '@'): Likewise.
21148 Use a standard error message, to save useless work from
21149 translators.
21150
41aca2e0
AD
211512000-03-17 Akim Demaille <akim@epita.fr>
21152
aa5fd0ee
AD
21153 * src/bison.s1: Formatting and cosmetics changes.
21154 * src/reader.c: Likewise.
41aca2e0
AD
21155 Update the Copyright notice.
21156
dc08c1d5
AD
211572000-03-17 Akim Demaille <akim@epita.fr>
21158
aa5fd0ee
AD
21159 * src/bison.s1 (#line): All set to `#line' only, since the
21160 Makefile now handles them.
dc08c1d5 21161
9ee3c97b
AD
211622000-03-16 Akim Demaille <akim@epita.fr>
21163
21164 * src/output.c (output_rule_data): Output the documentation of
21165 some of the tables.
21166 (Copyright notice): Update.
21167 Formatting changes.
21168
0de741ca
AD
211692000-03-16 Akim Demaille <akim@epita.fr>
21170
21171 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21172 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21173 One `#if YYDEBUG' remains, since it uses variables which are
21174 defined only if `YYDEBUG != 0'.
21175
bb10be54
AD
211762000-03-16 Akim Demaille <akim@epita.fr>
21177
21178 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21179 and related variables so that the similarities are highlighted.
21180
b07b484a
AD
211812000-03-16 Akim Demaille <akim@epita.fr>
21182
21183 * src/bison.s1: Properly indent CPP directives.
21184
361f60b3
AD
211852000-03-16 Akim Demaille <akim@epita.fr>
21186
21187 * src/bison.s1: Properly indent the `alloca' CPP section.
21188
8c44d3ec
AD
211892000-03-16 Akim Demaille <akim@epita.fr>
21190
21191 Do not hard code values of directories in `configure.in'.
21192 Update the `configure' tool chain.
21193
21194 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21195 src/makefile.am.
21196 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21197 (AC_OUTPUT): Add m4/Makefile.
21198 Bump to bison 1.28a, 1.29 has never been released.
21199 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21200 handled via src/Makefile.am.
21201 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21202 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21203 autoheader.
21204 * Makefile.am (SUBDIRS): Add m4.
21205 (ACLOCAL_AM_FLAGS): New variable.
21206 (AUTOMAKE_OPTIONS): Add check-news.
21207 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21208 the proper line number and file name.
21209 (DEFS): Propagate the location of bison library files and of the
21210 locale files.
21211 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21212 builddir.
21213 * acinclude.m4: Remove, replaced by the directory m4.
21214 * m4/Makefile.am (EXTRA_DIST): New variable.
21215 * m4/gettext.m4: New file, from the fileutils.
21216 * m4/lcmessage.m4: Likewise
21217 * m4/progtest.m4: Likewise.
21218 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21219
f95997e7
AD
212202000-03-10 Akim Demaille <akim@epita.fr>
21221
21222 * src/closure.c:
21223 Formatting changes of various comments.
21224 Respect the GNU coding standards at various places.
21225 Don't use `_()' when no translation is needed.
21226
212271999-12-13 Jesse Thilo <jthilo@gnu.org>
21228
21229 * src/files.c:
21230 OS/2 honors TMPDIR environment variable.
21231
212321999-12-13 Jesse Thilo <jthilo@gnu.org>
21233
21234 * doc/bison.texinfo: Tweaked spelling and grammar.
21235 Updated ISBN.
21236 Removed reference to price of printed copy.
21237 Mention BISON_SIMPLE and BISON_HAIRY.
21238
212391999-12-13 Jesse Thilo <jthilo@gnu.org>
21240
21241 * configure.in, NEWS:
21242 Bison 1.29 released.
21243
212441999-10-27 Jesse Thilo <jthilo@gnu.org>
21245
21246 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21247 Added reference card.
21248
212491999-07-26 Jesse Thilo <jthilo@gnu.org>
21250
21251 * po/ru.po: Added Russian translation.
21252
212531999-07-26 Jesse Thilo <jthilo@gnu.org>
21254
21255 * configure.in: Added Russian translation.
21256
212571999-07-06 Jesse Thilo <jthilo@gnu.org>
21258
21259 * configure.in, NEWS, README:
21260 Released version 1.28.
21261
212621999-06-14 Jesse Thilo <jthilo@gnu.org>
21263
21264 * src/system.h:
21265 Squashed redefinition warning on some systems.
21266
21267 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21268 Have configure build version string instead of relying on ANSI string
21269 concatentation.
21270
212711999-06-14 Jesse Thilo <jthilo@gnu.org>
21272
21273 * po/POTFILES.in: Got rid of version.c.
21274
212751999-06-14 Jesse Thilo <jthilo@gnu.org>
21276
21277 * acconfig.h, configure.in:
21278 Have configure build version string instead of relying on ANSI string
21279 concatentation.
21280
212811999-06-08 Jesse Thilo <jthilo@gnu.org>
21282
21283 * doc/bison.1:
21284 Dropped mention of `+' for long-named options.
21285
212861999-05-30 Jesse Thilo <jthilo@gnu.org>
21287
21288 * src/files.c: Added <unistd.h> for unlink().
21289
21290 * src/Makefile.am, src/system.h:
21291 I18n fixes.
21292
212931999-05-30 Jesse Thilo <jthilo@gnu.org>
21294
21295 * README: Added a FAQ list.
21296
21297 * configure.in, acconfig.h:
21298 I18n fixes.
21299
213001999-05-30 Jesse Thilo <jthilo@gnu.org>
21301
21302 * doc/FAQ, doc/Makefile.am:
21303 Added a FAQ list.
21304
213051999-05-19 Jesse Thilo <jthilo@gnu.org>
21306
21307 * src/alloc.h, src/symtab.h, src/version.c:
21308 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21309
213101999-04-18 Jesse Thilo <jthilo@gnu.org>
21311
21312 * src/.cvsignore, src/Makefile.am:
21313 Reorganized: sources in `src', documentation in `doc'.
21314
21315 * src/lex.c (literalchar):
21316 fixed the code for escaping double quotes (thanks
21317 Jonathan Czisny.)
21318
213191999-04-18 Jesse Thilo <jthilo@gnu.org>
21320
21321 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21322 Adjusted paths to reflect directory reorganization.
21323
213241999-04-18 Jesse Thilo <jthilo@gnu.org>
21325
21326 * doc/.cvsignore, doc/Makefile.am:
21327 Reorganized: sources in `src', documentation in `doc'.
21328
213291999-04-18 Jesse Thilo <jthilo@gnu.org>
21330
21331 * configure.in:
21332 Updated AC_INIT file to reflect directory reorganization.
21333
21334 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21335 Reorganized: sources in `src', documentation in `doc'.
21336
213371999-04-13 Jesse Thilo <jthilo@gnu.org>
21338
21339 * src/allocate.c:
21340 Don't declare calloc() and realloc() if not necessary.
21341
213421999-04-13 Jesse Thilo <jthilo@gnu.org>
21343
21344 * configure.in, acconfig.h, acinclude.m4:
21345 Don't declare calloc() and realloc() if not necessary.
21346
213471999-03-23 Jesse Thilo <jthilo@gnu.org>
21348
21349 * po/.cvsignore: Added i18n support.
21350
213511999-03-23 Jesse Thilo <jthilo@gnu.org>
21352
21353 * acconfig.h, configure.in, Makefile.am:
21354 Added i18n support.
21355
213561999-03-22 Jesse Thilo <jthilo@gnu.org>
21357
21358 * src/bison.s1: Fixed #line numbers.
21359
213601999-03-15 Jesse Thilo <jthilo@gnu.org>
21361
21362 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21363 Added PO files from Translation Project.
21364
213651999-03-03 Jesse Thilo <jthilo@gnu.org>
21366
21367 * Makefile.am:
21368 Added support for non-ANSI compilers (ansi2knr).
21369
213701999-02-16 Jesse Thilo <jthilo@gnu.org>
21371
21372 * configure.in: Bumped version number to 1.27.
21373
21374 * Makefile.am:
21375 Added `bison.simple' to list of files removed by `make distclean'.
21376
213771999-02-12 Jesse Thilo <jthilo@gnu.org>
21378
21379 * src/files.c, src/files.h:
21380 Defined locations of parser files in config.h instead of Makefile.
21381
213821999-02-12 Jesse Thilo <jthilo@gnu.org>
21383
21384 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21385 Defined locations of parser files in config.h instead of Makefile.
21386
213871999-02-09 Jesse Thilo <jthilo@gnu.org>
21388
21389 * Makefile.am:
21390 Removed inappropriate use of $< macro.
21391
213921999-02-05 Jesse Thilo <jthilo@gnu.org>
21393
21394 * po/Makefile.in.in, po/POTFILES.in:
21395 Add `po' directory skeleton.
21396
213971999-01-27 Jesse Thilo <jthilo@gnu.org>
21398
21399 * README: Document help-bison list.
21400
21401 * configure.in: Add check for mkstemp().
21402
214031999-01-20 Jesse Thilo <jthilo@gnu.org>
21404
21405 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21406 Hush a few compiler warnings.
21407
21408 * src/files.c:
21409 Add tryclose(), which verifies that fclose was successful.
21410 Hush a couple of compiler warnings.
21411
214121999-01-20 Jesse Thilo <jthilo@gnu.org>
21413
21414 * Makefile.am, OChangeLog:
21415 ChangeLog is now automatically generated. Include the old version as
21416 OChangeLog.
21417
214181999-01-14 Jesse Thilo <jthilo@gnu.org>
21419
21420 * 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:
21421 Update FSF address.
21422
214231999-01-14 Jesse Thilo <jthilo@gnu.org>
21424
21425 * doc/bison.texinfo: Fix formatting glitch.
21426
21427 * doc/bison.texinfo: Update FSF address.
21428
214291999-01-14 Jesse Thilo <jthilo@gnu.org>
21430
21431 * acconfig.h: Update FSF address.
21432
214331999-01-08 Jesse Thilo <jthilo@gnu.org>
21434
21435 * src/system.h:
21436 Don't define PACKAGE here, since config.h defines it.
21437
214381998-12-30 Jesse Thilo <jthilo@gnu.org>
21439
21440 * src/reader.c: Update copyright date.
21441
21442 * src/main.c:
21443 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21444 favor of output directly to stderr (avoids buffer overruns).
21445
21446 * src/reader.c: Some checks for premature EOF.
21447
21448 * 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:
21449 Use prototypes if the compiler understands them.
21450
21451 * src/files.c: Honor TMPDIR on Unix hosts.
21452 Use prototypes if the compiler understands them.
21453
21454 * src/reader.c:
21455 Fix a couple of buffer overrun bugs.
21456 Use prototypes if the compiler understands them.
21457
21458 * src/system.h: Include unistd.h and ctype.h.
21459 Use #ifdef instead of #if for NLS symbols.
21460
214611998-12-30 Jesse Thilo <jthilo@gnu.org>
21462
21463 * doc/bison.texinfo:
21464 Delete comment "consider using @set for edition number, etc..." since
21465 we now are doing so.
21466
214671998-12-30 Jesse Thilo <jthilo@gnu.org>
21468
21469 * configure.in:
21470 Use prototypes if the compiler understands them.
21471
21472 * NEWS: Document 1.26 highlights.
21473
21474 * Makefile.am: Require Automake 1.3 or later.
21475
21476 * acconfig.h:
21477 Use prototypes if the compiler understands them.
21478
214791998-12-29 Jesse Thilo <jthilo@gnu.org>
21480
21481 * src/version.c:
21482 Use VERSION symbol from automake for version number.
21483
214841998-12-29 Jesse Thilo <jthilo@gnu.org>
21485
21486 * acconfig.h, configure.in, version.cin:
21487 Use VERSION symbol from automake for version number.
21488
214891998-11-28 Jesse Thilo <jthilo@gnu.org>
21490
21491 * Makefile.am:
21492 Distribute original version of simple parser (bison.s1), not built
21493 version (bison.simple).
21494
214951998-11-28 Jesse Thilo <jthilo@gnu.org>
21496
21497 * doc/bison.texinfo: Add info dir entry.
21498
21499 * doc/bison.texinfo:
21500 Let automake put version number into documentation.
21501
215021998-11-26 Jesse Thilo <jthilo@gnu.org>
21503
21504 * src/bison.cld, src/build.com, src/vmshlp.mar:
21505 Add non-RCS files from /gd/gnu/bison.
21506
215071998-11-26 Jesse Thilo <jthilo@gnu.org>
21508
21509 * doc/bison.1:
21510 Document the BISON_HAIRY and BISON_SIMPLE variables.
21511
215121998-11-25 Jesse Thilo <jthilo@gnu.org>
21513
21514 * src/version.c: Build version.c automatically.
21515
21516 * src/reader.c:
21517 Fix token numbering (used to start at 258, not 257).
21518
21519 * src/system.h: Include config.h.
21520
21521 * src/getargs.c: Update bug report address.
21522
21523 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21524 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21525
215261998-11-25 Jesse Thilo <jthilo@gnu.org>
21527
21528 * Makefile.am:
21529 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21530
21531 * configure.in, version.cin:
21532 Build version.c automatically.
21533
21534 * AUTHORS: Add AUTHORS file.
21535
21536 * README: Update bug report address.
21537
21538 * bison.simple:
21539 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21540
21541 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21542 Add automake stuff.
21543
215441998-11-25 Jesse Thilo <jthilo@gnu.org>
21545
21546 * doc/bison.texinfo: Clean up some formatting.
21547
215481998-05-05 Richard Stallman <rms@gnu.org>
21549
21550 * doc/bison.texinfo:
21551 Explain better why to make a pure parser.
21552
215531998-01-05 Richard Stallman <rms@gnu.org>
21554
21555 * src/files.c (openfiles):
21556 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21557 find a temporary directory, if possible. Do not unlink files while
21558 they are open.
21559
215601997-08-25 Richard Stallman <rms@gnu.org>
21561
21562 * src/reader.c (stack_offset;):
21563 Change some warni to warns.
21564
21565 * src/lex.c (literalchar): Use warns, not warni.
21566
215671997-06-28 Richard Stallman <rms@gnu.org>
21568
21569 * src/bison.s1: Add a Bison version comment.
21570
21571 * src/main.c (fatal, warn, berror):
21572 Use program_name.
21573
215741997-06-28 Richard Stallman <rms@gnu.org>
21575
21576 * Makefile.in (bison_version): New variable.
21577 (dist): Use that variable.
21578 (bison.s1): Substitute the Bison version into bison.simple.
21579
21580 * bison.simple: Add a Bison version comment.
21581
215821997-06-18 Richard Stallman <rms@gnu.org>
21583
21584 * src/main.c (fatal, warn, berror):
21585 Make error messages standard.
21586 (toomany): Improve error message text.
21587
21588 * 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:
21589 new.h renamed to alloc.h.
21590
215911997-06-18 Richard Stallman <rms@gnu.org>
21592
21593 * Makefile.in: new.h renamed to alloc.h.
21594
215951997-05-24 Richard Stallman <rms@gnu.org>
21596
21597 * src/lex.c (literalchar):
21598 Fix the code for escaping \, " and '.
21599
21600 (lex): Avoid trouble when there are many chars
21601 to discard in a char literal with just several chars in it.
21602
216031997-05-17 Richard Stallman <rms@gnu.org>
21604
21605 * src/bison.s1:
21606 Use malloc, if using alloca is troublesome.
21607 (YYSTACK_USE_ALLOCA): New flag macro.
21608 Define it for some systems and compilers.
21609 (YYSTACK_ALLOC): New macro.
21610 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21611 If it was malloc'd, free it.
21612
216131997-05-17 Richard Stallman <rms@gnu.org>
21614
21615 * bison.simple:
21616 Use malloc, if using alloca is troublesome.
21617 (YYSTACK_USE_ALLOCA): New flag macro.
21618 Define it for some systems and compilers.
21619 (YYSTACK_ALLOC): New macro.
21620 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21621 If it was malloc'd, free it.
21622
216231997-04-23 Richard Stallman <rms@gnu.org>
21624
21625 * src/bison.s1:
21626 (alloca) [__hpux]: Always define as __builtin_alloca.
21627
216281997-04-23 Richard Stallman <rms@gnu.org>
21629
21630 * bison.simple:
21631 (alloca) [__hpux]: Always define as __builtin_alloca.
21632
216331997-04-22 Richard Stallman <rms@gnu.org>
21634
21635 * src/bison.s1:
21636 [__hpux]: Include alloca.h (right for HPUX 10)
21637 instead of declaring alloca (right for HPUX 9).
21638
21639 * src/bison.s1 (__yy_memcpy):
21640 Declare arg `count' as unsigned int.
21641 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21642
216431997-04-22 Richard Stallman <rms@gnu.org>
21644
21645 * bison.simple:
21646 [__hpux]: Include alloca.h (right for HPUX 10)
21647 instead of declaring alloca (right for HPUX 9).
21648
21649 * bison.simple (__yy_memcpy):
21650 Declare arg `count' as unsigned int.
21651 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21652
216531997-01-03 Richard Stallman <rms@gnu.org>
21654
21655 * src/allocate.c: [__STDC__ or _MSC_VER]:
21656 Declare calloc and realloc to return void *.
21657
216581997-01-02 Richard Stallman <rms@gnu.org>
21659
21660 * src/system.h:
21661 [_MSC_VER]: Include stdlib.h and process.h.
21662 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21663
21664 * src/main.c (main): Return FAILURE as a value.
21665 (printable_version): Declare arg as int, not char.
21666
216671997-01-02 Richard Stallman <rms@gnu.org>
21668
21669 * Makefile.in (dist):
21670 Explicitly check for symlinks, and copy them.
21671
216721996-12-19 Richard Stallman <rms@gnu.org>
21673
21674 * src/files.c:
21675 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21676
216771996-12-18 Paul Eggert <eggert@gnu.org>
21678
21679 * src/bison.s1 (yyparse):
21680 If __GNUC__ and YYPARSE_PARAM are both defined,
21681 declare yyparse to have a void * argument.
21682
216831996-12-18 Paul Eggert <eggert@gnu.org>
21684
21685 * bison.simple (yyparse):
21686 If __GNUC__ and YYPARSE_PARAM are both defined,
21687 declare yyparse to have a void * argument.
21688
216891996-12-17 Richard Stallman <rms@gnu.org>
21690
21691 * src/reduce.c (nbits): Add some casts.
21692
216931996-08-12 Richard Stallman <rms@gnu.org>
21694
21695 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21696
216971996-08-12 Richard Stallman <rms@gnu.org>
21698
21699 * bison.simple: Test _MSDOS as well as _MSDOS_.
21700
217011996-07-31 Richard Stallman <rms@gnu.org>
21702
21703 * src/bison.s1:
21704 [__sun && __i386]: Include alloca.h.
21705
217061996-07-31 Richard Stallman <rms@gnu.org>
21707
21708 * bison.simple:
21709 [__sun && __i386]: Include alloca.h.
21710
217111996-07-30 Richard Stallman <rms@gnu.org>
21712
21713 * src/bison.s1: Comment change.
21714
21715 * src/bison.s1: Test _MSDOS_, not MSDOS.
21716
217171996-07-30 Richard Stallman <rms@gnu.org>
21718
21719 * bison.simple: Comment change.
21720
21721 * bison.simple: Test _MSDOS_, not MSDOS.
21722
217231996-06-01 Richard Stallman <rms@gnu.org>
21724
21725 * 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:
21726 Insert `_' macro around many string constants.
21727
21728 * src/main.c:
21729 Insert `_' macro around many string constants.
21730
21731 (main): Call setlocale, bindtextdomain and textdomain.
21732
21733 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21734 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21735 [ENABLE_NLS]: Include libintl.h.
21736 [ENABLE_NLS] (gettext): Define.
21737 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21738 (N_, PACKAGE, LOCALEDIR): New macros.
21739
217401996-06-01 Richard Stallman <rms@gnu.org>
21741
21742 * POTFILES.in: New file.
21743
21744 * Makefile.in (allocate.o):
21745 Define target explicitly.
21746
21747 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21748 (LDFLAGS): Set to @LDFLAGS@.
21749 (configure): Run autoconf only if preceding `cd' succeeds.
21750 (bison.s1): Redirect output to temporary file then move the
21751 temporary to the target, rather than redirecting directly to bison.s1.
21752 (clean): Remove config.status and config.log.
21753 (distclean): Don't remove config.status here.
21754
217551996-05-12 Richard Stallman <rms@gnu.org>
21756
21757 * src/bison.s1:
21758 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21759
217601996-05-12 Richard Stallman <rms@gnu.org>
21761
21762 * bison.simple:
21763 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21764
217651996-05-11 Richard Stallman <rms@gnu.org>
21766
21767 * src/bison.s1 (__yy_memcpy):
21768 Really reorder the args, as was supposedly done on Feb 14 1995.
21769 (yyparse): Calls changed accordingly.
21770
217711996-05-11 Richard Stallman <rms@gnu.org>
21772
21773 * Makefile.in (dist): Don't use $(srcdir).
21774
21775 * bison.simple (__yy_memcpy):
21776 Really reorder the args, as was supposedly done on Feb 14 1995.
21777 (yyparse): Calls changed accordingly.
21778
217791996-01-27 Richard Stallman <rms@gnu.org>
21780
21781 * src/output.c (output_rule_data):
21782 Test YYERROR_VERBOSE in the conditional
21783 around the definition of ttyname.
21784
217851995-12-29 Richard Stallman <rms@gnu.org>
21786
21787 * src/bison.s1:
21788 Fix line numbers in #line commands.
21789
217901995-12-29 Richard Stallman <rms@gnu.org>
21791
21792 * bison.simple:
21793 Fix line numbers in #line commands.
21794
217951995-12-27 Richard Stallman <rms@gnu.org>
21796
21797 * src/bison.s1 (YYPARSE_PARAM_DECL):
21798 In C++, make it always null.
21799 (YYPARSE_PARAM_ARG): New macro.
21800 (yyparse): Use YYPARSE_PARAM_ARG.
21801
218021995-12-27 Richard Stallman <rms@gnu.org>
21803
21804 * bison.simple (YYPARSE_PARAM_DECL):
21805 In C++, make it always null.
21806 (YYPARSE_PARAM_ARG): New macro.
21807 (yyparse): Use YYPARSE_PARAM_ARG.
21808
218091995-11-29 Richard Stallman <rms@gnu.org>
21810
21811 * doc/bison.texinfo:
21812 Describe literal string tokens, %raw, %no_lines, %token_table.
21813
218141995-11-29 Daniel Hagerty <hag@gnu.org>
21815
21816 * doc/bison.texinfo: Fixed update date
21817
218181995-10-16 Richard Stallman <rms@gnu.org>
21819
21820 * src/version.c: Version 1.25.
21821
218221995-10-16 Richard Stallman <rms@gnu.org>
21823
21824 * NEWS: *** empty log message ***
21825
218261995-10-16 Richard Stallman <rms@gnu.org>
21827
21828 * doc/bison.1, doc/bison.rnh:
21829 Add new options.
21830
218311995-10-15 Richard Stallman <rms@gnu.org>
21832
21833 * src/vmsgetargs.c, src/getargs.c:
21834 Added -n, -k, and -raw switches.
21835 (noparserflag, toknumflag, rawtoknumflag): New variables.
21836
21837 * src/symtab.h (SALIAS):
21838 New #define for adding aliases to %token.
21839 (struct bucket): Added `alias' field.
21840
21841 * src/reduce.c (reduce_grammar):
21842 Revise error message.
21843 (print_notices): Remove final `.' from error message.
21844
21845 * src/reader.c (reader_output_yylsp):
21846 New function.
21847 (readgram): Use `#if 0' around code that accepted %command
21848 inside grammar rules: The documentation doesn't allow it,
21849 and it will fail since the %command processors scan for the next %.
21850 (parse_token_decl): Extended the %token
21851 declaration to allow a multi-character symbol as an alias.
21852 (parse_thong_decl): New function.
21853 (read_declarations): Added %thong declarations.
21854 (read_declarations): Handle NOOP to deal with allowing
21855 % declarations as another means to specify the flags.
21856 (readgram): Allow %prec prior to semantics embedded in a rule.
21857 (skip_to_char, read_declarations, copy_definition)
21858 (parse_token_decl, parse_start_decl, parse_type_decl)
21859 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21860 (get_type_name, copy_guard, copy_action, readgram)
21861 (get_type, packsymbols): Revised most error messages.
21862 Changed `fatal' to `warnxxx' to avoid aborting for error.
21863 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21864 (read_declarations): Improve the error message for
21865 an invalid character. Do not abort.
21866 (read_declarations, copy_guard, copy_action): Use
21867 printable_version to avoid unprintable characters in printed output.
21868 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21869 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21870 Allow the type of a non-terminal can be given
21871 more than once, as long as all specifications give the same type.
21872
21873 * src/output.c:
21874 (output_headers, output_trailers, output, output_gram)
21875 (output_rule_data): Implement noparserflag variable.
21876 Implement toknumflag variable.
21877 (output): Call reader_output_yylsp to output LTYPESTR.
21878
21879 * src/main.c (main):
21880 If reader sees an error, don't process the grammar.
21881 (fatals): Updated to not use VARARGS1.
21882 (printable_version, int_to_string, warn, warni, warns, warnss)
21883 (warnsss): New error reporting functions. Avoid abort for error.
21884
21885 * src/lex.h:
21886 Added THONG and NOOP for alias processing.
21887 Added SETOPT for the new code that allows setting options with %flags.
21888
21889 * src/lex.c:
21890 Include getopt.h. Add some extern decls.
21891 (safegetc): New function to deal with EOF gracefully.
21892 (literalchar); new function to deal with reading \ escapes.
21893 (lex): Use literalchar.
21894 (lex): Implemented "..." tokens.
21895 (literalchar, lex, parse_percent_token): Made tokenbuffer
21896 always contain the token. This includes growing the token
21897 buffer while reading an integer.
21898 (parse_percent_token): Replaced if-else statement with percent_table.
21899 (parse_percent_token): Added % declarations as another
21900 way to specify the flags -n, -l, and -r. Also added hooks for
21901 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21902 major changes to files.c.
21903 (lex) Retain in the incoming stream a character following
21904 an incorrect '/'.
21905 (skip_white_space, lex): Revised most error messages
21906 and changed fatal to warn to avoid aborting.
21907 (percent_table): Added %thong declarations.
21908
21909 * src/gram.h: Comment changes.
21910
21911 * src/files.c (openfiles, open_extra_files, done):
21912 Add faction flag
21913 and actfile file. Handle noparserflag. Both for -n switch.
21914
21915 * src/conflicts.c (resolve_sr_conflict):
21916 Remove use of alloca.
21917
219181995-06-01 Jim Meyering <meyering@gnu.org>
21919
21920 * doc/bison.texinfo: *** empty log message ***
21921
219221995-05-06 Richard Stallman <rms@gnu.org>
21923
21924 * src/bison.s1: Comment change.
21925
219261995-05-06 Richard Stallman <rms@gnu.org>
21927
21928 * bison.simple: Comment change.
21929
219301995-05-03 Richard Stallman <rms@gnu.org>
21931
21932 * src/version.c: Version now 1.24.
21933
21934 * src/bison.s1: Change distribution terms.
21935
21936 * src/version.c: Version now 1.23.
21937
219381995-05-03 Richard Stallman <rms@gnu.org>
21939
21940 * doc/bison.texinfo:
21941 Rewrite "Conditions for Using Bison".
21942 Update version to 1.24.
21943
219441995-05-03 Richard Stallman <rms@gnu.org>
21945
21946 * bison.simple: Change distribution terms.
21947
219481995-02-23 Richard Stallman <rms@gnu.org>
21949
21950 * src/files.c: Test __VMS_POSIX as well as VMS.
21951
219521995-02-14 Jim Meyering <meyering@gnu.org>
21953
21954 * src/bison.s1 (__yy_memcpy):
21955 Renamed from __yy_bcopy to avoid
21956 confusion. Reverse FROM and TO arguments to be consistent with
21957 those of memcpy.
21958
219591995-02-14 Jim Meyering <meyering@gnu.org>
21960
21961 * bison.simple (__yy_memcpy):
21962 Renamed from __yy_bcopy to avoid
21963 confusion. Reverse FROM and TO arguments to be consistent with
21964 those of memcpy.
21965
219661994-11-10 David J. MacKenzie <djm@gnu.org>
21967
21968 * NEWS: reformat
21969
21970 * NEWS: New file.
21971
21972 * Makefile.in (DISTFILES): Include NEWS.
21973
21974 * Makefile.in (DISTFILES):
21975 Include install-sh, not install.sh.
21976
21977 * configure.in: Update to Autoconf v2 macro names.
21978
219791994-10-05 David J. MacKenzie <djm@gnu.org>
21980
21981 * Makefile.in: fix typo
21982
21983 * Makefile.in (prefix, exec_prefix):
21984 Let configure set them.
21985
219861994-09-28 David J. MacKenzie <djm@gnu.org>
21987
21988 * Makefile.in: Set datadir to $(prefix)/share.
21989
219901994-09-15 Richard Stallman <rms@gnu.org>
21991
21992 * src/bison.s1:
21993 Update copyright notice and GPL version.
21994
219951994-09-15 Richard Stallman <rms@gnu.org>
21996
21997 * bison.simple:
21998 Update copyright notice and GPL version.
21999
220001994-07-12 Richard Stallman <rms@gnu.org>
22001
22002 * src/reduce.c, src/reader.c:
22003 entered into RCS
22004
220051994-05-05 David J. MacKenzie <djm@gnu.org>
22006
22007 * Makefile.in: entered into RCS
22008
220091994-03-26 Richard Stallman <rms@gnu.org>
22010
22011 * src/bison.s1: entered into RCS
22012
220131994-03-26 Richard Stallman <rms@gnu.org>
22014
22015 * bison.simple: entered into RCS
22016
220171994-03-25 Richard Stallman <rms@gnu.org>
22018
22019 * src/main.c: entered into RCS
22020
220211994-03-24 Richard Stallman <rms@gnu.org>
22022
22023 * src/conflicts.c: entered into RCS
22024
220251994-01-02 Richard Stallman <rms@gnu.org>
22026
22027 * Makefile.in: *** empty log message ***
22028
220291993-11-21 Richard Stallman <rms@gnu.org>
22030
22031 * src/bison.s1: *** empty log message ***
22032
220331993-11-21 Richard Stallman <rms@gnu.org>
22034
22035 * doc/bison.texinfo: entered into RCS
22036
22037 * doc/bison.texinfo: *** empty log message ***
22038
220391993-11-21 Richard Stallman <rms@gnu.org>
22040
22041 * bison.simple: *** empty log message ***
22042
220431993-10-25 David J. MacKenzie <djm@gnu.org>
22044
22045 * doc/bison.texinfo: *** empty log message ***
22046
220471993-10-19 Richard Stallman <rms@gnu.org>
22048
22049 * src/bison.s1: *** empty log message ***
22050
220511993-10-19 Richard Stallman <rms@gnu.org>
22052
22053 * bison.simple: *** empty log message ***
22054
220551993-10-14 Richard Stallman <rms@gnu.org>
22056
22057 * src/bison.s1: *** empty log message ***
22058
220591993-10-14 Richard Stallman <rms@gnu.org>
22060
22061 * bison.simple: *** empty log message ***
22062
220631993-09-14 David J. MacKenzie <djm@gnu.org>
22064
22065 * doc/bison.texinfo: *** empty log message ***
22066
220671993-09-13 Noah Friedman <friedman@gnu.org>
22068
22069 * Makefile.in: *** empty log message ***
22070
220711993-09-10 Richard Stallman <rms@gnu.org>
22072
22073 * src/conflicts.c: *** empty log message ***
22074
22075 * src/system.h: entered into RCS
22076
220771993-09-10 Richard Stallman <rms@gnu.org>
22078
22079 * doc/bison.1: entered into RCS
22080
220811993-09-06 Noah Friedman <friedman@gnu.org>
22082
22083 * src/version.c: entered into RCS
22084
220851993-09-06 Noah Friedman <friedman@gnu.org>
22086
22087 * Makefile.in: *** empty log message ***
22088
220891993-07-30 David J. MacKenzie <djm@gnu.org>
22090
22091 * Makefile.in: *** empty log message ***
22092
220931993-07-24 Richard Stallman <rms@gnu.org>
22094
22095 * src/bison.s1: *** empty log message ***
22096
220971993-07-24 Richard Stallman <rms@gnu.org>
22098
22099 * bison.simple: *** empty log message ***
22100
221011993-07-08 David J. MacKenzie <djm@gnu.org>
22102
22103 * Makefile.in: *** empty log message ***
22104
221051993-07-04 Richard Stallman <rms@gnu.org>
22106
22107 * src/bison.s1: *** empty log message ***
22108
221091993-07-04 Richard Stallman <rms@gnu.org>
22110
22111 * bison.simple: *** empty log message ***
22112
221131993-06-26 David J. MacKenzie <djm@gnu.org>
22114
22115 * src/getargs.c: entered into RCS
22116
221171993-06-26 David J. MacKenzie <djm@gnu.org>
22118
22119 * doc/bison.texinfo: *** empty log message ***
22120
22121 * doc/bison.1: New file.
22122
221231993-06-25 Richard Stallman <rms@gnu.org>
22124
22125 * src/getargs.c: New file.
22126
221271993-06-16 Richard Stallman <rms@gnu.org>
22128
22129 * src/bison.s1: *** empty log message ***
22130
221311993-06-16 Richard Stallman <rms@gnu.org>
22132
22133 * bison.simple: *** empty log message ***
22134
221351993-06-03 Richard Stallman <rms@gnu.org>
22136
22137 * src/bison.s1: New file.
22138
221391993-06-03 Richard Stallman <rms@gnu.org>
22140
22141 * doc/bison.texinfo: *** empty log message ***
22142
221431993-06-03 Richard Stallman <rms@gnu.org>
22144
22145 * bison.simple: New file.
22146
221471993-05-19 Richard Stallman <rms@gnu.org>
22148
22149 * doc/bison.texinfo: New file.
22150
221511993-05-07 Noah Friedman <friedman@gnu.org>
22152
22153 * Makefile.in: *** empty log message ***
22154
221551993-04-28 Noah Friedman <friedman@gnu.org>
22156
22157 * src/reader.c: *** empty log message ***
22158
221591993-04-23 Noah Friedman <friedman@gnu.org>
22160
22161 * src/alloc.h: entered into RCS
22162
221631993-04-20 David J. MacKenzie <djm@gnu.org>
22164
22165 * src/version.c: *** empty log message ***
22166
22167 * src/files.c, src/allocate.c:
22168 entered into RCS
22169
22170 * src/reader.c: *** empty log message ***
22171
22172 * src/lex.c: entered into RCS
22173
22174 * src/conflicts.c: New file.
22175
22176 * src/symtab.c: entered into RCS
22177
22178 * src/alloc.h: New file.
22179
22180 * src/LR0.c: entered into RCS
22181
221821993-04-18 Noah Friedman <friedman@gnu.org>
22183
22184 * src/reader.c: New file.
22185
22186 * src/version.c: *** empty log message ***
22187
221881993-04-18 Noah Friedman <friedman@gnu.org>
22189
22190 * Makefile.in: *** empty log message ***
22191
221921993-04-17 Noah Friedman <friedman@gnu.org>
22193
22194 * Makefile.in: *** empty log message ***
22195
221961993-04-15 Richard Stallman <rms@gnu.org>
22197
22198 * src/main.c, src/files.c:
22199 New file.
22200
222011993-04-15 Noah Friedman <friedman@gnu.org>
22202
22203 * configure.in: entered into RCS
22204
22205 * configure.in: *** empty log message ***
22206
22207 * configure.in: New file.
22208
222091993-04-14 Richard Stallman <rms@gnu.org>
22210
22211 * Makefile.in: New file.
22212
222131993-04-13 Richard Stallman <rms@gnu.org>
22214
22215 * src/version.c: New file.
22216
222171993-03-25 Richard Stallman <rms@gnu.org>
22218
22219 * src/output.c: entered into RCS
22220
222211992-09-25 Richard Stallman <rms@gnu.org>
22222
22223 * configure.bat: entered into RCS
22224
222251992-06-22 Richard Stallman <rms@gnu.org>
22226
22227 * src/vmsgetargs.c: entered into RCS
22228
222291992-06-22 Richard Stallman <rms@gnu.org>
22230
22231 * doc/bison.rnh: entered into RCS
22232
222331992-04-20 David J. MacKenzie <djm@gnu.org>
22234
22235 * README: entered into RCS
22236
222371992-01-22 Richard Stallman <rms@gnu.org>
22238
22239 * src/machine.h: entered into RCS
22240
222411991-12-21 Richard Stallman <rms@gnu.org>
22242
22243 * src/lalr.c, src/closure.c:
22244 entered into RCS
22245
222461991-12-20 Richard Stallman <rms@gnu.org>
22247
22248 * src/state.h: entered into RCS
22249
222501991-12-18 Richard Stallman <rms@gnu.org>
22251
22252 * src/print.c, src/nullable.c, src/derives.c:
22253 entered into RCS
22254
222551991-11-03 David J. MacKenzie <djm@gnu.org>
22256
22257 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22258 entered into RCS
22259
222601988-09-09 Richard Stallman <rms@gnu.org>
22261
22262 * src/bison.hairy: entered into RCS
22263
222641987-12-16 Richard Stallman <rms@gnu.org>
22265
22266 * REFERENCES: entered into RCS
dc546b0f 22267
f294a2c2 22268
04098407 22269 -----
f294a2c2 22270
04098407 22271 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
f490771b
JD
22272 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
22273 2007, 2008, 2009 Free Software Foundation, Inc.
f294a2c2 22274
04098407
PE
22275 Copying and distribution of this file, with or without
22276 modification, are permitted provided the copyright notice and this
22277 notice are preserved.