]> git.saurik.com Git - bison.git/blame - ChangeLog
Fix %error-verbose for conflicts resolved by %nonassoc.
[bison.git] / ChangeLog
CommitLineData
1fa30307
JD
12009-08-25 Joel E. Denny <jdenny@clemson.edu>
2
3 Fix %error-verbose for conflicts resolved by %nonassoc.
4 * NEWS (2.5): Document.
5 * data/glr.c (yyreportSyntaxError): Fix this by checking
6 yyis_table_ninf.
7 * data/yacc.c (yysyntax_error): Likewise.
8 * data/lalr1.cc (yysyntax_error_): Fix this by checking
9 yytable_ninf_.
10 * data/lalr1.java (yysyntax_error): Likewise.
11 * tests/conflicts.at (%nonassoc and eof): Update expected output
12 and remove FIXME.
13
77373efa
JD
142009-08-25 Joel E. Denny <jdenny@clemson.edu>
15
16 Some code and documentation improvements.
17 * data/c.m4 (b4_table_value_equals): New macro to capture
18 some repeated code.
19 * data/glr.c (yyis_pact_ninf): Use it here.
20 (yyis_table_ninf): Likewise.
21 (yyreportSyntaxError): Improve internal comments.
22 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
23 Use it everywhere possible.
24 (yyis_table_ninf): Likewise.
25 (yysyntax_error): Improve internal comments.
26 * data/lalr1.cc (yysyntax_error_): Likewise.
27 * data/lalr1.java (yysyntax_error): Likewise.
28 * src/tables.h: Improve comments about yypact, yytable, etc.
29
890ab17c
JD
302009-08-21 Joel E. Denny <jdenny@clemson.edu>
31
32 Use locale when quoting.
33 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
34 quote rather than implementing quoting here.
35
c5196098
EB
362009-08-20 Eric Blake <ebb9@byu.net>
37
aa50ba7b
EB
38 Make previous patch more robust.
39 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
40 argmatch.h.
41 (output_skeleton): Use it.
42 Suggested by Akim Demaille.
43
c5196098
EB
44 Import latest m4/m4.m4.
45 * submodules/autoconf: Update to autoconf 2.64.
46 * configure.ac (M4_GNU_OPTION): New define.
47 * src/output.c (output_skeleton): Use it to resolve FIXME.
48 * NEWS: Mention this.
49
39fb7e62
JD
502009-08-19 Joel E. Denny <jdenny@clemson.edu>
51
52 Fix complaints about escape sequences.
53 Discussed starting at
54 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
55 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
56 For a \0 and similar escape sequences meaning the null
57 character, report an invalid escape sequence instead of an
58 invalid null character because the latter does not actually
59 appear in the user's input.
60 In all escape sequence complaints, don't escape the initial
61 backslash, and don't quote when the sequence appears at the end
62 of the complaint line unless there's whitespace that quotearg
63 won't escape.
64 Consistently say "invalid" not "unrecognized".
65 Consistently prefer "empty character literal" over "extra
66 characters in character literal" warning for invalid escape
67 sequences; that is, consistently discard those sequences.
68 * tests/input.at (Bad escapes in literals): New.
69
c33bc800
AD
702009-08-19 Akim Demaille <demaille@gostai.com>
71
72 doc: fixes.
73 * doc/bison.texinfo: Fix minor Texinfo errors.
74
8fbbeba2
AD
752009-08-19 Akim Demaille <demaille@gostai.com>
76
77 doc: %initial-action to initialize yylloc.
78 Reported by Bill Allombert.
79 * doc/bison.texinfo: Set fill-column to 76.
80 (Location Type): Document the use of %initial-action to initialize
81 yylloc.
82
1874a474
JD
832009-08-18 Joel E. Denny <jdenny@clemson.edu>
84
85 maint: update for gnulib's recent update-copyright changes
86 * gnulib: Update.
87 * .x-update-copyright (COPYING): Add as it's no longer implied
88 when .x-update-copyright is present.
89 * cfg.mk (update-copyright-local): Remove, now ignored.
90 (update-copyright): Declare update-b4-copyright as a dependency.
91
f4bfd5a9
AD
922009-08-17 Akim Demaille <demaille@gostai.com>
93
94 build: require gettext 0.17.
95
96 Suggested by Bruno Haible.
97 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
98 * configure.ac: require gettext 0.17 to ensure compatibility with
99 gnulib.
100
2509eba6
AD
1012009-08-17 Akim Demaille <demaille@gostai.com>
102
103 build: lower gettext requirements.
104
105 Bison was uselessly requiring the formatstring macros from
106 gettext, which resulted in mo files not being installed on systems
107 that perfectly supported Bison mo files. Lower the requirement.
108 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
109
aa50ba7b
EB
110 * configure.ac: Require need-ngettext instead of
111 need-formatstring-macros.
112 Reported by Martin Jabocs.
113 Suggested by Bruno Haible.
114 * INSTALL: Restructure.
115 (Internationalization): New.
2509eba6 116
314542f9
JD
1172009-08-14 Joel E. Denny <jdenny@clemson.edu>
118
119 maint: fix use of copyright year intervals.
120 * gnulib: Update.
121 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
122 as now recommended in gnulib/NEWS.
123 * build-aux/update-b4-copyright: Fix.
124 * cfg.mk (update-copyright-env): Configure update-copyright.
125
24985964
JD
1262009-08-13 Joel E. Denny <jdenny@clemson.edu>
127
128 Make it easier to write deterministic tests.
129 Continues Akim's work from his 2009-06-10 commits.
130 * src/reader.c (check_and_convert_grammar): Don't add any
131 symbols after the first symbols_do invocation.
132 * src/symtab.c (symbols_sorted): New static global.
133 (user_token_number_redeclaration): Update comments.
134 (symbol_from_uniqstr): If a new symbol is being created, assert
135 that symbols_sorted hasn't been allocated yet.
136 (symbols_free): Free symbols_sorted.
137 (symbols_cmp, symbols_cmp_qsort): New functions.
138 (symbols_do): Sort symbol_table into symbols_sorted on first
139 invocation.
140 * tests/input.at (Numbered tokens): Recombine tests now that the
141 output should be deterministic across multiple numbers.
142
47076da5
AD
1432009-08-12 Akim Demaille <demaille@gostai.com>
144
145 distcheck: fix.
146
aa50ba7b 147 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
47076da5 148
36dfe466
JD
1492009-08-10 Joel E. Denny <jdenny@clemson.edu>
150
151 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
152
07c0db18
JD
1532009-08-10 Joel E. Denny <jdenny@clemson.edu>
154
155 Miscellaneous code readability improvements.
156
157 * src/reader.c (reader): Move %define front-end variable
158 defaults and checking into...
159 (prepare_percent_define_front_end_variables): ... this new
160 function.
161
162 * src/scan-gram.l (INITIAL): For consistency with string
163 literals, don't store open quote on character literal. It's
164 discarded before returning anyway.
165 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
166 Make length test more readable, and make the character stored
167 for an empty literal more obvious while consistent with the
168 previous behavior.
169
170 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
171 USER_NUMBER_HAS_STRING_ALIAS throughout.
172 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
173 that is repeated in symtab.h. Improve argument names to make it
174 clear which side of the symbol-string alias pair is which.
175 (symbol_check_alias_consistency): Improve local variable names
176 for the same purpose.
177 * src/symtab.h (struct symbol): Make comments about aliases
178 clearer.
179 (symbol_make_alias): Improve comments and argument name.
180 * src/output.c (token_definitions_output): Update for rename to
181 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
182
1a323c2f
AR
1832009-08-08 Alex Rozenman <rozenman@gmail.com>
184
185 Convert "misleading reference" messages to warnings.
186 * src/scan-code.l: New function 'show_sub_messages', more
187 factoring.
188 * tests/named-ref.at: Adjust tests.
189
38609c34
JD
1902009-08-06 Joel E. Denny <jdenny@clemson.edu>
191
192 maint: run "make update-copyright"
193
642f240e
JD
1942009-08-06 Joel E. Denny <jdenny@clemson.edu>
195
196 maint: make update-b4-copyright easier to use
197 * build-aux/update-b4-copyright: In warnings, report line
198 numbers rather than character positions.
199 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
200 that update-copyright runs it.
201 * gnulib: Update.
202
d0caad01
JD
2032009-08-05 Joel E. Denny <jdenny@clemson.edu>
204
205 maint: clean up update-b4-copyright code
206 * build-aux/update-b4-copyright: Do not accept 2-digit
207 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
208 Don't accept a `[' in a b4_copyright argument.
209 Format code more consistently.
210 Don't assume b4*copyright never occurs.
211
ac2def56
JD
2122009-08-04 Joel E. Denny <jdenny@clemson.edu>
213
214 maint: automate b4_copyright updates.
215 * Makefile.am (update-b4-copyright): New target rule.
216 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
217 * build-aux/update-b4-copyright: New.
218 * data/yacc.c: Remove stray characters around b4_copyright
219 invocations.
220
dbbb64f0
JD
2212009-08-04 Joel E. Denny <jdenny@clemson.edu>
222
223 maint: automate annual package-wide copyright-year update.
224 * .x-update-copyright: New.
225 * Makefile.am (EXTRA_DIST): Remove maint.mk.
226 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
227 update-copyright. Remove gnumakefile, which is implied by
228 maintainer-makefile.
229 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
230 * gnulib: Update.
231 * maint.mk: Remove, now copied from gnulib.
232 * examples/extexi: Add missing "(C)" in copyright statement so
233 update-copyright can recognize it.
234 * src/LR0.h: Likewise.
235 * src/print.h: Likewise.
236 * src/print_graph.h: Likewise.
237 * src/gram.c: Add missing comma in copyright statement.
238 * src/gram.h: Likewise.
239
bfa018d4
JD
2402009-08-04 Joel E. Denny <jdenny@clemson.edu>
241
242 Fix "make distcheck".
243 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
244 of just calc.stamp.
245
4521fcdf
JD
2462009-08-01 Joel E. Denny <jdenny@clemson.edu>
247
248 Pacify "gcc -Wunused" for the input function from Flex.
249 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
250 and later.
251 * src/scan-code.l: Add "%option noinput", which I cannot find in
252 the Flex manual, but which Flex has supported since at least as
253 far back as 2.5.4. However, if any of our developers still use
254 Flex 2.5.4, they'll need to stop configuring with
255 --enable-gcc-warnings because "%option noinput" didn't work
256 correctly until Flex 2.5.6.
257 * src/scan-gram.l: Likewise.
258 * src/scan-skel.l: Likewise.
259
992e874a
AR
2602009-07-31 Alex Rozenman <rozenman@gmail.com>
261
262 Fix --enable-gcc-warnings problems.
263 * src/reader.c: Adjust variable names.
264 * src/scan-code.l: Fix prototypes and adjust names.
265 * src/named-ref.c: Remove redundant "if".
266
a1ed2b71
JD
2672009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
268
269 Fix a --enable-gcc-warnings problem.
270 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
271 variable.
272
cbc6a70e 2732009-07-24 Alex Rozenman <rozenman@gmail.com>
1e20ad11
AR
274
275 Fix some memory leaks.
276 * src/named-ref.c: Add a pointer check (named_ref_free).
277 * src/scan-code.l: New function (variant_table_free). Called in
278 code_scanner_free.
279 * src/symlist.c: Call to named_ref_free (symbol_list_free).
280
ac9b0e95
JD
2812009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
282
283 Warn about character literals not of length one.
284 * NEWS (2.5): Document.
285 * src/scan-gram.l (INITIAL): Remove comment that we don't check
286 the length.
287 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
288 * tests/input.at (Bad character literals): New test group.
289
2de160e1
JD
2902009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
291
292 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
293
cba97506
JD
2942009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
295
296 Some M4 cleanup in the testsuite.
297 Suggested by Eric Blake at
298 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
299 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
300 complicate the code by distinguishing between a missing value
301 and an empty string value for an optional argument. This fix is
302 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
303 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
304 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
305 arguments are not needed because of the following changes.
306 Fix stale comments.
307 Bison developers should use GNU M4 and should not use
308 POSIXLY_CORRECT when building the test suite, so do not
309 complicate the code by avoiding $10 and above.
310 Do not quote an empty string value for an optional argument, and
311 do not distinguish between a missing value and an empty string
312 value.
313
62eb2d1b
JD
3142009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
315
316 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
317
620b2e36
JD
3182009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
319
320 Revert unnecessary column realignment in --help output.
321 Reported by Akim Demaille at
322 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
323 * src/getargs.c (usage): Here.
324
cbc6a70e 3252009-07-04 Alex Rozenman <rozenman@gmail.com>
dad6544d
AR
326
327 Alphabetical order in src/Makefile.am.
328 * src/Makefile.am: Adjust.
329
cbc6a70e 3302009-07-04 Alex Rozenman <rozenman@gmail.com>
d5e8574b
AR
331
332 Style changes and factoring.
333 * src/named-ref.h: Add comments.
334 * src/parse-gram.y: Readability and style changes.
335 * src/reader.c: Factoring: assign_named_ref function.
336 * src/scan-code.l: Factoring and style changes. Rename
337 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
338 Use "unsigned" type for variant index. Improve readablity.
339 * src/scan-gram.l: Change error messages and add comments.
340 * src/symlist.h: symbol_list_null: New function decl.
341 * src/symlist.c: symbol_list_null: Implement here.
342 * tests/named-refs.at: Adjust for new error messages.
343
ae09ec85
EB
3442009-06-29 Eric Blake <ebb9@byu.net>
345
346 scan-code: avoid compiler warnings
347 * src/scan-code.l (parse_named_ref): Use correct specifiers.
348
80d653fd
AD
3492009-06-29 Akim Demaille <demaille@gostai.com>
350
351 build: avoid concurrent extraction of calc++.
352 * examples/calc++/Makefile.am (calc.stamp): New.
353 Depend on it to create the sources of calc++ so that concurrent
354 builds don't launch several "extexi" in parallel.
355 Not only this is inefficient, this also builds incorrect sources
356 with several extractions mixed together.
357
7685e2f7
AR
3582009-06-27 Alex Rozenman <rozenman@gmail.com>
359
360 Implement support for named symbol references.
361 * src/parse-gram.y: Add new syntax (named_ref.opt).
362 * src/reader.c: Store named refs in symbol lists.
363 * src/reader.h: New argument for symbol_append and
364 action_append functions.
365 * src/scan-code.h: Add new field (named_ref) into
366 code_props data structure. Keeps named ref of midrule
367 actions.
368 * src/scan-code.l: Support for named refs in semantic
369 action code. New function 'parse_named_ref'.
370 * src/scan-gram.l: Support bracketed id.
371 * src/symlist.c: Store named refs in symbol lists.
372 * src/symlist.h: New field in symbol list: named_ref.
373 * src/named-ref.h: New file, a struct for named_ref.
374 * src/named-ref.cp: New file, named_ref_new function.
375 * src/local.mk: Add two new files.
376 * tests/testsuite.at: Include new test group:
377 * tests/named-refs.at: this new file.
378
67f8cf51
AD
3792009-06-25 Akim Demaille <demaille@gostai.com>
380
381 hash: check insertion for memory exhaustion.
382 * src/uniqstr.c (uniqstr_new): New.
383
83b66ddd
AD
3842009-06-11 Akim Demaille <demaille@gostai.com>
385
386 style changes.
387 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
388 * src/print-xml.c: Style changes.
389 * tests/conflicts.at: Comment changes.
390
517cb0ad
AD
3912009-06-11 Akim Demaille <demaille@gostai.com>
392
393 xml: beware of user strings used to give a %prec to rules.
394 * tests/conflicts.at (%prec with user strings): New.
395 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
396 XML output.
397
75c7a52a
AD
3982009-06-11 Akim Demaille <demaille@gostai.com>
399
400 hash: check insertion for memory exhaustion.
401 * src/muscle-tab.c (muscle_insert, muscle_grow)
402 * src/state.c (state_hash_insert): Check the return value of
403 hash_insert.
404
66ed9753
AD
4052009-06-10 Akim Demaille <demaille@gostai.com>
406
407 deterministic test suite.
408 Some consistency checks on symbols are performed after all the
409 symbols were read, by an iteration over the symbol table. This
410 traversal is nondeterministic, which can be a problem for test
411 cases.
412 Avoid this.
413 Addresses another form of nondeterminism reported by Joel E. Denny.
414 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
415
416 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
417 test in two.
418 Use different file names for the three tests to make the
419 maintenance easier.
420
ed15d907
AD
4212009-06-10 Akim Demaille <demaille@gostai.com>
422
95d176ff
AD
423 deterministic user-token-number redeclaration errors.
424 Address nondeterminism reported by Joel E. Denny.
425 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
426
427 * src/uniqstr.h: Comment changes.
428 * src/location.h (boundary_cmp, location_cmp): New.
429 * src/symtab.c (user_token_number_redeclaration): New.
430 (symbol_translation): Use it.
431 * tests/input.at (Numbered tokens): Adjust the expected output.
432
4332009-05-25 Akim Demaille <demaille@gostai.com>
434
ed15d907 435 gnulib: update.
aa50ba7b
EB
436 * gnulib: Update to latest.
437 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
438 * m4/.gitignore: Regen.
439 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
440 Call xalloc_die on hash_insert failures.
441 Requested by the new __warn_unused_result__ attribute of
442 hash_insert.
ed15d907 443
e3a33f7c
JD
4442009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
445
446 Convert multiple variable definition warnings to complaints.
447 * NEWS (2.5): Add a new entry for that change.
448 * doc/bison.texinfo (Decl Summary): Update %define entry.
449 (Bison Options): Update -D/--define/-F/--force-define entry.
450 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
451 * src/muscle_tab.h (muscle_percent_define_insert): Update
452 comments.
453 * tests/input.at (`%define errors'): Update.
454 (`%define, --define, --force-define'): Update.
455
34d41938
JD
4562009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
457
458 -F/--force-define and relative %define/-D/--define priorities.
459 * NEWS (2.5): Add documentation to -D/--define entry.
460 * build-aux/cross-options.pl: Hard-code association of
461 --force-define with %define.
462 * doc/bison.texinfo (Decl Summary): In %define entry,
463 cross-reference command-line options.
464 (Bison Options): Add documentation to -D/--define entry.
465 (Option Cross Key): Widen column for --force-define row.
466 * src/getargs.c (usage): Document -F/--force-define. Realign
467 options in output.
468 (short_options, long_options, getargs): Parse -F/--force-define,
469 and update muscle_percent_define_insert invocation.
470 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
471 (muscle_percent_define_insert): Add argument with that type.
472 * src/muscle_tab.c (muscle_percent_define_insert): Implement
473 -F/--force-define behavior and priorities.
474 * src/parse-gram.y (prologue_declaration): Update
475 muscle_percent_define_insert invocations.
476 * tests/input.at (`%define, --define'): Rename to...
477 (`%define, --define, --force-define'): ... this and extend.
478
246c4efa
JD
4792009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
480
481 Update some comments to make sense for -D.
482 * data/bison.m4 (b4_check_user_names): In header comments, say
483 "user occurrence" instead of "grammar occurrence".
484 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
485 (muscle_percent_code_grow): Likewise just for consistency.
486
531683e7
JD
4872009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
488
489 * data/c++.m4: Update copyright year.
490
e7bfa8b7
JD
4912009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
492
493 * data/c++.m4 (b4_namespace_close): Simplify slightly.
494
8c221795
JD
4952009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
496
497 Handle a trailing `:' in a user-supplied C++ namespace better.
498 * data/c++.m4 (b4_namespace_close): Don't let it be printed
499 among the closing braces here. This fix might make the
500 generated code easier to debug, but otherwise it should be
501 insignificant because a trailing `:' is a C++ error already.
502
c8bf65f0
AD
5032009-05-19 Akim Demaille <demaille@gostai.com>
504
505 remove useless variable.
506 * src/getargs.c (skeleton_arg): Remove now useless variable.
507 Should help the compiler see that this printf-like call is sane.
508
7ac45a46
AD
5092009-05-11 Akim Demaille <demaille@gostai.com>
510
511 doc: use C++ headers.
512 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
513 headers.
514
601bdfab
AD
5152009-05-05 Akim Demaille <demaille@gostai.com>
516
517 fix hexadecimal token number support.
518 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
519
d19123e6
AD
5202009-05-05 Akim Demaille <demaille@gostai.com>
521
522 tests: check token numbers.
523 * tests/input.at (Numbered tokens): New.
524
ecdfea9a
AD
5252009-05-04 Akim Demaille <demaille@gostai.com>
526
527 bison: catch bad symbol names.
528 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
529 * tests/input.at: Adjust.
530
43e6aea5
AD
5312009-05-04 Akim Demaille <demaille@gostai.com>
532
533 space changes.
534 * src/scan-gram.l: Untabify to be robust to zealous editors.
535
c046698e
AD
5362009-05-04 Akim Demaille <demaille@gostai.com>
537
538 identifiers: dashes are letters.
539 Dashes can now start identifiers (symbols and directives).
b10dd689 540
c046698e
AD
541 * src/scan-gram.l ({letter}): Add dash.
542 ({id}): Remove it.
543 * tests/input.at (Symbols): Adjust.
544 Remove stray comment.
545 * tests/regression.at (Invalid inputs): Adjust error message.
546 * doc/bison.texinfo (Symbols): Update.
547
966aba65
JD
5482009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
549
550 Declare %code to be a permanent feature.
551 * NEWS (2.4.2): Here.
552 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
553 experimental.
554 (Decl Summary): Likewise.
555
812775a0
JD
5562009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
557
558 Convert underscores to dashes in some %define variable names.
559 For now, just api.push-pull and lr.keep-unreachable-states.
560 Maintain old names for backward compatibility.
561 * NEWS (2.5): Document.
562 * data/c.m4 (b4_identification): Update comment.
563 * data/yacc.c: Update access.
564 * doc/bison.texinfo: Update.
565 * etc/bench.pl.in (bench_grammar): Update use.
566 * src/files.c (tr): Move to...
567 * src/getargs.c, src/getargs.h (tr): ... here because I can't
568 think of a better place to expose it. My logic is that, for all
569 uses of tr so far, command-line arguments can be involved, and
570 getargs.h is already included.
571 * src/main.c (main): Update access.
572 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
573 variable names to new variable names before assigning value.
574 * src/reader.c (reader): Update setting default.
575 * tests/calc.at: Update uses.
576 * tests/conflicts.at (Unreachable States After Conflict
577 Resolution): Update use.
578 * tests/input.at (%define enum variables): Update use.
579 (%define backward compatibility): New test group.
580 * tests/push.at: Update uses.
581 * tests/reduce.at: Update uses.
582 * tests/torture.at: Update uses.
583
1c4aa81d
JD
5842009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
585
586 Set all front-end %define defaults in one place.
587 * src/main.c (main): Move lr.keep_unreachable_states default...
588 * src/reader.c (reader): ... to here.
589
1d0f55cc
JD
5902009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
591
592 Rename lr.default_reductions to lr.default-reductions.
593 * NEWS (2.5): Here.
594 * doc/bison.texinfo: Here.
595 * src/lalr.c (initialize_LA): Here.
596 * src/print.c (print_reductions): Here.
597 * src/reader.c (reader): Here.
598 * src/tables.c (action_row): Here.
599 * tests/input.at (%define enum variables): Here.
600 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
601
0b593457
JD
6022009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
603
604 Pacify ./configure --enable-gcc-warnings.
605 * tests/input.at (Symbols): Prototype yyerror and yylex.
606
0939aa2d
AD
6072009-04-21 Akim Demaille <demaille@gostai.com>
608
609 tests: check the use of dashes and periods in symbols.
610 * tests/input.at (Symbol): New test group.
611
0b593457 6122009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
ae618dcc
JD
613
614 Document how `%define "var" "value"' is not M4-friendly.
615 * src/parse-gram.y (variable): In comments here.
616
0b593457 6172009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
6789b8bd
JD
618
619 Add copyright updates missed during previous cherry pick.
620 * src/output.c: Here.
621 * src/parse-gram.y: Here.
622 * src/scan-gram.l: Here.
623
663ce7bb
AD
6242009-04-20 Akim Demaille <demaille@gostai.com>
625
626 variables: accept dashes.
627 * src/scan-gram.l ({id}): Also accept dashes after the initial
628 letter.
629 ({directive}): Use {id}.
630 * src/parse-gram.y: Comment and formatting changes.
631 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
632 symbols.
633 * src/complain.h, src/complain.c (yacc_at): New.
634 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
635 symbol names.
636 * src/output.c (token_definitions_output): Do not #define token
637 names with dashes.
638
379261b3
JD
6392009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
640
641 Clean up recent patches a little.
642 Reported by Akim Demaille.
643 * doc/bison.texinfo (Understanding): Fix typos.
644 * src/print.c (print_reductions): Don't use negated variable.
645
25029e16
JD
6462009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
647
648 List accepted values for a %define enum variable with an invalid value.
649 Suggested by Akim Demaille at
650 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
651 * data/bison.m4 (_b4_percent_define_check_values): Implement.
652 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
653 * tests/input.at (%define lr.default_reductions invalid values): Merge
654 into...
655 (%define enum variables): ... here, and update output.
656
620b5727
JD
6572009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
658
659 Rename "default rule" to "default reduction".
660 This includes changing variable names in code, changing
661 comments, and renaming %define lr.default_rules to %define
662 lr.default_reductions.
663 * NEWS (2.5): Update IELR documentation.
664 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
665 Adjust YYDEFACT and yydefact_ documentation.
666 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
667 and lr.type documentation. Make some other wording
668 improvements.
669 (Glossary): Adjust cross-references and Default Reduction
670 definition.
671 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
672 Remove a confusing comment pointed out by Akim Demaille.
673 (initialize_LA): Adjust code.
674 * src/print-xml.c (print_reductions): Adjust code.
675 * src/print.c (print_reductions): Adjust code.
676 * src/reader.c (reader): Adjust code.
677 * src/tables.c (action_row): Adjust code.
678 (token_actions): Adjust code.
679 * src/tables.h: Adjust YYDEFACT documentation.
680 * tests/input.at (%define lr.default_rules invalid values):
681 Rename test group to...
682 (%define lr.default_reductions invalid values): ... this, and
683 update grammar file and expected output.
684 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
685 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
686
34a6c2d1
JD
6872009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
688
689 Document %define lr.type and lr.default_rules.
690 * NEWS (2.5): Add an entry.
691 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
692 besides just LALR(1) and GLR(1).
693 * doc/bison.texinfo (Introduction): Likewise.
694 (Language and Grammar): Bison is no longer limited to LALR(1)
695 restrictions.
696 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
697 when trying to distinguish from GLR. Talk about LR(1) grammars
698 rather than LALR(1) grammars.
699 (Decl Summary): In %define api.push_pull entry, say it applies
700 to deterministic parsers in C rather than LALR(1) parsers in C.
701 Add lr.default_rules entry.
702 Add lr.type entry.
703 (Mystery Conflicts): Bison is no longer limited to LALR(1)
704 restrictions.
705 (Generalized LR Parsing): Same changes as for the previous GLR
706 section.
707 (Memory Management): Say deterministic rather than LALR(1).
708 (Understanding): Correct some bison output.
709 Index discussion of "accepting state".
710 Say deterministic rather than LALR(1).
711 (Bison Options): In --yacc entry, say deterministic rather than
712 LALR(1).
713 In --report, --graph, and --xml entries, just don't mention
714 LALR(1).
715 (C++ Parsers): Say deterministic rather than LALR(1).
716 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
717 (Glossary): Add Accepting State, Consistent State, Default Rule,
718 and IELR(1) definitions.
719 In Generalized LR (GLR) definition, make same changes as in
720 previous GLR sections.
721 In LALR(1) definition, say Bison uses LALR(1) by default rather
722 than implying Bison is limited to LALR(1).
723 (LocalWords): Add IELR.
724
f805dfcb
JD
7252009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
726
727 Finish implementing %define lr.type.
728 Its value can be "LALR", "IELR", or "canonical LR".
729 * lib/timevar.def (TV_IELR_PHASE1): New var.
730 (TV_IELR_PHASE2): New var.
731 (TV_IELR_PHASE3): New var.
732 (TV_IELR_PHASE4): New var.
733 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
734 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
735 Sbitset.h, ielr.h, and ielr.c.
736 * src/getargs.h, src/getargs.c (enum trace, trace_args,
737 trace_types): Add trace_ielr.
738 * src/lalr.h, src/lalr.c (ngotos): Export it.
739 (F): Rename to...
740 (goto_follows): ... this, update all uses, and export it.
741 (set_goto_map): Export it.
742 (map_goto): Export it.
743 (compute_lookahead_tokens): Don't free goto_follows yet. Now
744 handled in ielr.
745 (initialize_LA): Export it. Move lookback allocation to...
746 (lalr): ... here because, for canonical LR, initialize_LA must
747 be invoked but lookback and much of the rest of LALR isn't
748 needed.
749 * main.c (main): Instead of lalr, invoke ielr, which invokes
750 lalr.
751 * src/reader.c (reader): Default lr.type to "LALR".
752 Default lr.default_rules to "accepting" if lr.type is "canonical
753 LR". Leave the default as "all" otherwise.
754 Check for a valid lr.type value.
755 * src/state.h, src/state.c (struct state_list): Add state_list
756 member.
757 (state_new): Initialize state_list member to NULL.
758 (state_new_isocore): New function, exported.
759 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
760 exercises all values of lr.type.
761 (GNU AWK Grammar): Rename test group to...
762 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
763 AT_TEST_EXISTING_GRAMMAR.
764 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
765 (GNU pic Grammar): Rename test group to...
766 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
767 AT_TEST_EXISTING_GRAMMAR.
768 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
769 all values of lr.type.
770 (Single State Split): New test groups using AT_TEST_LR_TYPE.
771 (Lane Split): Likewise.
772 (Complex Lane Split): Likewise.
773 (Split During Added Lookahead Propagation): Likewise.
774
166366b2
JD
7752009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
776
777 Add new files for IELR and canonical LR implementation.
778 * src/AnnotationList.c: New.
779 * src/AnnotationList.h: New.
780 * src/InadequacyList.c: New.
781 * src/InadequacyList.h: New.
782 * src/Sbitset.c: New.
783 * src/Sbitset.h: New.
784 * src/ielr.c: New.
785 * src/ielr.h: New.
786
03c07b03
JD
7872009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
788
789 Implement %define lr.default_rules.
790 Its value describes the states that are permitted to contain
791 default rules: "all", "consistent", or "accepting".
792 * src/reader.c (reader): Default lr.default_rules to "all".
793 Check for a valid lr.default_rules value.
794 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
795 is "accepting", then only mark the accepting state as
796 consistent.
797 (initialize_LA): Tell state_lookahead_tokens_count whether
798 lr.default_rules is "accepting".
799 * src/tables.c (action_row): If lr.default_rules is not "all",
800 then disable default rules in inconsistent states.
801 * src/print.c (print_reductions): Use this opportunity to
802 perform some assertions about whether lr.default_rules was
803 obeyed correctly.
804 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
805 helps with checking the parser tables for a grammar.
806 * tests/input.at (%define lr.default_rules invalid values): New
807 test group.
808 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
809 AT_TEST_TABLES_AND_PARSE.
810 (`no %define lr.default_rules'): New test group generated by
811 AT_TEST_LR_DEFAULT_RULES.
812 (`%define lr.default_rules "all"'): Likewise.
813 (`%define lr.default_rules "consistent"'): Likewise.
814 (`%define lr.default_rules "accepting"'): Likewise.
815
44c124a3
AD
8162009-04-20 Akim Demaille <demaille@gostai.com>
817
818 Consistently refer to Yacc, not YACC.
819 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
820
42660736
JD
8212009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
822
823 Pacify make maintainer-check-posix.
824 * tests/input.at (%define, --define): Move bison command-line
825 options before grammar file name.
826
a2d05674
JD
8272009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
828
829 Document semicolon warnings.
830 * NEWS (2.5): Here.
831
c4fae1ef
AD
8322008-12-08 Akim Demaille <demaille@gostai.com>
833
834 Fix portability issue in the test suite.
835 * tests/local.at (AT_MATCHES_CHECK): New.
836 Based on Perl instead of Sed. Sed has too many portability
837 pitfalls, not ever Sed is GNU Sed.
838 * tests/actions.at (Fix user actions without a trailing semicolon):
839 Use it.
840
42f4393a
DJ
8412008-12-07 Di-an Jan <dianj@freeshell.org>
842
843 Implement the FIXME that ends an user action with a semicolon
844 if it seems necessary.
845 * src/scan-code.l (flex rules section): Flag cpp directive from
846 any `#' to the first unescaped end-of-line. Semicolon is not
847 needed after `;', `{', '}', or cpp directives and is needed after
848 any other token (whitespaces and comments have no effect).
849 * tests/actions.at (Fix user actions without a trailing semicolon):
850 New test.
851 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
852 to make user actions complete statements.
853 Adjust column numbers in error messages.
854 * tests/regression.at (Fix user actions without a trailing semicolon):
855 Remove. Covered by new test.
856
bd5df716
AD
8572009-04-14 Akim Demaille <demaille@gostai.com>
858
859 doc: minor fixes.
860 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
861 (Table of Symbols): Remove duplicate entry for %debug.
862
7ba0d59d
EB
8632009-04-10 Eric Blake <ebb9@byu.net>
864
865 submodules: update to latest
866 * submodules/autoconf: Use latest upstream Autoconf.
867
b4d71a96
EB
8682009-04-06 Eric Blake <ebb9@byu.net>
869
870 Work around autoconf 2.63b bug in testsuite.
871 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
872 autoconf bug related to # in test.
873
4ecd3681
JD
8742009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
875
876 * NEWS (2.5): Describe new -D/--define feature.
877
c65e5292
AD
8782008-11-10 Akim Demaille <demaille@gostai.com>
879
880 --trace=muscles
881 * src/getargs.h, src/getargs.c (trace_muscle): New.
882 (trace_types, trace_args): Support it.
883 * src/output.c (output_skeleton): Use it.
884
96002de2
AD
8852008-11-10 Akim Demaille <demaille@gostai.com>
886
887 muscles_output.
888 * src/output.c (muscles_output): New, extracted from...
889 (output_skeleton): here.
890 Adjust.
891
fadb13b5
AD
8922008-11-21 Akim Demaille <demaille@gostai.com>
893
894 Display the changes in cross-options.texi.
895 * build-aux/cross-options.pl ($sep): New, to separate items.
896 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
897 the changes.
898
72183df4
DJ
8992008-11-20 Di-an Jan <dianj@freeshell.org>
900
901 Improves options in the manual.
902 * doc/bison.texinfo (-g, -x): Add space before argument.
903 (Option Cross Key): Implement FIXME: listing directives also.
904 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
905 (Short Option): Special case -d. Put arguments inside @option.
fadb13b5 906 (Bison Directive): Add column, automatically extracted from
72183df4
DJ
907 src/scan-gram.l (actual name passed as the first argument)
908 with special case for %define.
909 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
910 to build-aux/cross-options.pl.
911 * src/getargs.c (usage): Document limitations of cross-options.pl.
912 * src/scan-gram.l: Likewise.
913
e80b068c
AD
9142009-02-25 Akim Demaille <demaille@gostai.com>
915
916 Copyright years.
917 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
918
e3ee30b8
AD
9192008-12-08 Akim Demaille <demaille@gostai.com>
920
921 Install autoconf as a submodule to get m4sugar.
922 * .gitmodules: Add submodules/autoconf.
923 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
924 submodules/autoconf.
925
c4eb1e84
JD
9262008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
927
928 Simplify last patch slightly.
929 * src/getargs.c (getargs): Here.
930
10fa0146
JD
9312008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
932
933 Fix last warning from --enable-gcc-warnings.
934 * src/getargs.c (getargs): Don't assign const address to non-const
935 pointer.
936
6f5be1ab
DJ
9372008-11-17 Di-an Jan <dianj@freeshell.org>
938
939 Handle --enable-gcc-warnings.
940 * src/getargs.c (command_line_location): Set parameters to void.
941
11c4e57d
AD
9422008-11-11 Akim Demaille <demaille@gostai.com>
943
944 AT_FULL_COMPILE.
945 * tests/actions.at, tests/regression.at: Use it.
946
e186a284
AD
9472008-11-07 Akim Demaille <demaille@gostai.com>
948
949 Pass command line location to skeleton_arg and language_argmatch.
950 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
951 The location argument is now mandatory.
952 Adjust all dependencies.
953 (getargs): Use command_line_location.
954
e14c6831
AD
9552008-11-07 Akim Demaille <demaille@gostai.com>
956
957 -D, --define.
958 * src/getargs.c (usage): Document -D.
959 Fix help string for --locations.
960 (command_line_location): New.
961 (short_options, long_options, getargs): Support -D, --define.
962 (getargs): Move -d support at the right place.
963 * doc/bison.texinfo (Bison Options): Update.
964 * tests/input.at (%define, --define): New.
965
75c21b61
AD
9662008-11-07 Akim Demaille <demaille@gostai.com>
967
968 Initialize the muscle table before parsing the command line.
969 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
970 (getargs): Define file_name.
971 * src/main.c (main): Initialize muscle_tab before calling
972 getargs.
973 * src/muscle_tab.c (muscle_init): No longer define file_name, as
974 its value is not available yet.
975
33d2a860
AD
9762008-11-09 Akim Demaille <demaille@gostai.com>
977
978 Require the generation of parse-gram.output.
979 * src/Makefile.am (YACC): Pass --report=all.
980
006faedf
JD
9812009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
982
983 * NEWS (2.5): New stub.
984
ecd1b61c
JD
9852009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
986
987 Fix options documentation.
988 * build-aux/cross-options.pl: As in --help output, write optional
989 arguments as [=ARG] not =[ARG].
990 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
991
f67c4037
AD
9922008-11-07 Akim Demaille <demaille@gostai.com>
993
994 Fix --help.
995 * src/getargs.c (usage): Fix help string for -W.
996
0213d651
AD
9972008-11-07 Akim Demaille <demaille@gostai.com>
998
999 Handle more general types of option arguments.
1000 * build-aux/cross-options.pl: The argument ends at the first
1001 space, not the first non-symbol character.
1002 Use @var for each word appearing the argument description.
1003
c19178bf
JD
10042009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1005
1006 Remove spurious initial empty lines.
1007 * data/location.cc: End the @output lines with an @.
1008
0d2b2ab0
AD
10092008-11-04 Akim Demaille <demaille@gostai.com>
1010
1011 Remove spurious initial empty lines.
1012 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1013 * data/yacc.c: End the @output lines with an @.
1014
8ba62e3e
JD
10152009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1016
1017 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1018 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1019 requirements for a correct m4 are stricter.
1020 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
1021 * configure.ac: Update to use AC_PROG_GNU_M4.
1022 Reported by Eric Blake.
1023
5bc993d9
JD
10242009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1025
1026 Help with updating web manual.
1027 * HACKING: Incorporate instructions from gnulib/doc/README.
1028 * bootstrap.conf (gnulib_modules): Add gendocs.
1029
580c075d
JD
10302009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1031
1032 Fix strange %define locations for default values.
1033 Reported by Akim Demaille at
1034 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1035 and discussed again starting at
1036 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1037 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1038 because location information is bogus.
1039 Use angle brackets to delimit fake file name because square brackets
1040 look like underexpanded m4. Choose a better fake file name.
1041 Use negative line numbers.
1042 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1043 * src/location.c (location_print): If line for a boundary is negative,
1044 only print that boundary's file name.
1045 * src/location.h: Document that.
1046 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1047 defaults): Update output.
1048
5d3a1ecb
AD
10492008-11-07 Akim Demaille <demaille@gostai.com>
1050
1051 Locations without columns for command line arguments.
1052 * src/location.c (location_print): Don't display negative columns.
1053 * src/location.h: Document this.
1054
015e86a7
JD
10552009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1056
1057 Add reminder about uploading public key to keys.gnupg.net.
1058 * HACKING (Release Procedure): Here.
1059
c1455bab
AD
10602009-03-31 Akim Demaille <demaille@gostai.com>
1061
1062 bootstrap: --help to stdout.
1063 * bootstrap (usage): Don't send --help to stderr.
1064 Use a here doc instead of a long string.
1065
2075a82a
AD
10662009-03-31 Akim Demaille <demaille@gostai.com>
1067
1068 bootstrap: README-hacking no longer exists
1069 * bootstrap (checkout_only_file): Set to HACKING.
1070
26fccd4d
AD
10712009-03-26 Akim Demaille <demaille@gostai.com>
1072
1073 doc: merge HACKING and README-hacking.
1074 Two files is confusing.
1075 Reported by Alexandre Duret-Lutz.
5bc993d9 1076
26fccd4d
AD
1077 * README-hacking: Merge into...
1078 * HACKING (Working from the repository): here.
1079
6469c4d7
AD
10802009-03-26 Akim Demaille <demaille@gostai.com>
1081
1082 doc: update README-hacking.
1083 * README-hacking: We now use git and git submodules.
1084 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1085
b328890a
AD
10862009-03-26 Akim Demaille <demaille@gostai.com>
1087
1088 lalr1.cc: avoid GCC 4.3 warnings.
1089 GCC 4.3 now warns about "a || b && c" and asks for explicit
1090 parentheses.
1091 Reported by Alexandre Duret-Lutz.
1092 * data/location.cc: Update copyright years.
1093 (Position::operator==): Use parens to make precedence explicit.
1094 Compare lines and columns first, as they are more likely to be
1095 different, and they are faster to compare.
1096
f3079439
AD
10972009-03-26 Akim Demaille <demaille@gostai.com>
1098
1099 gnulib: update.
1100 * gnulib: Update to latest.
1101 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
1102 use +=.
1103
8defe11b
AD
11042009-01-08 Akim Demaille <demaille@gostai.com>
1105
1106 Fix grep portability issues.
1107 Grep on Solaris does not support -q.
1108 Reported by Summum Bonum.
5bc993d9 1109
8defe11b
AD
1110 * NEWS: Add a stub for 2.4.2.
1111 * THANKS: Add Summum Bonum.
1112 * tests/atlocal.in (EGREP): New.
1113 (CC, CXX, XSLTPROC): Make it possible to override them via
1114 envvars.
1115 * tests/java.at: Use $EGREP instead of egrep.
1116 Use AT_CHECK's ignore instead of grep's -q.
1117
41930e7a
JD
11182008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1119
1120 Version 2.4.1.
1121 * NEWS: Set version and date.
1122 * lib/Makefile.am: Update copyright year.
1123 * tests/atlocal.in: Update copyright year.
1124
d07932ef
JD
11252008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1126
1127 Semicolon feature removal is not about future language support.
1128 * NEWS: The semicolon feature is no longer active for newer languages,
1129 so don't claim that it causes trouble for them.
1130
0364b334
JD
11312008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1132
1133 * gnulib: Update submodule to HEAD.
1134
876fd835
AD
11352008-12-09 Akim Demaille <demaille@gostai.com>
1136
1137 Update data/README.
1138 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1139
bee1df15
EB
11402008-12-05 Eric Blake <ebb9@byu.net>
1141
1142 Build testsuite with newer autoconf.
1143 * tests/output.at (m4_expand): Don't override in newer autoconf,
1144 where the underlying implementation changed.
1145 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1146 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1147 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1148 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1149 since some of them contain unbalanced ')'.
1150
7e6d1e22
JD
11512008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1152
1153 * NEWS: Clarify a little.
1154
a957d06c
JD
11552008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1156
1157 * NEWS: Update for recent changes.
1158
462503f8
JD
11592008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1160
1161 Fix unexpanded macros in GLR defines file.
1162 Reported by Csaba Raduly at
1163 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1164 * THANKS (Csaba Raduly): Add.
1165 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1166 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1167 lexer in a separate module that includes the defines file.
1168 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
1169 source.
1170 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1171 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1172 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1173 (AT_DATA_SOURCE_PROLOGUE): New.
1174 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1175 (AT_DATA_SOURCE): New.
1176 (AT_FULL_COMPILE): New, copied from master branch and extended to
1177 support an additional source file.
1178
bf151b75
JD
11792008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1180
1181 Don't let maintainer-*-check targets force a version update.
1182 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1183 handled.
1184
f56274a8
DJ
11852008-11-17 Di-an Jan <dianj@freeshell.org>
1186
1187 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1188 Align menus. Adjust word wrapping. Use node names for menu names.
1189 (Examples): Don't abbreviate node names.
1190 (LocalWords): Remove abbreviations.
1191 (Copying): Make description a sentence.
bf151b75 1192 (Java Action Features): Remove period to match the rest of menu.
f56274a8 1193
b5775a81
PB
11942008-11-11 Paolo Bonzini <bonzini@gnu.org>
1195
1196 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1197 * configure.ac: Adjust usage.
1198 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1199 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1200 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1201
7ed73f82
JD
12022008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1203
1204 Don't add a semicolon to actions for %skeleton or %language.
1205 It breaks Java test cases as reported by Akim Demaille.
1206 * src/scan-code.l: Implement.
1207
4b1ebc49
JD
12082008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1209
1210 Clean up %skeleton and %language priority implementation.
1211 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1212 remove static qualifier because others will soon need to see it.
1213 (language_prio): Likewise.
1214 (getargs): Use command_line_prio rather than 0.
1215 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1216 enum fields.
1217 (skeleton_prio): Extern it.
1218 (language_prio): Extern it.
1219 * src/parse-gram.y: Use grammar_prio rather than 1.
1220
738cde3e
AD
12212008-11-04 Akim Demaille <demaille@gostai.com>
1222
1223 * NEWS: Mention the trailing semicolon in action.
1224
d6fb461d
AD
12252008-11-04 Akim Demaille <demaille@gostai.com>
1226
1227 Reformat NEWS.
1228 * NEWS: Use more outline-mode markup.
1229 Suggested by Jim Meyering.
1230
14da0cdd
JD
12312008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1232
1233 Fix user actions without a trailing semicolon.
1234 Reported by Sergei Steshenko at
1235 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1236 * THANKS (Sergei Steshenko): Add.
1237 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1238 * tests/regression.at (Fix user actions without a trailing semicolon):
1239 New test case.
1240
c9ba9e59
JD
12412008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1242
1243 Initiate further development.
1244 * NEWS: Create an empty section for new entries.
1245 * gnulib: Update submodule to HEAD.
1246
bfb40910
JD
12472008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1248
1249 * NEWS: Version 2.4.
1250
241fda7a
JD
12512008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1252
1253 Prepare for next release.
1254 * NEWS: Briefly mention changes since 2.3b.
1255 * README: Say GNU m4 1.4.6, which we've been requiring in release
1256 announcements already, not 1.4.3, which breaks the build.
1257
ed4d67dc
JD
12582008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1259
1260 Say %language is experimental.
1261 We're thinking of extending it's effect on output file naming. See the
1262 thread at
1263 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1264 * NEWS: Say it's experimental.
1265 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1266 recommend it over %skeleton for now.
1267 (Bison Options): Likewise.
1268 (C++ Bison Interface): Use %skeleton not %language.
1269 (Calc++ Parser): Use %skeleton not %language.
1270 * src/getargs.c (usage): Say it's experimental.
1271
e254a580
DJ
12722008-11-01 Di-an Jan <dianj@freeshell.org>
1273 Paolo Bonzini <bonzini@gnu.org>
1274
1275 Support all Java parser class modifiers.
1276 * data/java.m4 (b4_percent_define_get3): New.
1277 (b4_final_if, b4_strictfp_if): New.
1278 * data/lalr1.java (final, strictfp, extends, implements): Support.
1279 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1280 documentation.
1281 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1282 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1283 (AT_CHECK_JAVA_GREP): New.
1284 (Java parser class modifiers): New test.
1285 (Java parser class extends and implements): New test.
1286
1287 Model exception propagation better with throws and lex_throws.
1288 * data/java.m4 (b4_list2): New.
1289 (throws): Change default.
1290 * data/lalr1.java (yyaction): Add throws.
1291 (parse): Add lex_throws in addition to throws.
1292 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1293 * tests/java.at (Java throws specifications): New test.
1294
1295 Improve documentation for Java parsers.
1296 * doc/bison.texinfo (Java Parsers): Add subsections.
1297 Don't quote first argument of %define.
1298 (Java Bison Interface): Document output files. Move documentation
1299 of parser class and merge into Java Parser Interface. Document
1300 features that error out. Document directives with no effect.
1301 Move note about Javadoc higher.
1302 (Java Semantic Values): Explicitly mention stype.
1303 Document that generic types cannot be used.
1304 (Java Location Values): Use @deftypeivar. Document constructors.
1305 Correct return value for toString.
1306 (Java Parser Interface): List undocumented constants/fields.
1307 Move documentation of fields added by %parse-param closer to list
1308 of members. Document that token names are added as fields.
1309 Document constructors accurately. Remove error method.
1310 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1311 Interface. Describe %code lexer and yylex accutately.
1312 Remove documentation that does not match the code.
1313 (Java Action Features): New.
1314 (Java Differences): Add reference. Add item on semantic values.
1315 Add note about @{ ... @}. Clarify %% epilogue placement.
1316 (Java Declarations Summary): New.
1317
1318 Fix Java skeleton.
1319 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1320 (b4_remove_comma): Quote test argument.
1321 (b4_identification): Remove "bison" field.
1322 * tests/java.at (Java parser class and package names): New test.
1323 (Java %parse-param and %lex-param): New test.
1324 (Java stype, position_class and location_class): New test.
1325
f259e4e6
PB
13262008-10-31 Di-an Jan <dianj@freeshell.org>
1327
1328 * data/lalr1.jave: Update copyright years.
1329 (YYParser): Correct name of "generated from" file in Javadoc:
1330 use b4_file_name instead of @ofile@.
1331 (Location constructor): Correct Javadoc parameter name.
1332 (yylloc): Add missing opening m4 quote after b4_location_if.
1333 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1334 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1335 (YYParser constructor): Correct Javadoc parameter name.
1336
cae5057f
JD
13372008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1338
1339 Always put auxiliary code files in the same dir as other output files.
1340 * src/files.c (compute_file_name_parts): When the user specifies
1341 --output but not --file-prefix, extract the directory prefix from the
1342 file prefix not from the grammar file name. This affects the location
1343 of files like location.hh generated by the C++ skeleton. The includes
1344 in the other output files require this fix.
1345 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1346 for expected output files.
1347 (Output files): Add a test for the above.
1348
4af432ba
JD
13492008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1350
1351 * gnulib: Update submodule to HEAD.
1352
e26d4e43
JD
13532008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1354
1355 Update copyright year.
1356 * src/files.c: Here.
1357
c0ee9e21
DJ
13582008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1359
1360 Don't overwrite the input file.
1361 * src/files.c (output_file_name_check): Fatal error if using input file
1362 for output.
1363 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1364 argument.
1365 (Conflicting output files): Add test.
1366
482dc52f
AD
13672008-10-28 Akim Demaille <demaille@gostai.com>
1368
1369 Space changes.
1370 * data/lalr1.cc: Formatting changes.
1371
52cbbe84
AD
13722008-10-28 Akim Demaille <demaille@gostai.com>
1373
1374 Don't define debugging functions when !YYDEBUG.
1375 * data/lalr1.cc (debug_stream, set_debug_stream)
1376 (debug_level_type, debug_level, set_debug_level): Don't
1377 declare them when YYDEBUG is not defined.
1378 The implementation are already YYDEBUG-aware.
1379
0925d5bf
AD
13802008-10-28 Akim Demaille <demaille@gostai.com>
1381
1382 Prefer "continue" for empty loop bodies.
1383 * etc/bench.pl.in: Use "continue" instead of {}.
1384
cf98343c
AD
13852008-10-28 Akim Demaille <demaille@gostai.com>
1386
1387 Space and comments changes.
1388 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1389 * data/c.m4, data/lalr1.cc: Space changes.
1390
9f467b7d
AD
13912008-10-28 Akim Demaille <demaille@gostai.com>
1392
1393 Make gnulib a submodule.
1394 * gnulib: New.
1395 * .gitmodules (gnulib): New.
1396
0f0e1ace
JD
13972008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1398
1399 Fix yyerror_range for user-defined location type in C++. Reported by
1400 Georg Sauthoff at
1401 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1402 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1403 * THANKS (Georg Sauthoff): Add.
1404
548e2104
JD
14052008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1406
1407 Update several administrative files mainly to facilitate releasing.
1408 * HACKING (Administrivia): Make the git-merge-changelog notes more
1409 helpful.
1410 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1411 (Release Procedure): Update for git and add numerous details that were
1412 previously missing.
1413 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1414 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1415 that announcements don't claim we bootstrapped with whatever bison
1416 happened to be in PATH. Add flex as a bootstrap tool.
1417 * Makefile.maint: Remove, previously replaced by maint.mk.
1418 * Makefile.cfg: Remove, and migrate settings to...
1419 * cfg.mk: ... here for the sake of `make announcement'.
1420 * bootstrap.conf (gnulib_modules): Add announce-gen.
1421 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1422 Berry.
1423
ddf17a6e
PB
14242008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1425
1426 Small but important bugfixes for the Java skeleton.
1427 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1428 (yy_symbol_print): Call toString on yyvaluep.
1429
e1145ad8
AD
14302008-08-29 Akim Demaille <demaille@gostai.com>
1431
1432 Clarify UPDATED use.
bee1df15 1433 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 1434 not to the release date of Bison.
bee1df15 1435 Reported by Joel E. Denny.
e1145ad8 1436
0df72d78
AD
14372008-08-29 Akim Demaille <demaille@gostai.com>
1438
1439 * README: Update FAQ pointer.
1440 Reported by Joel E. Denny.
1441
9a90b6bb
EB
14422008-08-27 Eric Blake <ebb9@byu.net>
1443
1444 Resync m4sugar from autoconf.
1445 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1446 (m4_init): Adjust to latest m4.git changes.
1447 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1448 effects.
1449 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1450 (_m4_list_cmp): Reduce side effects.
1451
65015668
AD
14522008-08-27 Akim Demaille <demaille@gostai.com>
1453
1454 Check yyerrok in calc.at.
bee1df15
EB
1455 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1456 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1457 expected.
65015668 1458
98e26a92
AD
14592008-08-27 Akim Demaille <demaille@gostai.com>
1460
1461 Support yyerrok in lalr1.cc.
1462 YYBACKUP is still to import back into lalr1.cc.
bee1df15 1463 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 1464
86c0e784
JD
14652008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1466
1467 For maintainer-check*, don't recompile for a $(VERSION) update.
1468 * cfg.mk: New file.
1469 (_is-dist-target): Override the one in GNUmakefile.
1470 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1471
88511166
JD
14722008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1473
1474 Update for recent change to gnulib.
1475 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1476 string.h now.
1477
6bbb2ed5
EB
14782008-08-15 Eric Blake <ebb9@byu.net>
1479
d67c52e8
EB
1480 Remaining m4sugar merge from autoconf.
1481 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1482 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1483 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1484 * src/output.c (output_skeleton): Tell m4 how to find it.
1485
6bbb2ed5
EB
1486 Partial m4sugar merge from autoconf: m4_map.
1487 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1488 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1489 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1490 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1491 for empty list.
1492 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1493 Likewise.
1494 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1495 declares it.
1496
8dce3875
JD
14972008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1498
1499 Keep .version and PACKAGE_VERSION in sync.
1500 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1501 dependency, and add comments justifying this in more detail. Discussed
1502 starting at
1503 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1504
882a1fbf
EB
15052008-08-06 Eric Blake <ebb9@byu.net>
1506
a3764451
EB
1507 Partial m4sugar merge from autoconf: m4_shiftn.
1508 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1509 (m4_shift2, m4_shift3): New macros.
1510 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1511 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1512 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1513 * data/java.m4 (b4_remove_comma): Likewise.
1514
882a1fbf
EB
1515 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1516 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1517 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1518 (m4_init): Consolidate wrapped text into single m4_wrap.
1519 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1520 in wrapped text.
1521
a30e920d
EB
15222008-08-05 Eric Blake <ebb9@byu.net>
1523
dfcc5959
EB
1524 Partial m4sugar merge from autoconf: builtins, version.m4.
1525 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1526 (m4_prepend): Remove, as it is unused and inherently quadratic,
1527 whereas m4_append is linear in newer m4.
1528 (m4_mkstemp): New builtin.
1529 (m4_symbols): Make rename conditional.
1530 (m4_version_prereq): Ensure fatal error if used in bison, which
1531 intentionally lacks version.m4.
1532
a30e920d
EB
1533 Fix comments in m4sugar.
1534 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1535
445b7470
JD
15362008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1537
1538 Update for recent .gitignore fix in Gnulib.
1539 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1540 anchored .gitignore entries.
1541
a1e50014
JD
15422008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1543
1544 Set gnu or gnits strictness.
1545 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1546 development and gnits strictness for releases. Based on Eric Blake's
1547 suggestion at
1548 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1549
d43f77e7
PB
15502008-07-31 Paolo Bonzini <bonzini@gnu.org>
1551
1552 * NEWS: Clarify documentation of %language.
1553
fee2ed87
PB
15542008-07-31 Paolo Bonzini <bonzini@gnu.org>
1555
1556 Support usage of git-merge-changelog.
1557 * .gitattributes: New.
1558 * HACKING: Document usage of git-merge-changelog.
1559 * bootstrap: Install git-merge-changelog entries in .git/config
1560 if appropriate.
1561
78029cd5
JD
15622008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1563
1564 Remove remaining dependence on CVS Id keyword.
1565 * ChangeLog: For the sake of people still using CVS, don't use dollars
1566 when mentioning Id.
1567 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1568 unusual anyway.
1569 * data/xslt/xml2dot.xsl: Likewise.
1570 * data/xslt/xml2text.xsl: Likewise.
1571 * data/xslt/xml2xhtml.xsl: Likewise.
1572 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1573 * doc/Makefile.am (neutralize): Remove, no longer needed.
1574 (.x.1): Don't use neutralize.
1575 (edit): Don't substitute for ID.
1576 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1577
c53d18b1
JD
15782008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1579
1580 Fix dependence on computed configure variables.
1581 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1582 $(top_srcdir)/configure.ac so that changes to computed variables, such
1583 as PACKAGE_VERSION, are seen.
1584 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1585
5523ac79
JD
15862008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1587
1588 Update copyright dates for recent changes.
1589 * Makefile.am: Here.
1590 * src/Makefile.am: Here.
1591 * src/reduce.c: Here.
1592 * tests/reduce.at: Here.
1593
8fa36911
JD
15942008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1595
1596 Use git-version-gen for version names between releases.
1597 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1598 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1599 * .prev-version: New.
1600 * .version.in: Remove.
78029cd5 1601 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
1602 revision.
1603 * GNUmakefile: Remove, now copied from Gnulib.
1604 * Makefile.am: Add code suggested by comments in
1605 build-aux/git-version-gen.
1606 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1607 .prev-version, and .version.
1608 * NEWS (2.3b+): Rename to...
1609 (?.?): ... this because we're dropping the "+" version naming scheme,
1610 but, in general, we still can't be sure of our next release name.
1611 * bootstrap: Add a quick hack to remove from .gitignore the
1612 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1613 entry. This should really be fixed in gnulib instead.
1614 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1615 * configure.ac (AC_INIT): Set version name by invoking
1616 build-aux/git-version-gen.
1617 (AC_CONFIG_FILES): Remove .version, now generated by
1618 build-aux/git-version-gen.
1619 * maint.mk: New, copied from coreutils.
1620 * doc/.cvsignore (bison.1): Add.
1621 * doc/.gitignore (/bison.1): Add.
1622 * doc/bison.1: Remove, generated.
1623 * src/.cvsignore (revision.c): Remove.
1624 * src/.gitignore (/revision.c): Remove.
1625 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1626 (BUILT_SOURCES): Remove revision.c.
1627 (revision.c): Remove.
1628 * src/getargs.c (version): Don't print revision after the VERSION.
1629 * src/revision.h: Remove.
1630
bcf07cb7
JD
16312008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1632
1633 Fix untranslatable composition of sentences. Reported by Goran
1634 Uddeborg at
1635 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1636 * THANKS (Goran Uddeborg): Add.
1637 * src/reduce.c (reduce_print): Report the number of nonterminals and
1638 rules useless in the grammar in separate sentences.
1639 * tests/reduce.at (Useless Rules): Update output.
1640 (Reduced Automaton): Likewise.
1641 (Underivable Rules): Likewise.
1642 (Empty Language): Likewise.
1643
9aacab9a
JD
16442008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1645
1646 Fix some .gitignore and .cvsignore problems.
1647 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1648 (insert_vc_ignore): ... this new function, which prepends `/' to all
1649 .gitignore entries before passing them to insert_sorted_if_absent.
1650 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1651 .cvsignore files are maintained even though Bison developers run
1652 bootstrap while using Git.
1653 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1654 unneeded by Bison.
1655 (gnulib): Add.
1656 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1657 unneeded. Reported by Eric Blake.
1658 * lib/.gitignore (/*~): Add.
1659 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1660 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1661 Blake.
1662 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1663
a9fc7990
JD
16642008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1665
1666 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1667 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1668 * bootstrap.conf (gnulib_modules): Add unsetenv.
1669 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1670 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1671 (/setenv.m4): Add.
1672 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1673 the first argument because it may become position-dependent, and unset
1674 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1675 Add comments explaining these issues in more detail.
1676
0f1d6f10
JD
16772008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1678
1679 Add .gitignore everywhere based on .cvsignore.
1680 * .gitignore: New.
1681 * build-aux/.gitignore: New.
1682 * data/.gitignore: New.
1683 * doc/.gitignore: New.
1684 * etc/.gitignore: New.
1685 * examples/.gitignore: New.
1686 * examples/calc++/.gitignore: New.
1687 * lib/.gitignore: New.
1688 * m4/.gitignore: New.
1689 * po/.gitignore: New.
1690 * runtime-po/.gitignore: New.
1691 * src/.gitignore: New.
1692 * tests/.gitignore: New.
1693
7bd1665a
JD
16942008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1695
1696 * NEWS (2.3b+): New section, empty for now.
1697 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1698
72c5b982
JD
16992008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1700
1701 * NEWS (2.3b): Update release date since there has been a delay in
1702 getting the announcements and tarballs out.
1703
bd02cd5d
JD
17042008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1705
1706 * NEWS: Version 2.3b.
1707 * configure.ac (AC_INIT): Likewise.
1708 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1709
9126263e
JD
17102008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1711
1712 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1713 been doing it for years.
1714 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1715 (Release Procedure): Add FIXME about make alpha being unmaintained.
1716
fa6aa7b3
JD
17172008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1718
1719 * data/yacc.c: Reformat m4 a little for readability.
1720 * src/lalr.c (build_relations): Correct comment.
1721
d30b312d
JMG
17222008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1723
1724 DJGPP specific issue.
1725 * djgpp/config.sed: Fixes required to run configure scripts generated
1726 by autoconf 2.62.
1727
138d4cd9
JD
17282008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1729
1730 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1731 coordinator@translationproject.org.
1732
8f7e2e1f
JD
17332008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1734
1735 * THANKS: Add Eric Blake.
1736
f55efa38
JD
17372008-04-23 Eric Blake <ebb9@byu.net>
1738
1739 Revert prior patch, by working around autoconf regression.
1740 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1741 ("Output file name: ("): Uncomment test.
1742 ("Output file name: )"): Likewise.
1743 Based on an idea from Noah Misch.
1744
096c9f9d
JD
17452008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1746
1747 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1748 2.61. Reported by Juan Manuel Guerrero at
1749 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1750 * tests/output.at ("Output file name: ("): Comment out test case for
1751 now.
1752 ("Output file name: )"): Likewise.
1753
0f664b89
JD
17542008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1755
1756 * GNUmakefile: Update git-version-gen invocation so make dist
1757 succeeds.
1758
1cfe6375
JD
17592008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1760
1761 Update to the current gnulib CVS repository, and fix trigraph handling
1762 in Bison.
1763 * bootstrap: Update gnulib CVS repository URL.
1764 (symlink_to_dir): Encapsulate the code that guarantees the destination
1765 directory exists into...
1766 (check_dst_dir): ... this new function, and...
1767 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1768 fail when copying files into lib/uniwidth/.
1769 * src/output.c (prepare_symbols): When writing yytname muscles, where
1770 symbol names will be encoded in C-string literals, tell quotearg to
1771 escape trigraphs. This used to be the default in gnulib.
1772 * tests/regression.at (Token definitions): Because of the change in
1773 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1774 escapes trigraphs in symbol names. Thus, yytname no longer has
1775 trigraphs unnecessarily doubly escaped. Update test case output.
1776 Extend test case to be sure Bison's own error messages will no longer
1777 have trigraphs in symbol names unnecessarily escaped once.
1778
74c52fc8
JD
17792008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1780
1781 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1782 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1783 * .cvsignore: Add .version.
1784 * .version.in: New.
1785 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1786 * configure.ac (AC_CONFIG_FILES): Add .version.
1787 * build-aux/.cvsignore: Add git-version-gen.
1788
8e55b3aa
JD
17892008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1790
1791 * NEWS (2.3a+): Mention that -g now takes an argument.
1792 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1793 consistency. Update the -g and -x entries now that they take
1794 arguments. Use brackets to indicate optional arguments.
1795 * src/getargs.c (usage): Explain the relationship between arguments of
1796 long and short options more completely. Document --defines and -d
1797 separately since the former takes an argument but, for POSIX Yacc, the
1798 latter does not.
1799 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 1800 (getargs): Sort cases.
8e55b3aa 1801
59c5ac72
AD
18022008-02-28 Akim Demaille <demaille@gostai.com>
1803
1804 * doc/bison.texinfo: Fix a few typos.
1805
118d4978
AD
18062008-02-28 Akim Demaille <akim@epita.fr>
1807
1808 * doc/bison.texinfo (Bison Options): Document -W.
1809 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1810
7020f1e9
AD
18112008-02-28 Akim Demaille <akim@epita.fr>
1812
1813 * src/getargs.c (short_options): Split and sort for readability.
1814 -g and -x take optional arguments, just like their long options.
1815 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1816 understand.
1817 Fix the handling of $opt which resulted in all the argument to be
1818 considered as optional.
1819
59da312b
JD
18202008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1821
1822 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1823 say its interface is experimental.
1824 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1825 Java.
1826 (Bison Options): In the -L and --language entry, mention Java.
1827 (Java Bison Interface): Say the interface is experimental.
1828 * src/getargs.c (usage): Mention -L and --language.
1829
1830 * NEWS (2.3a+): Say the push parsing interface is experimental.
1831 * doc/bison.texinfo (Push Decl): Likewise.
1832 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1833 (Push Parser Function): Likewise.
1834 (Pull Parser Function): Likewise.
1835 (Parser Create Function): Likewise.
1836 (Parser Delete Function): Likewise.
1837 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1838 yypull_parse, and yypush_parse entries.
1839
1840 * NEWS (2.3a+): Mention XML support, and say the schema is
1841 experimental.
1842 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1843 * src/getargs.c (usage): Say the XML schema is experimental.
1844
1845 * NEWS (2.3a+): Say option instead of flag.
1846
2bb3ebec
WP
18472008-02-21 Wojciech Polak <polak@gnu.org>
1848
1849 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1850 text.
1851
333e670c
JD
18522008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1853
1854 Fix impure push parser compile error reported by Bob Rossi at
1855 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1856 * data/yacc.c: Clean up whitespace in the output a little.
1857 (yypstate_allocated): Define for impure push parsers regardless of
1858 whether the pull interface is also requested.
1859 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1860 check impure push parsers without the pull interface.
1861
1862 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1863 yyerror takes arguments specified by %parse-param while yypstate_new
1864 does not.
1865 * doc/bison.texinfo (Parser Create Function): Document that
1866 yypstate_new returns 0 for multiple impure parser instances.
1867 * tests/push.at (Push Parsing: Multiple impure instances): Update
1868 expected stderr output.
1869
798096e1
JD
18702008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1871
1872 * runtime-po/POTFILES.in (push.c): Remove.
1873
9ca7f077
JD
18742008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1875
1876 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1877 * data/push.c: Rename to...
1878 * data/yacc.c: ... this, overwriting it.
1879 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1880 `%push-pull-parser' -> `%define api.push_pull "both"'.
1881 Remove old yacc.c tests, and update push.c tests to yacc.c.
1882
42ee26bb
JD
18832008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1884
1885 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1886 `"%code top" blocks' instead of `%code "top" blocks'.
1887 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1888 Clean up whitespace in the output a little.
1889
b1cc23c4
JD
18902008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1891
1892 Fix documentation problems reported by Tim Josling at
1893 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1894 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1895 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1896 integers. Explain the effect of literal string aliases on error
1897 messages. Copy token 0 documentation from the C++ skeleton
1898 documentation.
1899
ab7f29f8
JD
19002008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1901
1902 Accept a token number in a %left, %right, or %nonassoc for POSIX
1903 conformance. Reported by Tim Josling at
1904 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1905 * NEWS (2.3a+): Mention.
1906 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1907 and code numbers are treated by precedence declarations.
1908 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1909 of symbols.1.
1910 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1911 of symbol.
1912 (symbol.prec): New, just like symbol but allows INT.
1913 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1914 longer holds.
1915 * tests/regression.at (Token number in precedence declaration): New
1916 test case.
1917
a924ef36
JMG
19182008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1919
1920 DJGPP specific issues.
1921 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1922 be changed. Copyright timestamp adjusted.
1923 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1924 be changed. Copyright timestamp adjusted.
1925 * djgpp/config.site: Copyright timestamp adjusted.
1926 * djgpp/config_h.sed: Copyright timestamp adjusted.
1927 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1928 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1929 filename translation list.
1930 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1931 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1932 files shall be created. Before trying to use the temp dir where the
1933 environment variable points to check that the dir really exists. If
1934 not default to the cwd as temp dir. Copyright timestamp adjusted.
1935 * djgpp/subpipe.h: Copyright timestamp adjusted.
1936 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1937
389c8cfd
PE
19382008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1939
1940 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
1941
5d1cfef4
PE
19422008-01-09 Paul Eggert <eggert@cs.ucla.edu>
1943
1944 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
1945 Problem reported by Claudio Saavedra in
1946 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
1947
e2dcf996
WP
19482008-01-05 Wojciech Polak <polak@gnu.org>
1949
1950 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
1951 document's title with the input grammar file name.
1952
da730230
JD
19532007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
1954
1955 Automate regression testing of the XML/XSLT implementation. Discussed
1956 starting at
1957 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
1958 * configure.ac (XSLTPROC): New substitution.
1959 * Makefile.am (maintainer-xml-check): New phony target invoking...
1960 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
1961 invoking make maintainer-check with BISON_TEST_XML=1.
1962 * tests/atlocal.in (XSLTPROC): New.
1963 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
1964 not to report reachable memory when Bison is expected to have a
1965 non-zero exit status and (2) to compare XML/XSLT output with --graph
1966 and --report=all output for every working grammar when
1967 BISON_TEST_XML=1.
1968 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
1969 (AT_BISON_CHECK_XML): New.
1970 (AT_QUELL_VALGRIND): New.
1971 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
1972 (AT_CHECK): ... don't redefine this since this was the old way to
1973 quell Valgrind.
1974 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
1975 AT_BISON_CHECK invocations.
1976 * tests/c++.at: Likewise.
1977 * tests/calc.at: Likewise.
1978 * tests/conflicts.at: Likewise.
1979 * tests/cxx-type.at: Likewise.
1980 * tests/existing.at: Likewise.
1981 * tests/glr-regression.at: Likewise.
1982 * tests/headers.at: Likewise.
1983 * tests/input.at: Likewise.
1984 * tests/java.at: Likewise.
1985 * tests/output.at: Likewise.
1986 * tests/push.at: Likewise.
1987 * tests/reduce.at: Likewise.
1988 * tests/regression.at: Likewise.
1989 * tests/sets.at: Likewise.
1990 * tests/skeletons.at: Likewise.
1991 * tests/synclines.at: Likewise.
1992 * tests/torture.at: Likewise.
1993 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
1994 tends to hang xsltproc.
1995 (Big horizontal): Likewise.
1996
408476bc
JD
19972007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1998
1999 In XML output, remove redundant class attribute on symbol element.
2000 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2001 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2002 look up a symbol to determine whether it's a nonterminal or terminal.
2003 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2004 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2005
2006 Add prec/assoc information to XML output.
2007 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2008 %prec, add a percent_prec attribute.
2009 * src/print-xml.c (print_grammar): For each terminal that has a
2010 precedence or associativity, add a prec or assoc attribute.
2011 (xml_indent): New.
2012 (xml_puts): Use xml_indent.
2013 (xml_printf): Use xml_indent.
2014 * src/print-xml.h (xml_indent): Prototype.
2015
2016 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2017 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2018
d4a26c48
JD
20192007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2020
2021 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2022 (bison:ruleByNumber): ... this for clarity.
2023 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2024 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2025 (xsl:template match="reduction"): Update.
2026 (xsl:template match="item"): Update.
2027 (xsl:template match="reduction"): Update.
2028
2029 In the XML output, don't print the list of rules where symbols appear.
2030 Compute it in XSLT instead. Discussed at
2031 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2032 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2033 (bison:ruleByRhs): New.
2034 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2035 bison:ruleByRhs.
2036 (xsl:template match="terminal/rule"): Remove.
2037 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2038 bison:ruleByRhs.
2039 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2040 Remove.
2041 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2042 bison:ruleByRhs and mode="number-link" for rule template.
2043 (xsl:template match="terminal/rule"): Remove.
2044 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2045 bison:ruleByRhs and mode="number-link" for rule template.
2046 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2047 Rewrite as...
2048 (xsl:template match="rule" mode="number-link"): ... this.
2049 * src/print-xml.c (print_grammar): Don't print the list of rules.
2050
ef1b4273
JD
20512007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2052
2053 Don't let --report affect XML output; always print all information.
2054 Discussed at
2055 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2056 * src/conflicts.c (log_resolution): Implement.
2057 * src/print-xml.c (print_core): Implement.
2058 (print_state): Implement.
2059 (print_xml): Implement.
2060
2061 * NEWS (2.3a+): Fix quotes.
2062 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2063 don't let %verbose clear the list specified by --report.
2064
0f6cd9e3
AD
20652007-11-26 Akim Demaille <akim@epita.fr>
2066
2067 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2068
d80fb37a
JD
20692007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2070
2071 In the XML output, list useless and unused symbols and rules with the
2072 useful ones and add a "usefulness" attribute. Discussed starting at
2073 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2074 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2075 (grammar_rules_print_xml): Print all rules instead of just those
2076 useful in the grammar, and add a "usefulness" attribute.
2077 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2078 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2079 (print_grammar): Print all nonterminals instead of just useful ones,
2080 and add a "usefulness" attribute to nonterminals and terminals.
2081 (print_xml): Don't print a separate "reductions" or
2082 "rules-useless-in-parser" element.
2083 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2084 (reduce_xml): Remove.
2085 (reduce_token_unused_in_grammar): New.
2086 (reduce_nonterminal_useless_in_grammar): New.
2087 * src/reduce.h (reduce_xml): Remove prototype.
2088 (reduce_token_unused_in_grammar): Add prototype.
2089 (reduce_nonterminal_useless_in_grammar): Add prototype.
2090 * data/xslt/xml2text.xsl: Update for XML changes.
2091 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2092 * tests/reduce.at (Useless Terminals): Update output.
2093 (Useless Rules): Update output.
2094 (Reduced Automaton): Update output.
2095
2096 Say "Terminals unused in grammar" instead of "Unused terminals".
2097 * NEWS (2.3a+): Update.
2098 * doc/bison.texinfo (Understanding): Update example output.
2099 * src/reduce.c (reduce_output): Implement.
2100 * data/xslt/xml2text.xsl: Implement.
2101 * data/xslt/xml2xhtml.xsl: Implement.
2102
1bb2bd75
JD
21032007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2104
2105 Accept --report-file=FILE to override the default `.output' filename.
2106 * NEWS (2.3a+): Mention.
2107 * doc/bison.texinfo (Bison Options): Add an entry.
2108 * src/files.c (compute_output_file_names): Don't override
2109 spec_verbose_file if already set.
2110 * src/getargs.c (usage): Document --report-file.
2111 (REPORT_FILE_OPTION): New anonymous enum member.
2112 (long_options): Add entry for it.
2113 (getargs): Add case for it setting spec_verbose_file.
2114
2115 * build-aux/cross-options.pl: Don't record a short option just because
2116 there's an arg.
2117 * doc/.cvsignore: Add yacc.1.
2118
a005a9c4
AD
21192007-11-14 Akim Demaille <akim@epita.fr>
2120
2121 * doc/yacc.1.in: New.
2122 * configure.ac, doc/Makefile.am: Adjust.
2123 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2124 config.h symbol.
2125 Use AC_SUBST for assignments too.
2126 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2127
cff03fb2
JD
21282007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2129
2130 * src/gram.c: Remove comments that duplicate comments in gram.h.
2131
2132 When reporting useless rules and nonterminals, say "useless in grammar"
2133 instead of "useless", and say "useless in parser" instead of "never
2134 reduced". Discussed starting at
2135 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2136 * NEWS (2.3a+): Mention this change.
2137 * data/xslt/xml2text.xsl: Update output text and expected input XML
2138 element names to match changes below.
2139 * data/xslt/xml2xhtml.xsl: Likewise.
2140 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2141 Contents: "Rules useless in parser due to conflicts".
2142 * doc/bison.texinfo (Decl Summary): Reword a little.
2143 (Understanding): Update example output for changes below.
2144 * src/gram.c: (rule_useful_p): Rename to...
2145 (rule_useful_in_grammar_p): ... this.
2146 (rule_useless_p): Rename to...
2147 (rule_useless_in_grammar_p): ... this.
2148 (rule_never_reduced_p): Rename to...
2149 (rule_useless_in_parser_p): ... this.
2150 (grammar_rules_print): Update for renames.
2151 (grammar_rules_print_xml): Update for renames.
2152 (grammar_rules_never_reduced_report): Rename to...
2153 (grammar_rules_useless_report): ... this since it is used for either
2154 kind of useless rule.
2155 * src/gram.h: Reword comments and update function names in prototypes.
2156 * src/main.c (main): Say "rule useless in parser due to conflicts".
2157 * src/print-xml.c (print_rules_never_reduced): Rename to...
2158 (print_rules_useless_in_parser): ... this, and rename output XML
2159 element "rules-never-reduced" to "rules-useless-in-parser".
2160 (print_xml): Update for rename.
2161 * src/print.c (print_results): Say "Rules useless in parser due to
2162 conflicts".
2163 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2164 (nonterminals_reduce): Say "nonterminal useless in grammar".
2165 (reduce_output): Say "Nonterminals useless in grammar".
2166 Say "Rules useless in grammar".
2167 (reduce_xml): Rename output XML element "useless" to
2168 "useless-in-grammar".
2169 (reduce_print): Don't report the count of grammatically useless rules
2170 as "rules never reduced" just because %yacc is specified.
2171 In the correct report of this count, say nonterminal(s) and rule(s)
2172 "useless in grammar".
2173 * tests/conflicts.at (S/R in initial): Update expected output.
2174 (Defaulted Conflicted Reduction): Likewise.
2175 (Unreachable States After Conflict Resolution): Likewise.
2176 * tests/existing.at (GNU pic Grammar): Likewise.
2177 * tests/reduce.at (Useless Nonterminals): Likewise.
2178 (Useless Rules): Likewise.
2179 (Reduced Automaton): Likewise.
2180 (Underivable Rules): Likewise.
2181 (Empty Language): Likewise.
2182
66f0441d
JD
21832007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2184
2185 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2186 here document and before the EOF so that BSD's implementation of Bourne
2187 shell doesn't parse the delimiter as part of the here document.
2188 * doc/.cvsignore: Add cross-options.texi.
2189 * src/getargs.c (usage): Add a blank line after the warning categories.
2190
d0ee4105
PB
21912007-11-08 Paolo Bonzini <bonzini@gnu.org>
2192
2193 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2194
e8b1fb9b
AD
21952007-11-05 Akim Demaille <akim@epita.fr>
2196
2197 Remove Id: from bison.1.
2198 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2199 (perl -0777 -pi -e 's/\.PP\nId): New.
2200 (.x.1): Use it to ignore the version control revision.
2201
2f7a96b5
AD
22022007-11-05 Akim Demaille <demaille@gostai.com>
2203
2204 * build-aux/Makefile.am: Ship cross-options.pl.
2205 * doc/Makefile.am: Always refer to cross-options.texi with
2206 $(srcdir).
2207 (MAINTAINERCLEANFILES): Add it.
2208
f4101aa6
AD
22092007-11-04 Akim Demaille <demaille@gostai.com>
2210
2211 Generate the long/short option cross-table.
2212 * build-aux/cross-options.pl: New.
2213 * doc/Makefile.am (cross-options.texi): New.
2214 * doc/bison.texinfo: Use it.
2215
727a1401
AD
22162007-11-04 Akim Demaille <demaille@gostai.com>
2217
2218 Generate bison.1 using help2man.
2219 * doc/common.x, doc/bison.x: New.
2220 * doc/Makefile.am (bison.1, .x.1): New.
2221 The code is taken from autoconf-2.61/man/Makefile.am.
2222 * configure.ac: Look for help2man.
2223
6aeb9c57
AD
22242007-11-04 Akim Demaille <demaille@gostai.com>
2225
2226 Complete --help.
2227 * src/getargs.c (usage): Document -W, make it clear that -d,
2228 -g and -x have optional arguments.
2229
d7be4085
AD
22302007-11-04 Akim Demaille <demaille@gostai.com>
2231
2232 Find sha1sum when named gsha1sum.
2233 * bootstrap (find_tool): New.
2234 ($SHA1SUM): New.
2235
d9df47b6
JD
22362007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2237
2238 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2239 at
2240 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2241 * NEWS (2.3a+): Mention.
2242 * data/bison.m4 (b4_pure_if): Don't define it here.
2243 * data/c.m4 (b4_identification): Depend on individual skeletons to
2244 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2245 values of the %define variables api.pure or api.push_pull. Define
2246 YYPURE, YYPUSH, and YYPULL accordingly.
2247 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2248 glr.cc has already defined b4_pure_flag.
2249 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2250 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 2251 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
2252 * doc/bison.texinfo (Pure Decl): Update.
2253 (Push Decl): Update.
2254 (Decl Summary): Add api.pure to %define entry.
2255 In %pure-parser entry, say it's deprecated and reference %define.
2256 (Pure Calling): Update.
2257 (Error Reporting): Update.
2258 (C++ Scanner Interface): Update.
2259 (How Can I Reset the Parser): Update.
2260 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2261 reference %define.
2262 * src/getargs.c (pure_parser): Remove global variable.
2263 * src/getargs.h (pure_parser): Remove extern.
2264 * src/output.c (prepare): Don't define pure_flag muscle.
2265 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2266 wrapper around `%define api.pure'.
2267 * tests/calc.at (Simple LALR Calculator): Update.
2268 (Simple GLR Calculator): Update.
2269 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2270 Update.
2271 (GLR: Resolve ambiguity, pure, locations): Update.
2272 (GLR: Merge conflicting parses, pure, no locations): Update.
2273 (GLR: Merge conflicting parses, pure, locations): Update.
2274 * tests/glr-regression.at (Uninitialized location when reporting
2275 ambiguity): Update
2276 * tests/input.at (Unused %define api.pure): New test case.
2277 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2278 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2279 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2280
c373bf8b
JD
22812007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2282
2283 %define push_pull -> %define api.push_pull. Discussed starting at
2284 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2285 * data/push.c: Expect the new name.
2286 * data/yacc.c: Likewise.
2287 * doc/bison.texinfo (Push Decl): Update.
2288 (Decl Summary): Update %define entry.
2289 (Push Parser Function): Update.
2290 (Pull Parser Function): Update.
2291 (Parser Create Function): Update.
2292 (Parser Delete Function): Update.
2293 * tests/calc.at (Simple LALR Calculator): Update.
2294 * tests/input.at (%define enum variables): Update.
2295 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2296 (Push Parsing: Multiple impure instances): Update.
2297 (Push Parsing: Unsupported Skeletons): Update.
2298 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2299 (Exploding the Stack Size with Malloc): Update.
2300
2301 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2302 other entries some.
2303
32f19b6b
JD
23042007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2305
2306 For the XML output's terminal element, rename @number to @token-number,
2307 and add @symbol-number. In the nonterminal element, rename @number to
2308 @symbol-number. Discussed starting at
2309 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2310 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2311 renames.
2312 (xsl:template match="nonterminal"): Likewise.
2313 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2314 (xsl:template match="nonterminal"): Likewise.
2315 * src/print-xml.c (print_grammar): Implement.
2316
255a6b90
JD
23172007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2318
2319 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2320 2007-10-11 change, the child elements here are items not rules.
408476bc 2321 (xsl:template match="item"): New.
255a6b90
JD
2322 (xsl:template match="rule"): Update for new reduced itemset.
2323 (xsl:template match="point"): Remove.
2324 (xsl:template match="empty"): For consistency with --graph, don't
2325 output "/* empty */".
2326 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2327 line-wrap, don't pass a negative value as first-line-length since this
2328 won't work with the following changes.
2329 (xsl:template name="line-wrap"): Simplify slightly.
2330 (xsl:template name="ws-search"): Eliminate recursion.
2331 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2332 set next to an item whose dot is not at the end of the RHS even if it
2333 happens to be associated with the same rule.
2334
88c78747
JD
23352007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2336
31984206
JD
2337 Add %define lr.keep_unreachable_states.
2338 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2339 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2340 * src/main.c (main): Implement it.
2341 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2342 Extend to test it, and fix a typo.
2343
23442007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2345
2346 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
2347 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2348 the example .output text.
2349 * tests/regression.at (Extra lookahead sets in report): Improve wording
2350 of comments.
2351
b7a70162
WP
23522007-10-17 Wojciech Polak <polak@gnu.org>
2353
2354 * src/print-xml.c (print_grammar): Renamed
2355 <terminal> and <nonterminal> attributes:
2356 "type" to "number" and "symbol" to "name".
2357 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2358 Use new attribute names.
2359 (xsl:template match="nonterminal"): Likewise.
2360 * data/xslt/xml2xhtml.xsl: Likewise.
2361
a0de5091
JD
23622007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2363
2364 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2365 (Option Cross Key): Likewise.
2366
2367 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2368 next to an item whose dot is not at the end of the RHS even if it
2369 happens to be associated with the same rule.
2370 * src/print.c (print_core): Likewise.
2371 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2372 (Resolved SR Conflicts): Update output.
2373 * tests/regression.at (Extra lookahead sets in report): New test case.
2374
4c20d18d
WP
23752007-10-11 Wojciech Polak <polak@gnu.org>
2376
2377 * src/print-xml.c (print_core): Remove item set
2378 redundancy.
2379 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2380 Improve processing time. Suggested by Joel E. Denny.
2381 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2382 Write xsl:param "required" attribute as comment.
2383 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2384 (xsl:template match="rule"): Support new reduced itemset.
2385 (xsl:template match="point"): Remove.
2386 * data/xslt/xml2xhtml.xsl: Likewise.
2387
f506ad1c
JD
23882007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2389
2390 * src/getargs.c (version): Update copyright year.
2391
21f1b063
JD
23922007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2393
2394 Make xml2dot.xsl and --graph produce the same output.
2395 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2396 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2397 escaped later.
2398 (xsl:template name="output-node"): Use the new escape template instead
2399 of the string-replace template directly.
2400 (xsl:template name="output-edge"): Likewise.
2401 (xsl:template name="escape"): New, escapes backslashes and newlines in
2402 addition to quotation marks.
2403 * src/graphviz.c (start_graph, output_node, output_edge): Add
2404 whitespace to output for legibility.
2405
2406 Make xml2text.xsl and --report produce the same output, and remove the
2407 XML "conflicts" element since a conflict summary is easily extracted
2408 from the automaton.
2409 * data/xslt/bison.xsl: New.
2410 (xsl:template match="state" mode="bison:count-conflicts): New.
2411 * data/xslt/xml2text.xsl: Import bison.xsl.
2412 (xsl:template match="bison-xml-report"): Instead of styling the
2413 "conflicts" element, style the "automaton" element with mode
2414 "conflicts". Unlike the former, the latter lists S/R and R/R
2415 conflicts for a state on the same line.
2416 (xsl:template match="conflicts"): Remove.
2417 (xsl:template match="conflict"): Remove.
2418 (xsl:template match="terminal"): Line-wrap the list of rules in which
2419 the terminal is used.
2420 (xsl:template match="nonterminal"): Likewise for nonterminals.
2421 (xsl:template match="automaton" mode="conflicts"): New.
2422 (xsl:template match="state" mode="conflicts"): New.
2423 (xsl:template name="line-wrap"): New.
2424 (xsl:template name="ws-search"): New.
2425 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2426 (xsl:template match="bison-xml-report"): Instead of styling the
2427 "conflicts" element, style the "automaton" element with mode
2428 "conflicts."
2429 (xsl:template match="conflicts"): Remove.
2430 (xsl:template match="conflict"): Remove.
2431 (xsl:template match="automaton" mode="conflicts"): New.
2432 (xsl:template match="state" mode="conflicts): New.
2433 * src/conflicts.c (conflicts_output_xml): Remove.
2434 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2435 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2436 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2437 the corresponding XSLT is easier. Also, never wrap between a word and
2438 the comma that follows it.
2439
793fbca5
JD
24402007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2441
2442 Improve C++ namespace support. Discussed starting at
2443 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2444 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2445 b4_namespace_close): New macros that interpret the %define variable
2446 "namespace" so its value can contain "::" to indicate nested
2447 namespaces.
2448 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2449 the above macros.
2450 * data/lalr1.cc (b4_namespace): Likewise.
2451 * data/location.cc (b4_namespace): Likewise.
2452 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2453 inside a new table in the general %define entry. Document `%define
2454 namespace' there as well. Point the %name-prefix entry to it since it
2455 explains it more completely in the case of C++.
2456 (C++ Bison Interface): Mention `%define namespace' instead of
2457 %name-prefix.
2458 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2459 entry suffices.
2460 * tests/c++.at (Relative namespace references): New test case.
2461 (Absolute namespace references): New test case.
2462 (Syntactically invalid namespace references): New test case.
2463 * tests/input.at (C++ namespace reference errors): New test case.
2464
35b8730d
JD
24652007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2466
2467 Add syncline support and location accessor to internal %define
2468 interfaces.
2469 * data/bison.m4 (b4_percent_define_get_loc): New.
2470 (b4_percent_define_get_syncline): New.
2471 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2472 (b4_percent_define_default): Record defining location as line 1 rather
2473 than 0 for the sake of synchronizing #line's, and define
2474 b4_percent_define_syncline(VARIABLE).
2475 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2476 * src/muscle_tab.c (muscle_syncline_grow): New.
2477 (muscle_code_grow): Use muscle_syncline_grow.
2478 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2479 define b4_percent_define_syncline(VARIABLE).
2480 (muscle_percent_define_get_loc): New.
2481 (muscle_percent_define_get_syncline): New.
2482 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2483 remove some unused variables.
2484 (muscle_percent_define_default): Record defining location as line 1
2485 rather than 0 for the sake of synchronizing #line's, and define
2486 b4_percent_define_syncline(VARIABLE).
2487 (muscle_percent_define_check_values): Use
2488 muscle_percent_define_get_loc.
2489 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2490 (muscle_percent_define_get_syncline): Prototype.
2491 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2492 defaults): Update output for location change.
2493 (Complaining during macro argument expansion): Extend to test
2494 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2495
7dc4a694
JD
24962007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2497
2498 Fix some error-reporting macro bugs.
2499 * data/bison.m4 (b4_cat): New.
2500 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2501 to stdout so they don't become arguments to other macros. Update
2502 comments and add examples.
2503 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2504 add examples.
2505 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2506 after printing the error directive so that M4 doesn't report subsequent
2507 problems that are induced by this problem.
2508 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2509 instead of just in them. Recognize @\n in both places. Both expand to
2510 the empty string. Needed by b4_cat.
2511 * tests/skeletons.at (Complaining during macro argument expansion):
2512 New test case.
2513 (Fatal errors make M4 exit immediately): New test case.
2514
d4bd2295
JD
25152007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2516
2517 Implement --print-datadir.
2518 * src/getargs.c (usage): Mention.
2519 (PRINT_DATADIR_OPTION): New anonymous enum member.
2520 (long_options): Add entry for it.
2521 (getargs): Add case for it calling compute_pkgdatadir.
2522 * src/output.c (output_skeleton): Encapsulate data directory
2523 computation from here...
2524 (prepare): ... and from here...
2525 (compute_pkgdatadir): ... into this new function.
2526 * src/output.h (compute_pkgdatadir): Prototype.
2527
34cdeddf
JD
25282007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2529
2530 * src/print-xml.c (escape_bufs): New static global variable
2531 replacing...
2532 (xml_escape_n): ... the static local variable buf here.
2533 (print_xml): Free memory for escape_bufs.
2534 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2535
d782395d
JD
25362007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2537
2538 Replace `%push-parser' and `%push-pull-parser' with
2539 `%define push_pull "push"' and `%define push_pull "both"'.
2540 `%define push_pull "pull"' is the default.
2541 * doc/bison.texinfo (Push Decl, Push Parser Function,
2542 Pull Parser Function, Parser Create Function, Parser Delete Function):
2543 Update declarations.
2544 (Decl Summary, Table of Symbols): Replace %push-parser and
2545 %push-pull-parser entries with a %define push_pull entry.
2546 * data/bison.m4 (b4_percent_define_check_values): New macro.
2547 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2548 definitions...
2549 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2550 definitions...
2551 * data/push.c: ... to here and compute them from the value of the
2552 %define variable push_pull.
2553 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2554 parsing requests here...
2555 * data/yacc.c: ... hack this to switch to push.c any time
2556 b4_use_push_pull_flag or the %define variable push_pull is set. This
2557 will go away when we mv push.c yacc.c.
2558 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2559 push parsing is not supported since unused %define variables are
2560 reported anyway.
2561 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2562 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2563 comments for consistency with b4_percent_define_check_values.
2564 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2565 muscles.
2566 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2567 Remove.
2568 (prologue_declaration): Remove %push-parser and %push-pull-parser
2569 rules.
2570 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2571 * tests/calc.at: Update declarations.
2572 * tests/input.at (%define enum variables): New test case.
2573 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2574 declaration.
2575 (Push Parsing: Multiple impure instances): Update declaration.
2576 (Push Parsing: Unsupported Skeletons): New test case.
2577 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2578 declaration.
2579 (Exploding the Stack Size with Malloc): Update declaration.
2580
3f999f78
WP
25812007-09-24 Wojciech Polak <polak@gnu.org>
2582
2583 Add XSLT transformations.
2584
2585 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2586 * data/xslt/xml2text.xsl: Transform XML into plain text.
2587 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2588 * data/Makefile.am (xsltdir): New variable.
2589 (dist_xslt_DATA): Add xslt/*.xsl files.
2590
a4f75309
PE
25912007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2592
2593 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2594 Problem reported by Wojciech Polak.
2595 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2596 (xml_printf): Undo change I made on 21 September; that is,
2597 indent 2 spaces, not 1.
2598
ad5feac4
JD
25992007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2600
2601 Pacify ./configure --enable-gcc-warnings.
2602 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2603 `char const *' instead of `char *'.
2604 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2605 local variable `sep'.
2606
41d7a5f2
PE
26072007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2608
2609 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2610 elsewhere.
2611 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2612 (xml_printf): Indent just 1 space for level.
2613 (e_char, xlate_char): Remove.
2614 (xml_escape_string): Rewrite to avoid undefined behavior (used
2615 storage that was freed from the stack).
2616 (xml_escape_n): Don't bother checking for subscript error.
2617
3f999f78
WP
26182007-09-21 Wojciech Polak <polak@gnu.org>
2619
2620 Add Bison XML Automaton Report.
41d7a5f2
PE
2621
2622 Add support for an -x option to generate an XML report.
2623 It is not documented yet.
2624 * src/print-xml.c: New file.
2625 * src/print-xml.h: Likewise.
2626 * lib/timevar.def (TV_XML): New var.
2627 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2628 * src/conflicts.c: Include print-xml.h.
2629 (solved_conflicts_xml_obstack): New var.
2630 (log_resolution, conflicts_solve, conflicts_free):
2631 Add support for XML report.
2632 (conflicts_output_val): New function.
2633 * src/conflicts.h (conflicts_output_val): New decl.
2634 * src/files.c (spec_xml_file): New var.
2635 (compute_output_file_names, output_file_names_free): Add XML support.
2636 * src/files.h (spec_xml_file): New decl.
2637 * src/getargs.c (xml_flag): New var.
2638 (usage, short_options, long_options, getargs): Add XML support.
2639 * src/getargs.h (xml_flag): New decl.
2640 * src/gram.c: Include print-xml.h.
2641 (rule_lhs_print_xml, rule_rhs_print_xml):
2642 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2643 New functions.
2644 * src/gram.h: Declare external ones.
2645 * src/main.c: Include print-xml.h.
2646 (main): Add XML support.
2647 * src/reduce.c: Include print-xml.h.
2648 (reduce_xml): New function.
2649 * src/reduce.h: Declare it.
2650 * src/state.c: Include print-xml.h.
2651 (state_new): Add XML support.
2652 (state_rule_lookahead_tokens_print_xml): New function.
2653 * src/state.h: Declare it.
2654 (struct state): New member solved_conflicts_xml.
2655 * src/symtab.c (symbol_class_get_string): New function.
2656 * src/symtab.h: Declare it.
2657
6d8e724d
PE
26582007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2659
2660 * GNUmakefile: Switch to coreutils's version.
2661 * bootstrap: Likewise.
2662 * Makefile.cfg: Adjust to new GNUmakefile.
2663 * README-hacking: Likewise.
2664
2665 Import from gnulib:
2666
2667 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2668 Bruno Haible <bruno@clisp.org>
2669
2670 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2671 and is a script that invokes bison. Tighten the code. Add comments.
2672
922bdd7f
JD
26732007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2674
2675 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2676 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2677 * doc/bison.texinfo (Decl Summary): Fix.
2678 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2679 * tests/input.at (Boolean %define variables): Update output.
2680 * tests/skeletons.at (%define boolean variables: invalid skeleton
2681 defaults): Rename to...
2682 (%define Boolean variables: invalid skeleton defaults): ... this and
2683 update output.
2684
1b17b01d
JD
26852007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2686
2687 In impure push mode, don't allow more than one yypstate to be allocated
2688 since multiple impure parsers would corrupt yynerrs.
2689 * data/push.c (yypstate_allocated): New static global variable
2690 initialized to 0.
2691 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2692 exhaustion if yypstate_allocated is 1, but still return 2.
2693 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2694 already 1. Otherwise, set it to 1.
2695 (yypstate_delete): Set it to 0.
2696 * tests/push.at (Push Parsing: Multiple impure instances): New test
2697 case.
2698
9987d1b3
JD
26992007-08-17 Bob Rossi <bob@brasko.net>
2700
2701 * doc/bison.texinfo (Push Decl): Document the push parser.
2702 (Table of Symbols): Ditto.
2703 (Pure Decl): Ditto.
2704 (Decl Summary): Ditto.
2705 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2706 Parser Create Function, Parser Delete Function):
2707 Add new push parser symbols.
2708 (Table of Symbols): Document push-parser, push-pull-parser,
2709 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2710
f16b0819
PE
27112007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2712
2713 Update to GPLv3.
2714 * doc/gpl-3.0.texi: New file.
2715 * doc/gpl.texi: Remove.
2716 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2717 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2718 * README-hacking, TODO, bootstrap, bootstrap.conf:
2719 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2720 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2721 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2722 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2723 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2724 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2725 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2726 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2727 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2728 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2729 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2730 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2731 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2732 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2733 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2734 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2735 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2736 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2737 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2738 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2739 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2740 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2741 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2742 * src/complain.c, src/complain.h, src/conflicts.c:
2743 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2744 * src/files.h, src/flex-scanner.h, src/getargs.c:
2745 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2746 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2747 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2748 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2749 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2750 * src/print.c, src/print.h, src/print_graph.c:
2751 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2752 * src/reduce.h, src/relation.c, src/relation.h:
2753 * src/revision.h, src/scan-code.h, src/scan-code.l:
2754 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2755 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2756 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2757 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2758 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2759 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2760 * tests/existing.at, tests/glr-regression.at:
2761 * tests/headers.at, tests/input.at, tests/java.at:
2762 * tests/local.at, tests/output.at, tests/push.at:
2763 * tests/reduce.at, tests/regression.at, tests/sets.at:
2764 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2765 * tests/torture.at:
2766 Update to GPLv3.
2767
728c4be2
JD
27682007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2769
2770 Get rid of broken %no-parser, -n, and --no-parser implementation and
2771 documentation.
2772 * TODO: Don't mention them.
2773 * doc/bison.1: Likewise.
2774 * doc/bison.texinfo (Decl Summary): Likewise.
2775 (Bison Options): Likewise.
2776 (Option Cross Key): Likewise.
2777 * src/getargs.c (no_parser_flag): Remove global variable.
2778 (usage): Don't print description of -n and --no-parser.
2779 (long_options): Remove --no-parser entry here.
2780 (getargs): Remove -n case in the switch here.
2781 * src/getargs.h (no_parser_flag): Remove extern.
2782 * tests/regression.at (Web2c Actions): Remove comment that mentions
2783 --no-parser.
2784
5d31a216
JD
27852007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2786
2787 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2788 name user variables starting with `yy'. Just pass NULL instead of a
2789 dummy local &yylval to yypush_parse.
2790 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2791 starting with `yy'.
2792
a2ea208d
JD
27932007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2794
2795 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2796 true since it's then always used regardless of whether yyoverflow is
2797 defined. Reported by Christian Burger at
2798 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2799 * THANKS: Add Christian Burger.
2800
91661ebb
JD
2801 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2802 node names: say "Decl Summary" not "Bison Declaration Summary".
2803
cbd50549
JD
28042007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2805
2806 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2807 determine whether this function has already complained about an invalid
2808 value for a %define boolean variable, don't check whether Bison has
2809 ever examined the value. As written, the check was a tautology.
2810 Instead, record and check for this complaint using a separate muscle.
2811
eb1b0740
JD
28122007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2813
2814 Fix push parsing memory leak reported by Brandon Lucia at
2815 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2816 * THANKS: Add Brandon Lucia.
2817 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2818 but the parse never completed and thus freed it.
2819 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2820 * tests/testsuite.at: Include push.at.
2821 * test/push.at: New.
2822 (Push Parsing: Memory Leak for Early Deletion): New test case.
2823
9d774aff
JD
28242007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2825
2826 Improve handling of multiple S/R conflicts in the same state and of S/R
2827 conflicts involving multiple reductions.
2828 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2829 set for a state here or Bison will abort if it is reassigned on a
2830 later conflicted reduction in the same state.
2831 Similarly, don't finalize and assign the solved conflicts report here
2832 or it will be lost if it is reassigned on a later conflicted reduction
2833 in the same state.
2834 (set_conflicts): Instead, assign them both here after all S/R conflicts
2835 in the state have been fully examined.
2836 * src/print.c (shift_set): Rename to...
2837 (no_reduce_set): ... this.
2838 (print_reductions): Update for rename, and add %nonassoc error action
2839 tokens to no_reduce_set so that, when printing the first remaining
2840 reduction on an error action token, the reduction is enclosed in
2841 brackets.
2842 (print_results): Update for rename.
2843 * tests/conflicts.at (Solved conflicts report for multiple reductions
2844 in a state): New test case.
2845 (%nonassoc error actions for multiple reductions in a state): New test
2846 case.
2847
2848 * src/main.c (main): Don't depend on C99 features.
2849
10159d2a
JD
28502007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2851
2852 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
2853 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2854 uniwidth.
10159d2a 2855
953b3935
JD
28562007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2857
2858 * bootstrap (slurp): Create target directories that don't exist.
2859 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2860
6ce2d93a
JD
28612007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2862
2863 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2864 than item number.
2865 * closure.c (closure): Likewise.
2866 * state.h (reductions): Comment sorting of rules.
2867 (state): Comment sorting of items.
2868
ce3448d5
JD
28692007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2870
2871 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2872 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2873 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2874 definition in order to avoid Gnulib headers since we don't use config.h
2875 here.
2876 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2877 rather than AT_DATA so that config.h is included.
2878
8a86eef0
JD
28792007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2880
2881 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2882 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2883 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2884 and so that YYFPRINTF is guaranteed to be defined here.
2885
b1a81613
JD
28862007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2887
2888 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2889 with...
2890 (muscle_percent_define_check_values): ... this more helpful function.
2891 Again, it's not used yet, but it will be.
2892 * src/muscle_tab.h: Likewise.
2893
71b61d4d
JD
2894 Improve some comments in parser table construction.
2895 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2896 (generate_states): Don't mention ruleset, which is internal to closure.
2897 * src/closure.c (closure): Explain sorting of core and itemset, which
2898 is required for this function to behave correctly.
2899 * src/closure.h (closure): Mention sorting.
2900
2a6b783d
JD
29012007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2902
2903 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2904 move the check for disabled transitions to an aver since conflict
2905 resolution hasn't happened yet.
2906
2907 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2908 labels a state as inconsistent just because it has error transitions.
2909 The original form of this check appeared in revision 1.1 of lalr.c,
2910 which was committed on 1991-12-21. Now (at least), changing the
2911 consistency label on such a state appears to have no useful effect in
2912 any of the places it is examined, which I enumerate below. The key
2913 point to understanding each item in this enumeration is that a state
2914 with an error transition is labelled consistent in the first place only
2915 if it has no rules, so the check cannot matter for states that have
2916 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2917 to try to identify its conflicts, and a state must have *rules* to have
2918 conflicts. (2) Labelling a state as inconsistent will affect how
2919 action_row sets the default *rule* for the state. (3) Labelling a
2920 state as inconsistent will cause build_relations to add lookback edges
2921 to *rules* in that state.
2922 * src/state.h (struct state): Word the comment for member consistent
2923 more carefully.
2924
14462c2b
JD
29252007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2926
2927 Don't depend on C99 features.
2928 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2929 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2930 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2931 * src/state.c (state_mark_reachable_states): Fix for-loop.
2932 (state_remove_unreachable_states): Fix for-loop.
2933
2934 Don't widen struct state with member reachable just to temporarily
2935 record reachability. Instead, use a local bitset.
2936 * src/state.h (struct state): Remove member.
2937 * src/state.c (state_new): Don't initialize it.
2938 (state_mark_reachable_states): Rename to...
2939 (state_record_reachable_states): ... this, and use bitset.
2940 (state_remove_unreachable_states): Use bitset.
2941
5a43d418
JD
29422007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2943
2944 * src/Makefile.am (yacc): Quote target action commands properly so
2945 that the yacc script isn't corrupt. Reported by Hans Aberg at
2946 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
2947
0c650a20
JD
2948 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
2949 the case of pure parsers. Reported by Frans Englich at
2950 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
2951 * THANKS: Add Frans Englich.
2952
61fee93e
JD
2953 * NEWS (2.3a+): In the %code entry, reference section `Bison
2954 Declaration Summary' from the manual now since the %code summary has
2955 moved there.
2956 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
2957 in the rules section must be terminated by semicolons.
2958
f124d423
JD
29592007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2960
2961 Extend the front-end API for %define variables to more completely
2962 mirror the back-end. This will be useful in the future.
2963 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
2964 Update comments to mention the new front-end counterparts of these
2965 macros.
2966 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
2967 for muscle_string_decode and muscle_location_decode.
2968 (muscle_string_decode): New static function.
2969 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
2970 (muscle_percent_define_get, muscle_percent_define_ifdef): New
2971 functions.
2972 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
2973 muscle_percent_define_get to mimic the b4_percent_define_flag_if
2974 implementation more closely.
2975 (muscle_percent_define_invalid_value): New function.
2976 * src/muscle_tab.h (muscle_percent_define_get,
2977 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
2978 Prototype.
2979
75ad86ee
JD
29802007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2981
2982 * NEWS (2.3a+): Mention yesterday's state-removal change.
2983 (2.3a): Remove the %language entry, which was added after 2.3a.
2984 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
2985 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
2986 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
2987 tests/existing.at: Update copyright date.
2988
5967f0cf
JD
29892007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2990
2991 If conflict resolution makes states unreachable, remove those states,
2992 report rules that are then unused, and don't report conflicts in those
2993 states.
2994 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
2995 New global function.
2996 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
2997 function.
2998 * src/main.c (main): After conflict resolution, remove the unreachable
2999 states and update all data structures that reference states by number.
3000 * src/state.c (state_new): Initialize each state's reachable member to
3001 false.
3002 (state_mark_reachable_states): New static function.
3003 (state_remove_unreachable_states): New global function.
3004 * src/state.h (struct state): Add member bool reachable.
3005 (state_remove_unreachable_states): Prototype.
3006 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3007 New test case.
3008 * tests/existing.at (GNU pic Grammar): Update test case output now that
3009 an unused rule is discovered.
3010
b09f4f48
JD
30112007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3012
3013 Minor code cleanup in parser table construction.
3014 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3015 (new_itemsets, save_reductions): Update for rename to nitemset.
3016 * src/closure.c (nritemset): Rename to...
3017 (nitemset): ... this since the "r" appears to meaningless and isn't
3018 used in the comments.
3019 (closure): Update for rename.
3020 * src/closure.h (nritemset): Update extern to...
3021 (nitemset): ... this.
3022 * src/lalr.c (LA): Fix a typo in comments.
3023 * src/print.c (print_core): Update for rename to nitemset.
3024 * src/print_graph.c (print_graph): Likewise.
3025 * src/state.h: Fix some typos in header comments.
3026
bbb44d83
PE
30272007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3028
9b33de72
PE
3029 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3030 still sticks to ASCII. Sorry!
3031
bbb44d83
PE
3032 * README-hacking: New file, taken mostly from coreutils, with changes
3033 for Bison. Contains much of the contents of:
3034 * README-cvs: Remove.
3035 * bootstrap: Sync from gnulib.
3036 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3037 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3038
29553547
JD
30392007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3040
3041 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3042 Setzer.
3043 (Java Differences): Fix some typos.
3044 * THANKS: Add Sebastian Setzer.
3045
01b477c6
PB
30462007-03-07 Paolo Bonzini <bonzini@gnu.org>
3047
730739e4
AD
3048 * data/java.m4 (b4_single_class_if): Remove.
3049 (b4_abstract_if): Look at "%define abstract".
3050 (b4_lexer_if): New.
3051 (b4_union_name): Rename...
3052 (b4_yystype): ... to this. Map to "%define stype".
3053 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3054 b4_maybe_throws): Fix quoting.
3055 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3056 * data/lalr1.java (Lexer interface): Always define.
3057 (Lexer interface within parser class): Remove.
3058 (YYLexer class): New, used when "%code lexer" is present.
3059 (constructor): When "%code lexer" is used, pass %lex-param
3060 to the lexer constructor.
3061 (yylex, yyparse): Remove %lex-param from method invocations
3062 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3063
3064 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3065 abstract". Rename "%define union_name" to "%define stype".
3066 Rename method names according to previous patch.
3067 (Java Scanner Interface): Describe "%code lexer" instead of
3068 "%pure-parser" and "%define single_class".
3069 (Java Differences): Mention "%code lexer".
3070
3071 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3072 Include scanner here, using macros from tests/local.at.
3073 (AT_DATA_CALC_Y): Remove final argument.
3074 (_AT_CHECK_JAVA_CALC): Likewise.
3075 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3076 of %locations and %error-verbose.
3077 (main): Test with and without %lex-param.
3078 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3079 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 3080
122bea3a
JMG
30812007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3082
3083 DJGPP spefic issue. Inhibit the use of disallowed characters for
3084 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3085 and concern testsuite case 46.
3086 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3087 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3088 * djgpp/config.bat: Inhibit the use of disallowed characters.
3089
9611cfa2
JD
30902007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3091
3092 Miscellaneous %define and %code cleanup.
3093 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3094 values are interpreted.
3095 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3096 documentation a little more.
3097 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3098 muscle_percent_define_insert, muscle_percent_code_grow): New
3099 functions/macros.
3100 * src/muscle_tab.h (muscle_percent_define_insert,
3101 muscle_percent_code_grow): Prototype.
3102 * src/parse-gram.y (prologue_declaration): Use
3103 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3104 %define and %code directives.
3105
3106 Make it easy to share %define boolean variables between the front-end
3107 and back-end. Though not used yet, this will be useful in the future.
3108 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3109 Bison uses of names rather than just skeleton uses of names.
3110 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3111 b4_percent_define_skeleton_variables(VARIABLE) to
3112 b4_percent_define_bison_variables(VARIABLE).
3113 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3114 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3115 b4_percent_code_bison_qualifiers(QUALIFIER).
3116 (b4_check_user_names_wrap): Update for renames.
3117 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3118 muscle_percent_define_default): New functions mimicking
3119 b4_percent_define_flag_if and b4_percent_define_default.
3120
3121 For %define variables, report locations for invalid values and
bbb44d83 3122 redefinitions.
9611cfa2
JD
3123 * data/bison.m4 (b4_percent_define_flag_if): Read
3124 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3125 value for VARIABLE.
3126 (b4_percent_define_default): Save a special location in
3127 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3128 must later be reported as invalid.
3129 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3130 functions.
3131 (muscle_percent_define_insert): Record the location of VARIABLE in
3132 muscle percent_define_loc(VARIABLE), and use it to report the previous
3133 location for a redefinition.
3134 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3135 (muscle_percent_define_default): Update like b4_percent_define_default.
3136 (muscle_grow_user_name_list): Rename to...
3137 (muscle_user_name_list_grow): ... this for consistency and use
3138 muscle_location_grow.
3139 * src/muscle_tab.h (muscle_location_grow): Prototype.
3140 * tests/input.at (%define errors): Update expected output.
3141 * tests/skeletons.at (%define boolean variables: invalid skeleton
3142 defaults): New test case.
3143
0bf92491
JD
31442007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3145
3146 * src/print.c (lookahead_set, state_default_rule): Remove.
3147 (print_reductions): Replace state_default_rule invocation with
3148 equivalent use of yydefact, which was computed in token_actions in
3149 tables.c.
3150 (print_results): Don't allocate lookahead_set.
3151
d3b12988
PB
31522007-02-27 Paolo Bonzini <bonzini@gnu.org>
3153
3154 * data/lalr1.java: Prefix all private members with yy.
3155
f57a7536
JD
31562007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3157
3158 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 3159 Sebastien Fricker at
f57a7536 3160 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 3161 * THANKS: Add Sebastien Fricker.
f57a7536
JD
3162 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3163 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3164 accept a variable number of arguments.
3165
6404a5bf
JD
31662007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3167
3168 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3169
e4e09639
JMG
31702007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3171
3172 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3173 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3174 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3175
d7e0a1a7
PE
31762007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3177
3178 Undo my 2007-02-07 change, switching back to the c-strcase module
3179 introduced in the 2007-02-03 change. Bruno Haible reported that
3180 the 2007-02-07 change would be dangerous in Turkish if we add a
3181 language whose name contains "i", since "i" is not lowercase "I"
3182 in Turkish.
3183 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3184 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3185 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3186 * m4/.cvsignore: Remove strcase.m4.
3187 * src/getargs.c: Revert 2007-02-07 change, as follows.
3188 Include c-strcase.h.
3189 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3190
deee93a1
JD
31912007-02-11 Bruno Haible <bruno@clisp.org>
3192
3193 Enable the Java related testsuite tests when the only Java compiler
3194 found is a gcj < 4.3. Discussed at
3195 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3196 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3197
574add85
JD
31982007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3199
3200 * data/Makefile.am: Update copyright date.
3201 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3202 yypstate_new returns NULL.
3203 (yypstate_new): Return NULL if malloc does.
3204 * src/reader.c (packgram): Move translation of rule actions from the
3205 beginning of packgram to...
3206 (check_and_convert_grammar): ... here right before packgram is invoked
3207 so it's easier to write more complete comments, and remove redundant
3208 code.
3209
e785ccf7
JD
32102007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3211
3212 As in semantic actions, make @$ in %initial-action, %destructor, and
3213 %printer imply %locations.
3214 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3215 scanning @$.
3216 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3217 (@$ in %initial-action implies %locations,
3218 @$ in %destructor implies %locations,
3219 @$ in %printer implies %locations): ... these new test cases.
3220
1cfe1ed7
PE
32212007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3222
3223 Undo most of the 2007-02-03 change, switching to the strcase module
3224 now that gnulib strcase has been fixed.
3225 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3226 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3227 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3228 * m4/.cvsignore: Add strcase.m4.
3229 * src/getargs.c: Revert 2007-02-03 change, as follows.
3230 Don't include c-strcase.h.
3231 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3232 strcasecmp has "unspecified behavior" outside the POSIX locale,
3233 but it works fine in practice if at least one argument is ASCII,
3234 as is the case in Bison.
3235
0049ec86
PB
32362007-02-07 Paolo Bonzini <bonzini@gnu.org>
3237
3238 * tests/java.at: Skip tests if only one of javac/java is present.
3239 Reported by Joel E. Denny.
3240 * tests/atlocal.in: Adjust copyright years.
3241
32422007-02-05 Paolo Bonzini <bonzini@gnu.org>
3243
3244 * data/lalr1.java (Stack): Work around old verifiers that disallow
3245 access to the private fields of an inner class, from the outer class.
3246 We can make Stack's fields public because user code doesn't have access
3247 to the instance of Stack used by parse(). Reported by Paul Eggert.
3248
2c2b7220
PE
32492007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3250
3251 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3252 the right spot for these files?
3253 * bootstrap.conf (gnulib_modules): Add c-strcase.
3254 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3255 c-strncasecmp.c.
3256 * src/getargs.c: Include c-strcase.h.
3257 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3258 to avoid unspecified behavior.
3259
b2b81dae
JD
32602007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3261
3262 * doc/bison.texinfo (Decl Summary): Correct typo.
3263
c1d19e10
PB
32642007-01-30 Paolo Bonzini <bonzini@gnu.org>
3265
3266 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3267 Complain if the value does not match empty, "true" or "false".
3268 * data/c++.m4: Adjust default definitions of %define variables.
3269 * data/java.m4: Adjust default definitions of %define variables.
3270 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3271 to above behavior.
3272 * tests/input.at (Boolean %define variables): Test new behavior.
3273
8405b70c
PB
32742007-01-29 Paolo Bonzini <bonzini@gnu.org>
3275
3276 * NEWS: Mention java.
3277 * TODO: Remove things that are done.
3278 * bootstrap.conf: Add javacomp-script and javaexec-script.
3279 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3280
3281 * data/Makefile.am: Add new files.
3282 * data/java-skel.m4: New.
3283 * data/java.m4: New.
3284 * data/lalr1.java: New.
3285
3286 * doc/bison.texinfo: Put "A Complete C++ Example" under
3287 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3288 under Other Languages.
3289
3290 * src/getargs.c (valid_languages): Add Java.
3291 * src/getargs.h (struct bison_language): Update size of string fields.
3292
3293 * tests/Makefile.am: Add java.at.
3294 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3295 * tests/java.at: New.
3296 * tests/testsuite.at: Include it.
3297
3eb82471
JD
32982007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3299
3300 Clean up.
3301 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3302 at_directive_argv arguments so these no longer have to be global
3303 variables. Also, update the implementation for the following changes.
3304 (fail_for_at_directive_too_many_args,
3305 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3306 (at_directive_name): Remove as at_directive_argv[0] will be used for
3307 this now.
3308 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3309 for the directive name.
3310 (at_directive_argc, at_directive_argv): Make these local within
3311 skel_lex instead of global.
3312 (INITIAL): Update directive start action for above changes.
3313 (SC_AT_DIRECTIVE_ARG): Rename to...
3314 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3315 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3316 (scan_skel): Move yylex_destroy to...
3317 (skel_scanner_free): ... here.
3318 * tests/skeletons.at (installed skeleton file name): Rename to...
3319 (installed skeleton file names): ... this.
3320
148d66d8
JD
33212007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3322
3323 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3324 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3325 Summary" not "Directives".
3326 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3327 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3328 since the former is now the more complete one.
3329 (Prologue Alternatives): Likewise and do the same for %defines.
3330 (Table of Symbols): Add summary of %code, add summary of %define, and
3331 move full %code documentation to...
3332 (Decl Summary): ... here for consistency with other entries in these
3333 sections.
3334 Move %define entry in order to keep this list alphabetized.
3335 Reword %define entry a little to put less emphasis on the skeleton
3336 concept, which most users shouldn't have to think about.
3337
665f0c24
PE
33382007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3339
3340 Adjust to recent gnulib changes.
3341 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3342 Add string.h, string_.h, unistd_.h, wchar_.h.
3343 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3344 * src/system.h: Don't include <stpcpy.h>; this is now done by
3345 <string.h>.
3346
592d0b1e
PB
33472007-01-23 Paolo Bonzini <bonzini@gnu.org>
3348
3349 Simplify implementation of unqualified %code, implement macros for
3350 uniform treatment of boolean %define flags. Document %define.
3351 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3352 b4_percent_code_ifdef): New.
3353 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3354 * data/c++.m4: Define default value for global_tokens_and_yystype.
3355 * data/glr.cc: Likewise.
3356 * data/location.cc: Use b4_percent_define_flag_if.
3357
148d66d8 3358 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
3359
3360 * src/parse-gram.y (Unqualified %code): Change muscle name to
3361 b4_percent_code().
3362 (content.opt): Default to empty.
3363
a7867f53
JD
33642007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3365
3366 Implement support for relative and absolute skeleton file names.
3367 Discussed starting at
3368 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3369 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3370 (Bison Options): Document in --skeleton entry.
3371 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3372 full_skeleton can't necessarily hold all of pkgdatadir.
3373 If the specified skeleton file name contains a `/', don't prepend
3374 pkgdatadir.
3375 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3376 file name contains a `/', prepend the grammar file directory.
3377 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3378 * skeletons.at: New file.
3379 (relative skeleton file names): New test case.
3380 (installed skeleton file names): New test case.
3381 * tests/testsuite.at: Include skeletons.at.
3382
3383 * bootstrap: Update copyright to 2007.
3384
830c9b18
PB
33852007-01-17 Paolo Bonzini <bonzini@gnu.org>
3386
3387 * bootstrap: Remove occurrences of .#bootmp from the files.
3388
a8c2e813
AD
33892007-01-17 Akim Demaille <akim@epita.fr>
3390
3391 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3392 nonterminals.
3393 Use per-type %printer.
3394
279cabb6
JD
33952007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3396
3397 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3398 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3399 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3400 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3401 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3402 tests/glr-regression.at, tests/input.at, tests/local.at,
3403 tests/output.at, tests/torture.at: Update copyright to 2007.
3404
bb32f4f2
AD
34052007-01-16 Akim Demaille <akim@epita.fr>
3406
3407 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3408 error code.
3409 (Calc++ Scanner): Exit with failure if we can't open the input
3410 file.
3411 Accept "-" standing for stdin.
3412 (Calc++ Top Level): Print the result only if the parsing was
3413 successful.
3414
7cff04b5
AD
34152007-01-16 Akim Demaille <akim@epita.fr>
3416
3417 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3418
a4e25e1d
JD
34192007-01-15 Paolo Bonzini <bonzini@gnu.org>
3420 and Joel E. Denny <jdenny@ces.clemson.edu>
3421
3422 Clean up %define and %code implementation in M4 some. Most
3423 importantly, rename all related macros to be in the b4_percent_define
3424 and b4_percent_code namespaces. Also, complete support for `.' in
3425 %define variable names and %code qualifiers.
3426 * data/bison.m4 (b4_check_user_names): Check for special
3427 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3428 m4_foreach loops.
3429 (b4_get_percent_define, b4_get_percent_code): Rename to...
3430 (b4_percent_define_get, b4_percent_code_get): ... these.
3431 Extend documentation with examples.
3432 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3433 b4_percent_define_skeleton_variables and
3434 b4_percent_code_skeleton_qualifiers.
3435 Expect any value for the %define variable `foo' to be stored in the
3436 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3437 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3438 expect any unqualified %code blocks to be stored in a macro named
3439 `b4_percent_code_unqualified'.
3440 Use m4_indir so that %define variable names and %code qualifiers can
3441 contain `.', which is allowed by the grammar parser.
3442 (b4_percent_define_default): New macro to set a default value for a
3443 %define variable.
3444 (m4_wrap): Update wrapped code, and fix some underquoting.
3445 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3446 Expect grammar uses of %define variables and %code qualifiers to be
3447 defined in b4_percent_define_user_variables and
3448 b4_percent_code_user_qualifiers.
3449 * data/c++.m4: Use b4_percent_define_default rather than
3450 m4_define_default. Fix some underquoting. Skeleton usage of %define
3451 variable define_location_comparison now implies skeleton usage of
3452 %define variable filename_type.
3453 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3454 data/push.c, data/yacc.c: Update macro names.
3455 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3456 muscle names.
3457
e37c665c
JMG
34582007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3459
3460 DJGPP specific issues.
3461
3462 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3463 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3464
7d2d521f
JD
34652007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3466
3467 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3468 run parsers in all tests so that Valgrind is invoked during
3469 maintainer-check-valgrind.
3470 (Duplicate representation of merged trees): Free all semantic values.
3471 (Duplicated user destructor for lookahead): Likewise.
3472
e0ac9b4b
JD
34732007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3474
3475 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3476 command-line prefix.
3477 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3478 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3479 miss Valgrind messages.
3480 (Exploding the Stack Size with Malloc): Likewise.
3481
78143faa
JD
34822007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3483
3484 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3485 locals. Reported by Juan Manuel Guerrero at
3486 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3487 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3488 Fix some indentation also.
3489 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3490 explaining this issue.
3491
7ecec4dd
JD
34922007-01-09 Paolo Bonzini <bonzini@gnu.org>
3493 and Joel E. Denny <jdenny@ces.clemson.edu>
3494
3495 Simplify union and prologue handling, and escape union and lex/parse
3496 params with digraphs.
3497 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3498 values to the empty string since these are no longer guaranteed
3499 initialized by the front-end.
3500 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3501 braces around b4_user_stype since this is no longer done by the
3502 front-end.
3503 * src/files.c, src/files.h (pre_prologue_obstack,
3504 post_prologue_obstack): Remove.
3505 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3506 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3507 with digraphs. This fixes lex params and parse params.
3508 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3509 * src/output.c (prepare): Remove muscle insertion of the prologues.
3510 (output): Remove freeing of pre_prologue_obstack and
3511 post_prologue_obstack.
3512 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3513 than prologue_augment for prologue parsing so you don't need prologue
3514 obstacks.
5c80250c
JD
3515 (grammar_declaration): For %union RHS, use `braceless' instead of
3516 "{...}" so that braces are already stripped and code is escaped with
3517 digraphs.
7ecec4dd
JD
3518 * src/reader.c (prologue_augment): Remove.
3519 (reader): Remove initialization of pre_prologue_obstack and
3520 post_prologue_obstack.
3521 * src/reader.h (prologue_augment): Remove.
3522
3523 * data/c.m4: Remove stray parenthesis.
3524
16dc6a9e
JD
35252007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3526
3527 Remove quotes from variables names in %define directives and from
3528 qualifiers in %code directives, and restrict the characters that are
3529 allowed in them to M4-friendly ones. For %define, continue to support
3530 the quoted form as a deprecated feature. Discussed starting at
3531 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3532 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3533 %code.
3534 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
3535 (Decl Summary): In %defines entry, update mention of `%code requires'
3536 and `%code provides'.
16dc6a9e
JD
3537 (C++ Location Values): Update %define uses.
3538 (Calc++ Parser Interface): Likewise.
3539 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 3540 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
3541 * src/parse-gram.y (prologue_declaration): For %define variables, use
3542 `variable' instead of `STRING'.
3543 (grammar_declaration): For %code qualifiers, use `ID' instead of
3544 `STRING'.
3545 (variable): New nonterminal that takes an `ID' or a `STRING'.
3546 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3547 and %define uses.
3548 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3549 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3550 (%define errors): Update %define uses.
3551
e9813cd4
JD
35522007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3553
3554 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3555 instead of muscle_insert for %define values so that M4-special
3556 characters are replaced with digraphs.
3557 * tests/input.at (%define errors): Extend to check weird values.
3558
6afc30cc
JD
35592007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3560
3561 Instead of having skeletons declare all valid %define variables and
3562 %code qualifiers, provide macros that retrieve the associated values
3563 and build these lists automatically. Thus Bison will now warn when a
3564 variable or qualifier is not used by the skeleton in the current
3565 invocation regardless of whether it might sometimes be used by that
3566 skeleton in other invocations. Also, move all %define value macros to
3567 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3568 form, which is replaced by %code.
3569 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3570 (b4_check_user_names): ... this, and change the series of valid name
3571 arguments to a single list argument for names used in the skeleton
3572 similar to the existing list argument for names used in the grammar.
3573 Warn instead of complaining.
3574 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3575 values and %code code, to format %code code properly, and to build
3576 lists of all %define variables and %code qualifiers used in the
3577 skeleton: b4_skeleton_percent_define_variables and
3578 b4_skeleton_percent_code_qualifiers.
3579 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3580 Remove, and...
3581 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3582 the skeleton names lists can finish building first. In place of
3583 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3584 expect the lists b4_user_percent_define_variables and
3585 b4_user_percent_code_qualifiers.
3586 * data/c++.m4: Where setting default values for b4_parser_class_name,
3587 b4_location_type, b4_filename_type, b4_namespace, and
3588 b4_define_location_comparison, update their names to the
3589 b4_percent_define_ namespace.
3590 * data/glr.c: Don't use b4_check_percent_define_variables and
3591 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3592 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3593 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 3594 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
3595 * data/location.cc: Use b4_get_percent_define.
3596 * data/push.c: Don't use b4_check_percent_define_variables and
3597 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3598 * data/yacc.c: Likewise, and don't call m4_exit in
3599 b4_use_push_for_pull_if or m4_wrap code will never execute.
3600 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3601 Rename to...
3602 (muscle_grow_user_name_list): ... this for consistency with the
3603 terminology used in bison.m4.
3604 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3605 %define variable names, and rename muscle used_percent_define_variables
3606 to user_percent_define_variables.
3607 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3608 user_percent_code_qualifiers.
3609 (content): Remove.
3610 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3611 {CODE} form is no longer accepted.
3612 * tests/input.at (Reject bad %code qualifiers): Rename to...
3613 (Reject unused %code qualifiers): ... this, and update test output.
3614 (%define error): Update test output.
3615
7eb8a0bc
JD
36162007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3617
3618 Check for unrecognized %define variables similar to checking for
3619 unrecognized %code qualifiers. Check for redefined %define variables.
3620 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3621 generalizes...
3622 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3623 (b4_check_percent_define_variables): New, also wraps it.
3624 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3625 variables using b4_check_percent_define_variables.
3626 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3627 all those exercised in the test suite and all those listed in the
3628 `Default values' section of c++.m4. Are there others?
3629 * data/push.c, data/yacc.c: Declare no valid %define variables.
3630 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3631 similar to muscle_find, but it works even when the muscle stores a
3632 const value.
3633 (muscle_grow_used_name_list): New function for constructing the used
3634 name list muscles that b4_check_for_unrecognized_names requires.
3635 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3636 %define'd more than once. Define the b4_used_percent_define_variables
3637 muscle with muscle_grow_used_name_list.
3638 (grammar_declaration): Abbreviate %code code with
3639 muscle_grow_used_name_list.
3640 * tests/input.at (%define errors): New.
3641
3fc65ead
JD
36422007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3643
3644 Provide warn_at, complain_at, and fatal_at function callbacks to the
3645 skeletons, and use this for %code qualifier complaints.
3646 * data/bison.m4 (b4_error_at): New, invoked by...
3647 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3648 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3649 @fatal_at(...@) directives.
3650 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3651 qualifiers in b4_used_percent_code_qualifiers and to use
3652 b4_complain_at.
3653 * src/location.c, src/location.h (boundary_set_from_string): New global
3654 function.
3655 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3656 function.
3657 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3658 to b4_used_percent_code_qualifiers.
3659 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3660 function.
3661 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3662 (lineno): Rename to...
3663 (out_lineno): ... this so I don't misunderstand it again.
3664 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3665 here; these newlines are in the input but not the output file.
3666 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3667 (at_directive_perform): ... this new static function, and add handling
3668 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3669 directives.
3670 * tests/input.at (Reject bad %code qualifiers): Update test output with
3671 locations and extend.
3672
3673 * tests/output.at (Output file name: [, Output file name: ]): Remove
3674 bogus comment about these tests failing.
3675
1c7b7e1d
JD
36762007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3677
3678 Clean up b4_check_percent_code_qualifiers a little.
3679 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3680 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3681 documentation and add examples.
3682 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3683 qualifiers here.
3684
08af01c2
JD
36852007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3686
3687 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3688 unreliable -- especially when they're hidden inside another macro.
3689 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3690 data/c.m4: Remove m4_divert(-1).
3691 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3692 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3693 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 3694 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
3695 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3696 pushed and popped by m4sugar, should be first on the stack.
3697
3698 Provide warn, complain, and fatal function callbacks to the skeletons.
3699 This provides more flexibility than m4_fatal, improves the error
3700 message format, and captures messages for translation. Discussed
3701 starting at
3702 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3703 * data/bison.m4 (b4_error): New, invoked by...
3704 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3705 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3706 directives. Because these M4 macros might be called when the current
3707 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3708 the previous removal of uses of m4_divert, which caused trouble.
3709 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3710 m4_fatal to report unrecognized %code qualifiers.
3711 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3712 push parser requests.
3713 * data/glr.c: Use b4_complain instead of m4_fatal to report
3714 non-deterministic push parser requests.
3715 Update @output usage to @output(...@) form.
3716 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3717 report missing %defines. Update @output usage to @output(...@) form.
3718 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3719 @output(...@) form.
3720 * src/main.c (main): Invoke skel_scanner_free.
3721 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3722 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3723 obstack_for_string from flex-scanner.h.
3724 (YY_DECL): Use to declare skel_lex static.
3725 (decode_at_digraphs): Remove; now handled in the new
3726 SC_AT_DIRECTIVE_ARG start condition.
3727 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3728 functions.
3729 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3730 at_directive_argv): New static globals.
3731 (INITIAL): Use fail_for_invalid_at.
3732 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3733 recognize the start of a generalized `@directive(...@)' form and
3734 start...
3735 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3736 directive args (using the new obstack_for_string), to decode the
3737 contained @ diagraphs, and to perform the directive. It recognizes
3738 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3739 @output(...@).
3740 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3741 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3742 `@,'.
3743 (scan_skel): Initialize obstack_for_string on the first call.
3744 (skel_scanner_free): New function to free obstack_for_string.
3745 * tests/input.at (Reject bad %code qualifiers): Update test output.
3746
8e0a5e9e
JD
37472007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3748
3749 Consolidate the 4 prologue alternative directives (%code, %requires,
3750 %provides, and %code-top) into a single %code directive with an
3751 optional qualifier field. Discussed at
3752 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3753 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3754 alternatives.
3755 * doc/bison.texinfo (Prologue Alternatives): Update.
3756 (Decl Summary): Update to %code "requires" and %code "provides".
3757 (Calc++ Parser): Update to %code "requires".
148d66d8 3758 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
3759 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3760 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3761 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3762 which are skeleton-specific.
3763 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3764 declare what %code qualifiers it supports and to complain if any other
3765 qualifiers were used in the grammar.
3766 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3767 and b4_user_code([b4_percent_code_provides]) in place of
3768 b4_user_requires and b4_user_provides.
3769 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3770 Add b4_user_code([b4_percent_code_top]) and
3771 b4_user_code([b4_percent_code]).
3772 Invoke b4_check_percent_code_qualifiers.
3773 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3774 PERCENT_REQUIRES): Remove.
3775 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3776 %requires. Rewrite the %code RHS as the unqualified form defining the
3777 muscle b4_percent_code. Add another RHS for the qualified %code form,
3778 which defines muscles of the form b4_percent_code_QUALIFIER and the
3779 b4_used_percent_code_qualifiers muscle.
3780 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3781 PERCENT_REQUIRES): Remove.
3782 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3783 %code "requires" and %code "provides".
3784 * tests/input.at (Reject bad %code qualifiers): New.
3785
95021767
JD
37862007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3787
3788 Use the new code_props interface for destructors and printers.
3789 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3790 printer_location members, and change the type of the destructor and
3791 printer members to code_props.
3792 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3793 symbol_printer_get, semantic_type_destructor_set,
3794 semantic_type_printer_set, default_tagged_destructor_set,
3795 default_tagless_destructor_set, default_tagged_printer_set,
3796 default_tagless_printer_set): Use code_props in arguments and return
3797 types in place of char const * and location.
3798 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3799 since the locations are now contained in the return of
3800 symbol_destructor_get and symbol_printer_get.
3801 * src/output.c (symbol_destructors_output, symbol_printers_output):
3802 Replace with...
3803 (symbol_code_props_output): ... this to eliminate duplicate code.
3804 (output_skeleton): Update to use symbol_code_props_output.
3805 * src/reader.c (symbol_should_be_used): Update use of
3806 symbol_destructor_get.
3807 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3808 Update uses of the various _destructor_set and _printer_set functions.
3809 * src/symtab.c: (default_tagged_destructor_location,
3810 default_tagless_destructor_location, default_tagged_printer_location,
3811 default_tagless_printer_location): Remove since we...
3812 (default_tagged_destructor, default_tagless_destructor,
3813 default_tagged_printer, default_tagless_printer): ... change the type
3814 of these to code_props.
3815 (symbol_new, semantic_type_new, symbol_destructor_set,
3816 semantic_type_destructor_set, symbol_destructor_get,
3817 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3818 symbol_check_alias_consistency, default_tagged_destructor_set,
3819 default_tagless_destructor_set, default_tagged_printer_set,
3820 default_tagless_printer_set): Update.
3821 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3822 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3823 code_props members.
3824 (symbol_print): Use SYMBOL_CODE_PRINT.
3825
f6857bbf
JD
38262007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3827
3828 Use the new code_props interface for rule actions.
3829 * src/symlist.h (symbol_list): Replace action, action_location, and
3830 used members with a code_props action_props member.
3831 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3832 grammar_midrule_action, grammar_current_rule_merge_set,
3833 grammar_current_rule_symbol_append, packgram): Update.
3834 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3835 * src/scan-code.l (handle_action_dollar): Update.
3836 (translate_rule_action): Remove, no longer used.
3837 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3838
7c0c6181
JD
38392007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3840
3841 Use the new code_props interface in parse-gram.y.
3842 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3843 Update all uses of translate_* functions to use the new code_props
3844 interface and to use gram_scanner_last_string_free and
3845 code_scanner_last_string_free where possible.
3846 (grammar_declaration): symbol_list_destructor_set and
3847 symbol_list_printer_set now perform the translation, so don't do it
3848 here. Use gram_scanner_last_string_free where possible.
3849 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3850 translate_code): Remove, no longer used.
3851 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3852 symbol_list_printer_set): Perform code translation here rather than
3853 depending on the caller to do so.
3854
3855 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3856 * src/scan-gram.h (gram_last_string): Remove declaration.
3857 * src/scan-gram.l (last_string): Declare it static.
3858
28e52c0d
JD
38592007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3860
3861 Encapsulate code properties and related functionality for the various
3862 destructors, printers, and actions into a code_props structure and
3863 interface. This patch merely implements code_props in scan-code.h and
3864 scan-code.l. Future patches will rewrite other modules to use it.
3865 Discussed starting at
3866 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3867 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3868 consistently initialize const structs that have an empty location
3869 field.
3870 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3871 to ensure consistency.
3872 * src/scan-code.h (code_props): New structure.
3873 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3874 function, macro, and const global variable for initializing a
3875 code_props with no code.
3876 (code_props_plain_init, code_props_symbol_action_init,
3877 code_props_rule_action_init, code_props_translate_code): The rest of
3878 the new code_props functional interface. Among other things, the init
3879 functions set the code_props kind field so that
3880 code_props_translate_code will know whether to behave like
3881 translate_symbol_action, translate_rule_action, or translate_code.
3882 These old translate functions must remain until all other modules are
3883 updated to use the new code_props interface.
3884 (code_scanner_last_string_free): New function similar to
3885 gram_scanner_last_string_free.
3886 (code_scanner_free): Add documentation.
3887 * src/scan-code.l: Implement the new interface.
3888 (code_lex): Make it static, add a code_props* argument, and remove the
3889 rule argument.
3890 (last_string): New static global similar to the one in scan-gram.l.
3891 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3892 instead of rule.
3893 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3894 code_props since Bison may one day use this information for destructors
3895 and printers.
3896 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3897 (handle_action_dollar): Use symbol_list_n_get and set used flag
3898 directly since symbol_list_n_used_set is removed.
3899 (translate_action): Add a code_props* argument and remove the rule,
3900 action, and location arguments. Pass the code_props* on to code_lex.
3901 (translate_rule_action, translate_symbol_action, translate_code):
3902 Rewrite as wrappers around the new code_props interface.
3903 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3904 it would eventually need to break the encapsulation of code_props.
3905
96034983
JD
39062007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3907
3908 * etc/.cvsignore: New.
3909
945e396c
JD
39102007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3911
3912 Add maintainer-push-check to run maintainer-check using push parsing in
3913 place of pull parsing where available.
3914 * Makefile.am (maintainer-push-check): New.
3915 * data/bison.m4 (b4_use_push_for_pull_if): New.
3916 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3917 appropriately based on their existing values.
3918 (yypush_parse): Don't print push-parser-specific diagnostics if push
3919 parsing is being used in place of pull parsing.
3920 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3921 push.c.
3922 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3923 variable, and insert b4_use_push_for_pull_flag into muscles.
3924 * tests/Makefile.am (maintainer-push-check): New.
3925
7d596384
JD
39262006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3927
3928 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3929 (whether successful or failed) so that yypush_parse can be invoked
3930 again to start a new parse using the same yypstate.
3931 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3932 check multiple yypull_parse invocations on the same yypstate. For pull
3933 mode, extend to check multiple yyparse invocations.
3934 (Exploding the Stack Size with Alloca): Extend to try with
3935 %push-pull-parser.
3936 (Exploding the Stack Size with Malloc): Likewise.
3937
3938 * tests/calc.at (Simple LALR Calculator): Don't specify
3939 %skeleton "push.c" since %push-pull-parser implies that now.
3940 * tests/headers.at (export YYLTYPE): Don't check for the push
3941 declarations. Otherwise, this test case can't be used to see if push
3942 mode can truly emulate pull mode.
3943 * tests/input.at (Torturing the Scanner): Likewise.
3944 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
3945 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
3946 AT_YACC_IF, which now includes the case of push mode since %skeleton
3947 need not be used for push mode. This will be more intuitive once
3948 push.c is renamed to yacc.c.
3949
7172e23e
JD
39502006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3951
3952 For push mode, convert yyparse from a macro to a function, invoke yylex
3953 instead of passing a yylexp argument to yypull_parse, and don't
3954 generate yypull_parse or yyparse unless %push-pull-parser is declared.
3955 Discussed starting at
3956 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
3957 * data/bison.m4 (b4_pull_if): New.
3958 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
3959 * data/push.c: Improve M4 quoting a little.
3960 (b4_generate_macro_args, b4_parenthesize): Remove.
3961 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
3962 any time a pull parser is requested.
3963 Don't #define this as a wrapper around yypull_parse. Instead, when
3964 both push and pull are requested, make it a function that does that
3965 same thing.
3966 (yypull_parse): If there's a b4_prefix, #define this to
3967 b4_prefix[pull_parse] when both push and pull are requested.
3968 Don't define this as a function unless both push and pull are
3969 requested.
3970 Remove the yylexp argument and hard-code yylex invocation instead.
3971 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
3972 %push-parser.
3973 * src/getargs.c (pull_parser): New global initialized to true.
3974 * getargs.h (pull_parser): extern it.
3975 * src/output.c (prepare): Insert pull_flag muscle.
3976 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
3977 (prologue_declaration): Set both push_parser and pull_parser = true for
3978 %push-pull-parser. Set push_parser = true and pull_parser = false for
3979 %push-parser.
3980 * src/scan-gram.l: Don't accept %push_parser as an alternative to
3981 %push-parser since there's no backward-compatibility concern here.
3982 Scan %push-pull-parser.
3983 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
3984 instead of %push-parser.
3985 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
3986 prototype it in the module that calls yyparse.
3987 * tests/input.at (Torturing the Scanner): Likewise.
3988 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
3989
2e7944cb
JD
39902006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
3991
3992 Update etc/bench.pl. Optimize push mode a little (the yyn change
3993 deserves most of the credit).
3994 * Makefile.am (SUBDIRS): Add etc subdirectory.
3995 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
3996 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
3997 yytoken, yyval, and yyloc declarations to...
3998 (yyparse or yypush_parse): ... here to improve performance. For
3999 yypush_parse invocations after the first, be sure to assign yyn its old
4000 value again.
4001 (yypstate_new): Don't bother initializing the yyresult field since the
4002 initial value isn't used.
4003 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4004 remove the #define that, in push mode, set it to yyps->NAME.
4005 * etc/Makefile.am: New.
4006 * etc/bench.pl: Remove and build it instead from...
4007 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4008 "tests/bison" from the build directory by default rather than just
4009 invoking "bison" from $PATH.
4010 (calc_grammar): Update push parser code: don't declare yylval globally,
4011 don't define yyparse_wrapper, and don't #define yyparse.
4012 (bench_grammar): Update to check all working combinations of yacc.c,
4013 push.c, impure, pure, pull, and push.
4014
c3d50342
JD
40152006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4016
4017 For push mode, add pull wrappers around yypush_parse.
4018 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4019 (yypull_parse): New function wrapping yypush_parse.
4020 (yyparse): New #define wrapping yypull_parse.
4021 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4022 is declared.
4023 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4024 prototype yylex in the module that calls yyparse, and don't prototype
4025 yyparse there. Otherwise, the yyparse expansion won't compile.
4026 * tests/input.at (Torturing the Scanner): Likewise.
4027
94ebeba5
JD
40282006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4029
4030 Enable push parsers to operate in impure mode. Thus, %push-parser no
4031 longer implies %pure-parser. The point of this change is to move
4032 towards being able to test the push parser code by running the entire
4033 test suite as if %push-parser had been declared.
4034 * data/push.c (yypush_parse): For impure mode, remove the
4035 yypushed_char, yypushed_val, and yypushed_loc arguments.
4036 Instead, declare these as local variables initialized to the global
4037 yychar, yylval, and yylloc.
4038 For the first yypush_parse invocation only, restore the initial values
4039 of these global variables when it's time to read a token since they
4040 have been overwritten.
4041 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4042 %push-parser.
4043 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4044 %pure-parser along with %push-parser since this test case was designed
4045 for pure push parsers.
4046 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4047 (AT_YACC_OR_PUSH_IF): New.
4048 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4049 add a note that it's still wrong for some cases (as it has been for a
4050 while).
4051 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4052 %push-parser no longer implies %pure-parser.
4053
a0633178
JD
40542006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4055
4056 Remove some unnecessary differences between the pull parser code and
4057 the push parser code. This patch enables yynerrs in push mode.
4058 * data/push.c: Reformat M4 a little.
4059 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4060 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4061 because push mode is on. Instead, if pure mode is on, move yynerrs
4062 to...
4063 (b4_declare_parser_state_variables): ... here.
4064 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4065 to yyps->NAME so it can be used in yypush_parse.
4066 (yypush_parse): Don't omit uses of yynerrs in push mode.
4067
8646b6a3
JD
40682006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4069
4070 Fix bug such that the first pushed token's value and location are
4071 sometimes overwritten (sometimes by %initial-action) before being used.
4072 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4073 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4074 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4075 more closely mimic the pull parser logic.
4076 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4077 time to read a token, which is after any initialization of yylval and
4078 yylloc.
4079 (gottoken): Rename label to...
4080 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4081 user namespace.
4082
9baf4d74
JD
40832006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4084
4085 Rearrange initialization of the parser state variables so that the
4086 skeleton doesn't have to have a copy for pull mode and another for push
4087 mode. This patch also fixes at least a bug such that yylloc was not
4088 initialized (with b4_location_initial_line and
4089 b4_location_initial_column) upon calling yypush_parse. However, that
4090 initialization now overwrites the first token's location;
4091 %initial-action assigning @$ already did the same thing, and both bugs
4092 will be fixed in a later patch.
4093 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4094 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4095 yyss, yyvs, yyls, and yystacksize.
4096 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4097 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4098 yylsp.
4099 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4100 yyps->NAME so it can be used in yypush_parse.
4101 (yyparse or yypush_parse): For yypush_parse, don't print the
4102 "Starting parse" diagnostic for invocations after the first.
4103 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4104 yypush_parse, only do it for the first invocation.
4105 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4106 initialization to occur in yypush_parse but only on the first
4107 invocation.
4108
23522164
JD
41092006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4110
4111 * data/push.c: Add CPP guards around push parser declarations in both
4112 the header and the code file.
4113 In the code file, move the push parser declarations to the same place
4114 they appear in the header file.
4115 Clean up the M4 some, especially the inconsistent underquoting in
4116 some b4_c_function_def and b4_c_function_decl uses.
4117
bb010fe5
JD
41182006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4119
4120 Encapsulate the push parser state variables into an M4 macro so the
4121 push skeleton doesn't have to list them again for pull mode's yyparse.
4122 For push mode, remove yypush_parse's local equivalents of these
4123 variables to eliminate unnecessary copying between the two sets at
4124 run-time. This patch also fixes at least a bug related to multiple
4125 %initial-action invocations in push mode.
4126 * data/push.c (b4_declare_parser_variables): Rename to...
4127 (b4_declare_scanner_communication_variables): ... this for clarity and
4128 update both uses.
4129 (b4_declare_yyparse_variables): Remove and move its contents to the one
4130 spot where it was invoked.
4131 (b4_declare_parser_state_variables): New macro containing the parser
4132 state variables required by push mode.
4133 (struct yypstate): Replace all fields but yynew with
4134 b4_declare_parser_state_variables.
4135 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4136 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4137 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4138 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4139 parser state variable declarations with
4140 b4_declare_parser_state_variables.
4141 Don't initialize parser state variables when calling yypush_parse since
4142 yypstate_new already does that.
4143 Invoke the user's initial action only upon the first yypush_parse
4144 invocation.
4145 Remove all code that copies between the local parser state variables
4146 and the yypstate.
4147
2d212f8c
JD
41482006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4149
4150 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4151 prevent a name collision in a future patch where these names will
4152 sometimes be #define'd.
4153 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4154 since it no longer has the same name as the existing argument.
4155 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4156
e6e704dc
JD
41572006-12-19 Paolo Bonzini <bonzini@gnu.org>
4158 and Joel E. Denny <jdenny@ces.clemson.edu>
4159
4160 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4161 that the argument is case-insensitive, and there's no `=' here.
4162 For the %skeleton entry, mention that %language is better.
4163 (Bison Options): Likewise for --language and --skeleton. Move the
4164 --skeleton entry so that the `Tuning the parser' section is sorted
4165 alphabetically on long options.
4166 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4167 %language directive in detail here; cross-reference the %language
4168 documentation instead.
4169 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4170 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 4171 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
4172 * examples/extexi (normalize): Instead of replacing every %require
4173 argument with the current Bison version, just substitute for
4174 `@value{VERSION}'. This guarantees that we're testing what actually
4175 appears in the documentation.
4176 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4177 rather than `@VERSION@'.
4178
0e021770
PE
41792006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4180
fd575f05
PE
4181 * NEWS: Reword the %language news a bit, and put it earlier.
4182
0e021770
PE
4183 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4184 Rewrite to simplify the logic.
4185 (language_argmatch): Likewise.
fd575f05
PE
4186 (program_name): We now own this var.
4187 * src/getargs.h (struct bison_language): Use char[] rather than
4188 const char *.
0e021770
PE
4189
4190 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4191 Java is supported.
4192 * src/complain.c (program_name): Remove decl; no longer needed.
4193 * src/main.c (program_name): Remove; now belongs to getargs.
4194
41952006-12-18 Paolo Bonzini <bonzini@gnu.org>
4196
4197 * NEWS: Document %language.
4198
4199 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4200
4201 * data/c-skel.m4, data/c++-skel.m4: New files.
4202 * data/glr.c: Complain on push parsers.
4203
4204 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4205 over %skeleton.
148d66d8 4206 (Decl Summary): Document %language and %skeleton.
0e021770
PE
4207 (Command line): Document -L.
4208
4209 * examples/extexi: Rewrite %require directive.
4210 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4211
4212 * src/files.c (compute_exts_from_gc): Look in language structure
4213 for .y extension.
4214 (compute_file_name_parts): Check whether .tab should be added.
4215 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4216 (language, skeleton_arg, language_argmatch): New.
4217 (long_options): Add --language.
4218 (getargs): Use skeleton_arg, add -L/--language.
4219 * src/getargs.h: Include location.h.
4220 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4221 * src/output.c (prepare): Pick default skeleton from struct language.
4222 Don't dispatch C skeletons here.
4223 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4224 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4225 * src/scan-gram.l ("%language"): New rule.
4226
4227 * tests/calc.at: Test %skeleton and %language.
4228 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4229 (AT_GLR_IF): Look for %skeleton "glr.cc".
4230 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4231 (AT_YACC_IF): Reject %language.
4232
5691bf57
PE
42332006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4234
db06f0ce
PE
4235 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4236 since it wasn't used; only the typedef name 'semantic_type' is needed.
4237 Also, omit trailing white space.
4238
5691bf57
PE
4239 * bootstrap: Sync from coreutils.
4240 (gnulib_extra_files): Add build-aux/announce.gen.
4241 (slurp): Adjust .gitignore files like .cvsignore files.
4242 * build-aux/announce-gen: Remove from CVS, since bootstrap
4243 now creates this.
4244
791934e4
JD
42452006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4246
4247 Make %push-parser imply %pure-parser. This fixes several bugs; see
4248 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4249 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4250 pure_parser = true.
4251 * data/push.c: Don't bother testing b4_push_if when deciding whether
4252 to expand b4_declare_parser_variables globally.
4253 (yypush_parse): Likewise in here.
4254
4255 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4256 (yy_reduce_print): Reformat M4 for readability.
4257
ee5abb37
JD
42582006-12-15 Bob Rossi <bob@brasko.net>
4259 and Joel Denny <jdenny@ces.clemson.edu>
4260
4261 * data/push.c (yypstate): Add typedef, and update all uses of
4262 struct yypstate to just yypstate.
4263 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4264
16ca01f9
JD
42652006-12-14 Bob Rossi <bob@brasko.net>
4266
4267 * data/push.c (yypush_parse): Declare prototype regardless of
4268 %locations option.
4269
ab8e7e1a
JD
42702006-12-14 Bob Rossi <bob@brasko.net>
4271
4272 * data/push.c (yyparse): Remove the prototype and the #define when in
4273 push-parser mode.
4274
9bf32be3
JD
42752006-12-13 Bob Rossi <bob@brasko.net>
4276
4277 * data/push.c (yypstate_init): Rename to...
4278 (yypstate_new): ... this and use b4_c_function_def.
4279 (yypstate_delete): New.
4280 (yypush_parse): Change parameters yynval and yynlloc to be const.
4281 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4282 yypstate_delete functions.
4283
f02e2948
JD
42842006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4285
4286 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4287 strange test case titles. Reported by Bob Rossi.
4288
38eb7751
PE
42892006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4290
4291 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4292 of potential ambiguities in GLR grammers.
4293
bd9d212b
JD
42942006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4295
4296 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4297 `bison ', use m4_index instead of m4_substr since chopping up a string
4298 containing M4-special characters causes problems here.
4299
4300 Fix a couple of bugs related to special characters in user-specified
4301 file names, and make it easier for skeletons to compute output file
4302 names with the same file name prefix as Bison-computed output file
4303 names.
4304 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4305 b4_parser_file_name and b4_spec_defines_file instead of
4306 @output_parser_name@ and @output_header_name@, which are now redundant.
4307 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4308 b4_parser_file_name, b4_spec_defines_file, and the new
4309 @basename(FILENAME@) instead of @output_parser_name@ and
4310 @output_header_name@, which inappropriately escaped the file names as
4311 C string literals.
4312 * src/files.c (all_but_ext): Remove static qualifier.
4313 (compute_output_file_names): Move `free (all_but_ext)' to...
4314 (output_file_names_free): ... here since all_but_ext is needed later.
4315 * src/files.h (all_but_ext): Extern.
4316 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4317 exactly what MUSCLE_INSERT_STRING used to do.
4318 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4319 characters are escaped properly.
4320 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4321 all_but_ext.
4322 For pkgdatadir muscle, maintain previous functionality by using
4323 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4324 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4325 digraphs would never be expanded. Hopefully no one has M4-special
4326 characters in his Bison installation path.
4327 * src/scan-skel.l: Don't parse @output_header_name@ and
4328 @output_parser_name@ anymore since they're now redundant.
4329 In @output, use decode_at_digraphs.
4330 Parse a new @basename command that invokes last_component.
4331 (decode_at_digraphs): New.
4332 (BASE_QPUTS): Remove unused.
4333 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4334 (Output file name): New tests.
4335
3f7ca628
JD
43362006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4337
4338 Warn about output files that are generated by the skeletons and that
4339 conflict with other output files.
4340 * data/glr.c: Don't generate the header file here when glr.cc does.
4341 * src/files.c (file_names, file_names_count): New static globals.
4342 (compute_output_file_names): Invoke output_file_name_check for files
4343 not generated by the skeletons and remove existing checks.
4344 (output_file_name_check): New function that warns about conflicting
4345 output file names.
4346 (output_file_names_free): Free file_names.
4347 * src/files.h (output_file_name_check): Declare.
4348 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4349 the skeletons.
4350 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4351 (Conflicting output files): New tests.
4352
178e123e
PE
43532006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4354
4355 * doc/bison.texinfo: Fix a couple of typos.
4356
43572006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
4358
4359 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4360 Rename to...
4361 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4362 update all uses.
4363 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4364 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4365 local pv.
4366 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4367 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4368
ea17f233
JD
43692006-12-07 Bob Rossi <bob@brasko.net>
4370 and Joel Denny <jdenny@ces.clemson.edu>
4371
4372 * data/push.c (yypvarsinit): Change return type from void* to struct
4373 yypvars*. No longer cast to void* on return.
4374 (struct yypvars): Remove yylen since it need not be remembered between
4375 yypushparse invocations.
4376 (yypushparse): Don't copy between yylen and pv->yylen.
4377
55a30bda
JD
43782006-12-05 Bob Rossi <bob@brasko.net>
4379
4380 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4381 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4382 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4383 (struct yypvars): Remove b4_declare_parser_variables.
4384 (yypvarsinit): Remove init code for removed variables.
4385 (global scope): Do not declare b4_declare_parser_variables if
4386 push or pure mode.
4387 (yypushparse): Add b4_declare_parser_variables.
4388 Init new local variables, and remove init code for removed
4389 yypvars variables.
4390 (yyparse): Delete.
4391 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4392 and yyparse for other modes.
4393 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4394 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4395 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4396 (AT_PURE_LEX_IF): True if pure or push parser.
4397
85894313
JD
43982006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4399
4400 Document Yacc prologue alternatives and default %destructor's and
4401 %printer's as experimental. Don't mention Java yet. Discussed at
4402 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4403 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4404 (2.3a): Annotate this entry to say the old forms of these features were
4405 also experimental.
4406 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 4407 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
4408 of Java (we'll want this back eventually).
4409
02975b9a
JD
44102006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4411
4412 Support a file name argument to %defines. Deprecate `=' in
4413 %file-prefix, %name-prefix, and %output. Discussed at
4414 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4415 * NEWS (2.3a+): Mention.
148d66d8 4416 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
4417 form of %defines, and remove `=' from entries for %file-prefix,
4418 %name-prefix, and %output.
4419 * src/parse-gram.y (prologue_declaration): Implement.
4420 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4421 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4422 all but one occurrence of %name-prefix.
4423 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4424 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4425 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4426 occurrence of each of %file-prefix and %output. Add check for %defines
4427 with argument.
4428 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4429 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4430 Remove the `=' from %output.
4431
287b314e
JD
44322006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4433
4434 Don't escape $ in test case titles since Autoconf 2.61 now does that
4435 correctly.
4436 * tests/actions.at (Default %printer and %destructor are not for error
4437 or $undefined): Here.
4438 (Default %printer and %destructor are not for $accept): Here.
4439 * tests/input.at (Invalid $n and @n): Here.
4440
3ebecc24
JD
44412006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4442
4443 Rename <!> to <>. Discussed starting at
4444 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4445 * NEWS (2.3a+): Update.
148d66d8 4446 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
4447 Update.
4448 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4449 * src/scan-gram.l (INITIAL): Implement.
4450 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4451 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4452 comment.
4453 * tests/actions.at (Default tagless %printer and %destructor,
4454 Default tagged and per-type %printer and %destructor,
4455 Default %printer and %destructor are not for error or $undefined,
4456 Default %printer and %destructor are not for $accept,
4457 Default %printer and %destructor for mid-rule values): Update.
4458 * tests/input.at (Default %printer and %destructor redeclared,
4459 Unused values with default %destructor): Update.
4460
26b8a438
JD
44612006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4462
4463 Don't let %prec take a nonterminal.
4464 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4465 token.
4466 * tests/input.at (%prec takes a token): New test checking that %prec
4467 won't take a nonterminal.
4468
07c39ae9
JD
44692006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4470
405d53b7
JD
4471 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4472 it was double-quoted.
07c39ae9
JD
4473 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4474 grammar is maintained with Bison's highest standards.
4475 * src/getargs.c: Fix some typos in Doxygen comments.
4476
580b8926
JD
44772006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4478
4479 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4480 later. Reported by Paul Eggert in
4481 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4482 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4483 * src/scan-code.l (translate_action): Don't bother invoking
4484 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4485 (code_scanner_free): Instead of invoking
4486 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4487 which frees more.
4488 * src/scan-gram.l (gram_scanner_free): Likewise.
4489 * src/scan-skel.l (scan_skel): Likewise.
4490
4502eadc
JD
44912006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4492
4493 * src/files.c (tr): Change return type to void.
4494 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4495 has been called previously for the same key.
4496 (muscle_find): Return storage instead of value so that
4497 --enable-gcc-warnings doesn't produce warnings that the return discards
4498 const. aver that the value and storage are the same since storage
4499 could potentially be NULL when value is not.
4500 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4501 same as 0.
4502
7746c8f6
PE
45032006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4504
4505 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4506 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4507 us a slightly cleaner distribution, and also works.
4508 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4509 gnulib changes.
4510
eb095650
PE
45112006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4512 and Paul Eggert <eggert@cs.ucla.edu>
4513
4514 Don't let Bison leak memory except when it complains.
4515 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4516 (spec_defines_file, dir_prefix): Now char *, not const char *,
4517 since they are freed.
4518 * src/files.c: Likewise.
4519 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4520 Likewise.
4521 (tr): Now operates in-place. All uses changed.
4522 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4523 values.
4524 (compute_file_name_parts, compute_output_file_names): Don't store
4525 read-only data in variables that will be freed.
4526 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4527 src_extension, and header_extension.
4528 (output_file_names_free): New public function to free
4529 spec_verbose_file, spec_graph_file, spec_defines_file,
4530 parser_file_name, and dir_prefix.
4531 * src/getargs.c (getargs): Don't store read-only data in variables that
4532 will be freed.
4533 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4534 (which previously existed but was unused), and quotearg_free.
4535 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4536 * src/muscle_tab.c: Likewise.
4537 (muscle_entry): Make the value char const *,
4538 and add a new storage member that is char * and can be freed.
4539 (muscle_entry_free): New private function.
4540 (muscle_init): Use it instead of free.
4541 (muscle_insert, muscle_grow): Update and use new storage member.
4542 (muscle_code_grow): Free the string passed to muscle_grow
4543 since it's not needed anymore.
4544 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4545 add a new `char *code' member.
4546 ("{...}"): Declare semantic type as code.
4547 * src/scan-code.h (translate_rule_action):
4548 (translate_symbol_action, translate_code, translate_action): Return
4549 `char const *' rather than `char *' since external code should not free
4550 these strings.
4551 * src/scan-code.l: Likewise.
4552 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4553 which is "{...}" in the parser.
4554 * tests/Makefile.am (maintainer-check-valgrind): Set
4555 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4556 Valgrind.
4557 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4558 complain.
4559 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4560 expecting a non-zero exit status sets --leak-check=summary and
4561 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4562 this case, and we don't want to hear about it.
4563
ac564be4
PE
45642006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4565
4566 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4567 instead of from the template, to simplify configuration a bit.
4568 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4569 and m4/wint_t.m4, as they are needed with the latest gnulib.
4570
17bd8a73
JD
45712006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4572
4573 Disable unset/unused mid-rule value warnings by default, and recognize
4574 --warnings=midrule-values to enable them. Discussed starting at
4575 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4576 * NEWS (2.3a+): Mention.
4577 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4578 warnings): Add entry for midrule-values subargument.
4579 * src/reader.c (symbol_should_be_used): Don't return true just because
4580 the value is a set/used mid-rule value unless
4581 --warnings=midrule-values was specified.
4582 * tests/input.at (Unused values, Unused values before symbol
4583 declarations): Run tests with and without --warnings=midrule-values.
4584
4585 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4586 than LIST_FREE directly.
4587
89eb3c76
JD
45882006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4589
4590 Finish implementing --warnings=error, which should not be implied by
4591 --warnings=all (or by its synonyms -W and --warnings without
4592 subarguments).
4593 * src/complain.c (set_warning_issued): New function to report that
4594 warnings are being treated as errors and to record an error if so.
4595 Invoke...
4596 (warn_at, warn): ... here.
4597 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4598 "error - warnings are errors" does not appear above "all - all of the
4599 above".
4600 (getargs): For -W and --warnings without subarguments, don't let
4601 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4602 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4603
ba7560e2
JD
46042006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4605
4606 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4607 empty subargument list. For example: `bison --warnings= parser.y'.
4608
31283fc3
JD
46092006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4610
4611 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4612 the parser header file so that gcc doesn't warn.
4613
12e35840
JD
46142006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4615
4616 Split the default %destructor/%printer into two kinds: <*> and <!>.
4617 Discussed starting at
4618 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4619 * NEWS (2.3a+): Mention.
4620 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4621 previous change today related to mid-rules.
148d66d8 4622 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 4623 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
4624 (TYPE_TAG_ANY): Add as <*>.
4625 (TYPE_TAG_NONE): Add as <!>.
4626 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4627 for <*> and <!>.
4628 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4629 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4630 * src/symlist.c (symbol_list_default_new): Split into tagged and
4631 tagless versions.
4632 (symbol_list_destructor_set, symbol_list_printer_set): Split
4633 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4634 SYMLIST_DEFAULT_TAGLESS.
4635 * src/symlist.h: Update symbol_list_default*_new prototypes.
4636 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4637 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4638 * src/symtab.c (default_destructor, default_destructor_location,
4639 default_printer, default_printer_location): Split each into tagged and
4640 tagless versions.
4641 (symbol_destructor_get, symbol_destructor_location_get,
4642 symbol_printer_get, symbol_printer_location_get): Implement tagged
4643 default and tagless default cases.
4644 (default_destructor_set, default_printer_set): Split each into tagged
4645 and tagless versions.
4646 * src/symtab.h: Update prototypes.
4647 * tests/actions.at (Default %printer and %destructor): Rename to...
4648 (Default tagless %printer and %destructor): ... this, and extend.
4649 (Per-type %printer and %destructor): Rename to...
4650 (Default tagged and per-type %printer and %destructor): ... this, and
4651 extend.
4652 (Default %printer and %destructor for user-defined end token): Extend.
4653 (Default %printer and %destructor are not for error or $undefined):
4654 Update.
4655 (Default %printer and %destructor are not for $accept): Update.
4656 (Default %printer and %destructor for mid-rule values): Extend.
4657 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4658 (Unused values with default %destructor): Extend.
4659
f91b1629
JD
46602006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4661
4662 Don't apply the default %destructor/%printer to an unreferenced midrule
4663 value. Mentioned at
4664 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4665 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4666 like $@n instead of just @n so that the default %destructor/%printer
4667 logic doesn't see them as user-defined symbols.
4668 (symbol_is_dummy): Check for both forms of the name.
4669 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4670 name for which the midrule value is referenced in any action.
4671 * tests/actions.at (Default %printer and %destructor for mid-rule
4672 values): New test.
4673 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4674 for change to dummy symbol names.
4675
519d0004
JD
46762006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4677
4678 Warn about unset midrule $$ if the corresponding $n is used.
4679 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4680 $n usage.
4681 (packgram): Before invoking grammar_rule_check on any rule, make sure
4682 all actions have already been scanned in order to set `used' flags.
4683 Otherwise, checking that a midrule's $$ is set will not always work
4684 properly because the midrule check must forward-reference the midrule's
4685 parent rule.
4686 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4687 warning.
4688
a501eca9
JD
46892006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4690
4691 More improvements to the documentation of the prologue alternatives:
4692 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4693 Bison manual.
4694 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4695 some text to clarify the relative importance of the new directives and
4696 to show how these directives may be viewed as code labels.
4697
2cbe6b7f
JD
46982006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4699
4700 Similar to the recently removed %before-header, add %code-top as the
4701 alternative to the pre-prologue. Mentioned at
4702 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4703 Also, let the prologue alternatives appear in the grammar section.
4704 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4705 (prologue_declaration): Move the existing prologue alternatives to...
4706 (grammar_declaration): ... here and add %code-top.
4707 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4708
4709 Clean up and extend documentation for the prologue alternatives.
4710 * NEWS (2.3a+): Describe prologue alternatives.
4711 * doc/bison.texinfo (Prologue): Move discussion of prologue
4712 alternatives to...
4713 (Prologue Alternatives): ... this new section, and extend it to discuss
4714 all 4 directives in detail.
148d66d8
JD
4715 (Table of Symbols): Clean up discussion of prologue alternatives and
4716 add %code-top.
2cbe6b7f 4717
e557d3ea
JMG
47182006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4719
4720 DJGPP specific issues.
4721
4722 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4723 config.bat accordingly.
4724 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4725 * djgpp/config.site: Likewise.
4726
136a0f76
PB
47272006-10-16 Paolo Bonzini <bonzini@gnu.org>
4728
27bd5d67
PB
4729 Replace %*-header with %provides, %requires, %code. See discussion at
4730 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4731
136a0f76
PB
4732 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4733 (b4_user_start_header): Remove.
4734 * data/glr.c: Use new macros instead of b4_*start_header
4735 and b4_*end_header.
4736 * data/glr.cc: Likewise.
4737 * data/lalr1.cc: Likewise.
4738 * data/push.c: Likewise.
4739 * data/yacc.c: Likewise.
4740
4741 * doc/bison.texinfo: Remove %before-header, rename
4742 %{start,end,after}-header to %requires, %provides, %code.
4743
4744 * src/parse-gram.y: Likewise (also rename token names accordingly).
4745 * src/scan-gram.l: Likewise.
4746 * tests/actions.at: Likewise.
4747
10f429ef
PE
47482006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4749
4750 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4751 Problem reported by Joel E. Denny.
4752
47532006-10-14 Jim Meyering <jim@meyering.net>
4754
4755 (Sync from coreutils.)
4756 Work also when the working directory (with e.g. coreutils sources)
4757 is version controlled with git, rather than CVS.
4758 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4759 rather than CVS.
4760 In messages and comments, say e.g., "checked-out sources",
4761 rather than "CVS sources".
4762 (version_controlled_file): New function. Work for git as well as
4763 for CVS. Don't use grep's -q option.
4764 (slurp): Call it here, in place of CVS-specific code.
4765
c4bd5bf7
JD
47662006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4767
4768 Fix testsuite for ./configure --enable-gcc-warnings:
4769 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4770 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4771 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4772 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4773 * test/regression.at (Diagnostic that expects two alternatives):
4774 Likewise.
4775
46356ea4
PE
47762006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4777
231ed89a
PE
4778 * bootstrap.conf (gnulib_modules): Add config-h.
4779 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4780 worry about HAVE_CONFIG_H.
4781 * lib/abitset.c: Likewise.
4782 * lib/bitset.c: Likewise.
4783 * lib/bitset_stats.c: Likewise.
4784 * lib/bitsetv-print.c: Likewise.
4785 * lib/bitsetv.c: Likewise.
4786 * lib/ebitset.c: Likewise.
4787 * lib/get-errno.c: Likewise.
4788 * lib/lbitset.c: Likewise.
4789 * lib/subpipe.c: Likewise.
4790 * lib/timevar.c: Likewise.
4791 * lib/vbitset.c: Likewise.
4792 * lib/bitset.c: Include "bitset.h" first, to test interface.
4793 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4794 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4795 * lib/bitsetv.c: Include "bitsetv.h" first.
4796 * lib/get-errno.c: Include "get-errno.h" first.
4797 * m4/.cvsignore: Add config-h.m4.
4798 * tests/actions.at (Default %printer and %destructor for ...):
4799 Adjust expected line numbers in output to reflect removal of #if
4800 HAVE_CONFIG_H lines.
4801 * tests/glr-regression.at (Missed %merge type warnings when ...):
4802 Likewise.
4803 * tests/regression.at (Braced code in declaration in rules section):
4804 Likewise.
4805 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4806 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4807 Include <config.h> unconditionally.
4808
46356ea4
PE
4809 * bootstrap: Sync from coreutils, as follows:
4810
4811 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4812
4813 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4814 variable was sometimes used without being initialized. This
4815 messed up the installation of the INSTALL file in some cases.
4816
4817 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4818
4819 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4820 --copy. Inspired by a suggestion from Bruno Haible.
4821
4822 2006-10-03 Jim Meyering <jim@meyering.net>
4823
4824 * bootstrap: Undo last change to this file, since now gnulib-tool
4825 sticks with the automake default in generating dependencies.
4826
dd4bf078
PE
48272006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4828
cf2a5f7c
PE
4829 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4830 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4831
4832 * doc/bison.1: Add copyright notice.
4833
4834 * data/glr.c: Don't include <stdarg.h>; not used.
4835
35fe0834
PE
4836 * NEWS: The -g and --graph options now output graphs in Graphviz
4837 DOT format, not VCG format.
4838 * doc/bison.1: Likewise.
4839 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
4840 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4841 of this change in
4842 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
4843 * TODO: Remove Graphviz entry.
4844 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4845 remove vcg.c, vcg.h, vcg_defaults.h.
4846 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4847 * src/graphviz.c, src/graphviz.h: New files.
4848 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4849 * src/files.h: Make comment more generic.
4850 * src/main.c (main): Likewise.
4851 * src/print_graph.h: Likewise.
4852 * src/getargs.c (usage): Make usage description more generic.
4853 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4854 (static_graph, fgraph): Remove. All uses changed to pass
4855 arguments instead of sharing a static var.
4856 (print_core, print_actions, print_state, print_graph):
4857 Output graphviz format rather than VCG format.
4858 * tests/.cvsignore: Remove *.vcg; add *.dot.
4859 * tests/output.at: Expect *.dot files, not *.vcg files.
4860
dd4bf078
PE
4861 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4862 accommodates the 2006-10-08 change.
4863
efdd7421
PE
48642006-10-11 Bob Rossi <bob@brasko.net>
4865
4866 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4867 (b4_yyssa, b4_yyerror_range): New macros.
4868 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4869 (yypvarsinit): Remove init of removed fields.
4870 (yypushparse): Remove use of removed fields; use new macros instead.
4871
96a1981a
PE
48722006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4873
4874 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4875 in a push parser. Reindent slightly to match yacc.c better.
4876
48772006-10-11 Bob Rossi <bob@brasko.net>
4878
46356ea4
PE
4879 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4880 yymsg_alloc fields.
4881 (yypvarsinit, yypushparse): Remove init of removed fields.
4882 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 4883
c1630a8b
PE
48842006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4885
4886 * THANKS: Add Paolo Bonzini and Bob Rossi.
4887
90b9908d
PB
48882006-10-08 Paolo Bonzini <bonzini@gnu.org>
4889
4890 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4891 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4892 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4893 b4_define_user_cde and uses): Remove.
4894 (b4_comment, b4_prefix, b4_sync_start): New.
4895 * data/bison.m4: New file, with most of the content removed from c.m4.
4896 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4897 * src/output.c (output_skeleton): Pass bison.m4.
4898 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4899 only if specified.
4900
cf806753
PE
49012006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4902
4903 Fix test failure reported by Tom Lane in
4904 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4905 and try to make such failures easier to catch in the future.
4906 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4907 that's now the caller's responsibility.
4908 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4909 Set yychar = YYEOF if it's negative.
4910 * tests/actions.at (yylex): Abort if asked to read past EOF.
4911 * tests/conflicts.at (yylex): Likewise.
4912 * tests/cxx-type.at (yylex): Likewise.
4913 * tests/glr-regression.at (yylex): Likewise.
4914 * tests/input.at (yylex): Likewise.
4915 * tests/regression.at (yylex): Likewise.
4916 * tests/torture.at (yylex): Likewise.
4917
0e2f006a
PE
49182006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4919
4920 Fix problems with translating English-language diagnostics.
4921 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4922 respect to bison-runtime pot generation. The YY_ stuff
4923 wasn't being captured.
4924 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4925 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4926 * runtime-po/POTFILES.in: Add data/push.c.
4927
e3ddc1e3
PE
49282006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4929
4930 Merge bootstrap changes from coreutils.
4931
4932 2006-09-28 Jim Meyering <jim@meyering.net>
4933
4934 Automatically generated dependencies are important even
4935 when all of the sources in a directory come from gnulib.
4936 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4937 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4938
4939 2006-09-23 Jim Meyering <jim@meyering.net>
4940
4941 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
4942
4943 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4944
4945 * bootstrap: Add support for --force.
4946 (usage): New function. Describe usage less tersely.
4947 (CVS_only_file): New var.
4948
01e972b3
PE
49492006-09-21 Paul Eggert <eggert@cs.ucla.edu>
4950
4951 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4952 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
4953 Adjust white space and comments to match GNU style better.
4954
c63d3e90
PE
49552006-09-20 Bob Rossi <bob@brasko.net>
4956
4957 * data/push.c (yyresult_get): Remove function.
4958 (YYPUSH_MORE): Add #define.
4959 (yypushparse): Modify return value.
4960
e70f46d1
PE
49612006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4962
4963 * stamp-h.in: Remove; no longer needed.
4964 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
4965 Remove config.h, config.hin, intl (no longer created).
4966 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
4967 stamp-h1.
4968
4969 Sync bootstrap from coreutils, as follows:
4970
4971 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
4972
4973 * bootstrap (symlink_to_gnulib): New function.
4974 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
4975 to copies-of-gnulib.
4976 (cp_mark_as_generated, slurp, gnulib_files):
4977 Avoid making a copy if it's the same as the old version.
4978 (gnulib_files): Add support for this variable (used by Bison).
4979
a92be413
PE
49802006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4981
4982 * src/getargs.c (usage): Rework to use conventions similar to
4983 coreutils, to make translation a bit easier and the code a bit
4984 smaller. Problem reported by Tim Van Holder.
4985
4f82b42a
PE
49862006-09-15 Paul Eggert <eggert@cs.ucla.edu>
4987
3b2942e6
PE
4988 Use some of gnulib's new modules, taken from coreutils.
4989
4990 * bootstrap: Sync from coreutils, except add support for gnulib_files.
4991 * bootstrap.conf: New file.
4992 (gnulib_modules): Add configmake, inttypes, unistd.
4993 (XGETTEXT_OPTIONS): Add complain, complain_at,
4994 fatal, fatal_at, warn, warn_at, unexpected_end.
4995 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
4996 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
4997 (gl_EARLY): Add.
4998 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
4999 (gl_INIT): Add
5000 (GNULIB_AUTOCONF_SNIPPET): Remove.
5001 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5002 the pickiest.
5003 * lib/.cvsignore: Add inttypes_.h.
5004 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5005 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5006 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5007 no-longer-necessary initializations.
5008 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5009 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5010 use the unistd module.
5011 * src/system.h: Likewise.
5012 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5013 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5014 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5015 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5016 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5017 * src/system.h: Include inttypes.h unconditionally, now that we
5018 use the inttypes module. Don't bother to include stdint.h, since
5019 inttypes.h now does that for us.
5020 (LOCALEDIR): Remove, now that we use the configmake module.
5021 * src/getargs.c: Include configmake.h.
5022 * src/main.c: Likewise.
5023 * src/output.c: Likewise.
5024 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5025 not from $abs_top_builddir, since config.h moved.
5026
5027
4f82b42a
PE
5028 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5029 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5030
5031 * src/parse-gram.y (symbol_declaration): Don't put statements
5032 before declarations; it's not portable to C89.
5033 * src/scan-code.l (handle_action_at): Likewise.
5034
5035 * src/scan-code.l: Always initialize braces_level; the old code
5036 left it uninitialized and therefore had undefined behavior.
5037
5038 Don't attempt to redefine 'assert', since it runs afoul of
5039 systems where standard headers (mistakenly) include <assert.h>.
5040 Instead, define and use our own alternative, called 'aver'.
5041 * src/reader.c: Don't include assert.h, since we no longer
5042 use assert.
5043 * src/scan-code.l: Likewise.
5044 * src/system.h (assert): Remove, replacing with....
5045 (aver): New function, taking a bool arg. All uses changed.
5046 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5047 not merely an integer.
5048
31c10e38
PE
50492006-09-15 Bob Rossi <bob@brasko.net>
5050
5051 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5052 * data/c.m4 (YYPUSH): New.
5053 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5054 * src/getargs.c (push_parser): New var.
5055 * src/getargs.h (push_parser): New declaration.
5056 * src/output.c (prepare): Add macro insertion of `push_flag'.
5057 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5058 (prologue_declaration): Parse %push-parser.
5059 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5060 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5061 list of removed lines from the traces observed.
5062 (AT_CHECK_CALC_LALR): Added push parser tests.
5063
fa7b79c0
PE
50642006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5065
21fe08ca
PE
5066 * NEWS: Version 2.3a.
5067 * configure.ac (AC_INIT): Likewise.
5068
e8ec4d9b
PE
5069 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5070 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5071 due to header ordering dependencies. I don't know why the #define
5072 was there.
5073
fa7b79c0
PE
5074 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5075 runtime cost when YYDEBUG is not defined, and so that some tests
5076 that used to fail now work. Problem and initial suggestion by
5077 Paolo Bonzini.
5078 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5079 * data/glr.cc (b4_parser_class_name):
5080 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5081 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5082 (yydebug_) [YYDEBUG]: New member.
5083 (yycdebug_): Now defined only if YYDEBUG.
5084 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5085 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5086 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5087 if YYYDEBUG.
5088 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5089 Define only if YYDEBUG.
5090 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5091 set_debug_level.
5092 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5093 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5094 AT_CHECK_CALC_GLR_CC that are working now.
5095
4ec13d60
PE
50962006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5097
5098 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5099 We don't need them in glr.cc, and glr.c defines them.
5100 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5101 assumes that defining it to anything is the same as defining
5102 it to 1. Problem reported by Paolo Bonzini.
5103
8e1687ae
PE
51042006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5105
5106 * data/c.m4 (b4_null, b4_case): Define.
5107 * src/output.c (prepare_symbols): Use b4_null.
5108 (user_actions_output): Use b4_case.
5109
3dc5e96b
PE
51102006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5111
aef3da86
PE
5112 * data/glr.c (b4_shared_declarations): Put start-header first,
5113 before any #includes that we generate, so that feature-test
5114 macros work. Problem reported by Michael Deutschmann in
5115 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5116 * data/lalr1.cc: Likewise.
5117 * doc/bison.texinfo (Prologue): Document that feature-test macros
5118 should be defined before any Bison declarations.
5119 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5120 that depend on location.hh after, not before, Bison decls, since
5121 we now include location.hh after the first user prologue.
5122
3dc5e96b
PE
5123 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5124 Sander Brandenburg in
5125 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5126 Also, fix minor white space and comment issues.
aef3da86
PE
5127 (Prologue): Mention that it's better to define feature-test macros
5128 before Bison declarations. Problem reported by Michael Deutschmann.
5129
5130 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5131 by Jim Meyering.
5132 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5133 This adjusts to recent gnulib changes.
3dc5e96b 5134
b2a0b7ca
JD
51352006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5136
5137 Finish implementation of per-type %destructor/%printer. Discussed
5138 starting at
5139 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5140 and
5141 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5142 * NEWS (2.3+): Add a description of this feature to the default
5143 %destructor/%printer description.
5144 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5145 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5146 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5147 list node contains a semantic type.
5148 * src/symtab.c, src/symtab.h: Extend with a table that associates
5149 semantic types with their %destructor's and %printer's.
5150 (semantic_type_from_uniqstr, semantic_type_get,
5151 semantic_type_destructor_set, semantic_type_printer_set): New functions
5152 composing the public interface of that table.
5153 (symbol_destructor_get, symbol_destructor_location_get,
5154 symbol_printer_get, symbol_printer_location_get): If there's no
5155 per-symbol %destructor/%printer, look up the per-type before trying
5156 the default.
5157 * tests/actions.at (Per-type %printer and %destructor): New test case.
5158 * tests/input.at (Default %printer and %destructor redeclared):
5159 Extend to check that multiple occurrences of %symbol-default in a
5160 single %destructor/%printer declaration is an error.
5161 (Per-type %printer and %destructor redeclared, Unused values with
5162 per-type %destructor): New test cases.
5163
3be03b13
JD
51642006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5165
5166 Require default %destructor/%printer to be declared using
5167 %symbol-default instead of an empty symbol list, and start working on
5168 new per-type %destructor/%printer. Discussed at
5169 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5170 * NEWS (2.3+): Add %symbol-default to example.
5171 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 5172 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
5173 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5174 (generic_symlist, generic_symlist_item): New nonterminals for creating
5175 a list in which each item is a symbol, semantic type, or
5176 %symbol-default.
5177 (grammar_declaration): Use generic_symlist in %destructor and %printer
5178 declarations instead of symbols.1 or an empty list.
5179 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5180 for changes to symbol_list.
5181 * src/reader.c: Update for changes to symbol_list.
5182 * src/scan-code.l: Likewise.
5183 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5184 * src/symlist.c, src/symlist.h: Extend such that a list node may
5185 represent a semantic type or a %symbol-default in addition to just an
5186 ordinary symbol. Add switched functions for setting %destructor's and
5187 %printer's.
5188 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5189 %destructor/%printer declarations.
5190
3508ce36
JD
51912006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5192
5193 Whether the default %destructor/%printer applies to a particular symbol
5194 isn't a question of whether the user *declares* that symbol (in %token,
5195 for example). It's a question of whether the user by any means
5196 *defines* the symbol at all (by simply using a char token, for
5197 example). $end is defined by Bison whereas any other token with token
5198 number 0 is defined by the user. The error token is always defined by
5199 Bison regardless of whether the user declares it with %token, but we
5200 may one day let the user define error as a nonterminal instead.
5201 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5202 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5203 the meaning of "user-defined".
5204 * tests/actions.at (Default %printer and %destructor for user-declared
5205 end token): Rename to...
5206 (Default %printer and %destructor for user-defined end token): ...
5207 this.
5208
5209 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5210 computation of whether to apply the default, don't maintain a list of
5211 every Bison-defined symbol. Instead, just check for a first character
5212 of '$', which a user symbol cannot have, and check for the error token.
5213
9350499c
JD
52142006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5215
5216 Don't apply the default %destructor or %printer to the error token,
5217 $undefined, or $accept. This change fits the general rule that the
5218 default %destructor and %printer are only for user-declared symbols,
5219 and it solves several difficulties that are described in the new test
5220 cases listed below.
5221 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5222 * tests/actions.at (Default %printer and %destructor are not for error
5223 or $undefined, Default %printer and %destructor are not for $accept):
5224 New test cases.
5225
4d7370cb
JD
52262006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5227
5228 Allow %start after the first rule.
5229 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5230 when parsing the first rule.
5231 (check_and_convert_grammar): Search for it here after all grammar
5232 declarations have been parsed. Skip midrules, which have dummy LHS
5233 nonterminals.
5234 * src/symtab.c (symbol_is_dummy): New function.
5235 * src/symtab.h (symbol_is_dummy): Declare it.
5236 * tests/input.at (%start after first rule): New test.
5237
6d0ef4ec
JD
52382006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5239
5240 Redo some of the previous commit: add back the ability to use
5241 non-aliased/undeclared string literals since it might be useful to
5242 those declaring %token-table.
5243 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5244 commit: don't worry about complaints from symbols_pack.
5245 * src/symtab.c (symbol_new, symbol_class_set,
5246 symbol_check_alias_consistency): Undo changes in previous commit: count
5247 each string literal as a new symbol and token, assign it a symbol
5248 number, and don't complain about non-aliased string literals.
5249 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5250 and token counts but does still set aliased tokens to the same number,
5251 symbol_pack_processor now leaves empty slots in the symbols array.
5252 Remove those slots.
5253 * tests/regression.at (Undeclared string literal): Remove test case
5254 added in previous commit since non-aliased string literals are allowed
5255 again.
5256 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5257 remove unnecessary string literal declarations.
5258 * tests/sets.at (Firsts): Likewise.
5259
965537bc
JD
52602006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5261
5262 Don't allow an undeclared string literal, but allow a string literal to
5263 be used before its declaration.
5264 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5265 symbols_pack complained.
5266 * src/symtab.c (symbol_new): Don't count a string literal as a new
5267 symbol.
5268 (symbol_class_set): Don't count a string literal as a new token, and
5269 don't assign it a symbol number since symbol_make_alias does that.
5270 (symbol_make_alias): It's not necessary to decrement the symbol and
5271 token counts anymore. Don't assume that an alias declaration occurs
5272 before any uses of the identifier or string, and thus don't assert that
5273 one of them has the highest symbol number so far.
5274 (symbol_check_alias_consistency): Complain if there's a string literal
5275 that wasn't declared as an alias.
5276 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5277 symbol_pack asserts that every token has been assigned a symbol number
5278 although undeclared string literals have not.
5279 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 5280 string literal): New test cases.
965537bc
JD
5281 (Characters Escapes, Web2c Actions): Declare string literals as
5282 aliases.
5283 * tests/sets.at (Firsts): Likewise.
5284
47aee066
JD
52852006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5286
5287 In the grammar scanner, STRING_FINISH unclosed constructs and return
5288 them to the parser in order to improve error messages.
5289 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5290 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5291 * tests/input.at (Unclosed constructs): New test case.
5292 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5293 seen.
5294
5295 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5296 unused global.
5297
1f6b3679
JD
52982006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5299
5300 Handle string aliases for character tokens correctly.
5301 * src/symtab.c (symbol_user_token_number_set): If the token has an
5302 alias, check and set its alias's user token number instead of its own,
5303 which is set to indicate the alias. Previously, every occurrence of
5304 the character token in the grammar overwrote that alias indicator with
5305 the character code.
5306 * tests/input.at (String aliases for character tokens): New test.
5307
219741d8
JD
53082006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5309
5310 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5311
11daa4e7
PE
53122006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5313
5314 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5315 to prevent failures when building on older platforms.
5316 Check for autopoint failure.
5317 Set XGETTEXT_OPTIONS to values that check for C format strings,
5318 so that translators are warned about them (this also helps
5319 prevent core dumps).
5320
5321 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5322 function, since it simplifies our code a bit.
5323
5324 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5325 rather than -W, so we don't get bogus warnings about sign comparisons.
5326 Add -Wpointer-arith, since that warning is useful (it reports code
5327 that does not conform to C89 and that some compilers reject).
5328 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5329 since it's no longer needed.
5330
f9bfc42a
JD
53312006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5332
5333 Clean up scanners a bit.
5334 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5335 definitions so gcc won't warn when obstack_for_string is unused.
5336 * src/scan-code.l: config.h and system.h are already #include'd by
5337 scan-code-c.c, so get rid of them here.
5338 * src/scan-gram.l: Likewise.
5339 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5340 definitions rather than duplicating the rest of it.
5341 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5342
06e8700a
JD
53432006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5344
5345 Suppress signed/unsigned comparison warnings for yycheck.
5346 * data/c.m4 (b4_safest_int_type): New macro.
5347 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5348 a signed int type, cast it to b4_safest_int_type first.
5349 * data/yacc.c: Likewise.
5350 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5351 also overwritten.
5352
9c437126
PE
53532006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5354
5355 * doc/bison.texinfo: Fix some typos.
5356
284d8a13
PE
53572006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5358
5359 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5360 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5361
5362 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5363 the latest gnulib does this a different way.
5364 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5365 translation was patched, so stop omitting it.
5366
ec5479ce
JD
53672006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5368
5369 Enable declaration of default %printer/%destructor. Make the parser
5370 use these for all user-declared grammar symbols for which the user does
5371 not declare a specific %printer/%destructor. Thus, the parser uses it
5372 for token 0 if the user declares it but not if Bison generates it as
5373 $end. Discussed starting at
5374 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5375 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5376 and
5377 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5378 * NEWS (2.3+): Mention.
5379 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5380 declare a %destructor for a mid-rule's semantic value. It's just
5381 impossible to declare one specific to it.
5382 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5383 code. Describe default %destructor form.
5384 * src/parse-gram.y (grammar_declaration): Parse default
5385 %printer/%destructor declarations.
5386 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5387 and symbol_destructor_location_get rather than accessing the destructor
5388 and destructor_location members of struct symbol.
5389 (symbol_printers_output): Likewise but for %printer's.
5390 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5391 again.
5392 * src/symtab.c (default_destructor, default_destructor_location,
5393 default_printer, default_printer_location): New static global
5394 variables to record the default %destructor and %printer.
5395 (symbol_destructor_get, symbol_destructor_location_get,
5396 symbol_printer_get, symbol_printer_location_get): New functions to
5397 compute the appropriate %destructor and %printer for a symbol.
5398 (default_destructor_set, default_printer_set): New functions to set the
5399 default %destructor and %printer.
5400 * src/symtab.h: Prototype all those new functions.
5401 * tests/actions.at (Default %printer and %destructor): New test to
5402 check that the right %printer and %destructor are called, that they're
5403 not called for $end, and that $$ and @$ work correctly.
5404 (Default %printer and %destructor for user-declared end token): New
5405 test to check that the default %printer and %destructor are called for
5406 a user-declared end token.
5407 * tests/input.at (Default %printer and %destructor redeclared, Unused
5408 values with default %destructor): New tests to check related grammar
5409 warnings and errors.
5410
868d2d96
JD
54112006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5412
5413 Clean up handling of %destructor for the end token (token 0).
5414 Discussed starting at
5415 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5416 and
5417 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5418
5419 Make the skeletons consistent in how they pop the end token and invoke
5420 its %destructor.
5421 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5422 state, which has token number 0, since this would invoke the
5423 %destructor for the end token.
5424 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5425 until after shifting the end token, or else it won't be popped.
5426 * data/yacc.c (yyparse): Likewise.
5427
5428 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5429 it's the end token. Upon termination, destroy an unshifted lookahead
5430 even when it's the end token.
5431 * data/lalr1.cc (yy::parser::parse): Likewise.
5432 * data/yacc.c (yyparse): Likewise.
5433
5434 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5435 value warnings for the end token when the user gives the end token a
5436 %destructor.
5437
5438 * tests/actions.at (Printers and Destructors): Test all the above.
5439
62a9592d
PE
54402006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5441
5442 Update to latest gnulib and gettext versions.
5443 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5444 Add fopen-safer.
5445 (gnulib_files): Add m4/warning.m4. Don't worry about files
5446 overwritten by autopoint.
5447 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5448 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5449 rejects them.
5450 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5451 so that we can remove the intl files at a better time.
5452 (intl_files_to_remove): Remove aclocal.m4, since it gets
5453 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5454 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5455 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5456 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5457 Remove datarootdir hack; no longer needed.
5458 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5459 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5460 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5461 strdup.h.
5462 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5463 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5464
10d6970f
PE
54652006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5466
5467 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5468 it with --assume-autoconf='latest-stable'.
5469
50a33993
JD
54702006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5471
5472 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5473 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5474 YYSTYPE' and `{'.
5475 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5476 those from muscle_tab.c since the old ones are misleading.
5477
2ce4ed68
AD
54782006-07-13 Akim Demaille <akim@epita.fr>
5479
5480 Support %define "KEY" {VALUE}.
5481 * src/scan-code.h, src/scan-code.l (translate_action)
5482 (translate_rule_action, translate_symbol_action, translate_code):
5483 Return char *, not const char *.
5484 * src/parse-gram.y (declaration): Rename as...
5485 (prologue_declaration): this.
5486 (string_content): Remove this nonterminal, use STRING.
5487 (braceless, content, content.opt): New nonterminal.
5488 Use them.
5489 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5490 as value.
5491 * src/scan-gram.l (getargs.h): Don't include it.
5492
db7e5eb5
PE
54932006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5494
5495 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5496 rather than a for-loop that declares a local bool variable. This
5497 should work around a compatibility problem with a Cray x1e C++
5498 compiler reported by Hung Nguyen in
5499 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5500 The for-loop was introduced in the 2004-11-17 change but I don't
5501 know why it was needed.
5502
a5d80ba5
AD
55032006-07-12 Akim Demaille <akim@epita.fr>
5504
5505 * data/c.m4: Comment changes.
5506
23eb2a69
AD
55072006-07-10 Akim Demaille <akim@lrde.epita.fr>
5508
5509 * src/complain.c (error_message, ERROR_MESSAGE): New.
5510 To factor...
5511 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5512 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5513
ddc8ede1
PE
55142006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5515
5516 * NEWS: Instead of %union, you can define and use your own union type
5517 YYSTYPE if your grammar contains at least one <type> tag.
5518 Your YYSTYPE need not be a macro; it can be a typedef.
5519 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5520 (Union Decl, Decl Summary): Document this.
5521 * data/glr.c (YYSTYPE): Implement this.
5522 * data/glr.cc (YYSTYPE): Likewise.
5523 * data/lalr1.cc (YYSTYPE): Likewise.
5524 * data/yacc.c (YYSTYPE): Likewise.
5525 * src/output.c (prepare): Output tag_seen_flag.
5526 * src/parse-gram.y (declaration, grammar_declaration):
5527 Use 'union_seen' rather than 'typed' to determine whether
5528 %union has been seen, since grammars can now be typed without
5529 %union.
5530 (symbol_declaration, type.opt, symbol_def):
5531 Keep track of whether a tag has been seen.
5532 * src/reader.c (union_seen, tag_seen): New vars.
5533 (typed): remove.
5534 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5535 * src/scan-code.l (untyped_var_seen): New variable.
5536 (handle_action_dollar): Adjust to above changes.
5537 (handle_action_dollar, handle_action_at):
5538 Improve overflow checking for outlandish numbers.
5539 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5540 avoid new diagnostics generated by above changes.
5541 * tests/regression.at (YYSTYPE typedef): Add test to check
5542 for type tags without %union.
5543
5544 * src/symlist.c (symbol_list_length): Return int, not unsigned
5545 int, since callers expect int. This may need to get revisited
5546 once we have proper integer overflow checking.
5547
5548 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5549 object is now static.
5550
5551 * src/getargs.c (flags_argmatch): Return void, not int,
5552 to pacify ./configure --enable-gcc-warnings.
5553
5554 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5555 since last_string is already defined to FLEX_PREFIX (last_string).
5556
7b42569e
AD
55572006-07-09 Akim Demaille <akim@lrde.epita.fr>
5558
5559 Implement --warnings/-W.
5560 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5561 replaced by...
5562 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5563 Adjust callers.
5564 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5565 (warnings_args, warnings_types): New.
5566 (getargs, short_options, long_options): Accept -W/--warnings.
5567 Sort the options by alphabetical order, upper case letter right
5568 before its lower case.
5569
3b452f4e
JD
55702006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5571
5572 Change %merge result type clash warnings to errors. Discussed at
5573 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5574 * src/reader.c (record_merge_function_type): Use complain_at.
5575 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5576 declared later): Update test case results.
5577
b8a41559
AD
55782006-07-09 Akim Demaille <akim@lrde.epita.fr>
5579
5580 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5581 to be in alphabetical order.
5582 (trace_args): Spelling fixes.
5583
cd9e1ba2
PE
55842006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5585
5586 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5587 so they don't collide with user-defined macros.
5588 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5589 this was never guaranteed, and now that we're using gnulib stdint,
5590 which defines int_fast16_t to long int, the problem is exposed.
5591
cb48f191
PE
55922006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5593
b8445a15
PE
5594 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5595 need the full POSIX semantics (and weren't implementing them
5596 anyway).
5597
cb48f191
PE
5598 Adjust to Autoconf 2.60 and today's gnulib.
5599 * bootstrap (gnulib_modules): Add stdint.
5600 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5601 no longer copies it.
5602 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5603 since stdint needs the former and wcwidth (which is now required
5604 by mbswidth) needs the latter.
5605 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5606 work around a compatibility glitch between gettext 0.14.6 and
5607 Autoconf 2.60.
5608 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5609 Do not check for uintptr_t, since new stdint module does the right
5610 thing.
5611 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5612 Add stdint.h, stdint_.h, wcwidth.h.
5613 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5614 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5615 stdint.m4, wchar_t.m4, wcwidth.m4.
5616 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5617 usual order for ../lib/*.h files.
5618 (file_name_split): Use last_component, not base_name, to adjust
5619 to gnulib changes.
5620 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5621 for ../lib/*.h files.
5622 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5623 Define unconditionally, since we now assume the stdint module.
5624 * src/scan-skel.l: Include <dirname.h>.
5625 (BASE_QPUTS): Use last_component, not base_name.
5626 * src/system.h: Include <unlocked-io.h> in the usual order
5627 for ../lib/*.h files. Include <stdint.h> unconditionally,
5628 since we now use the stdint module.
5629 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5630 HAVE_UINTPTR_T, since we now use the stdint module.
5631 (base_name): Remove decl, since files now include <dirname.h>
5632 to get the decl.
5633
cd48d21d
AD
56342006-07-08 Akim Demaille <akim@lrde.epita.fr>
5635
5636 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5637 New, default to 1.
5638 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5639 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5640 default.
5641 * tests/calc.at: Adjust.
5642
8ec0a172
AD
56432006-07-08 Akim Demaille <akim@lrde.epita.fr>
5644
b8445a15 5645 * data/c.m4 (b4_basename): New.
8ec0a172
AD
5646 (b4_syncline): Also output the location of its invocation (from
5647 the skeleton).
5648 (b4_user_action, b4_define_user_action, b4_user_actions)
5649 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5650 (b4_user_stype): New.
5651 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5652
4a678af8
JD
56532006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5654
5655 In the grammar file, the first column is 1 not 0 on the first line as
5656 on every other line.
5657 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5658 * tests/input.at (Torturing the Scanner): Update output.
5659
5660 * src/scan-gram.l (scanner_cursor): Declare it static.
5661
dd60572a
JD
56622006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5663
5664 In warnings, say "previous declaration" rather than "first
5665 declaration".
5666 * src/symtab.c (redeclaration): Do that here.
5667 * src/reader.c (record_merge_function_type): In the case of a result
5668 type clash, report the previous declaration rather than the very first
5669 one in the grammar file.
5670 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5671 declared later): Add a third declaration to check this behavior.
5672 * tests/input.at (Incompatible Aliases): Update output.
5673
2073e1b6
AD
56742006-06-27 Akim Demaille <akim@epita.fr>
5675
5676 * doc/Doxyfile.in: New.
5677 * doc/Makefile.am: Use it.
5678 * src/lalr.h, src/symtab.h: Initial doxygenation.
5679
8ee5b538
JD
56802006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5681
5682 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
5683 declared after the %merge. This continues the effort of the previous
5684 patch.
8ee5b538
JD
5685 * src/reader.c (get_merge_function): Don't set the merger type yet.
5686 (record_merge_function_type): New function for setting the merger type
5687 and checking for clashes.
5688 (grammar_current_rule_merge_set): Set the location of the %merge for
5689 the current rule.
5690 (packgram): Invoke record_merge_function_type for each rule now that
5691 all symbol type declarations have been parsed.
5692 * src/reader.h (merger_list.type_declaration_location): New member
5693 storing the location of the first %merge from which the type for this
5694 merging function was derived.
5695 * src/symlist.h (symbol_list.merger_declaration_location): New member
5696 storing the location of a rule's %merge, if any.
5697 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5698 declared later): New test to catch the error fixed by the above patch.
5699
ffa4ba3a
JD
57002006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5701
5702 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
5703 declarations appear after the rules. Discussed at
5704 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5705 and
5706 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5707 Don't mistake the type of $$ in a midrule to be that of its parent
5708 rule's $$.
ffa4ba3a
JD
5709 * src/reader.c (grammar_current_rule_end): Don't invoke
5710 grammar_rule_check yet since not all symbol declarations may have been
5711 parsed yet.
5712 (grammar_midrule_action): Likewise.
5713 Don't record whether the midrule's $$ has been used yet since actions
5714 haven't been translated yet.
5715 Record the midrule's parent rule and its RHS index within the parent
5716 rule.
5717 (grammar_current_rule_action_append): Don't translate the action yet
5718 since not all symbol declarations may have been parsed yet and, thus,
5719 warnings about types for $$, $n, @$, and @n can't be reported yet.
5720 (packgram): Translate the action and invoke grammar_rule_check now that
5721 all symbol declarations have been parsed.
5722 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5723 after parsing the entire grammar file, the symbol list here in the case
5724 of a midrule is actually the midrule's empty RHS, so reference its
5725 parent rule's RHS where necessary.
5726 On the other hand, now that you can already know it's a midrule, you
5727 aren't forced to think $$ has the same type as its parent rule's $$.
5728 (handle_action_at): In the case of a midrule, reference the parent rule
5729 where necessary.
5730 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5731 members.
5732 (symbol_list_length): Now that this is invoked after all rules have
5733 been parsed, a NULL symbol (rather than a NULL symbol list node)
5734 terminates a rule. symbol_list_print already does this correctly.
5735 * src/symlist.h (symbol_list.midrule_parent_rule,
5736 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5737 remember their relationships with their parents.
5738 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5739 fixed by the above patch.
5740 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5741 implementing...
5742 (Unused values): ... this old test case and...
5743 (Unused values before symbol declarations): ... this new test case.
5744 This one is the same as `Unused values' except that all symbol
5745 declarations appear after the rules in order to catch the rest of the
5746 errors fixed by the above patch.
5747
e256e17f
JD
57482006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5749
300a1930
JD
5750 More cleanup.
5751 * src/reader.c (current_rule): Declare it static since it's no longer
5752 used outside this file.
5753 (grammar_current_rule_action_append): Remove redundant arguments from
5754 translate_rule_action invocation.
5755 * src/reader.h (current_rule): Remove this unused extern.
5756 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5757 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 5758
381ecb06
JD
57592006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5760
5761 Clean up yesterday's patch.
5762 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5763 to...
5764 * src/reader.c (grammar_current_rule_action_append): ... here for
5765 consistency with grammar_current_rule_symbol_append.
5766 * tests/regression.at (Braced code in declaration in rules section):
5767 Make yyerror and yylex static as usual.
5768
4210cd0b
JD
57692006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5770
5771 Fix bug that mistakes braced code in a declaration in the rules section
5772 to be a rule action. Mentioned at
5773 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5774 * src/scan-gram.l: Move midrule action detection from the start of the
5775 scanning of any braced code to...
5776 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5777 action. For readability, use $2 and @2 rather than the equivalent
5778 global variables.
5779 * tests/regression.at (Braced code in declaration in rules section):
5780 New test to catch the error fixed by the above patch.
5781
5782 Work on code readability some.
5783 * src/scan-code.l (current_rule): Get rid of this misleading and
5784 redundant declaration: it's actually extern'ed in reader.h.
5785 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5786 translate_action): Add a rule argument and use it instead of the global
5787 current_rule.
5788 (translate_rule_action): This already receives current_rule through an
5789 argument, so pass it on to translate_action instead of assigning
5790 current_rule to current_rule.
5791 (translate_symbol_action, translate_code): Pass rule = NULL to
5792 translate_action.
5793
34f98f46
JD
57942006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5795
5796 Rename %before-definitions to %start-header and %after-definitions to
5797 %end-header. Don't use these declarations to separate pre-prologue
5798 blocks from post-prologue blocks. Add new order-independent
5799 declarations %before-header and %after-header as alternatives to the
5800 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5801 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5802 * NEWS (2.3+): Update for these changes.
5803 * data/glr.c (b4_before_definitions): Update to...
5804 (b4_start_header): ... this.
5805 (b4_after_definitions): Update to...
5806 (b4_end_header): ... this.
5807 * data/glr.cc: Likewise.
5808 * data/lalr1.cc: Likewise.
5809 * data/yacc.c: Likewise.
5810 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5811 prologue blocks with %*-header declarations.
5812 (Calc++ Parser): Likewise.
91661ebb 5813 (Decl Summary): Update names.
148d66d8 5814 (Table of Symbols): Update description.
34f98f46
JD
5815 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5816 (PERCENT_END_HEADER): ... this.
5817 (PERCENT_BEFORE_DEFINITIONS): Update to...
5818 (PERCENT_START_HEADER): ... this.
5819 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5820 (declaration): Update token names and m4 macro names.
5821 When parsing %end-header and %start-header, invoke translate_code
5822 before muscle_code_grow, and no longer set global booleans to remember
5823 whether these declarations have been seen.
5824 Parse new %after-header and %before-header.
5825 * src/reader.c (before_definitions, after_definitions): Remove.
5826 (prologue_augment): Accept a new bool argument to specify whether to
5827 augment the pre-prologue or post-prologue.
5828 * src/reader.h (before_definitions, after_definitions): Remove these
5829 extern's.
5830 (prologue_augment): Add new bool argument.
5831 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5832 (PERCENT_END_HEADER): ... this.
5833 (PERCENT_BEFORE_DEFINITIONS): Update to...
5834 (PERCENT_START_HEADER): ... this.
5835 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5836 * tests/actions.at (Printers and Destructors): Update names.
5837
31b2b07e
JD
58382006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5839
5840 Add comparison operators for C++ location classes. Discussed at
5841 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5842 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5843 declaration indicating whether filename_type has an operator==. If
5844 filename_type is `std::string', it defaults to `1', `0' otherwise.
5845 * data/location.cc: Iff b4_define_location_comparison is `1', add
5846 operator== and operator!= for class position and for class location.
5847
5848 Some minor fixes.
5849 * src/scan-action.l: Remove unused file.
5850 * src/symtab.c (symbol_printer_set): Use printer_location not
5851 destructor_location.
5852 * src/symtab.h (struct symbol): Replace incorrect source comment for
5853 printer members.
5854 * tests/input.at (Incompatible Aliases): Update output with correct
5855 printer location.
5856
9bc0dd67
JD
58572006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5858
5859 Don't put the pre-prologue in the header file. For the yacc.c code
5860 file and the glr.c header and code files, move the pre-prologue before
5861 the token definitions. Add new %before-definitions and
5862 %after-definitions to declare code that will go in both the header file
5863 and code file. Discussed at
5864 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5865 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5866 and
5867 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5868 * NEWS (2.3+): Describe these changes.
5869 * data/glr.c (b4_pre_prologue): Move from within to before...
5870 (b4_shared_declarations): ... this.
5871 Add new b4_before_definitions before b4_token_enums.
5872 Add new b4_after_definitions at the end.
5873 * data/glr.cc (b4_pre_prologue): Replace with...
5874 (b4_before_definitions): ... this in the header file.
5875 (b4_after_definitions): New near the end of the header file.
5876 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5877 code file right before including the header file.
5878 (b4_before_definitions): New in the previous position of
5879 b4_pre_prologue in the header file.
5880 (b4_after_definitions): New near the end of the header file.
5881 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5882 (b4_token_enums_defines): In the code file, move to right before
5883 YYSTYPE for consistency with the header file.
5884 (b4_before_definitions): New right before b4_token_enums_defines in
5885 both the header and code file.
5886 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5887 header and code file.
5888 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5889 of prologues for %union dependencies.
91661ebb
JD
5890 (Decl Summary): In %defines description, mention the effect of
5891 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
5892 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5893 than in the pre-prologue so that make check succeeds.
148d66d8 5894 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
5895 %after-definitions.
5896 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5897 %before-definitions.
5898 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5899 (declaration): Parse those declarations and append to
5900 b4_before_definitions and b4_after_definitions, respectively.
5901 * src/reader.c (before_definitions, after_definitions): New bools to
5902 track whether those declarations have been seen.
5903 (prologue_augment): Add to the post-prologue if %union,
5904 %before-definitions, or %after-definitions has been seen.
5905 * src/reader.h (before_definitions, after_definitions): New extern's.
5906 * src/scan-gram.l: Scan the new declarations.
5907 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5908 prologue block in a %before-definitions or a %after-definitions based
5909 on whether the %union is declared.
5910 * tests/regression.at (Early token definitions with --yacc, Early token
5911 definitions without --yacc): Move tests for token definitions into the
5912 post-prologue since token names are no longer defined in the
5913 pre-prologue.
5914
203b9274
AD
59152006-06-20 Akim Demaille <akim@epita.fr>
5916
5917 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5918 (symbol_get): Use it.
5919 * src/parse-gram.y: Use it.
5920
a7ee59cf
JD
59212006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5922
5923 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5924 build succeeds when configured with --enable-gcc-warnings.
5925
5a2baae7
PE
59262006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5927
33ad1a9c
PE
5928 * src/parse-gram.y (char_name): New function.
5929 (CHAR, STRING, string_content): For %printer, properly escape.
5930 (ID): Prefer fputs to fprintf.
5931 (id): Reindent to be consistent with other rules.
5932 Properly quote char.
5933
5a2baae7
PE
5934 The Translation Project changed its way of publishing translations
5935 to maintainers. I haven't received any responses to my request
5936 for supporting the old way, or for documenting the new way. I
5937 have modified 'bootstrap' to use screen scraping
5938 (in this case, HTML scraping). This is unreliable and inelegant,
5939 but I don't see any better way. Yuck.
5940 * bootstrap (TP_URL, WGET_COMMAND): New vars.
5941 (get_translations): New function, which uses HTML scraping to
5942 deduce locations of latest translations.
5943 Use this function to grab both bison and bison-runtime .po files.
5944 Don't bother priming the pump for the runtime-po domain any more,
5945 as it's now translated better than bison is.
5946
58d7a1a1
AD
59472006-06-19 Akim Demaille <akim@epita.fr>
5948
5949 * src/scan-gram.l: No longer "parse" things after `%union' until
5950 `{'. Rather, return a single "%union" token.
5951 No longer make symbols: return strings, and leave the conversion
5952 to symbols to the parser.
5953 (SC_PRE_CODE, token_type): Remove.
5954 * src/parse-gram.y (%union): New field `character'.
5955 Sort tokens.
5956 (CHAR): New token.
5957 (ID, ID_COLON): Now that the scanner no longer makes them
5958 identifiers, adjust all uses to invoke symbol_get.
5959 (id_colon): New, wraps the conversion from string to symbol.
5960 (%union): Accept a possible union_name.
5961 (symbol): Now can be a char.
5962 * data/c.m4 (b4_union_name): Leave a default value.
5963 * data/glr.c, data/yacc.c: Use it.
5964
b931235e
JD
59652006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
5966
5967 For associating token numbers with token names for "yacc.c", don't use
5968 #define statements unless `--yacc' is specified; always use enum
5969 yytokentype. Most important discussions start at:
5970 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
5971 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
5972 and
5973 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
5974 * NEWS (2.3+): Mention.
5975 * data/c.m4 (b4_yacc_if): New.
5976 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
5977 token #define's.
5978 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
5979 on token name definitions.
5980 * src/getargs.c (usage): Capitalize `Yacc' in English.
5981 * src/output.c (prepare): Define b4_yacc_flag.
5982 * tests/regression.at (Early token definitions): Test that tokens names
5983 are defined before the pre-prologue not just before the post-prologue.
5984 Remove this test case and copy to...
5985 (Early token definitions with --yacc): ... this to test #define's.
5986 (Early token definitions without --yacc): ... and this to test enums.
5987
9e6e7ed2
PE
59882006-06-11 Paul Eggert <eggert@cs.ucla.edu>
5989
5990 * NEWS: Reword the post-2.3 change to not be so optimistic about
5991 removing the old "look-ahead" spelling.
5992 Update previous look-ahead/lookahead change reports.
5993 * REFERENCES: look-ahead -> lookahead (since that's
5994 what he actually wrote).
5995 * doc/refcard.tex: look ahead -> lookahead,
5996 look-ahead -> lookahead
5997
742e4900
JD
59982006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
5999
6000 For consistency, use `lookahead' instead of `look-ahead' or
6001 `look_ahead'. Discussed starting at
6002 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6003 and then at
6004 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6005 * NEWS: For the next release, note the change to `--report'.
6006 * TODO, doc/bison.1: Update English.
6007 * doc/bison.texinfo: Update English.
6008 (Understanding Your Parser, Bison Options): Document as
6009 `--report=lookahead' rather than `--report=look-ahead'.
6010 * src/conflicts.c: Update English in comments.
6011 (lookahead_set): Rename from look_ahead_set.
6012 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6013 (resolve_sr_conflict): Rename local look_ahead_tokens to
6014 lookahead_tokens, and update other uses.
6015 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6016 count_rr_conflicts, conflicts_free): Update uses.
6017 * src/getargs.c (report_args): Move "lookahead" before alternate
6018 spellings.
6019 (report_types): Update uses.
6020 (usage): For `--report' usage description, state `lookahead' spelling
6021 rather than `look-ahead'.
6022 * src/getargs.h (report.report_lookahead_tokens): Rename from
6023 report_look_ahead_tokens.
6024 * src/lalr.c: Update English in comments.
6025 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6026 (state_lookahead_tokens_count): Rename from
6027 state_look_ahead_tokens_count.
6028 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6029 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6030 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6031 Update other uses.
6032 Update English in output.
6033 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6034 * src/print.c: Update English in comments.
6035 (lookahead_set): Rename from look_ahead_set.
6036 (print_reduction): Rename argument lookahead_token from
6037 look_ahead_token.
6038 (print_core, state_default_rule, print_reductions, print_results):
6039 Update uses.
6040 * src/print_graph.c: Update English in comments.
6041 (print_core): Update uses.
6042 * src/state.c: Update English in comments.
6043 (reductions_new): Update uses.
6044 (state_rule_lookahead_tokens_print): Rename from
6045 state_rule_look_ahead_tokens_print, and update other uses.
6046 * src/state.h: Update English in comments.
6047 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6048 (state_rule_lookahead_tokens_print): Rename from
6049 state_rule_look_ahead_tokens_print.
6050 * src/tables.c: Update English in comments.
6051 (conflict_row, action_row): Update uses.
6052 * tests/glr-regression.at
6053 (Incorrect lookahead during deterministic GLR,
6054 Incorrect lookahead during nondeterministic GLR): Rename
6055 print_look_ahead to print_lookahead.
6056 * tests/torture.at: Update English in comments.
6057 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6058 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6059 (Many lookahead tokens): Update uses.
6060 * data/glr.c: Update English in comments.
6061 * lalr1.cc: Likewise.
6062 * yacc.c: Likewise.
6063 * src/conflicts.h: Likewise.
6064 * src/lalr.h: Likewise.
6065 * src/main.c: Likewise.
6066 * src/output.c: Likewise.
6067 * src/parse-gram.c: Likewise.
6068 * src/tables.h: Likewise.
6069 * tests/calc.at: Likewise.
6070
3c40d0b5
JD
60712006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6072
6073 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6074
5d278082
PE
60752006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6076
6077 * TODO: Add request from Nelson H. F. Beebe to be able to install
6078 Bison without installing the yacc script.
6079
9e668899
JD
60802006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6081
6082 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6083 and yytext if they're already #define'd.
6084 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6085 * src/scan-code-c.c: ... here.
6086 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6087 <config.h>.
6088
0c8e079f
JD
60892006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6090
6091 Get Bison to build again when configured with --enable-gcc-warnings.
6092 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6093 missing #include's.
6094 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6095 loc argument as it shadows a global.
6096 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6097 invocation.
6098
6099 * src/.cvsignore: Add scan-code.c.
6100
2346344a
AD
61012006-06-07 Akim Demaille <akim@epita.fr>
6102
6103 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6104 to...
6105 * src/scan-code.l: here.
6106 * tests/input.at (Torturing the Scanner): Fix another location
6107 error.
6108
4862bdfd
AD
61092006-06-07 Akim Demaille <akim@epita.fr>
6110
6111 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6112
e9071366
AD
61132006-06-06 Akim Demaille <akim@epita.fr>
6114
6115 Extract the parsing of user actions from the grammar scanner.
6116 As a consequence, the relation between the grammar scanner and
6117 parser is much simpler. We can also split "composite tokens" back
6118 into simple tokens.
6119 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6120 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6121 rename as...
6122 * src/location.h, src/location.c (add_column_width)
6123 (location_compute): these.
6124 Fix the column count: the initial column is 0.
6125 (location_print): Be robust to ending column being 0.
6126 * src/location.h (boundary_set): New.
6127 * src/main.c: Adjust to scanner_free being renamed as
6128 gram_scanner_free.
6129 * src/output.c: Include scan-code.h.
6130 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6131 Use boundary_set.
6132 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6133 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6134 which is now, again, a separate token.
6135 Adjust all dependencies.
6136 Whereever actions with $ and @ are used, use translate_code.
6137 (action): Remove this nonterminal which is now useless.
6138 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6139 (grammar_current_rule_action_append): Use translate_code.
6140 (packgram): Bound check ruleno, itemno, and rule_length.
6141 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6142 (last_string, last_braced_code_loc, max_left_semantic_context)
6143 (scanner_initialize, scanner_free, scanner_last_string_free)
6144 (gram_out, gram_lineno, YY_DECL_): Move to...
6145 * src/scan-gram.h: this new file.
6146 (YY_DECL): Rename as...
6147 (GRAM_DECL): this.
6148 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6149 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6150 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6151 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6152 Move these declarations, and...
6153 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6154 these to...
6155 * src/flex-scanner.h: this new file.
6156 * src/scan-gram.l (rule_length, rule_length_overflow)
6157 (increment_rule_length): Remove.
6158 (last_braced_code_loc): Rename as...
6159 (gram_last_braced_code_loc): this.
6160 Adjust to the changes of the parser.
6161 Move all the handling of $ and @ into...
6162 * src/scan-code.l: here.
6163 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6164 (handle_action_dollar, handle_action_at): Move to...
6165 * src/scan-code.l: here.
6166 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6167 scan-code.h, scan-code-c.c, scan-gram.h.
6168 (EXTRA_bison_SOURCES): Add scan-code.l.
6169 (BUILT_SOURCES): Add scan-code.c.
6170 (yacc): Be robust to white spaces.
6171
6172 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6173 * tests/regression.at: Adjust the column numbers.
6174 * tests/regression.at: Adjust the error message.
7891a7c4 6175
184e42f0
JD
61762006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6177
6178 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6179 Use Akim's wording from
6180 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6181
7891a7c4
JD
61822006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6183
6184 Between Bison releases, manually append `+' to the previous Bison
6185 release number, and use that as a signal to automatically print the
6186 ChangeLog's CVS Id keyword from --version. Discussed starting at
6187 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6188 * ChangeLog: Add Id header.
6189 * configure.ac (AC_INIT): Append `+' to `2.3'.
6190 * src/.cvsignore: Add revision.c.
6191 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6192 (BUILT_SOURCES): Add revision.c.
6193 (revision.c): New target rule. This file defines a new global variable
6194 named revision. It initializes it with either the Id from ChangeLog
6195 or, if VERSION doesn't contain `+', with the empty string.
6196 * src/getargs.c (version): Print the value of revision.
6197 * src/revision.h: Extern revision.
6198
4ad3ed84
PE
61992006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6200
6201 * NEWS: Version 2.3.
6202 * configure.ac (AC_INIT): Likewise.
6203
02103984
PE
62042006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6205
6206 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6207 with no arguments, not as an object-like macro. This is for
6208 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6209 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6210 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6211 Document this.
6212
2c08afa5
JD
62132006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6214
6215 * src/getargs.c (usage): Back out yesterday's modification of the
6216 --help output so that we don't have to wait for translation before
6217 releasing 2.3.
6218
6077da58
PE
62192006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6220
6221 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6222 Problem reported by Akim Demaille.
6223
2a26b6c2
JD
62242006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6225
6226 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6227
aefef0d6
PE
62282006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6229
6230 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6231 generated source code. Problem reported by Frans Englich in
6232 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6233
fcd8e201
PE
62342006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6235
6236 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6237 shell, not within 'make', so that 'make' by an ordinary builder
6238 (using GNU make) does not worry about configuring gzip. This also
6239 works around a bug reported independently by Keith Thompson and by
6240 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6241 stderr rather than stdout, messing up the build logs.
6242
7b5cdcbd
JD
62432006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6244
6245 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6246 to make sure that YYID will never be unused. This fixes a 'make
6247 maintainer-check' failure caused by the recent changes to the 'Trivial
6248 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6249 not used.
6250 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6251
5ad0a449
JD
62522006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6253
6254 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6255 state before an empty RHS is always resolved here. Only the location
6256 of that state is guaranteed to be resolved, and that's enough. This
6257 fixes the remaining bug reported by Derek M. Jones in
6258 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6259 * tests/glr-regression.at (Uninitialized location when reporting
6260 ambiguity): Test the above case.
6261 Also, the embedded comments in this test case claim it checks the case
6262 of an empty RHS that has inherited the initial location. However, the
6263 corresponding LHS was already resolved, so yyresolveLocations didn't
6264 actually have reason to modify it. Fix this by forcing
6265 nondeterministic operation at the beginning of the parse.
6266
50cce58e
PE
62672006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6268
6269 * data/c.m4 (b4_yy_symbol_print_generate):
6270 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6271 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6272 of the bugs reported today by Derek M Jones in
6273 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6274 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6275 defined to be a type name without parens or brackets.
6276 (Location Type): Similarly for YYLTYPE.
6277 * tests/regression.at (Trivial grammars): Put in a test for this
6278 bug that will be caught by 'make maintainer-check' (though not,
6279 alas, by 'make check' unless your compiler is picky).
6280
ab8d9dc5
PE
62812006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6282
0d2c8934 6283 * NEWS: Version 2.2.
ab8d9dc5
PE
6284 * configure.ac (AC_INIT): Likewise.
6285
9138c575
JD
62862006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6287
6288 * data/glr.c (yyreportTree): Make room in yystates for the state
6289 preceding the RHS. This fixes the segmentation fault reported by Derek
6290 M. Jones in
6291 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6292 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6293 to the user. Reported for yyreportTree by Derek M. Jones later in the
6294 same thread.
6295 * THANKS: Add Derek M. Jones.
6296 Update my email address.
6297 Fix typo in Steve Murphy's name.
6298
276f48df
PE
62992006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6300
d6645148
PE
6301 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6302 checking against YYLAST that caused the parser to miss a potential
6303 alternative in its diagnostic.
6304 Problem reported by Maria Jose Moron Fernandez in
6305 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6306 * data/lalr1.cc (yysyntax_error_): Likewise.
6307 * data/yacc.c (yysyntax_error): Likewise.
6308 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6309 tokens, in case we run into an older C compiler.
6310 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6311 Use them to check for the off-by-one error fixed above.
6312
276f48df
PE
6313 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6314 YYSIZE_T, not size_t.
6315 * tests/regression.at (Trivial grammars): New test, to catch
6316 the error fixed by the above patch.
6317
cd8b5791
AD
63182006-05-14 Akim Demaille <akim@lrde.epita.fr>
6319
6320 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6321 scheme.
6322 Reported by Steve Murphy.
6323
34376418
AD
63242006-05-14 Akim Demaille <akim@lrde.epita.fr>
6325
6326 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6327 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6328
327afc7c
AD
63292006-05-14 Akim Demaille <akim@lrde.epita.fr>
6330
6331 Implement --trace=m4.
6332 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6333 * src/output.c (output_skeleton): When set, pass -dV to m4.
6334
6335 Factor the handling of flags in m4.
6336 * src/output.c (prepare): Rename the muscle names debug, defines,
6337 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6338 * data/c.m4: Adjust.
6339 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6340 Use b4_define_flag_if to define other b4_FLAG_if macros.
6341 (b4_location_if): As a consequence, rename as...
6342 (b4_locations_if): this, for consistency.
6343 Adjust all the skeletons.
6344
ba9ecd19
AD
63452006-05-14 Akim Demaille <akim@lrde.epita.fr>
6346
6347 * etc/bench.pm: Shorten bench names.
6348
4e83ea15
AD
63492006-05-14 Akim Demaille <akim@lrde.epita.fr>
6350
6351 * src/output.h, src/output.c (error_verbose): Move to...
6352 * src/getargs.h, src/getargs.c: here.
6353 Sort the flags.
6354 Adjust dependencies.
6355
6e93d810
PE
63562006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6357
6358 * data/c.m4 (b4_copyright): Put the special exception for Bison
6359 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
6360 uses changed. Suggested by Akim Demaille. Also, wrap the
6361 copyright notice, in case it is longer than 80 columns. Replace
6362 comma by newline after title.
6e93d810 6363
eaea13f5
PE
63642006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6365
6366 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6367 incompatibility, not a bug. Mention that it wasn't fixed as of
6368 flex 2.5.33.
6369
3cf084ec
AD
63702006-05-11 Akim Demaille <akim@lrde.epita.fr>
6371
6372 * examples/extexi: Enforce the precedence of concatenation over
6373 >>.
0a9f1c7d 6374 Reported by Tommy Nordgren.
3cf084ec 6375
32c96bd7
AD
63762006-05-11 Akim Demaille <akim@lrde.epita.fr>
6377
6378 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6379 with the member "token".
f94705b2 6380 Reported by Martin Nylin.
32c96bd7 6381
eaea13f5
PE
63822006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6383
6384 * data/glr.c: Switch to Bison 2.2 special-exception language in
6385 the copyright notice. Use more-regular format for titles and
6386 copyright notices.
6387 * data/glr.cc: Likewise.
6388 * data/location.cc: Likewise.
6389 * data/yacc.cc: Likewise.
6390 * doc/bison.texinfo (Conditions): Document this.
6391 * NEWS: likewise. Upgrade version to 2.2.
6392
6e2d1146
AD
63932006-04-27 Akim Demaille <akim@lrde.epita.fr>
6394
6395 * data/glr.cc: Remove dead code.
6396
47671055
PE
63972006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6398
6399 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6400 that variable and the line breaks the bootstrap. Problem reported
6401 by Juan M. Guerrero.
6402
ed2e6384
AD
64032006-04-24 Akim Demaille <akim@lrde.epita.fr>
6404
6405 * doc/bison.texinfo (Multiple start-symbols): New.
6406
3cedc2dc
AD
64072006-04-24 Akim Demaille <akim@lrde.epita.fr>
6408
6409 * etc/README, etc/bench.pl: New.
6410
b2ddc3f3
AD
64112006-04-03 Akim Demaille <akim@lrde.epita.fr>
6412
6413 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6414 rule.
6415 Reported by Mickael Labau.
6416 * tests/input.at (Torturing the Scanner): Test it.
6417
91e3ac9a
PE
64182006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6419
6420 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6421 Problem reported by Bob Rossi.
6422
64232006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6424
6425 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6426 and didn't really work.
6427 For the index, use @ifnotinfo, not @iftex.
6428 Minor cleanups of spacing and terminology.
6429
5cf61e93
AD
64302006-03-12 Akim Demaille <akim@lrde.epita.fr>
6431
6432 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6433 of AT_NAME_PREFIX when %name-prefix is not used.
6434
aa08666d
AD
64352006-03-12 Akim Demaille <akim@lrde.epita.fr>
6436
6437 Apply --prefix to C++ skeletons too: they change the namespace.
6438 The test suite already exercize these cases.
6439 * data/c++.m4 (b4_namespace): New.
6440 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6441 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6442 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6443 * doc/bison.texinfo: Document it.
6444 (Option Cross Key): Use @multitable in all formats. It looks
6445 nicer, even in TeX outputs.
6446 (Rules): Use the same code whatever the output type is.
6447 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6448 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6449 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 6450
45567173
AD
64512006-03-10 Akim Demaille <akim@lrde.epita.fr>
6452
6453 * TODO: Remove dead items.
6454
e9d8f881 64552006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
6456
6457 * doc/FAQ: Remove, merged into...
6458 * doc/bison.texinfo (FAQ): this.
6459 * doc/Makefile.am (EXTRA_DIST): Adjust.
6460
c095d689
AD
64612006-03-10 Akim Demaille <akim@lrde.epita.fr>
6462
6463 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6464 even if empty.
6465 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6466 * doc/bison.texinfo (Calc++ Scanner): Use it.
6467
6e0f8287
PE
64682006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6469
6470 Fix two nits reported by twlevo, plus one more that I discovered.
6471
6472 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6473 this is the usual Bison style.
6474 * src/location.h (location_print): Likewise.
6475
6476 * src/reader.h (token_name): Likewise.
6477
d6b771c3
PE
64782006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6479
6480 Fix some nits reported by twlevo.
6481 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6482 and "POSIX". Use more-modern syntax for URLs. Mention C++
6483 and ask for Java. Don't hardwire OS version numbers. Add
6484 copyright notice.
6485 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6486 * src/conflicts.c (solved_conflicts_obstack): Now static.
6487
1e137b71
JD
64882006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6489
6490 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6491 page. Say "you can use it" not "you may use it" as on the web page;
6492 we're describing capabilities not granting permission.
6493
73f2e47e
PE
64942006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6495
6d05403d
PE
6496 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6497 shadowing warnings. Use usual patter for iterating through RHS.
6498 * tests/glr-regression.at
6499 (Uninitialized location when reporting ambiguity):
6500 Modify yylex so that it uses its argument, rather than trying
6501 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6502 const char -> char const.
6503
73f2e47e
PE
6504 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6505 Don't use tabs inside commands; it messes up 'ps'.
6506 Problem reported by twlevo.
6507
8710fc41
JD
65082006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6509
6510 * tests/glr-regression.at (Uninitialized location when reporting
6511 ambiguity): New test case.
6512 * data/glr.c (yyresolveLocations): New function, which uses
6513 YYLLOC_DEFAULT.
6514 (yyresolveValue): Invoke yyresolveLocations before reporting an
6515 ambiguity.
6516 * doc/bison.texinfo (Default Action for Locations): Note
6517 YYLLOC_DEFAULT's usage for ambiguity locations.
6518 (GLR Semantic Actions): Cross-reference those notes.
6519
ae952af2
JD
65202006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6521
6522 * tests/glr-regression.at (Leaked semantic values when reporting
6523 ambiguity): Remove unnecessary union and type declarations.
6524 (Leaked lookahead after nondeterministic parse syntax error): New test
6525 case.
6526 * data/glr.c (yyparse): Check for zero stacks remaining before
6527 attempting to shift the lookahead so that you don't lose it.
6528
35ee866a
JD
65292006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6530
6531 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6532 * tests/glr-regression.at (Leaked semantic values when reporting
6533 ambiguity): New test case.
6534 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6535 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6536 now unnecessary yystackp parameter.
6537 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6538 destructors can be called.
6539
6540 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6541 in existing testcases.
6542
520181ab
JD
65432006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6544
6545 Don't leak semantic values for parent RHS when a user action cuts the
6546 parser, and clean up related code a bit.
6547 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
6548 cuts parse): Rename to...
6549 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
6550 for leaked parent RHS values.
6551 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6552 between an unresolved state (non-empty chain of semantic options) and
6553 an incomplete one (signaled by an empty chain).
ae952af2 6554 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
6555 successfully or unsuccessfully resolved yyGLRState to...
6556 (yyresolveValue): ... here so that yyresolveValue always leaves a
6557 yyGLRState with consistent data and thus is easier to understand.
6558 Remove the yyvalp and yylocp parameters since they are always just
6559 taken from the yys parameter. When reporting a discarded merged value
6560 in debugging output, note that it is incompletely merged. Document the
6561 interface.
6562 (yyresolveAction): If resolving any of the RHS states fails, destroy
6563 them all rather than leaking them. Thus, as long as user actions are
6564 written to clean up the RHS correctly, yyresolveAction always cleans up
6565 the RHS of a semantic option. Document the interface.
6566
18d9185c
PE
65672006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6568
6569 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6570 led to a segmentation fault in GNU Pascal. Problem reported
6571 by Waldek Hebisch.
6572
841a7737
JD
65732006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6574
6575 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6576 mid-rule action inside a nonterminal symbol in order to declare a
6577 destructor for its semantic value.
6578
fc3f467f
PE
65792006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6580
6581 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6582 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6583 __cplusplus && ! defined _STDLIB_H && !
6584 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6585 defined free))]: Include <stdlib.h> rather than rolling our own
6586 declarations of malloc and free, to avoid problems with
6587 incompatible declarations (using 'throw') C++'s stdlib.h. This
6588 should fix Debian bug 340012
6589 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6590 reported by Guillaume Melquiond.
6591
a3af26dd
PE
65922006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6593
4d7bc38c
PE
6594 * NEWS: Clarify symbols versus types in unused-value warnings.
6595
a3af26dd
PE
6596 * configure.ac (AC_INIT): Bump version number.
6597
4e26c69e
PE
65982006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6599
6600 * NEWS: Version 2.1a.
6601 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6602 since C99 requires this.
6603
498e897c
PE
66042006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6605
6606 * m4/c-working.m4: New file.
6607 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6608
57bb17ca
PE
66092006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6610
6611 * Makefile.maint: Merge from coreutils.
6612
0be105dc
PE
66132006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6614
6615 More portability fixes for problems summarized by Nelson H. F. Beebe.
6616
6617 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6618 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6619 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6620 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6621 messes up because C++ code is compiled in 32-bit mode but linked
6622 in 64-bit mode.
6623
6fc0c024
PE
66242006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6625
6626 More portability fixes for problems summarized by Nelson H. F. Beebe.
6627
7870f699
PE
6628 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6629 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6630
6fc0c024
PE
6631 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6632 nodist_PROGRAMS, since we don't need to actually compile the
6633 example if we're just doing a plain 'make'. This avoids bothering
6634 the installer unnecessarily about problems due to weird C++
6635 compilers.
6636
fe6c2fde
PE
66372006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6638
6639 More portability fixes for problems summarized by Nelson H. F. Beebe.
6640
6641 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6642 than #include "...", and compile with -I'.'. The old method was
6643 not portable, according to Posix and the C standard, and it does
6644 not work with Sun C 5.7, where previous #line directives affect
6645 the working directory used in later #include "..." directives.
6646
927b425b
JMG
66472006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6648
6649 Various DJGGP specific issues in /djgpp
6650
d9735e9e
PE
66512006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6652
6653 More portability fixes for problems summarized by Nelson H. F. Beebe.
6654
6655 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6656 '#include <map>' works and that you can apply ++ to iterators.
6657
5a6755af
PE
66582006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6659
67a0dc4f
PE
6660 Work around portability problems summarized by Nelson H. F. Beebe in
6661 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6662
8c86f0ef
PE
6663 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6664 that '#include <string>' works.
6665
de35dd59
PE
6666 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6667 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6668 "warning: sorry: semantics of inline function static data `const
6669 unsigned char translate_table[262]' are wrong (you'll wind up with
6670 multiple copies)".
6671
67a0dc4f
PE
6672 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6673 or, xor to not_, and_, or_, and xor_, respectively. This works
6674 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6675 random system header somewhere that includes the equivalent of
6676 <iso646.h>.
6677
5a6755af
PE
6678 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6679 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 6680 Suite Version 2.0.
5a6755af 6681
3f001415
JD
66822006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6683
6684 During deterministic GLR operation, user actions should be able to
6685 influence the parse by changing yychar. To make this easier to fix and
6686 to make glr.c easier to evolve in general, don't maintain yytoken in
6687 parallel with yychar; just compute yytoken when needed.
6688 * tests/glr-regression.at (Incorrect lookahead during deterministic
6689 GLR): Check that setting yychar in a user action has the intended
6690 effect.
6691 * data/glr.c (yyGLRStack): Remove yytokenp member.
6692 (yyclearin): Don't set *yytokenp.
6693 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6694 yychar rather than *yytokenp to determine the current lookahead.
6695 Compute yytoken locally when needed.
6696 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6697 point to.
6698
6699 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6700 after `--report' documentation.
6701
e2a8c0f5
PE
67022006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6703
6704 * src/parse-gram.y (grammar_declaration): Location of printer
6705 symbol is @1, not list->location. Bug reported by twlevo.
6706 * tests/input.at (Incompatible Aliases): Adjust to above change.
6707
6b702268
PE
67082006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6709
27622431
PE
6710 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6711 all the test at once. This makes the output easier to read in the
6712 normal case.
6713
6b702268
PE
6714 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6715 got from <http://bro-ids.org/download.html>. The bug is that
6716 when two actions appeared in succession, the second one was
6717 scanned before the first one was added to the grammar rule
6718 as a midrule action. Bison then output the incorrect warning
6719 "parse.y:905.17-906.36: warning: unused value: $3".
6720 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6721 associated with a value.
6722 (rhs): Don't invoke grammar_current_rule_action_append.
6723 (action): Invoke it here instead.
6724 * src/reader.c (grammar_midrule_action): Now extern.
6725 (grammar_current_rule_action_append): Don't invoke
6726 grammar_midrule_action; that is now the scanner's job.
6727 * src/reader.h (last_string, last_braced_code_loc):
6728 (grammar_midrule_action): New decls.
6729 * src/scan-gram.l (last_string): Now extern, sigh.
6730 (last_braced_code_loc): New extern variable.
6731 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6732 rule already has an action.
6733 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6734 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6735 Add some tests to check that the above changes fixed the bug.
6736
d40ba6c2
PE
67372006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6738
6739 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6740 All used changed. Check whether the symbol has a destructor,
6741 not whether it is typed.
6742 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6743 that the values are still reported as unused. All line numbers
6744 adjusted.
6745
401aace6
PE
67462006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6747
6748 Work around a bug in bro 0.8, which underparenthesizes its
6749 definition of YYLLOC_DEFAULT.
6750 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6751 their arguments.
6752 * data/lalr1.cc: Likewise.
6753 * data/yacc.cc: Likewise.
6754
06f01bc4
PE
67552006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6756
401aace6
PE
6757 Work around a bug in Pike 7.0, and give the Pike folks a
6758 better way to override the usual int widths.
6759 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6760 user can override the types.
6761 (short): #undef, to work around a bug in Pike 7.0.
6762 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6763 (union yyalloc.yyss): Use yytype_int16 rather than short.
6764 All uses changed.
6765 (yysigned_char): Remove.
6766 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6767 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6768 * tests/regression.at (Web2c Actions): Adjust to above changes.
6769
6770 * src/reader.c (check_and_convert_grammar): New function.
6771 (reader): Close the input file even if something went wrong during
6772 parsing. Minor file descriptor leak reported by twlevo.
6773
06f01bc4
PE
6774 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6775 to pacify gcc -Wswitch-default.
6776 * src/scan-gram.l (adjust_location): Use a default: break; case
6777 to pacify gcc -Wswitch-default.
6778 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6779 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6780 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6781 Move these decls to scan-skel.l, since they don't need to be
6782 visible elsewhere.
6783 * src/scan-skel.l: Accept the above decls.
6784 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6785 is used.
6786
02650b7f
PE
67872006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6788
6789 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6790 since we don't want to insist on a version number at the start
6791 of the changelog every time.
6792 * Makefile.maint: Sync from coreutils a bit better.
6793 (sc_trailing_blank): Renamed from sc_trailing_space.
6794 All uses changed.
6795 (sc_no_if_have_config_h, sc_require_config_h):
6796 (sc_prohibit_assert_without_use): New rules.
6797 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6798 (sc_dd_max_sym_length): Fix leading spaces in rule.
6799 (sc_system_h_headers): Prefix with @.
6800 (sc_useless_cpp_parens, m4-check): Output line numbers.
6801 (changelog-check): Allow version only in head.
6802 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6803 satisfy new Makefile.maint rule.
6804 * data/glr.c: Likewise.
6805 * data/glr.cc: Likewise.
6806 * data/lalr1.cc: Likewise.
6807 * data/yacc.c: Likewise.
6808 * lib/ebitsetv.c: Likewise.
6809 * lib/lbitset.c: Likewise.
6810 * lib/subpipe.c: Likewise.
6811 * lib/timevar.c: Likewise.
6812 * src/system.h: Likewise.
6813 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6814 * djgpp/Makefile.maint: Add copyright notice.
6815 * djgpp/README.in: Likewise.
6816 * djgpp/config.bat: Likewise.
6817 * djgpp/config.site: Likewise.
6818 * djgpp/config_h.sed: Likewise.
6819 * djgpp/djunpack.bat: Likewise.
6820 * djgpp/config.sed: Fix copyright notice to match standard format.
6821 * djgpp/subpipe.h: Likewise.
6822 * lib/bitsetv-print.c: Likewise.
6823 * lib/bitsetv.c: Likewise.
6824 * lib/subpipe.h: Likewise.
6825 * lib/timevar.c: Likewise.
6826 * lib/timevar.h: Likewise.
6827 * djgpp/subpipe.c: Use standard recipe for config.h.
6828 * lib/abitset.c: Likewise.
6829 * lib/bitset.c: Likewise.
6830 * lib/bitset_stats.c: Likewise.
6831 * lib/bitsetv-print.c: Likewise.
6832 * lib/bitsetv.c: Likewise.
6833 * lib/ebitsetv.c: Likewise.
6834 * lib/get-errno.c: Likewise.
6835 * lib/lbitset.c: Likewise.
6836 * lib/subpipe.c: Likewise.
6837 * lib/timevar.c: Likewise.
6838 * lib/vbitset.c: Likewise.
6839 * tests/local.at: Likewise.
6840 * src/scan-gram.l: Don't include verify.h, since system.h does
6841 that for us.
6842 * .x-sc_require_config_h: New file.
6843 * .x-sc_unmarked_diagnostics: New file.
6844
287c78f6
PE
68452006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6846
287c78f6
PE
6847 Be a bit more systematic about using 'abort'.
6848 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6849 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6850 Put 'default: abort ();' before some other case, to satisfy older
6851 pedantic compilers.
6852 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6853 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6854 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6855 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
6856 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6857 (get_decision_str, get_orientation_str, get_node_alignment_str):
6858 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6859 (get_linestyle_str, get_arrowstyle_str): Likewise.
6860 * src/conflicts.c (resolve_sr_conflict):
6861 Use a default case rather than one for the one remaining enum
6862 value, to catch invalid enum values as well.
6863 * src/lalr.c (set_goto_map, map_goto):
6864 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6865 * src/nullable.c (nullable_compute, token_definitions_output):
6866 Likewise.
6867 * src/reader.c (packgram, reader): Likewise.
6868 * src/state.c (transitions_to, state_new, state_reduction_find):
6869 Likewise.
6870 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6871 (symbol_pack): Likewise.
6872 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
6873 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6874 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
6875 * src/system.h: Don't include <assert.h>.
6876 (assert): New macro.
6877
6878 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6879 (Destructor Decl, Parser Function, Pure Calling):
6880 Describe rules for braces inside C code more carefully.
287c78f6 6881
c66dfadd
PE
68822006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6883
c21493b8
PE
6884 Fix some porting glitches found by Nelson H. F. Beebe.
6885 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6886 compilers that don't understand that abort () does not return.
6887 * src/state.c (transitions_to): Likewise.
6888 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6889 that '#include <cstdlib>' works.
6890 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6891 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6892 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6893 for the benefit of some pre-C99 compilers.
6894
b6e3facf
PE
6895 * bootstrap: Undo changes to gnulib files that autoreconf made.
6896
c66dfadd
PE
6897 Minor fixups to get 'make maintainer-check' to work.
6898 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6899 with the new verify.h implementation.
6900 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6901 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6902 * data/yacc.c (YYUSE): Likewise.
6903 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6904 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6905 * src/parse-gram.y (declaration): Don't pass a string constant
6906 to a function that expects char *, since GCC might complain
6907 about the constant value.
6908 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6909 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6910 before #defining them.
6911 * tests/glr-regression.at
6912 (Incorrectly initialized location for empty right-hand side in GLR):
6913 In yyerror, use the msg arg.
6914 (Corrupted semantic options if user action cuts parse):
6915 (Incorrect lookahead during deterministic GLR):
6916 (Incorrect lookahead during nondeterministic GLR):
6917 Don't name a local var 'index'; it shadows string.h's 'index'.
6918
ed94ef2a
AD
69192006-01-19 Akim Demaille <akim@epita.fr>
6920
6921 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6922 location, not just parts of it.
6923
e9ad4aec
PE
69242006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6925
d6ca7905
PE
6926 * NEWS: Document the fact that multiple %unions are now allowed.
6927 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
6928 * TODO: This feature is now implemented, so remove it from
6929 the wishlist.
d6ca7905 6930
ef1b70e0
PE
6931 * Makefile.maint: Merge with coreutils Makefile.maint.
6932 (CVS_LIST): Use build-aux version if available.
6933 (VERSION_REGEXP): New macro.
6934 (syntax-check-rules): Add sc_no_if_have_config_h,
6935 sc_prohibit_assert_without_use, sc_require_config_h,
6936 sc_useless_cpp_parens.
6937 (sc_obsolete_symbols): Check for O_NDELAY.
6938 (sc_dd_max_sym_length): Track coreutils.
6939 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6940 (sc_useless_cpp_parens): New rule.
6941 (news-date-check): Look for version or today's date.
6942 (changelog-check): Don't require version number near head.
6943 (copyright-check): Use current year instead of hardwiring 2005.
6944 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
6945 (announcement): Add --gpg-key-ID.
6946
6947 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
6948 with "file system".
6949
2073ce56 6950 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
6951 array. Problem reported by twlevo.
6952 * src/reader.c (packgram): Prepend a new sentinel before ritem.
6953 * src/lalr.c (build_relations): Rely on new sentinel.
6954 * src/gram.c (gram_free): Adjust to new sentinel.
6955
b7691f15
JD
69562006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
6957
6958 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
6959 yylookaheadNeeds. All uses updated.
6960 (yysplitStack): Rename local yynewLookaheadStatuses to
6961 yynewLookaheadNeeds.
6962 * data/glr-regression.at (Incorrect lookahead during nondeterministic
6963 GLR): In comments, change `lookahead status' to `lookahead need'.
6964
ddee1b06
PH
69652006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6966
6967 * data/glr.c (yysplitStack): A little stylistic rewrite.
6968
12f4614d
PH
69692006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6970
6971 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
6972
32c29292
JD
69732006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
6974
6975 * doc/bison.texinfo: Fix some typos.
6976 (GLR Semantic Actions): New subsection discussing special
6977 considerations because GLR semantic actions might be deferred.
6978 (Actions): Mention look-ahead usage of yylval.
6979 (Actions and Locations): Mention look-ahead usage of yylloc.
6980 (Special Features for Use in Actions): Add YYEOF entry and mention it
6981 in the yychar entry.
6982 In the yychar entry, remove mention of the local yychar case (pure
6983 parser) since this is irrelevant information when writing semantic
148d66d8 6984 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
6985 yychar is otherwise described as an external variable.
6986 In the yychar entry, don't call it the `current' look-ahead since it
6987 isn't when semantic actions are deferred.
6988 In the yychar and yyclearin entries, add note about deferred semantic
6989 actions.
6990 Add yylloc and yylval entries discussing look-ahead usage.
6991 (Look-Ahead Tokens): When discussing yychar, don't call it the
6992 `current' look-ahead, and do mention yylval and yylloc.
6993 (Error Recovery): Cross-reference `Action Features' when mentioning
6994 yyclearin.
148d66d8 6995 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
6996 look-ahead.
6997 In the yylloc and yylval entries, mention look-ahead usage.
6998
de366a2f 69992006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
7000
7001 * tests/glr-regression.at: Update copyright year to 2006.
7002
bf70fa87
JD
70032006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7004
7005 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7006 use during nondeterministic operation to track which stacks have
7007 actually needed the current lookahead.
7008 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7009 Allocate, deallocate, resize, and otherwise shuffle space for
7010 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7011 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7012 appropriately during nondeterministic operation.
7013 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7014 members to store the current lookahead to be used by the deferred
7015 user action.
7016 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7017 from which the RHS is taken. Set the lookahead members of the new
7018 yySemanticOption according to the lookahead status for stack yyk.
7019 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7020 yyaddDeferredAction.
7021 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7022 members of yySemanticOption before invoking yyuserAction, and then set
7023 them back to their current values afterward.
7024 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7025 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7026 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7027 titles for consistency.
7028 (Leaked merged semantic value if user action cuts parse): In order to
7029 suppress lint warnings, use arguments in merge function, and assign
7030 char value < 128 in main.
7031 (Incorrect lookahead during deterministic GLR): New test case.
7032 (Incorrect lookahead during nondeterministic GLR): New test case.
7033
05449a2c
JD
70342006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7035
de366a2f 7036 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
7037 !yyvaluep as signal that no semantic value is available to print.
7038 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7039 to print a semantic value.
7040
4158e0a1 70412006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 7042
4158e0a1
JD
7043 * tests/glr-regression.at: For consistency with my newer test cases,
7044 don't thank myself.
7045
d659304d
JD
70462006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7047
7048 * data/glr.c (yyresolveValue): When merging semantic options, if at
7049 least one user action succeeds but a later one cuts the parse, then
7050 destroy the semantic value before returning rather than leaking it.
7051 (yyresolveStates): If a user action cuts the parse and thus
7052 yyresolveValue fails, ignore the (unset) semantic value rather than
7053 corrupting the yyGLRState, and empty the semantic options list since
7054 the user actions should have called all necessary destructors.
7055 Simplify code with YYCHK.
7056 * tests/glr-regression.at (Corrupted semantic options if user action
7057 cuts parse): New test case.
7058 (Undesirable destructors if user action cuts parse): New test case.
7059 Before applying any of this patch, this test case never actually failed
7060 for me... but only because the corrupted semantic options usually
7061 masked this bug.
7062 (Leaked merged semantic value if user action cuts parse): New test
7063 case.
7064
6ec2c0f2
AD
70652006-01-05 Akim Demaille <akim@epita.fr>
7066
7067 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7068
1b9c21fb
PE
70692006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7070
7071 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7072 _MSC_VER. Problem reported by Cenzato Marco.
7073 (b4_c_function_def): Use it.
7074 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7075 b4_c_modern.
7076 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7077 than rolling our own.
7078
84866159
AD
70792006-01-04 Akim Demaille <akim@epita.fr>
7080
7081 Also warn about non-used mid-rule values.
7082 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7083 member.
7084 (symbol_list_new): Adjust.
7085 * src/reader.c (symbol_typed_p): New.
7086 (grammar_rule_check): Use it.
7087 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7088 Check its rule.
7089 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7090 Use it.
7091 * tests/actions.at (Exotic Dollars): Adjust.
7092
378f4bd8
AD
70932006-01-04 Akim Demaille <akim@epita.fr>
7094
7095 * src/reader.c (grammar_midrule_action): If $$ is set in a
7096 mid-rule, move the `used' bit to its lhs.
7097 * tests/input.at (Unused values): New.
7098 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7099
e2a21b6f
PE
71002006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7101
54662697
PE
7102 * doc/bison.texinfo (Bison Options): Say more accurately what
7103 --yacc does.
7104 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7105 about declarations in the grammar when in Yacc mode, as POSIX does
7106 not require a diagnostic when the grammar uses extensions.
7107
7108 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7109
073f9288
PE
7110 Warn about dubious constructions like "%token T T".
7111 Reported by twlevo.
7112 * src/symtab.h (struct symbol.declared): New member.
7113 * src/symtab.c (symbol_new): Initialize it to false.
7114 (symbol_class_set): New arg DECLARING, specifying whether
7115 this is a declaration that we want to warn about, if there
7116 is more than one of them. All uses changed.
7117
1221b78a
PE
7118 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7119 Allow multiple %union directives, whose contents concatenate.
7120 * src/parse-gram.y (grammar_declaration): Likewise.
7121 Use muscle_code_grow, so that we don't need stype_line any more.
7122 All uses changed.
7123
7124 * src/muscle_tab.c (muscle_grow): Fix comment.
7125
e2a21b6f
PE
7126 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7127 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7128 Update copyright year to 2006.
7129
8f7e3cf9
AD
71302006-01-03 Akim Demaille <akim@epita.fr>
7131
7132 Have glr.cc pass (some of) the calc.at tests.
7133 * data/glr.cc (b4_parse_param_orig): New.
7134 (b4_parse_param): Improve its definition, and bound it more
7135 clearly in the skeleton.
7136 (b4_epilogue): Append, instead of prepending, in order to keep
7137 #line consistency.
7138 Simplify the generation of auxiliary functions: locations and
7139 purity are mandated.
7140 (b4_global_tokens_and_yystype): Honor it.
7141 * data/location.cc (c++.m4): Don't include it.
7142 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7143 and AT_SKEL_CC_IF.
7144 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7145 AT_LALR1_CC_IF.
7146 Be sure to initialize the first position's filename.
7147 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7148 mandated anyway.
7149 (AT_CHECK_CALC_GLR_CC): New.
7150 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7151
3953ed88
AD
71522006-01-02 Akim Demaille <akim@epita.fr>
7153
7154 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7155 c.m4.
0a96ba81 7156 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
7157 * data/glr.cc: Do not include stack.hh.
7158
9ecafbbf
AD
71592006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7160
7161 * data/glr.c: Reformat whitespace with tabs.
7162 (b4_lpure_formals): Remove this unused m4 macro.
7163 * tests/cxx-type.at: Reformat whitespace with tabs.
7164 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7165 since it's a member. Rename type to isNterm for clarity.
7166
c4d497a0
AD
71672005-12-29 Akim <akim@sulaco.local>
7168
7169 Let glr.cc catch up with symbol_value_print.
7170 * data/glr.cc (b4_yysymprint_generate): Replace by...
7171 (b4_yy_symbol_print_generate): this.
7172 (yy_symbol_print, yy_symbol_value_print): Declare them.
7173
4517da37
PE
71742005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7175
7176 * src/location.h (boundary): Note that a line or column equal
7177 to INT_MAX indicates an overflow.
7178 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7179 (rule_length_overflow, increment_rule_length, add_column_width):
7180 New functions.
7181 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7182 (<SC_BRACED_CODE>"}"):
7183 Use increment_rule_length rather than incrementing it by hand.
7184 (adjust_location, handle_syncline): Diagnose overflow.
7185 (handle_action_dollar, handle_action_at):
7186 Fix bug with monstrosities like $-2147483648.
7187 Remove now-unnecessary checks.
7188 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7189 (convert_ucn_to_byte): Verify assumptions.
7190 (handle_syncline): New arg LOC. All callers changed.
7191 Don't store through a value derived from char const * pointer.
7192
7193 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7194 GCC warnings.
7195
e3233bf6
PE
71962005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7197
7198 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7199 Remove unnecessary forward static decls.
7200
8f3596a6
AD
72012005-12-27 Akim Demaille <akim@epita.fr>
7202
7203 * src/reader.c (grammar_current_rule_check): Also check that $$
7204 is used.
7205 Take the rule to check as argument, hence rename as...
7206 (grammar_rule_check): this.
7207 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7208 Rename as...
7209 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7210 (grammar_midrule_action, grammar_symbol_append): Now static.
7211 * tests/torture.at (input): Don't rely on the default action
7212 being always performed.
7213 * tests/calc.at: "Set" $$ even when the action is "cut" with
7214 YYERROR or other.
7215 * tests/actions.at (Exotic Dollars): Instead of using unused
7216 values, check that the warning is issued.
7217
721be13c
PE
72182005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7219
7220 * NEWS: Improve wording for unused-value warnings.
7221
a0af42fc
AD
72222005-12-22 Akim Demaille <akim@epita.fr>
7223
7224 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7225 (b4_yysymprint_generate): Rename as...
7226 (b4_yy_symbol_print_generate): this.
7227 Generate yy_symbol_print instead of yysymprint.
7228 Generate also yy_symbol_value_print, and use it.
7229
affac613
AD
72302005-12-22 Akim Demaille <akim@epita.fr>
7231
721be13c 7232 * NEWS: Warn about unused values.
affac613
AD
7233 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7234 a `used' member.
7235 (symbol_list_n_get, symbol_list_n_used_set): New.
7236 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7237 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7238 * src/reader.c (grammar_current_rule_check): Check that values are
7239 used.
7240 * src/symtab.c (symbol_print): Accept 0.
7241 * tests/existing.at: Remove the type information.
7242 Empty the actions.
7243 Remove useless actions (beware of mid-rule actions: perl -000
7244 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7245 * tests/actions.at (Exotic Dollars): Use unused values.
7246 * tests/calc.at: Likewise.
7247 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7248 Likewise.
7249
7250 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7251 rule_useful_p.
7252
9d9b8b70
PE
72532005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7254
8bb4c753
PE
7255 Undo 2005-12-01 tentative license wording change. The wording is
7256 still being reviewed by the lawyers, and we don't want to wait for
7257 them before publishing a test release. For now, revert to the
7258 previous wording.
7259 * NEWS: Undo 2005-12-01 change.
7260 * data/glr.c: Revert to previous license wording.
7261 * data/glr.cc: Likewise.
7262 * data/lalr1.cc: Likewise.
7263 * data/location.cc: Likewise.
7264 * data/yacc.c: Likewise.
7265
9d9b8b70
PE
7266 * NEWS: Reword %destructor vs YYABORT etc.
7267 * data/glr.c: Use American spacing, for consistency.
7268 * data/glr.cc: Likewise.
7269 * data/lalr1.cc: Likewise.
7270 * data/yacc.c: Likewise.
7271 * data/yacc.c: Reformat comments slightly.
7272 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7273 for consistency. Fix some spelling errors and reword recently-included
7274 text slightly.
7275 * tests/cxx-type.at: Cast results of malloc, for C++.
7276
2c3b392a
AD
72772005-12-21 Joel E. Denny <address@hidden>
7278
7279 * tests/cxx-type.at: Construct a tree, count the parents of shared
7280 nodes, and free each node once and only once. Previously, the memory
7281 for semantic values was leaked instead.
7282
d6cff4dc
AD
72832005-12-21 Joel E. Denny <address@hidden>
7284
7285 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7286 (yylval, yylloc): If pure, #define to yystackp->yyval and
7287 yystackp->yyloc similar to yychar and yynerrs.
7288 (yyparse): If pure, remove local yylval and yylloc. Add local
7289 yystackp to accommodate pure definitions of yylval and yylloc.
7290 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7291 yylvalp and yyllocp to &yylval and &yylloc.
7292 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7293 namespace. Previously, nerrs and char were missing, but lval and lloc
7294 weren't necessary.
7295 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7296 yylvalp and yyllocp parameters since, if pure, these are now always
7297 accessible through yystackp. If not pure, they are still accessible
7298 globally.
7299 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7300 `if (YYID (N))' to pacify lint.
7301
a85284cf
AD
73022005-12-21 Akim Demaille <akim@epita.fr>
7303
7304 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7305 destroy the RHS symbols of a rule.
7306 * data/yacc.c (yylen): Initialize to 0.
7307 Keep its value to the number of items to possibly shift.
7308 In particular, a regular successful parse that ends on YYFINAL by
7309 a (internal) YYACCEPT must not have yylen != 0.
7310 (yyerrorlab, yyreturn): Pop the RHS.
7311 Reorder a bit to emphasize the `shifting' bits of code.
7312 (YYPOPSTACK): Now accept a number of items to pop.
7313 * data/lalr1.cc: Likewise.
7314 * data/glr.c: Formatting changes.
7315 Use goto instead of fall through.
7316 * doc/bison.texinfo (Destructor Decl): Complete.
7317
d508c281
JMG
73182005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7319
7320 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7321 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7322 * djgpp/config.bat: Replace every occurence of the file name
7323 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7324 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7325 * djgpp/config.sed: Replace every occurence of the file name
7326 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7327 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7328 * djgpp/djunpack.bat: DJGPP specific file.
7329 * djgpp/fnchange.lst: DJGPP specific file.
7330 * djgpp/README.in: Add new information about how to unpack the bison
7331 source on MSDOS and other systems which have 8.3 file name restrictions
7332 using djunpack.bat and fnchange.lst.
7333
3e7a2cd9
PE
73342005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7335
7336 * bootstrap (build_cvs_prefix): Remove; unused.
7337 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7338 when getting gnulib.
7339
73402005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7341
7342 * data/glr.c: Reorder typedef declarations for structs to match order
7343 of struct declarations.
7344 Rename yystack everywhere to yystackp except in yyparse where it's not
7345 a pointer.
7346 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7347 consistency.
7348 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7349 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7350 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7351 lint.
7352
877519f8
PE
73532005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7354
0eca5a39
PE
7355 * tests/sets.at (Accept): Fix typos in regular expression used to
7356 sed out the final state number.
7357
2cec9080
PE
7358 Work around portability problem on Solaris 10: flex-generated
7359 files include <stdio.h> before <config.h>, which messes up
7360 because the latter defines __EXTENSIONS__. Address the problem
7361 by creating two new little files that include <config.h> first,
7362 then include the flex-generated files. Rewrite everyone else
7363 to include <config.h> first, as well.
7364 * lib/timevar.c: Always include "config.h".
7365 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7366 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7367 (EXTRA_bison_SOURCES): New macro.
7368 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7369 * src/system.h: Don't include config.h.
7370 * src/LR0.c: Include <config.h> first.
7371 * src/assoc.c: Likewise.
7372 * src/closure.c: Likewise.
7373 * src/complain.c: Likewise.
7374 * src/conflicts.c: Likewise.
7375 * src/derives.c: Likewise.
7376 * src/files.c: Likewise.
7377 * src/getargs.c: Likewise.
7378 * src/gram.c: Likewise.
7379 * src/lalr.c: Likewise.
7380 * src/location.c: Likewise.
7381 * src/main.c: Likewise.
7382 * src/muscle_tab.c: Likewise.
7383 * src/nullable.c: Likewise.
7384 * src/output.c: Likewise.
7385 * src/parse-gram.y: Likewise.
7386 * src/print.c: Likewise.
7387 * src/print_graph.c: Likewise.
7388 * src/reader.c: Likewise.
7389 * src/reduce.c: Likewise.
7390 * src/relation.c: Likewise.
7391 * src/state.c: Likewise.
7392 * src/symlist.c: Likewise.
7393 * src/symtab.c: Likewise.
7394 * src/tables.c: Likewise.
7395 * src/uniqstr.c: Likewise.
7396 * src/vcg.c: Likewise.
7397
877519f8
PE
7398 * src/parse-gram.y: Fix minor problems uncovered by lint.
7399 (current_lhs, current_lhs_location): Now static.
7400 (current_assoc): Remove unused variable.
7401
7402 Cleanups so that Bison-generated parsers have less lint.
7403 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7404 Prepend /*ARGSUSED*/, for lint's sake.
7405 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7406 definition if 'lint' is defined.
7407 (YYID): New macro (or function, if lint).
7408 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7409 * data/yacc.c: Likewise.
7410 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7411 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7412 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7413 is C++ only.
7414 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7415 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7416 Use YYID(0) rather than 0, for lint.
7417 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7418 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7419
f5228370
PE
74202005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7421
7422 * tests/glr-regression.at
7423 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7424 Close memory leak reported by twlevo.
7425
69ce078b
PE
74262005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7427
6ff99711
PE
7428 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7429 all stacks.
7430 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
7431 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7432 New test case.
7433 (Duplicated user destructor for lookahead): This test now is expected
7434 to succeed.
7435
af3412cd
PE
74362005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7437
32b5b719 7438 * NEWS: Document the following change.
af3412cd
PE
7439 * data/yacc.c: Say "parser skeleton" rather than "file", since
7440 it's no longer just a file.
7441 * data/glr.c: Grant a special exception for C GLR parsers, that
7442 reads like the already-existing exception for C LALR(1) parsers.
7443 * data/glr.cc: Likewise.
7444 * data/lalr1.cc: Likewise.
7445 * data/location.cc: Likewise.
7446 * data/yacc.c: Reword the "written by" statement to clarify that
7447 it was the parser skeleton, not the entire output file.
7448 * data/glr.c: Written by Paul Hilfinger.
7449 * data/glr.cc: Written by Akim Demaille.
7450 * data/lalr1.cc: Likewise.
7451
035aa4a0
PE
74522005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7453
d9963c85
PE
7454 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7455 Fix typos in previous change that broke 'make check'.
7456 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7457 supported in C.
7458 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7459 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7460 We can revert this once things settle down.
7461
035aa4a0
PE
7462 * src/conflicts.c (conflicts_print): Don't print file name twice
7463 when %expect fails because there were no conflicts.
7464 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7465 change.
7466 * tests/conflicts.at (%expect not enough, %expect too much):
7467 (%expect with reduce conflicts): Adjust to new behavior.
7468
74692005-11-18 Akim Demaille <akim@epita.fr>
7470
7471 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7472 errors.
7473 * NEWS: Document this.
7474 * doc/bison.texinfo (Expect Decl): Likewise.
7475
d1ff7a7c
AD
74762005-11-16 Akim Demaille <akim@epita.fr>
7477
7478 Generalize the display of semantic values and locations in traces.
7479 * data/glr.c (yy_reduce_print): Fix indices (again).
7480 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7481 literal integers.
7482 * data/lalr1.cc (yyreduce_print): Rename as...
7483 (yy_reduce_print): this.
7484 Display values and locations.
7485 * data/yacc.c (yy_reduce_print): Likewise.
7486 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7487 (yysymprint): Move higher to be visible from yy_reduce_print).
7488 (yyparse): Adjust.
7489 * tests/calc.at: Adjust the expected length of the traces.
7490
6de5398d
AD
74912005-11-14 Akim Demaille <akim@epita.fr>
7492
7493 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7494 from 1 to N, while values and location start at 0.
7495 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7496
a1373f55
AD
74972005-11-14 Akim Demaille <akim@epita.fr>
7498
7499 * data/glr.c (yy_reduce_print): Fix the $ number.
7500
613d8952
AD
75012005-11-14 Akim Demaille <akim@epita.fr>
7502
7503 "Use" parse parameters.
7504 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7505 * data/glr.c, data/glr.cc: Use them.
7506 * data/glr.c (YYUSE): Have a C++ definition that supports
7507 non-pointer types.
7508
b2741627
AD
75092005-11-14 Akim Demaille <akim@epita.fr>
7510
7511 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7512
5059b5c8
AD
75132005-11-14 Akim Demaille <akim@epita.fr>
7514
42249483
AD
7515 * data/glr.cc: New.
7516 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 7517
4626a15d
AD
75182005-11-12 Akim Demaille <akim@epita.fr>
7519
7520 Let position and location be PODs.
7521 * data/location.cc (position::initialize, location::initialize): New.
7522 (position::position, location::location): Define only if
7523 b4_location_constructors is defined.
7524 * data/lalr1.cc (b4_location_constructors): Define it for backward
7525 compatibility.
7526 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7527
75282005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
7529
7530 * data/lalr1.cc: Move the body of the ctor and dtor into the
7531 parser file (instead of the header).
7532 Wrap the implementations in a "namespace yy".
7533
75342005-11-12 Akim Demaille <akim@epita.fr>
7535
7536 Have glr.c include its header file when created.
7537 * data/glr.c (b4_shared_declarations): New.
7538 Output them verbatim in the parser if !%defines, otherwise
7539 output then in the header file, and include it instead.
7540
1989d947
AD
75412005-11-11 Akim Demaille <akim@epita.fr>
7542
7543 * data/glr.c: Comment changes.
7544
75452005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
7546
7547 When yydebug, report semantic and location values for reductions.
7548 * data/glr.c (yy_reduce_print): Report the semantic values and the
7549 locations.
7550 (YY_REDUCE_PRINT): Adjust.
7551 (yyglrReduce): Use them.
7552 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7553 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7554 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7555 traces.
7556
02998094
AD
75572005-11-10 Akim Demaille <akim@epita.fr>
7558
7559 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7560 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7561 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7562
5210672f
PE
75632005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7564
7565 * m4/cxx.m4, examples/Makefile.am: Don't build
7566 examples/calc++ if no C++ compiler is available. (trivial change)
7567
a8991a1d
AD
75682005-11-09 Akim Demaille <akim@epita.fr>
7569
7570 * src/scan-skel.l: Use a couple of asserts.
7571
36b5e963
AD
75722005-11-03 Akim Demaille <akim@epita.fr>
7573
7574 In some (weird) cases, the final state number is incorrect.
7575 Reported by Alexandre Duret-Lutz.
7576 * src/LR0.c (state_list_append): Remove the computation of
7577 final_state.
7578 (save_reductions): Do it here.
7579 (get_state): Alpha conversion.
7580 (generate_states): Use a for loop.
7581 * src/gram.h (item_number_is_rule_number)
7582 (item_number_is_symbol_number): New.
7583 * src/state.c: Use assert.
7584 * src/system.h: Include assert.h.
7585 * tests/sets.at (Accept): New.
7586
44e7ead1
PH
75872005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7588
7589 * data/glr.c (yyfill): Adjust comment.
36b5e963 7590 (yyresolveAction): Initialize default location properly
44e7ead1
PH
7591 for empty right-hand sides.
7592 (yydoAction): Ditto.
7593 Add comment explaining apparently dead code.
36b5e963
AD
7594 * tests/glr-regression.at
7595 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 7596 New test.
36b5e963 7597
e10a80ee
PE
75982005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7599
7600 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7601 gnulib when interrupted. This fixes some race conditions and
7602 works around some portability problems (one noted by Paul
7603 Hilfinger).
7604
067b32ee
AD
76052005-10-22 Akim <akim@epita.fr>
7606
7607 * Makefile.cfg: Adjust to config -> build-aux.
7608 Reported by twledo.
7609
4b367315
AD
76102005-10-21 Akim Demaille <akim@epita.fr>
7611
7612 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7613 the %parse-params.
7614 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7615 * data/yacc.c (b4_Pure_if): Rename as...
7616 (b4_yacc_pure_if): this.
7617 (YY_SYMBOL_PRINT, yyparse): Adjust.
7618 * doc/bison.texinfo: Formatting changes.
7619
24cc23d9
AD
76202005-10-21 Akim Demaille <akim@epita.fr>
7621
7622 Finish the transition config -> build-aux.
7623 * configure.ac, Makefile.am: Use build-aux.
7624 * config/prev-version, config/announce-gen, config/Makefile.am:
7625 Move to...
7626 * build-aux/prev-version, build-aux/announce-gen,
7627 * build-aux/Makefile.am: here.
7628
d4476375
AD
76292005-10-14 Akim Demaille <akim@epita.fr>
7630
7631 * examples/calc++/test: Use set -x only when VERBOSE.
7632
302c0aee
PE
76332005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7634
7635 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7636 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7637
7625ec2c
AD
76382005-10-13 Akim Demaille <akim@epita.fr>
7639
7640 * src/scan-skel.l: Output the base name parts of the parser and
7641 header file names.
302c0aee 7642 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
7643 additional checks.
7644 Use this to exercise C++ outputs in subdirs.
7645 Reported by Oleg Smolsky.
7646
ba0fe3c7
PE
76472005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7648
7649 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7650 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7651 Problem reported by John P. Hartmann.
7652 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7653 already defined it.
7654
9b8a5ce0
AD
76552005-10-12 Akim Demaille <akim@epita.fr>
7656
7657 * src/parse-gram.y (version_check): Exit 63 to please missing
7658 (stands for "version mismatch).
7659 * tests/input.at, doc/bison.texinfo: Adjust.
7660
4f6e011e
PE
76612005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7662
7663 Work around portability problems with Visual Age C compiler
7664 (xlc and xlC_r) reported by John P. Hartmann.
7665 * data/location.cc (initial_column, initial_line): Remove.
7666 All uses replaced by 0 and 1.
7667 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7668 that xlc complains about.
7669 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 7670 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 7671 as __STDC__.
4d7aa45e
PE
7672 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7673 __STDC_VERSION__. Use it everywhere instead of looking at
7674 __STDC__ and __cplusplus.
4f6e011e 7675
a1b3bf8c
AD
76762005-10-10 Akim Demaille <akim@epita.fr>
7677
7678 * examples/calc++/test: Be quiet unless VERBOSE.
7679
412e44aa
PE
76802005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7681
2a4647a3
PE
7682 * data/c.m4 (yydestruct, yysymprint):
7683 Use YYUSE instead of casting to void.
7684 * data/glr.c (YYUSE): New macro.
7685 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7686 Use it instead of rolling our own.
7687 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7688 (YYCHK1):
7689 Use /*CONSTCOND*/ to suppress lint warnings.
7690 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7691 (YY_STACK_PRINT): Use 'false' not '0'.
7692 (YYUSE): New macro.
7693 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7694 * data/yacc.c (YYUSE): New macro.
7695 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7696 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7697 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7698
7699
412e44aa
PE
7700 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7701 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7702
88c6637f
PE
77032005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7704
2f4f028d
PE
7705 Undo the parts of the unlocked-I/O change that substituted
7706 putc or puts for printf. This might hurt performance a bit,
7707 but some people prefer the printf style.
7708 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7709 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7710 All uses replaced by YYFPRINTF and YYDPRINTF.
7711 * data/yacc.c: Likewise.
7712 * lib/bitset.c (bitset_print): Likewise.
7713 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7714 putc and puts.
7715 * lib/lbitset.c (debug_lbitset): Likewise.
7716 * src/closure.c (print_firsts, print_fderives): Likewise.
7717 * src/gram.c (grammar_dump): Likewise.
7718 * src/lalr.c (look_ahead_tokens_print): Likewise.
7719 * src/output.c (escaped_output): Likewise.
7720 (user_actions_output): Break apart two printfs.
7721 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7722 * src/reduce.c (reduce_print): Likewise.
7723 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7724 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7725
88c6637f
PE
7726 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7727 Use assignments rather than casts-to-void to suppress
7728 unused-variable warnings. This pacifies 'lint'.
7729 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7730 unused-variable warnings.
7731
fb32e373
JMG
77322005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7733
7734 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7735
edb8f44f
PE
77362005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7737
fb9c0b33
PE
7738 Use unlocked I/O for a minor performance improvement on hosts like
7739 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7740 is to use the gnlib unlocked-io module, and to prefer putc and
7741 puts to printf when either will work (since the latter doesn't
7742 come in an unlocked flavor).
7743 * bootstrap (gnulib_modules): Add unlocked-io.
7744 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7745 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7746 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7747 and similarly for puts and putc and printf.
7748 * data/yacc.c: Likewise.
7749 * lib/bitset.c (bitset_print): Likewise.
7750 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7751 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7752 to printf.
7753 * lib/lbitset.c (debug_lbitset): Likewise.
7754 * src/closure.c (print_firsts, print_fderives): Likewise.
7755 * src/gram.c (grammar_dump): Likewise.
7756 * src/lalr.c (look_ahead_tokens_print): Likewise.
7757 * src/output.c (escaped_output): Likewise.
7758 (user_actions_output): Coalesce two printfs.
2f4f028d 7759 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
7760 * src/reduce.c (reduce_print): Likewise.
7761 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 7762 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 7763
edb8f44f
PE
7764 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7765 this confuses xgettext.
7766
b50d2359
AD
77672005-10-02 Akim Demaille <akim@epita.fr>
7768
7769 * bootstrap (gnulib_modules): Add strverscmp.
7770 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7771 * m4/.cvsignore: Add strverscmp.m4.
7772 * src/parse-gram.y (%require): New token, new rule.
7773 (version_check): New.
7774 * src/scan-gram.l (%require): Adjust.
7775 * tests/input.at (AT_REQUIRE): New.
7776 Use it.
7777 * doc/bison.texinfo (Require Decl): New.
7778 (Calc++ Parser): Use %require.
7779
21667f64
AD
77802005-10-02 Akim Demaille <akim@epita.fr>
7781
7782 * data/location.cc: New.
7783
2b81e969
AD
77842005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7785 Akim Demaille <akim@epita.fr>
7786
7787 Make sure -odir/foo.cc creates dir/location.hh etc.
7788 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7789 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7790 (spec_defines_file): Now const.
7791 (dir_prefix): New.
7792 (short_base_name): Remove.
7793 * src/files.c: Adjust.
7794 (dirname.h): Include.
7795 (base_name): Don't prototype it.
7796 (finput): Remove, duplicates gram_in.
7797 (full_base_name, short_base_name): Replace by...
7798 (all_but_ext, all_but_tab_ext): these.
7799 (compute_base_names): Rename as...
7800 (compute_file_name_parts): this.
7801 Update to compute the new variables, including dir_prefix.
7802 Adjust dependencies.
7803 * src/output.c (prepare): Output them.
7804 * src/reader.c: Adjust to use gram_in, not finput.
7805 * src/scan-skel.l (@dir_prefix@): New.
7806
ad6a9b97
JMG
78072005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7808
7809 * lib/subpipe.c: New function end_of_output_subpipe() added
7810 to allow support for non-posix systems. This is a no-op function
7811 for posix systems.
7812
7813 * lib/subpipe.h: New function end_of_output_subpipe() added
7814 to allow support for non-posix systems. This is a no-op function
7815 for posix systems.
7816
7817 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7818 handle the lack of pipe/fork functionality on non-posix systems.
7819
7820 * djgpp/Makefile.maint: DJGPP specific file.
7821
7822 * djgpp/README.in: DJGPP specific file.
7823
7824 * djgpp/config.bat: DJGPP specific configuration file.
7825
7826 * djgpp/config.sed: DJGPP specific configuration file.
7827
7828 * djgpp/config.site: DJGPP specific configuration file.
7829
7830 * djgpp/config_h.sed: DJGPP specific configuration file.
7831
7832 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7833
7834 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7835
fc695704
AD
78362005-10-02 Akim Demaille <akim@epita.fr>
7837
7838 * data/location.cc: New, extract from...
7839 * data/lalr1.cc: here.
7840 (location.hh): Include it after the user prologue, in case the
7841 filename type is defined by the user.
7842 Forward declation location and position before the pre-prologue.
7843 (yyresult_): Rename as...
7844 (yyresult): this, it's a local variable, not an attribute.
7845 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7846
78472005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
7848
7849 * examples/extexi: Restore the #line generation.
7850
fb9712a9
AD
78512005-09-30 Akim Demaille <akim@epita.fr>,
7852 Alexandre Duret-Lutz <adl@gnu.org>
7853
7854 Move the token type and YYSTYPE in the parser class.
7855 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7856 (parser::token): New, from the moved free definition of tokens.
7857 (parser::semantic_value): Now a full definition instead of an
7858 indirection to YYSTYPE.
7859 (b4_post_prologue): No longer included in the header file, but
7860 in the implementation file.
7861 * doc/bison.texi (C+ Language Interface): Update.
7862 * src/parse-gram.y: Support unary %define.
7863 * tests/actions.at: Define global_tokens_and_yystype for backward
7864 compatibility until we update the tests.
7865 * tests/calc.at: Idem.
7866 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7867 to simplify the code.
7868
55f0c7b1
PE
78692005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7870
7871 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7872 Ah, the good old days! Problem reported by Peter Klein.
7873 * bootstrap (gnulib_modules): Add strerror, strtoul.
7874 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7875 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7876
fb9712a9 78772005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
7878
7879 * data/c.m4 (b4_error_verbose_if): New.
7880 * data/lalr1.cc: Use it.
7881 (YYERROR_VERBOSE_IF): Remove.
7882 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7883 parser members, replaced by...
7884 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7885 local variables.
7886 (yysyntax_error_): Takes the state number as argument.
7887 (yyreduce_print_): Use the argument yyrule, not the former
7888 attribute yyn_.
7889
8a6f72f3
PE
78902005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7891
7892 * bootstrap (gnulib_modules): Add verify.
7893 * lib/.cvsignore: Add verify.h.
7894 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7895 * src/system.h (verify): Remove.
7896 Include verify.h instead.
7897 * src/tables.c (tables_generate): Use new API for 'verify'.
7898
0d50976f
PE
78992005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7900
ebc3737e
PE
7901 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7902 local variables whose names begin with 'yy'.
7903 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7904 Trivial changes from Joel E. Denny.
7905
0d50976f
PE
7906 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7907 it itself.
7908 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7909 don't use alloca any more.
7910
7911 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7912 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 7913 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
7914 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7915 to match yacc.c, to test more hosts.
7916
a05b79df
PE
79172005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7918
55289366
PE
7919 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7920 doesn't affect behavior.
7921 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7922 Solaris, AIX, MSC.
7923 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7924 This works a bit better with glibc, if user code has already included
7925 stdlib.h.
7926 * doc/bison.texinfo (Bison Parser): Document that users can't
7927 arbitrarily use malloc and free for other purposes. Document
7928 that <alloca.h> and <malloc.h> might be included.
7929 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7930 user must declare alloca.
7931
a05b79df
PE
7932 * HACKING (release): Forwarn the Translation Project about
7933 stable releses.
7934
3ab2ca22
AD
79352005-09-20 Akim Demaille <akim@epita.fr>
7936
7937 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7938
a9739e7c
PE
79392005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7940
a702593e
PE
7941 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
7942 (YYSTACK_ALLOC_MAXIMUM): Use it.
7943 (yysyntax_error): New function.
7944 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
7945 multiple syntax errors are reported, and alloca is being used.
7946 Instead, reallocate buffers twice as big each time, so that
7947 we waste at most half the allocated memory. Start with a small
7948 (128-byte) buffer that will suffice in most cases anyway.
7949 Use yysyntax_error to do most of the work.
7950
7951 * doc/bison.texinfo (Error Reporting, Table of Symbols):
7952 yynerrs is the number of errors reported, not the number of
7953 errors encountered.
7954
a9739e7c
PE
7955 * tests/glr-regression.at (Duplicated user destructor for lookahead):
7956 Mark it as expected to fail.
7957 Cast result of malloc; problem reported by twlevo@xs4all.nl.
7958 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
7959 Don't start user-code symbols with "yy", to avoid name space problems.
7960
f479c6c6
AD
79612005-09-19 Akim Demaille <akim@epita.fr>
7962
7963 Remove the traits, failed experiment.
7964 It never proved useful, and anyway because of the current
7965 definition, it was not possible to have several specialization of
7966 this traits, making it useless.
7967 * data/lalr1.cc (yy:traits): Remove.
7968 Inline its definitions in the parser class.
7969
e2586f82
AD
79702005-09-19 Akim Demaille <akim@epita.fr>
7971
7972 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
7973 least Mac OSX with a /usr/local install of gettext.
7974
2e8cf949
AD
79752005-09-19 Akim Demaille <akim@epita.fr>
7976
7977 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
7978 and yytoken for similarity with the other skeletons.
7979
c7fb0b90
AD
79802005-09-19 Akim Demaille <akim@epita.fr>
7981
4e26c69e 7982 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 7983
1bd0deda
PE
79842005-09-16 Paul Eggert <eggert@cs.ucla.edu>
7985
7986 * NEWS: Version 2.1.
7987
7988 * NEWS: Remove notice of yytname change, since it was never in an
7989 official release.
7990 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
7991 diagnostic.
7992 * src/output.c (prepare): Likewise.
7993 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
7994 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
7995 is not defined. This is an awful hack, but it's enough for now.
7996 All callers changed.
7997 * tests/glr-regression-at (make_value): Args are const pointers now,
7998 to avoid GCC warning.
7999 (Duplicated user destructor for lookahead): New test. Currently
8000 skipped. It fails on my host but I'm not sure it'll always fail.
8001
80022005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
8003
8004 * src/symtab.h (struct symbol): Declare the printer and destructor
8005 as const, to avoid accidental calls to free.
8006 (symbol_destructor_set, symbol_printer_set): Adjust.
8007 * src/symtab.c: Adjust.
8008
1bd0deda 80092005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
8010
8011 * data/c.m4 (b4_token_enums): New.
8012 (b4_token_defines): Rename as...
8013 (b4_token_enums_defines): this.
8014 (b4_token_defines): New, output only the #defines.
8015 * data/yacc.c, data/glr.c: Adjust.
8016 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8017 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8018 as default values.
8019
dbcdae2d
AD
80202005-09-16 Akim Demaille <akim@epita.fr>
8021
8022 * data/lalr1.cc (yylex_): Remove, inline its code.
8023 (yyreport_syntax_error_): Remove, replaced by...
8024 (yysyntax_error_): this which returns a string and leaves to the
8025 caller the call to the users' error function.
8026 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8027 Move from members of the parser object...
8028 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8029 to local variables of the parse function.
8030
70d8f291
AD
80312005-09-16 Akim Demaille <akim@epita.fr>
8032
8033 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8034 since it's in Bison's name space.
8035
b47dbebe
PE
80362005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8037
ae199bf1
PE
8038 * data/glr.c (yyresolveValue): Add default case to pacify
8039 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8040
b47dbebe
PE
8041 * NEWS: Document when yyparse started to return 2.
8042 * doc/bison.texinfo (Parser Function): Document when yyparse
8043 returns 2.
8044
8045 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8046 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8047 changed.
8048 (class position): file_name -> filename (reverting). All uses changed.
8049
80502005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8051
8052 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8053 do anything if $@ exists. This reverts part of the 2005-07-07
8054 patch.
8055
00292f66
PE
80562005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8057
8058 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8059 contains obsolete information and isn't worth distributing as a
8060 separate file anyway.
8061 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8062 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8063 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8064 (yyparse): Abort if user code uses longjmp to throw an unexpected
8065 value.
8066
a420f962
PE
80672005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8068
00292f66
PE
8069 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8070 Suggested by twlevo@xs4all.nl.
8071
127287e9
PE
8072 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8073 This avoids a diagnostic from gcc -Wswitch-enum.
8074 Problem reported by twlevo@xs4all.nl.
8075
a420f962
PE
8076 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8077 standards. Use "file name" or "file" or "name", depending on
8078 the context.
8079 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8080 not to hack/foo.tab.c.
8081 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
8082 * data/glr.c: b4_filename -> b4_file_name.
8083 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8084 All uses changed.
8085 (class position): filename -> file_name. All uses changed.
8086 * data/yacc.c: b4_filename -> b4_file_name.
8087 * lib/bitset.h: filename -> file_name in local vars.
8088 * lib/bitset_stats.c: Likewise.
8089 * src/files.c: Likewise.
8090 * src/scan-skel.l ("@output ".*\n): Likewise.
8091 * src/files.c (file_name_split): Renamed from filename_split.
8092 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
8093
80942005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8095
8096 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8097 to accommodate latest gnulib.
8098
8099 * tests/glr-regression.at (Duplicate representation of merged trees):
8100 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8101
8102 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8103 needed.
8104
42a6501d
PE
81052005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8106
8107 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8108 All uses changed. Invoke user destructor after an error during a
8109 split parse (trivial change from Joel E. Denny).
8110
8111 * tests/glr-regression.at
8112 (User destructor after an error during a split parse): New test case.
8113 Problem reported by Joel E. Denny in:
8114 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8115
ef9a1faf
PE
81162005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8117
5b4aaf78
PE
8118 * README-cvs: Give URLs for recommended tools.
8119 Mention Gzip version problem, and bootstrapping issues.
8120 Remove troubleshooting section, as it's somewhat obsolete.
8121
b5240ba5
PE
8122 * bootstrap (no_cache): New var, to accommodate different wget
8123 variants. Use it instead of '-C off'. Problem reported by
8124 twlevo@xs4all.nl.
8125
ef9a1faf
PE
8126 * data/glr.c (yydestroyStackItem): New function.
8127 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8128 debugging information. Problem reported by Joel E. Denny.
8129
e6efa9da
AD
81302005-08-25 Akim Demaille <akim@epita.fr>
8131
8132 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8133
adc90f13
PE
81342005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8135
8136 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8137 Don't invoke destructor on unresolved entries.
8138 * tests/glr-regression.at
8139 (User destructor for unresolved GLR semantic value): New test case.
8140 Problem reported by Joel E. Denny in:
8141 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8142
f9315de5
PE
81432005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8144
15d29c1f
PE
8145 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8146 Add strnlen.c.
8147 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8148 lib-prefix.m4, po.m4.
8149
dd5f2af2
PE
8150 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8151 in yydestruct diagnostic, since it might not be an error.
8152 Problem reported by Joel Denny near end of
8153 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 8154 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
8155 * data/yacc.c (yyreturn): Likewise.
8156 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8157
8158 * src/files.c: Remove obsolete FIXME comment.
8159
8160 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8161 with the other templates, and to fix bogus run-on messages such
8162 as the one reported at the end of
8163 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8164 All callers changed to avoid the newline.
8165 (yyprocessOneStack): Output two lines rather than one, to accommodate
8166 the above change. This changes the debug output format slightly.
8167
f9315de5
PE
8168 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8169 reported by Joel E. Denny in
8170 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8171 (trivial change).
8172 * tests/glr-regression.at (Duplicate representation of merged trees):
8173 New test, from Joel E. Denny in:
8174 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8175 * THANKS: Add Joel E. Denny.
8176
8177 * configure.ac (AC_INIT): Bump to 2.0c.
8178
04098407
PE
81792005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8180
8181 * NEWS: Version 2.0b.
8182
ca5d2013
PE
8183 * Makefile.am (SUBDIRS): Put examples before tests, so that
8184 "make check" doesn't finish with "All 1 tests passed".
8185
3d54b576
PE
8186 * tests/regression.at (Token definitions): Don't rely on
8187 AT_PARSER_CHECK for data that contains backslashes. It currently
8188 uses 'echo', and 'echo' isn't portable if its argument contains
8189 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8190 that the byte '\0xff' is not printable in the C locale; it is,
8191 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8192 not printable, so use '\0x81' to test.
8193
d53ae497
PE
8194 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8195 version of GCC, since the macro is used with non-GCC compilers.
8196
fc01665e
PE
8197 Fix core dump reported by Pablo De Napoli in
8198 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8199 * tests/regression.at (Invalid inputs with {}): New test.
8200 * src/parse-gram.y (token_name): Translate type before using
8201 it as an index.
8202
04098407
PE
8203 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8204 the user's name space. All uses changed to __attribute__
8205 ((__unused__)).
8206 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8207 Add __attribute__ ((__noreturn__)).
8208
8209 * etc/clcommit: Remove. We weren't using it, and it failed
8210 "make maintainer-distcheck".
8211 * Makefile.maint: Merge from coreutils.
8212 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8213 (syntax-check-rules): Change list of rules as described below.
8214 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8215 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8216 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8217 (sc_trailing_space): New rules.
8218 (sc_xalloc_h_in_src): Remove.
8219 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8220 (sc_space_tab, sc_error_exit_success, sc_changelog):
8221 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8222 (makefile-check, po-check, author_mark_check):
8223 (makefile_path_separator_check, copyright-check):
8224 Use grep -n, to make it easier to find violations.
8225 Use CVS_LIST and CVS_LIST_EXCEPT.
8226 (header_regexp, h_re): Remove.
8227 (dd_c): New macro.
8228 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8229 (my-distcheck): Use more-modern GCC flags.
8230 (signatures, %.asc): Remove.
8231 (rel-files, announcement): Remove signatures.
8232 Restore old updating code, even though we don't use it, so
8233 that we're the same as coreutils.
8234 (alpha, beta, major): Depend on news-date-check.
8235 Make the upload commands.
8236
8237 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8238 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8239 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8240 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8241 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8242 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8243 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8244 * tests/sets.at: Likewise.
8245
8246 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8247 we comment out the Autoconf version number.
8248 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8249 it's error-prone and "make maintainer-distcheck" rejects it.
8250
8251 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8252 Indent calls to "error" to pacify "make maintainer-distcheck",
8253 when the calls are not intended to be translated.
8254 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8255
8256 * src/Makefile.am (DEFS): Use +=, to pacify
8257 "make maintainer-distcheck".
8258 (bison_SOURCES): Add scan-skel.h.
8259 (sc_tight_scope): New rule, from coreutils.
8260
8261 * src/files.c (src_extension, header_extension):
8262 Now static, not extern.
8263 * src/getargs.c (short_options): Likewise.
8264 * src/muscle_tab.c (muscle_table): Likewise.
8265 * src/parse-gram.y (current_class, current_type, current_prec):
8266 Likewise.
8267 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8268 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8269 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8270 void, to avoid warning when NLS is disabled.
8271 * src/output.c: Include scan-skel.h.
8272 (scan_skel): Remove decl, since scan-skel.h does this.
8273 (output_skeleton):
8274 Indent calls to "error" to pacify "make maintainer-distcheck".
8275 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8276 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8277 "make maintainer-distcheck".
8278 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8279 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8280 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8281 (skel_lex_destroy, scan_skel): Move these decls to...
8282 * src/scan-skel.h: New file.
8283 * src/uniqstr.c (uniqstr_assert):
8284 Indent calls to "error" to pacify "make maintainer-distcheck".
8285
8286 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8287 not @VAR@.
8288
8289 * tests/torture.at: Revamp to avoid misuse of atoi that
8290 "make maintainer-distcheck" complained about.
8291
8292 * examples/extexi (message): Don't print a message more than once,
8293 and omit line-number decoration that makes Emacs compile think
8294 that informative messages are worth worrying about.
8295
82962005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8297
8298 * configure.ac: Update version number.
8299
8300 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8301 accidentally.
8302 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8303 autogenerated by the maintainer.
8304 * examples/calc++/.cvsignore: Add *.yy.
8305
8306 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8307 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8308 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8309
8310 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8311
8312 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8313 from maintainer-distcheck about casting the argument of 'free'.
8314
8315 * NEWS: Mention recent yytname changes.
8316 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8317
8318 * bootstrap: For translations that have not yet been upgraded to
8319 the new runtime-po domain, prime the pump by extracting the
8320 relevant strings from the obsolete translations. This code can be
8321 removed once the bison-runtime domain has been translated by each
8322 team.
8323
8324 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8325 now that token names are already quoted.
8326
8327 Fix problem reported by Anthony Heading.
8328 * data/glr.c (YYTOKEN_TABLE): New macro.
8329 (yytname): Define if YYTOKEN_TABLE.
8330 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8331 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8332 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8333 * src/output.c (prepare_symbols): Output token_table_flag.
8334
0ffda363
PE
83352005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8336
8337 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8338 again if the first call fails.
8339
8340 * data/glr.c (yytnamerr): New function.
8341 (yyreportSyntaxError): Use it to dequote most string literals.
8342 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8343 with other skeletons. All uses changed.
8344 (yytnameerr_): New function.
8345 (yyreport_syntax_error): Use it to dequote most string literals.
8346 * data/yacc.c (yytnamerr): New function.
8347 (yyerrlab): Use it to decode most string literals.
8348 * doc/bison.texinfo (Decl Summary, Calling Convention):
8349 Clarify quoting convention of yytname.
8350 * src/output.c (prepare_symbols): Quote all names. This undoes
8351 the 2005-04-17 change, which is now accomplished (mostly) via
8352 changes in the parsers as described above.
8353 * tests/regression.at (Token definitions, Web2c Actions):
8354 Undo most 2005-04-17 change here, too.
8355
83562005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8357
8358 Fix more problems reported by twlevo@xs4all.nl.
8359 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8360 remove trailing spaces. This loses the exit status of ./types,
8361 and isn't needed since ./types shouldn't be emitting trailing
8362 spaces.
8363 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8364 as the stack isn't valid in that case.
8365
8366 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8367 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8368 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8369 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8370 is used.
8371 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8372 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8373 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8374 Likewise.
8375
8376 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8377 overly-picky compilers that reject 'char *foo = "bar";'.
8378
8379 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8380 to FILE * parameter, not to stderr. This fixes a typo introduced
8381 in the 2005-07-12 change.
8382
8383 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8384 warnings from GCC 4.
8385
8386 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8387 (yyglrShiftDefer, yysplitStack):
8388 Remove unused parameters b4_pure_formals. All uses changed.
8389 (yyglrShift): Remove unused parameters b4_user_formals.
8390 All uses changed.
8391 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8392
6100a9aa
PE
83932005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8394
258b75ca
PE
8395 Destructor cleanups and regularization among the three skeletons.
8396 * NEWS: Document the behavior changes.
8397 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8398 stack before failing, as the cleanup code will do it for us now.
8399 * data/lalr1.cc (yyerrlab): Likewise.
8400 * data/glr.c (yyparse): Pop everything off the stack before
8401 freeing it, so that destructors get called properly.
8402 * data/lalr1.cc (yyreturn): Likewise.
8403 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8404 This is more consistent.
8405 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8406 why destructors might be called. 1.875 -> 2.1.
8407 (Destructor Decl, Decl Summary, Table of Symbols):
8408 Some English-language cleanups for %destructor.
8409 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8410 Add output line for destructor of start symbol.
8411 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8412 because of that same extra output line.
8413
1a059451
PE
8414 * NEWS: Document minor wording changes in diagnostics of
8415 Bison-generated parsers.
8416 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8417 Remove unused formals. All uses changed.
8418 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8419 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8420 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8421 Rename yyoverflowab to yyexhaustedlab.
8422 When memory exhaustion occurs during syntax-error reporting,
8423 report it separately rather than in a single diagnostic; this
8424 eases translation.
8425 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8426 (Memory Exhausted): Renamed from Parser Stack Overflow.
8427 Revamp wording slightly to prefer "memory exhaustion".
8428 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8429
97460c78
PE
8430 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8431
30757c8c
PE
8432 Add i18n support to the GLR skeleton. Partially fix the C++
8433 skeleton; a C++ expert needs to finish this. Remove debugging
8434 msgids; there's little point to having them translated, since they
8435 can be understood only by someone who can read the
8436 (English-language) source code.
8437
8438 Generate runtime-po/bison-runtime.pot automatically, so that we
8439 don't have to worry about garbage getting in that file. We'll
8440 make sure after the next official release that old msgids don't
8441 get lost. See
8442 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8443
8444 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8445 Now auto-generated.
8446 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8447 Fix typos in explanations of the runtime file.
8448 * bootstrap: Change gettext keyword from YYI18N to YY_.
8449 Use standard Makefile.in.in in runtime-po, since we'll arrange
8450 for backward-compatible bison-runtime.po files in a different way.
8451 * data/glr.c (YY_): New macro, from yacc.c.
8452 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8453 Translate messages intended for users.
8454 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8455 the wording in the other skeletons. We don't know that the memory
8456 is virtual.
8457 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8458 Use same method that yacc.c uses.
8459 Don't translate debugging messages.
8460 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8461 it doesn't work (yet), and requires C++ expertise to fix.
8462 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8463 Move defn to a more logical place, to be consistent with other
8464 skeletons.
8465 Don't translate debugging messages.
8466 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8467 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8468 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8469 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8470
ac8c5689
PE
8471 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8472 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8473 void, not int.
8474 * tests/glr-regression.at (Badly Collapsed GLR States):
8475 Likewise.
8476 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8477 yylex should return 0 at EOF rather than aborting.
8478
6100a9aa
PE
8479 Improve tests for stack overflow in GLR parser.
8480 Problem reported by twlevo@xs4all.nl.
8481 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8482 All uses removed.
8483 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8484 can handle the problem.
8485 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8486 (yyparse): New local variable yyresult to record the result.
8487 Use result of setjmp to set it, rather than storing itinto
8488 struct.
8489 (yyDone): Remove label.
8490 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8491 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8492 if YYABORT is used).
8493 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8494 yyparse status; put status > 1 into diagnostic.
8495 Check that status==2 works.
8496 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8497 Use exit status 3 for failure to open (which shouldn't happen).
8498
15f40952
PE
84992005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8500
67fd79c4
PE
8501 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8502 1 on syntax error; just let yyparse do its thing.
8503 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8504 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8505 (Exploding the Stack Size with Alloca):
8506 (Exploding the Stack Size with Malloc):
8507 Expect exit status 2, not 1, since the parser is supposed to blow
8508 its stack. Problem reported by twlevo@xs4all.nl.
8509
15f40952
PE
8510 * data/glr.c (yyparse): Don't assume that the initial calls
8511 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8512 Print a stack-overflow message and fail instead.
8513 Initialize the line-number information before creating the stack,
8514 so that the stack-overflow message can report line zero safely.
8515
f32c66b5
PE
85162005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8517
a22ff96f 8518 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
8519 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8520 (yyuserMerge): Provide a default case if b4_mergers is empty.
8521 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8522 * tests/glr-regression.at
8523 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 8524 Add casts to pacify C++ compilers.
1beb0b24
PE
8525 * tests/glr-regression.at (Improper merging of GLR delayed action
8526 sets): Declare yylex before using it.
f32c66b5 8527 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
8528 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8529 test for valgrind; valgrind is independent of g++.
8530 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8531 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8532 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8533 Use a destructor, so that we can expand the stack. Change
8534 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 8535
d741bd1b
PE
85362005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8537
8538 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8539 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8540
0410a6e0
PE
85412005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8542
8543 * PACKAGING: New file, suggested by Bruno Haible and taken from
8544 similar wording in gettext's PACKAGING file.
8545 * NEWS: Mention PACKAGING.
8546 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8547
f7ab6a50
PE
85482005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8549
baf785db 8550 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
8551 * bootstrap: Get runtime translations into runtime-po.
8552 Create runtime-po files automatically, if possible.
8553 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8554 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8555 does not infringe on the user's name space.
8556 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8557 * doc/bison.texinfo (Internationalization): Revamp the English
8558 and Texinfo syntax a bit, to try to make it clearer.
8559 (Bison Options, Option Cross Key): Mention --print-localedir.
8560 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8561 YYENABLE_NLS. Quote a bit more.
8562 * runtime-po/.cvsignore: New file.
8563 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8564 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8565 * runtime-po/quot.sed: Likewise.
8566 * runtime-po/boldquot.sed: Likewise.
8567 * runtime-po/en@quot.header: Likewise.
8568 * runtime-po/en@boldquot.header: Likewise.
8569 * runtime-po/insert-header.sin: Likewise.
8570 * runtime-po/remove-potcdate.sin: Likewise.
8571 * runtime-po/Makevars: Likewise.
8572 * runtime-po/LINGUAS: Likewise.
8573 * runtime-po/de.po: Likewise; we will rely on the translation project
8574 to maintain this, so "bootstrap" should get it.
0410a6e0 8575 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
8576 its value.
8577 * src/main.c (main): Bind the bison-runtime domain, too.
8578
85792005-07-12 Bruno Haible <bruno@clisp.org>
8580
8581 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8582 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8583 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8584 * runtime-po: New directory.
8585 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8586 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8587 * runtime-po/Rules-quot: New file, copied from po/.
8588 * runtime-po/quot.sed: Likewise.
8589 * runtime-po/boldquot.sed: Likewise.
8590 * runtime-po/en@quot.header: Likewise.
8591 * runtime-po/en@boldquot.header: Likewise.
8592 * runtime-po/insert-header.sin: Likewise.
8593 * runtime-po/remove-potcdate.sin: Likewise.
8594 * runtime-po/Makevars: New file.
8595 * runtime-po/POTFILES.in: New file.
8596 * runtime-po/LINGUAS: New file.
8597 * runtime-po/bison-runtime.pot: New file.
8598 * runtime-po/de.po: New file.
8599 * m4/bison.m4: New file.
8600 * Makefile.am (SUBDIRS): Add runtime-po.
8601 (aclocaldir, aclocal_DATA): New variables.
8602 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8603 Define aclocaldir.
8604 * src/getargs.c (usage): Document --print-localedir option.
8605 (PRINT_LOCALEDIR_OPTION): New enum item.
8606 (long_options): Add --print-localedir option.
8607 (getargs): Handle --print-localedir option.
8608 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8609 (Internationalization): New section.
8610
22dda0f0
AD
86112005-07-12 Akim Demaille <akim@epita.fr>
8612
8613 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8614 for consistency with the rest of the code.
8615 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8616 Add separators.
8617
82b248ad
AD
86182005-07-12 Akim Demaille <akim@epita.fr>
8619
8620 * src/parse-gram.y: Use %printer instead of YYPRINT.
8621
fa0e9314
AD
86222005-07-12 Akim Demaille <akim@epita.fr>
8623
867a3e00
AD
8624 * src/symtab.h, src/symtab.c (symbol_print): New.
8625 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8626 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8627
86282005-07-12 Akim Demaille <akim@epita.fr>
8629
8630 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
8631 b4_at_dollar and b4_dollar_dollar.
8632
e054b190
PE
86332005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8634
8635 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8636 and Pennello's paper.
8637
34160ec4
PE
86382005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8639
407d4a75
PE
8640 * data/yacc.c (yyparse): Undo previous patch. Instead,
8641 set yylsp[0] and yyvsp[0] only if the initial action
8642 sets yylloc and yylval, respectively.
8643
34160ec4
PE
8644 * data/yacc.c (yyparse): In the initial action, set
8645 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8646 This avoids the use of undefined variables if the initial
8647 action does not set yylloc and/or yylval.
8648
c3d5a4a7
PE
86492005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8650
b34d96c1
PE
8651 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8652 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8653 Remove from CVS. These files are automatically generated.
8654 * examples/extexi: Clarify that this file is now part of Bison,
8655 not GNU M4, and that it works with any POSIX-compatible Awk.
8656 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8657 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8658 so that we also get calc++-parser.yy. Geneate it.
8659 Use $(AWK), not gawk, since any conforming Awk will do.
8660 Put comment before action, since older 'make' can't handle comment
8661 in action.
8662 $(BUILT_SOURCES): List all built sources, not just some of them.
8663 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8664 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8665 $($(calc_sources_generated)): Remove unnecessary test for existence
8666 of target. (This had a shell syntax error anyway; a stray "x".)
8667 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8668 calc++-parser.yy.
8669 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8670
c3d5a4a7
PE
8671 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8672 implied by the other modules.
8673
828c373b
AD
86742005-07-06 Akim Demaille <akim@epita.fr>
8675
8676 Bind examples/calc++ to the package.
8677 * examples/calc++/Makefile: Remove, replaced by...
8678 * examples/calc++/Makefile.am: ... this new file.
8679 * examples/calc++/test: Remove input.
8680 * examples/calc++/compile: Remove.
8681 * examples/Makefile.am: New.
8682 * configure.ac, Makefile.am: Adjust.
8683 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8684
63cb01d6
PE
86852005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8686
fd2df2ed
PE
8687 * data/glr.c (yyFail): Drastically simplify; since the format argument
8688 never had any % directives, we can simply pass it to yyerror.
8689 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8690 be modified later, as that is the usual style in glr.c.
8691 Problems reported by Paul Hilfinger.
8692
63cb01d6
PE
8693 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8694 and size overflow errors.
8695 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8696 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8697 (YYSIZEMAX): New macro.
8698 (yystpcpy): New function, taken from yacc.c.
8699 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8700 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8701 so that we don't have to maintain their signatures.
8702 (yyFail): Check for buffer overflow, by using vsnprintf rather
8703 than vsprintf. Allocate a bigger buffer if possible.
8704 Report an error if buffer allocation fails.
8705 (yyStackOverflow): New function.
8706 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8707 the initialization was successful. It might fail if storage was
8708 exhausted.
8709 (yyexpandGLRStack): Add more checks for storage allocation failure.
8710 Use yyStackOverflow to report failures.
8711 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8712 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8713 Don't assume stack number fits in int.
8714 (yysplitStack): Check for storage allocation failure.
8715 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8716 can print diagnostics on storage allocation failure. All callers
8717 changed.
8718 (yyresolveValue): Use yybool for boolean.
8719 (yyreportSyntaxError): Check for size-calculation overflow.
8720 This code is taken from yacc.c.
8721 (yyparse): Check for storage allocation errors when allocating
8722 the initial stack.
8723
1c59e0a1
AD
87242005-07-05 Akim Demaille <akim@epita.fr>
8725
8726 Extract calc++ from the documentation.
8727 * doc/bison.texinfo (Calc++): Add the extraction marks.
8728 * examples/extexi: New, from the aborted GNU Programming 2E.
8729 Separate the different paragraph of a file with empty lines.
8730 * examples/Makefile: Use it to extract the whole calc++ example.
8731
8a0adb01
AD
87322005-06-24 Akim Demaille <akim@epita.fr>
8733
8734 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8735 class typedefs.
8736
12545799
AD
87372005-06-22 Akim Demaille <akim@epita.fr>
8738
8739 * doc/bison.texinfo (C++ Language Interface): First stab.
8740 (C++ Parsers): Remove.
8741
99be0235
AD
87422005-06-22 Akim Demaille <akim@epita.fr>
8743
8744 * data/lalr1.cc (yylex_): Honor %lex-param.
8745
0ffd4fd1
AD
87462005-06-22 Akim Demaille <akim@epita.fr>
8747
8748 Start a set of simple examples.
8749 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8750 * examples/calc++/calc++-driver.hh,
8751 * examples/calc++/calc++-parser.yy,
8752 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8753 * examples/calc++/compile, examples/calc++/test: New.
8754
0925ebb4
PE
87552005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8756
8757 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8758 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8759 which stems from the 2005-05-27 patch.
8760
43d3b664
PH
87612005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8762
8763 * data/glr.c: Modify treatment of unused parameters to permit use
8764 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8765
3062864d
PE
87662005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8767
8768 Fix infringement on user name space reported by Janos Zoltan Szabo.
8769 * data/yacc.c (yyparse): strlen -> yystrlen.
8770
989b5b8e
AD
87712005-05-30 Akim Demaille <akim@epita.fr>
8772
8773 * data/lalr1.cc (_): New.
8774 Translate the various messages.
8775
bedf57f5
PE
87762005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8777
8778 Fix infringement on user name space reported by Bruno Haible.
8779 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8780 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8781 the user's name space.
8782 (alloca): Include <stdlib.h> to get it, if it's not built in.
8783 (YYMALLOC, YYFREE): Define only if needed.
8784 (malloc, free): Declare, but only if needed, as this infringes on
8785 the user name space.
8786
4d1801f1
PE
87872005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8788
8789 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8790 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8791 with %d format.
8792 * lib/ebitset.c (min, max): Undef before defining.
8793 * lib/vbitset.c (min, max): Likewise.
8794 * lib/subpipe.c (create_subpipe): Save local variables in case
8795 vfork clobbers them.
8796
87972005-05-24 Bruno Haible <bruno@clisp.org>
8798
8799 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8800 error message syntax used by gcc-4.0.
8801
b94a9e1e
PE
88022005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8803
85ac3861
PE
8804 * README: Mention m4 1.4.3. Remove obsolete advice about
8805 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8806
b94a9e1e
PE
8807 * bootstrap: Remove workaround for problem I encountered with
8808 gettext 0.14.1; it seems to be fixed now.
8809
51c30d21
PE
88102005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8811
009ce67d
PE
8812 * NEWS: Version 2.0a.
8813
f2a97c62
PE
8814 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8815 the previous change.
8816
c8775f93
PE
8817 Various maintainer cleanups.
8818 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8819 conftest*, for benefit of CVS commands run at the same time as
8820 "configure". Add build-aux, since "bootstrap" now creates it and
8821 its subfiles.
8822 * Makefile.cfg (move_if_change): Remove.
8823 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8824 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8825 (po_repo, do-po-update, po-update, wget_files, get-targets):
8826 (config.guess-url_prefix, config.sub-url_prefix):
8827 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8828 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8829 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8830 Remove.
8831 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8832 this is now the recommended name.
8833 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8834 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8835 ylwrap. These files now go into build-aux.
8836 * config/move-if-change: Remove.
8837 * config/prev-version.txt: Bump from 1.75 to 2.0.
8838
3ea5f0ec
PE
8839 * bootstrap: Add stdio-safer, unistd-safer modules.
8840 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8841 we don't need it).
8842 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8843 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8844 * lib/subpipe.c: Include "unistd-safer.h".
8845 (create_subpipe): Make sure all the newly-created
8846 file descriptors are > 2, so that diagnostics don't
8847 get sent down them (which might cause Bison to hang, in theory).
8848 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8849 * src/files.c (xfopen): Use fopen_safer, not fopen.
8850
51c30d21
PE
8851 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8852 yesterday's yacc.c fix.
8853
cea1469d
PE
88542005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8855
3ea5f0ec
PE
8856 * data/glr.c, data/lalr1.cc: Update copyright date.
8857
cea1469d
PE
8858 Fix a destructor bug reported by Wolfgang Spraul in
8859 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8860 * data/yacc.c (yyabortlab): Don't call destructor, and
8861 don't set yychar to EMPTY.
8862 (yyoverflowlab): Don't call destructor.
8863 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8864 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8865 since we no longer output the message "discarding lookahead token
8866 end of input ()".
8867
5e6f62f2
PH
88682005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8869
8870 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8871 fix a small glitch in debugging output.
8872 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8873 after YY_SYMBOL_PRINT where needed.
8874
8875 (struct yyGLRState): Add some comments.
8876 (struct yySemanticOption): Add some comments.
8877 (union yyGLRStackItem): Add comment.
8878
8879 (yymergeOptionSets): Correct this to properly perform the union,
8880 avoiding infinite reported by Michael Rosien.
8881 Update comment.
8882
8883 * tests/glr-regression.at: Add test for GLR merging error reported
8884 by M. Rosien.
cea1469d 8885
0fb669f9
PE
88862005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8887
8888 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8889 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8890 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8891 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8892 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8893 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8894 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8895 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8896 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8897 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8898 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8899 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8900 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8901 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8902 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8903 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8904 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8905 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8906 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8907 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8908 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8909 src/output.h, src/parse-gram.c, src/parse-gram.h,
8910 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8911 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8912 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8913 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8914 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8915 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8916 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8917 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8918 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8919 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8920 tests/reduce.at, tests/regression.at, tests/sets.at,
8921 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8922 Update FSF postal mail address.
8923
51f4735e
PE
89242005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8925
8926 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8927 Problem reported by Ralf Menzel.
8928
80ce3401
PE
89292005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8930
8931 * tests/actions.at: Test that stack overflow invokes destructors.
8932 From Marcus Holland-Moritz.
8933 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8934 from here....
8935 (yyreturn): to here. That way, destructors are called properly
8936 even if the stack overflows, or the user calls YYACCEPT or
8937 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8938 (yyoverflowlab): Destroy the lookahead.
8939
89402005-04-24 Paul Eggert <eggert@cs.ucla.edu>
8941
8942 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
8943
72f000b0
PE
89442005-04-17 Paul Eggert <eggert@cs.ucla.edu>
8945
8946 * NEWS: Bison-generated C parsers no longer quote literal strings
8947 associated with tokens.
8948 * src/output.c (prepare_symbols): Don't escape strings,
8949 since users don't want to see C escapes.
8950 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
8951 in diagnostics.
c19683bb 8952 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
8953 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
8954
1094323f
PE
89552005-04-16 Paul Eggert <eggert@cs.ucla.edu>
8956
8957 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
8958 the data size is known to be too small and we can't increase it.
8959 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
8960
ca407bdf
PE
89612005-04-15 Paul Eggert <eggert@cs.ucla.edu>
8962
8963 * src/parse-gram.y: Include quotearg.h.
8964 (string_as_id): Quote $1 before using it as a key, since the
8965 lexer no longer quotes it for us.
8966 (string_content): Don't strip quotes, since lexer no longer
8967 quotes it for us.
8968 * src/scan-gram.l: Include quotearg.h.
8969 ("\""): Omit quote.
8970 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
8971 a key, since the rest of the lexer doesn't quote it.
8972 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
8973 * tests/regression.at (Token definitions): Check for backslashes
8974 in token strings.
8975
8976 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
8977 (YYSIZE_T): Define to unsigned long int when using an older compiler.
8978 (yyparse): Revamp code to generate long syntax error message, to
8979 make it easier to translate, and to avoid problems with arithmetic
8980 overflow. Change "virtual memory" to "memory" in diagnostic, since
8981 we don't know whether the memory is virtual.
8982
1ce59070
PE
89832005-04-13 Paul Eggert <eggert@cs.ucla.edu>
8984
8985 * NEWS: Bison-generated C parsers now use the _ macro to
8986 translate strings.
8987 * data/yacc.c (_) [!defined _]: New macro.
8988 All English strings wrapped inside this macro.
8989 * doc/bison.texinfo (Bison Parser): Document _.
8990 * po/POTFILES.in: Include src/parse-gram.c, since it now
8991 includes translateable strings that parse-gram.y doesn't.
8992
a749a695
PE
89932005-04-12 Paul Eggert <eggert@cs.ucla.edu>
8994
8995 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
8996 reverting the 2004-10-11 change to this function.
8997 (symbol_check_alias_consistency): Don't call symbol_type_set
8998 if the type name is already correct.
8999 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9000
8fb1053b
PE
90012005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9002
9003 * tests/regression.at (Token definitions): Don't use a token named
9004 c, as that generates a "#define c ..." that runs afoul of buggy
9005 stdlib.h that uses the identifier c as a member of struct
9006 drand48_data. Problem reported by Horst Wente.
9007
ff498c4a
PE
90082005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9009
9010 * bootstrap: Change translation URL from
9011 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9012 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9013 redirection glitches. Problem reported by twlevo@xs4all.nl.
9014
65211d70
PE
90152005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9016
9017 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9018 after operands; POSIX says this isn't portable for the c99 command.
9019
9577fb1f
PE
90202005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9021
9022 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9023 immediately if a data overrun has occurred; this may help us track
9024 down what may be a spurious failure on MacOS.
9025
78b178f7
PE
90262005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9027
a2599d0f
PE
9028 Respond to problems reported by twlevo@xs4all.nl.
9029
9030 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9031
78b178f7
PE
9032 * src/vcg.h: Comment fix.
9033 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9034 (G_CMAX): Change to -1 instead of INT_MAX.
9035
9036 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 9037
7296e729
PE
90382005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9039
9040 * src/tables.c (state_number_to_vector_number): Put it inside an
9041 "#if 0", since it's not currently used. Problem reported by
9042 Roland McGrath.
9043
05ac60f3
PE
90442005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9045
9046 * src/output.c (escaped_output): Renamed from
9047 escaped_file_name_output, since we now use it for symbol tags as
9048 well. All uses changed.
9049 (symbol_destructors_output, symbol_printers_output):
9050 Escape symbol tags too.
9051 Problem reported by Matyas Forstner in
9052 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9053
9054 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9055 not needed.
9056 * src/output.c (user_actions_output, token_definitions_output,
9057 symbol_destructors_output, symbol_printers_output): Likewise.
9058 * src/reader.c (prologue_augment): Likewise.
9059 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9060
9061 * src/vcg.c (output_edge): Don't quote linestyle arg.
9062 Problem reported by twlevo@xs4all.nl.
9063
7eb453ac
PE
90642005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9065
9066 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9067 example, reported by Derek M Jones. Also, make the example even
9068 more outrageous, to better illustrate how bad the problem is.
9069
4c04c52a
PE
90702005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9071
9072 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9073 putsym. Typo reported by Sebastian Piping.
9074
a61e1620
PE
90752005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9076
9077 * doc/bison.texinfo (Language and Grammar): some -> same
9078 (Epilogue): int he -> in the
9079 Typos reported by Sebastian Piping via Justin Pence.
9080
9ec93868
PE
90812005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9082
9083 * tests/glr-regression.at (Improper handling of embedded actions
9084 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9085 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9086 with dollar signs in test names.
9087 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9088 for a similar reason.
9089
73ce7e7e
PE
90902005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9091
9092 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9093 wants to redefine G_VIEW.
9094
2e72b98e
PE
90952005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9096
9097 * src/vcg.c (get_view_str): Remove case for normal_view.
9098 Problem reported by twlevo@xs4all.nl.
9099
e0d634e5
PE
91002005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9101
ccf830a4
PE
9102 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9103 Problem reported by twlevo@xs4all.nl.
9104
e0d634e5
PE
9105 * doc/bison.texinfo: Change @dircategory from "GNU programming
9106 tools" to "Software development". Requested by Richard Stallman
9107 via Karl Berry.
9108
7bbc8cb0
PE
91092005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9110
9111 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9112 Problem reported by twlevo@xs4all.nl.
9113
08b770bc
PE
91142005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9115
9116 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9117 keyword; it's not needed with modern compilers, and it doesn't
9118 affect correctness with older compilers. Suggested by
9119 twlevo@xs4all.nl.
9120
95f22ad2
PE
91212005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9122
9123 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9124 gcc -Wswitch-default.
9125 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9126 * data/yacc.c (yyparse): Likewise.
9127
d229d15c
PE
91282005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9129
9130 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9131 already. Let config.h define any nonstandard values.
9132
ecadd90f
PE
91332005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9134
9135 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9136 for the benefit of slower hosts. Problem reported by
9137 Nelson H. F. Beebe.
9138
213744b5
PE
91392005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9140
9141 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9142 being defined and not used.
9143 * data/lalr1.cc (yyparse): Likewise.
9144 Use "if (false)" rather than "if (0)".
9145
249d3236
PE
91462005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9147
9148 * TODO: Mention that we should allow NUL bytes in tokens.
9149
987cc1fb
PE
91502005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9151
9152 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9153 Problem reported by Hans Aberg.
9154
08fe02d9
PE
91552005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9156
9157 * src/getargs.c (version): Happy new year; update overall
9158 program copyright date from 2004 to 2005.
9159
9160 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9161 Problem reported by Hans Aberg.
9162 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9163 (Output file names.): Add a test for the case when standard output
9164 is closed.
9165
010c0266
PE
91662004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9167
9168 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9169 to fix an oversight in the Bison 2.0 manual.
9170
da12206a
PE
91712004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9172
9173 * NEWS: Version 2.0. Reformat the existing news items since
9174 1.875, so that related items are grouped together.
3a4734aa 9175 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
9176 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9177
c935d934
PE
9178 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9179 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9180 otherwise, we're not testing alloca. Unfortunately there's no
9181 simple way to consult HAVE_ALLOCA here.
9182
da12206a
PE
9183 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9184 for yymsg, too.
9185
9186 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9187 hand. This avoids a warning about comparing int to size_t when
9188 GCC warnings are enabled.
9189
0a2c5137
PE
91902004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9191
d7e14fc0
PE
9192 * NEWS: Bison-generated parsers no longer default to using the
9193 alloca function (when available) to extend the parser stack, due
9194 to widespread problems in unchecked stack-overflow detection.
9195 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9196 responsibility to set it to a positive value. This lets the user
9197 specify a value that is not a preprocessor constant.
9198 * data/yacc.c (YYMAXDEPTH): Likewise.
9199 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9200 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9201 to be a compile-time constant. However, explain the constraints on it.
9202 Also, explain the constraints on YYINITDEPTH.
9203 (Table of Symbols): Explain that alloca is no longer the default.
9204 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9205 to 1.
9206
0a2c5137
PE
9207 * doc/bison.texinfo (Location Default Action): Mention that n must
9208 be zero when k is zero. Suggested by Frank Heckenbach.
9209
e019c247
AD
92102004-12-22 Akim Demaille <akim@epita.fr>
9211
9212 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9213 (parser::state_type, parser::semantic_type, parser::location_type):
9214 Private, not public.
9215 (parser::parse): Return ints, not bool.
9216 Returning a bool introduces a problem: 0 corresponds to false, and
9217 it seems weird to return false on success. Returning true changes
9218 the conventions for yyparse.
9219 Alternatively we could return void and send an exception.
9220 There is no clear consensus (yet?).
9221 (state_stack, semantic_stack, location_stack): Rename as...
9222 (state_stack_type, semantic_stack_type, location_stack_type): these.
9223 Private, not public.
9224 * tests/c++.at: New.
9225 * tests/testsuite.at, tests/Makefile.am: Adjust.
9226
72731bb7
AD
92272004-12-21 Akim Demaille <akim@epita.fr>
9228
9229 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9230
9a0d8bec
AD
92312004-12-21 Akim Demaille <akim@epita.fr>
9232
9233 Don't impose std::string for filenames.
9234
9235 * data/lalr1.cc (b4_filename_type): New.
9236 (position::filename): Use it.
9237 (parser.hh): Move the inclusion of stack.hh and location.hh below
9238 the user code, so that needed headers for the filename type can be
9239 included first.
72731bb7
AD
9240 Forward declare them before the user code.
9241 * tests/Makefile.am (check-local, installcheck-local): Pass
9242 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 9243
99880de5
AD
92442004-12-20 Akim Demaille <akim@epita.fr>
9245
9246 Use more STL like names: my_class instead of MyClass.
9247
9248 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9249 (SemanticStack, SemanticType, StateStack, StateType)
9250 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9251 (Parser::value): Rename as...
9252 (location_stack, location_type, rhs_number_type, semantic_stack)
9253 (semantic_type, state_stack, state_type, token_number_type, stack)
9254 (slice, traits, parser::yylloc, parser::yylval): these.
9255
9256 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9257
9bec482e
PE
92582004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9259
9260 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9261 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9262
f6fbd3da
PE
92632004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9264
9265 Remove uses of 'short int' and 'unsigned short int'. This raises
9266 some arbitrary limits. It uses more memory but nowadays that's
9267 not much of an issue.
9268
9269 This change does not affect the generated parsers; that's a different
9270 task, as some users will want to conserve memory there.
9271
9272 Ideally we should use size_t to represent all object counts, and
9273 something like ptrdiff_t to represent signed differences of object
9274 counts; but that will require more code-cleanup than I have the
9275 time to do right now.
9276
9277 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9278 Use size_t, not int or short int, to count objects.
9279 * src/closure.c (nritemset, closure): Likewise.
9280 * src/closure.h (nritemset, closure): Likewise.
9281 * src/nullable.c (nullable_compute): Likewise.
9282 * src/print.c (print_core): Likewise.
9283 * src/print_graph.c (print_core): Likewise.
9284 * src/state.c (state_compare, state_hash): Likewise.
9285 * src/state.h (struct state): Likewise.
9286 * src/tables.c (default_goto, goto_actions): Likewise.
9287
9288 * src/gram.h (rule_number, rule): Use int, not short int.
9289 * src/output.c (prepare_rules): Likewise.
9290 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9291 errs, reductions): Likewise.
9292 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9293 Likewise.
9294 * src/tables.c (vector_number, tally, action_number,
9295 ACTION_NUMBER_MINIMUM): Likewise.
9296 * src/output.c (muscle_insert_short_int_table): Remove.
9297
efeed023
AD
92982004-12-17 Akim Demaille <akim@epita.fr>
9299
9300 * data/lalr1.cc: Extensive Doxygenation.
9301 (error_): Rename as...
9302 (error): this, since it is visible to the user.
9303 Adjust callers.
9304 (Parser::message): Now an automatic variable from...
9305 (Parser::yyreport_syntax_error_): here.
9306 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9307 Parser::error.
9308 * tests/input.at: Escape $.
9309
bc82c5a5
PE
93102004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9311
9312 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9313 Parenthesize rhs to avoid obscure problems with mistakes like
9314 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9315 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9316 b4_rhs_location): Likewise.
9317 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9318 b4_rhs_location): Likewise.
9319
fd19f271
AD
93202004-12-16 Akim Demaille <akim@epita.fr>
9321
9322 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9323 yacc.c: be sure to stay within yycheck_.
9324 * tests/actions.at: Re-enable C++ tests.
9325
10454ea4
AD
93262004-12-16 Akim Demaille <akim@epita.fr>
9327
9328 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9329 real.
9330
c5b95ccf
AD
93312004-12-16 Akim Demaille <akim@epita.fr>
9332
9333 Use #define to handle the %name-prefix.
9334
9335 * data/glr.c, data/yacc.c: Comment changes.
9336 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9337 so that one can refer to yylex in the parser file, and have it
9338 renamed, as is the case with other skeletons.
9339
617a8f12
AD
93402004-12-16 Akim Demaille <akim@epita.fr>
9341
9342 Move lalr1.cc internals into yy*.
9343
9344 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9345 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9346 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9347 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9348 (empty_, final_, terror_, errcode_, ntokens_)
9349 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9350 (looka_, ilooka_, error_range_, nerrs_):
9351 Rename as...
9352 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9353 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9354 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9355 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9356 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9357 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9358 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9359 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9360 these.
9361
1e547e6e
PE
93622004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9363
9364 Fix some problems reported by twlevo at xs4all.
9365 * src/symtab.c (symbol_new): Report an error if the input grammar
9366 contains too many symbols. This is better than calling abort() later.
9367 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9368 (struct node, struct graph):
9369 Rename member expand to stretch. All uses changed.
9370 (struct graph): Remove member layoutalgorithm. All uses removed.
9371 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9372 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9373 All uses changed.
9374 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9375
735d6bd4
AD
93762004-12-15 Akim Demaille <akim@epita.fr>
9377
9378 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9379 Add more Doxygen comments.
9380 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9381 (report_syntax_error_, translate_): Rename as...
9382 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9383 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9384
2e1f5829
AD
93852004-12-15 Akim Demaille <akim@epita.fr>
9386
9387 * data/lalr1.cc (lex_): Rename as...
9388 (yylex_): this.
9389 Move the trace here.
9390 Take the %name-prefix into account.
9391 Reported by Alexandre Duret-Lutz.
9392
a3cb6248
AD
93932004-12-15 Akim Demaille <akim@epita.fr>
9394
9395 Simplify the C++ parser constructor.
9396
9397 * data/lalr1.cc (debug_): Rename as...
9398 (yydebug_): so that the parser's internals are always in the yy*
9399 pseudo namespace.
9400 Adjust uses.
9401 (b4_parse_param_decl): Remove the leading comma as it is now only
9402 called as unique argument list.
9403 (Parser::Parser): Remove the constructor accepting a location and
9404 an initial debugging level.
9405 Remove from the other ctor the argument for the debugging level.
9406 (debug_level_type, debug_level, set_debug_level): New.
9407
9408 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9409 constructor calls.
9410
07fed891
AD
94112004-12-15 Akim Demaille <akim@epita.fr>
9412
9413 Remove b4_root related material: failure experiment
a3cb6248 9414 (which goal was to allow to derive from a class).
07fed891
AD
9415
9416 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9417 definitions and uses.
9418
e603eaa5
PE
94192004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9420
9421 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9422 not 2, since it's not portable to subtract 1 from the start of an
9423 array. The new item 0 is never set or used. All uses changed.
9424
9425 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9426 the default definition of YYLLOC_DEFAULT. Problem reported
9427 by Frank Heckenbach.
9428
fafb007d
PE
94292004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9430
9431 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9432 the normal case and one for the error case. Just use the
9433 first one uniformly. Problem reported by Frank Heckenbach.
9434 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9435 use exactly the same macro in both places.
9436 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9437 so that the normal-case YYRHSLOC works for the error case too.
9438 All uses changed.
9439 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9440 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9441 * doc/bison.texinfo (Location Default Action): Don't claim that
9442 we have an array of locations. Use the same macro for both glr
9443 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9444 the index is 0.
9445
48814dcd
PE
94462004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9447
a4e1a53b
PE
9448 * HACKING: Update email addresses to send announcements to.
9449
48814dcd
PE
9450 * configure.ac (AC_INIT): Bump version to 1.875f.
9451
337116ba
PE
94522004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9453
9454 * NEWS: Version 1.875e.
9455 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9456
9457 * src/scan-skel.l: Include "complain.h", for "fatal".
9458
9459 * src/relation.h (relation_print, relation_digraph):
9460 Relation sizes are of type relation_node, not size_t (this is
9461 merely a doc fix, since the two types are equivalent).
9462 (relation_transpose): Relation sizes are of type relation_node,
9463 not int.
9464 * src/relation.c: Likewise.
9465 (top, infinity): Now of type relation_node, not int.
9466 (traverse, relation_transpose): Use relation_node, not int.
9467
9468 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9469 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9470 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9471
9472 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 9473 specifying whether the test should be skipped. Use it tp
337116ba 9474 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 9475 fail on some hosts, and should be skipped.
337116ba 9476
da2a7671
PE
94772004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9478
9479 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9480 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9481 unless otherwise specified below.
9482
9483 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9484 to allocate kernel_base, kernel_items, kernel_size, since
9485 they needn't be initialized to 0.
9486 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9487 * src/closure.c (new_closure): Likewise, for itemset.
9488 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9489 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9490 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9491 (build_relations): Likewise for edge, states1, includes.
9492 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9493 * src/reader.c (packgram): Likewise, for ritem, rules.
9494 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9495 * src/relation.c (relation_digraph): Likewise for VERTICES.
9496 (relation_transpose): Likewise for new_R, end_R.
9497 * src/symtab.c (symbols_token_translations_init): Likewise for
9498 token_translations.
9499 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9500 (token_actions): Likewise for yydefact, actrow, conflrow,
9501 conflict_list.
9502 (save_column): Likewise for froms[symno], tos[symno].
9503 (goto_actions): Likewise for state_count.
9504 (pack_table): Likewise for base, pos, check.
9505 (tables_generate): Likewise for width.
9506
9507 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9508 for initial core. Just have a separate core, so we needn't worry
9509 about whether kernel_size and kernel_base are initialized.
9510
9511 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9512 kernel_size, kernel_items): Remove unnecessary initialization.
9513 * src/conflicts.c (conflicts): Likewise.
9514 * src/derives.c (derives): Likewise.
9515 * src/muscle_tablc (muscle_insert): Likewise.
9516 * src/relation.c (relation_digraph): Likewise.
9517 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9518 conflrow, conflict_table, conflict_list, table, check):
9519 Likewise.
9520
9521 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9522 This is because all callers pass unsigned int.
9523 * src/closure.h (new_closure): Likewise.
9524
9525 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9526 (build_relations): Initialize includes[i] in all cases.
9527 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9528 and rules[ruleno].precsym. Initialize members in order.
9529 * src/relation.c (relation_transpose): Always initialize new_R[i]
9530 and end_R[i].
9531 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9532
9533 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9534 conflict_list[0] was always 0, but now it isn't initialized.
9535
9536 * src/table.c (table_grow): When conflict_table grew, the grown
9537 area wasn't cleared. Fix this.
9538
9539 * lib/.cvsignore: Add strdup.c, strdup.h.
9540 * m4/.cvsignore: Add strdup.m4.
9541
00baeeac
PE
95422004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9543
9544 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9545 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9546 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9547 ngotos + 1 without checking for overflow.
9548 (build_relations): Use END_NODE, not -1, to denote end of edges.
9549 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9550 build_relations): Use goto_number, not int, for goto numbers.
9551 * src/tables.c (save_column, default_goto): Likewise.
9552
be3d9d42
AD
95532004-11-23 Akim Demaille <akim@epita.fr>
9554
9555 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9556 of #defining from yystype.
9557 Don't typedef yystype, C++ does not need it.
9558 This lets it possible to forward declare it as union.
9559
78e526d5
PE
95602004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9561
9562 * bootstrap (gnulib_modules): Add extensions.
9563 Problem reported by Jim Meyering.
9564
afbb696d
PE
95652004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9566
9567 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9568 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9569 src/system.h, src/tables.c: XFREE -> free, to accommodate
9570 recent change to gnulib xalloc.h.
78e526d5 9571 Problem reported by Jim Meyering.
afbb696d 9572
c1f8f16a
AD
95732004-11-17 Akim Demaille <akim@epita.fr>
9574
9575 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9576
db7e5eb5 95772004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
9578 Alexandre Duret-Lutz <adl@gnu.org>
9579
9580 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9581 changes.
9582 (YYCDEBUG): Adjust.
9583 Use it instead of cdebug_.
9584 (Parser::debug_stream, Parser::set_debug_stream): New.
9585 (Parser::symprint_): Define cdebug_ for temporary backward
9586 compatibility.
9587 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9588 debug_stream ().
9589
68e11668
AD
95902004-11-17 Akim Demaille <akim@epita.fr>
9591
9592 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9593 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9594 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9595 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9596
97cbc73e
PE
95972004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9598
9599 * data/glr.c (yyloc_default): Remove; not used.
9600 Problem reported by Frank Heckenbach.
9601
e342c3be
AD
96022004-10-25 Akim Demaille <akim@epita.fr>
9603
9604 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9605 Introduce another definition to address simple location arrays.
9606 (yyGLRStack): New member: yyerror_range.
9607 (yyrecoverSyntaxError, yyparse): Update it.
9608 (yyrecoverSyntaxError): Use it when shifting the error token to
9609 have an accurate range, equivalent to the one computed by both
9610 yacc.c and lalr1.cc.
9611 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9612 that column numbers start at column 0, as per GNU Coding
9613 Standards, the others tests, and the doc.
9614 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9615 Adjust to the above change (first column is 0).
9616 And adjust the location of the "<error>", now covering the whole
9617 line.
9618
93602feb 96192004-10-22 Akim Demaille <akim@epita.fr>
04098407 9620 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
9621
9622 Remove some arbitrary limits on goto numbers and relations.
9623 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9624 initial values, since they're never used.
9625 (set_goto_map): ngotos is now unsigned, so test for overflow
9626 by seeing whether it wraps around to zero.
9627 * src/lalr.h (goto_number): Now size_t, not short int.
9628 (GOTO_NUMBER_MAXIMUM): Remove.
9629 * src/relation.c (relation_print, traverse, relation_transpose):
9630 Check for END_NODE rather than looking at sign.
9631 * src/relation.h (END_NODE): New macro.
9632 (relation_node): Now size_t, not short int.
9633
dba08b04
PE
96342004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9635
9636 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9637 keyword, not an identifier. Problem reported by Baron Schwartz in
9638 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9639
df09ef2e
AD
96402004-10-11 Akim Demaille <akim@epita.fr>
9641
9642 * src/symtab.c (symbol_check_alias_consistency): Also check
9643 type names, destructors, and printers.
9644 Reported by Alexandre Duret-Lutz.
9645 Recode the handling of associativity and precedence in terms
9646 of symbol_precedence_set.
9647 Accept no redeclaration at all, not even equal to the previous
9648 value.
9649 (redeclaration): New.
9650 Use it to factor redeclaration complaints.
9651 (symbol_make_alias): Don't set the type of the alias, let
9652 symbol_check_alias_consistency do it as for other features.
9653 * src/symtab.h (symbol): Add new member prec_location, and
9654 type_location.
9655 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9656 * tests/input.at (Incompatible Aliases): New.
9657
146bc99d
PE
96582004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9659
9660 .cvsignore fixes to accommodate gnulib changes,
9661 and the practice of naming build directories "_build".
9662 * .cvsignore: Add "_*". Sort.
9663 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9664 * m4/.cvsignore: Add "*_gl.m4".
9665
e503aa60
AD
96662004-10-06 Akim Demaille <akim@epita.fr>
9667
9668 * src/parse-gram.y (add_param): Fix the truncation of trailing
9669 spaces.
9670
b4a20338
AD
96712004-10-05 Akim Demaille <akim@epita.fr>
9672
9673 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9674 whether the reducion was empty or not. This leaves room to
9675 improve the use of YYLLOC_DEFAULT in such a case.
9676 lalr1.cc is still experimental, so changing this is acceptable.
9677 And finally, there are probably not many users who changed the
9678 handling of locations in GLR, so changing is admissible too.
9679
9680 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9681 empty reduction, set @$ to an empty location ending the previously
9682 stacked symbol.
9683 Adjust uses to make sure the code is triggered on empty
9684 reductions.
9685 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9686 expected output: empty reductions have empty locations.
9687
f85a5e6f
AD
96882004-09-29 Akim Demaille <akim@epita.fr>
9689
9690 * data/lalr1.cc: Move towards a more standard C++ coding style
9691 for templates: Class < T > -> Class<T>.
9692
b203fc2c
AD
96932004-09-29 Akim Demaille <akim@epita.fr>
9694
9695 * data/lalr1.cc: Reinstall the former ctor, for sake of
9696 compatibility, but warn it will be removed.
9697 Move towards a more standard C++ coding style (i.e., type *var ->
9698 type* var).
9699
5b7e1e73
PE
97002004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9701
3fee967f
PE
9702 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9703 since it's less likely to work if NULs are involved in the future.
5b7e1e73 9704
0dcca5c2
AD
97052004-09-27 Akim Demaille <akim@epita.fr>
9706
9707 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9708
6dde1c82
AD
97092004-09-27 Akim Demaille <akim@epita.fr>
9710
9711 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 9712 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
9713 and argument names.
9714 (b4_cc_constructor_call): Likewise.
9715
b233d555
AD
97162004-09-24 Akim Demaille <akim@epita.fr>
9717
9718 * src/parse-gram.y (add_param): Strip the leading and trailing
9719 blanks from a formal argument declaration.
9720 (YY_LOCATION_PRINT): New.
9721
619404e3
AD
97222004-09-24 Akim Demaille <akim@epita.fr>
9723
9724 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9725 after the location.
9726
dd8d9022
AD
97272004-09-24 Akim Demaille <akim@epita.fr>
9728
9729 * doc/bison.texinfo (Table of Symbols): Sort.
9730
0092f063
AD
97312004-09-21 Akim Demaille <akim@epita.fr>
9732
9733 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9734 the useless parentheses.
9735 Suggested by Paul Eggert.
9736
451364ed
AD
97372004-09-20 Akim Demaille <akim@epita.fr>
9738
9739 Let the initial-action act on the look-ahead, and use it for the
9740 "initial push" (corresponding to an hypothetical beginning-of-file).
9741 And let lalr1.cc honor %initial-action.
9742
9743 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9744 example.
9745 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9746 (Parser::Parser): Remove the ctor that used to initialize it.
9747 (Parser::parse): Like in the other skeletons, issue the "starting
9748 parse" message before any action.
9749 Honor %initial-action.
9750 Initialize the stacks with the lookahead.
9751 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9752 look-ahead.
9753 Push them in the stacks.
9754 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9755
18d192f0
AD
97562004-09-20 Akim Demaille <akim@epita.fr>
9757
9758 * doc/bison.texinfo (Initial Action Decl): New.
9759
b8458aa5
AD
97602004-09-20 Akim Demaille <akim@epita.fr>
9761
9762 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9763 clearer criterion to define it.
9764 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9765 When reducing on an empty RHS, use the latest stacked location as
9766 location.
9767 yylloc is not always available.
9768 * data/glr.c: Likewise.
9769 Also, honor initial-actions.
9770
3fc16193
AD
97712004-09-20 Akim Demaille <akim@epita.fr>
9772
9773 * data/yacc.c (YY_LOCATION_PRINT): New.
9774 Define when we know YYLTYPE's structure, i.e., when the default
9775 YYLLOC_DEFAULT is used.
9776 * data/c.m4 (b4_yysymprint_generate): Use it.
9777 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9778 value of the result.
9779 (error_start_): Replace with...
9780 (error_range_): this location array.
9781 This allows to replace code relying on the implementation of
9782 locations by portable code.
9783 * data/yacc.c (yylerrsp): Replace with...
9784 (yyerror_range): this.
9785 Every time a token is popped, update yyerror_range[0], to have an
9786 accurate location for the error token.
9787 * data/glr.c (YY_LOCATION_PRINT): New.
9788 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9789 deference a pointer.
9790 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9791 report the location in %printers.
9792
9793 * src/scan-skel.l: Instead of abort, report error messages to ease
9794 understanding skeleton scanning failures.
9795
ecfe33e7
AD
97962004-09-16 Akim Demaille <akim@epita.fr>
9797
9798 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9799 (iterator, const_iterator): these, to be more in the C++ spirit.
9800 Also, return reverse iterators so that when displaying the stack
9801 we display its bottom first.
9802 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9803 from yacc.c.
9804 We should probably use vector here though.
9805
1576d44d
AD
98062004-09-16 Akim Demaille <akim@epita.fr>
9807
9808 Have more complete shift traces.
9809
9810 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9811 to report Shifts instead of ad hoc YYDPRINTF invocations,
9812 including for the error token.
9813 * data/lalr1.cc (symprint_): Output the location.
9814 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9815 output the location within the %printer.
9816 Activate GLR tests, at least to make sure they compile properly.
9817 They still don't pass though.
9818 * tests/calc.at: Adjust expect verbose output, since now "Entering
9819 state..." is on a different line than the "Shifting" message.
9820
9c66f418
AD
98212004-09-08 Akim Demaille <akim@epita.fr>
9822
9823 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9824 Bison directive from the Bison file to the invocation of this
9825 macro, so that these directives are passed to
9826 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9827 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9828 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9829 the extra Bison directives instead of the whole series.
9830 Change the grammar so that there are recoverable errors, and
9831 unrecoverable errors. Now we can have the parser give up before
9832 consuming the whole input. As a result we now can observe that
9833 the lookahead is freed when needed.
9834 Change the parser source to parse argv[1] instead of a hard coded
9835 string.
9836 Simplify yylex, and give a value and location to EOF.
9837 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9838 passed directives already coded in the file.
9839 Add some tests to check the location of "error".
9840 For some tests, the C++ parser is correct, and not yacc.c.
9841 For other tests, they provide different, but unsatisfying, values,
9842 so keep the C++ value so that at least one parser is "correct"
9843 according to the test suite.
9844 (Actions after errors): Remove, this is subsumed by the
9845 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9846
52d5733f
AD
98472004-09-06 Akim Demaille <akim@epita.fr>
9848
9849 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 9850 (Parser::pop): New.
52d5733f
AD
9851 Use it.
9852
a0e68930
AD
98532004-09-06 Akim Demaille <akim@epita.fr>
9854
9855 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9856 argument, an informative message.
9857 Call YY_SYMBOL_PRINT.
9858 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9859 * data/lalr1.cc (destruct_): Likewise.
9860 In addition, no longer depend on b4_yysymprint_generate and
9861 b4_yydestruct_generate to generate these functions, do it "by
9862 hand".
9863
e757bb10
AD
98642004-09-03 Akim Demaille <akim@epita.fr>
9865
9866 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9867 invoked, yydestruct the lookahead.
9868 * tests/calc.at (Calculator $1): Update the expected lengths of
9869 traces: there is an added line for the discarded lookahead.
9870 * doc/bison.texinfo (Destructor Decl): Some rewording.
9871 Define "discarded" symbols.
9872
0fe1f06d
AD
98732004-09-02 Akim Demaille <akim@epita.fr>
9874
9875 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9876
284acc8b
AD
98772004-09-02 Akim Demaille <akim@epita.fr>
9878
9879 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9880 (YYDSYMPRINTF): Rename as...
9881 (YY_SYMBOL_PRINT): this.
9882 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9883 two.
9884 Use it instead of direct symprint_ calls.
9885 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9886 one.
9887
a5eb1ed2
AD
98882004-09-02 Akim Demaille <akim@epita.fr>
9889
b7c72fe1
AD
9890 * data/lalr1.cc (b4_yysymprint_generate): New.
9891 (symprint_): New member function, defined when YYDEBUG.
9892 Use it consistently instead of token/nterm debugging output by
9893 hand.
a5eb1ed2
AD
9894 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9895 %printer calls to use cdebug_ when using lalr1.cc.
9896
417141dd
AD
98972004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9898
9899 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9900 with #ifdef YYDEBUG.
9901
2fa09258
AD
99022004-08-26 Akim Demaille <akim@epita.fr>
9903
9904 * doc/bison.texinfo (Implementing Loops): Rename as...
9905 (Implementing Gotos/Loops): this.
9906
9378b508
PE
99072004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9908
9909 Adjust to latest gnulib.
9910 * bootstrap (gnulib_modules): Add xalloc-die.
9911 Set LC_ALL=C so that file names sort consistently.
9912 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9913 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9914 uintmax_t.m4, ulonglong.m4.
9915 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9916 po.m4 since we are now using _gl.m4 instead.
9917
87a8ad5c
PE
99182004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9919
9920 * src/scan-action.l: Remove. Scanning of semantic actions is
9921 handled in scan-gram.l.
9922
dca81a78
PE
99232004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9924
9925 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9926
9927 * src/location.h (struct): The file member is a uniqstr.
9928 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9929
c9cbf7c5
PE
99302004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9931
9932 Fix bug with non-%union parsers that have printers or destructors,
9933 which led to a Bison core dump. Reported by Peter Fales in
9934 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 9935
c9cbf7c5
PE
9936 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9937 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9938 not to our own type.
9939 * src/output.c (symbol_destructors_output, symbol_printers_output):
9940 Don't assume %union.
9941 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
9942 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
9943 UNION-FLAG. All callers changed.
9944 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
9945 Use type char, not unsigned int, when declaring an array of char;
9946 this lets us remove a cast.
9947 (Printers and Destructors): Add non-%union test cases.
9948
fa7e68c3
PE
99492004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9950
9951 * doc/bison.texinfo: Minor editorial changes, mostly to the new
9952 GLR writeups. E.g., avoid frenchspacing and the future tense,
9953 change "lookahead" to "look-ahead", and change "wrt" to "with
9954 respect to".
2fa09258 9955
fa7e68c3
PE
99562004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9957
9958 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
9959 New sections, split off from the GLR Parsers section. Put the new
9960 Simple GLR Parser near the start of the GLR section, for clarity.
9961 Rewrite connective text.
9962
99a9344e
PE
99632004-06-21 Frank Heckenbach <frank@g-n-u.de>
9964
9965 * doc/bison.texinfo (Simple GLR Parsers): New section.
9966
8dd162d3
PE
99672004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9968
9969 * NEWS, TODO, doc/bison.texinfo:
9970 Use "look-ahead" instead of "lookahead", to be consistent.
9971 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
9972 while we're fixing "look-ahead".
9973 * src/conflicts.c (shift_set): Renamed from shiftset.
9974 (look_ahead_set): Renamed from lookaheadset.
9975 * src/print.c: Likewise.
9976 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
9977 name for "lookahead".
9978 (report_types, usage): Likewise.
9979 * src/getargs.h (report_look_ahead_tokens): Renamed from
9980 report_lookaheads.
9981 * src/lalr.c (compute_look_ahead_tokens): Renamed from
9982 compute_lookaheads.
9983 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
9984 (look_ahead_tokens_print): Renamed from lookaheads_print.
9985 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
9986 state_rule_lookaheads_print.
9987 * src/state.h: Likewise.
9988 (reductions.look_ahead_tokens): Renamed from lookaheads.
9989 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
9990 AT_DATA_LOOKAHEADS_GRAMMAR.
9991
57a90331
PE
99922004-06-03 Paul Eggert <eggert@cs.ucla.edu>
9993
9994 * README: Update location of patched M4 distribution.
9995
8ed3234a
PE
99962004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
9997
9998 Don't assume the C++ compiler takes the same arguments as the C compiler
9999 (trivial change).
10000 * configure.ac (O0CXXFLAGS): New var.
10001 * tests/atlocal.in (CXXFLAGS): Use it.
10002
07971983
PE
100032004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10004
10005 Fix some "make check" problems with C++ reported by
10006 Albert Chin-A-Young for Tru64 C++ in this thread:
10007 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10008
10009 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10010 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10011 Output to a .cc file for C++, not to a .c file.
10012 * tests/calc.at (AT_CHECK_CALC): Likewise.
10013 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10014 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10015
29058652
PE
100162004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10017
10018 * tests/calc.at, tests/actions.at: Workaround for SGI
10019 C++ compiler. (trivial change)
10020
62cb8a99
PE
100212004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10022
fd418816
PE
10023 Spent a few hours checking out which prerequisite versions the
10024 current sources actually require. I went all the way back to
10025 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10026 a seemingly endless set of combinations of versions more recent
10027 than that. The bottom line is that the current sources require
10028 fairly recent versions of the build tools, and it'll be some work
10029 to change this.
10030 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10031 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10032 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10033 Add comments explaining why those particular versions are
10034 currently needed.
2fa09258 10035
62cb8a99
PE
10036 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10037 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 10038 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
10039
10040 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10041 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10042
caa52c10
PE
100432004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10044
10045 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10046 0.11.5. Suggested by Bruno Haible.
10047 * bootstrap: Remove gettext version checking.
10048
10049 * doc/bison.texinfo (Decl Summary): Also mention that %union
10050 can depend on prerequisite types. Problem reported by Tim
10051 Van Holder.
10052
4bfd5e4e
PE
100532004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10054
2cef3017
PE
10055 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10056 * README-alpha: Don't tell people not to package this.
10057
b9c85d5c
PE
10058 * bootstrap: Don't assume $(...) works; use `...` instead.
10059 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10060 gettext better.
10061
4bfd5e4e
PE
10062 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10063 put into the -d output file, and mention what to do if YYSTYPE is
10064 defined as a macro.
10065
6a36ff94
PE
100662004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10067
6712933e
PE
10068 Undo change made earlier today: it caused autopoint to not bring
10069 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10070 autopoint's.
10071
10072 * bootstrap: Check that gettext version matches what's in
10073 configure.ac. Warn users to ignore robots.txt ERROR 404.
10074 * bootstrap: Undo today's earlier change (logged below).
10075 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 10076
6a36ff94
PE
10077 The gettext version checking is causing more trouble than it's
10078 curing; remove it. Problem reported by Paul Hilfinger.
10079
10080 * bootstrap: Issue a warning that one can expect a message
10081 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10082 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10083
209ea708
PE
100842004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10085
10086 Ensure that the C++ compiler used for testing actually works on a
10087 simple test program; if not, skip the C++-related tests. Problem
10088 reported by Vin Shelton in:
161a71f3 10089 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
10090
10091 * m4/cxx.m4: New file.
10092 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10093 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10094 * tests/local.at (AT_COMPILE_CXX): Use it.
10095
41ca2549
PE
100962004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10097
383e69dc
PE
10098 * data/glr.c (yylloc): Output this macro even if locations are not
10099 being generated, as the GLR parser needs it even in that case.
10100 Problem reported by Troy A. Johnson
10101 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10102
41ca2549
PE
10103 * configure.ac (AC_INIT): Update to 1.875e.
10104
e476c87d
PE
101052004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10106
10107 * NEWS: Version 1.875d.
10108 * configure.ac (AC_INIT): Likewise.
10109 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10110
10111 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10112 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10113 lalr1.cc runs afoul of the first, and the last two are no longer
10114 supported by GCC 3.4.0.
10115 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10116 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10117
233a88ad
PE
101182004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10119
10120 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10121 unsigned int, for compatibility with latest gnulib hash module.
10122 * src/state.c (state_hash, state_hasher): Likewise.
10123 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10124 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 10125
12ffdd28
PE
101262004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10127
10128 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10129
10130 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10131 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10132 character and string literals.
10133 (unexpected_end): New function.
10134 (unexpected_eof): Use it.
10135 (unexpected_newline): New function.
10136 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10137 actions.
e476c87d 10138
12ffdd28
PE
10139 * NEWS: Document %expect-rr.
10140
10141 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10142 Fix typo by replacing $1 with $option.
10143 Remove more 'intl'-related files.
9668e2be 10144 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
10145
10146 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10147 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10148 strtoul.c.
10149 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10150 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10151 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10152 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10153 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10154 * src/.cvsignore: Add *.output.
10155
10156 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10157 gets copied to the output file.
e476c87d 10158
1f65350a
PE
101592004-04-28 Paul Eggert <eggert@twinsun.com>
10160
10161 Get files from the gnulib and po repositories, instead of relying
10162 on them being in our CVS. Upgrade to latest versions of gnulib
10163 and Automake.
10164
10165 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10166 * bootstrap: Bootstrap from gnulib and po repositories.
10167 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10168 * README-cvs: Document these changes. Remove version numbers from
10169 mentions of build tools, since they change so often. Mention Flex.
10170
10171 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10172 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
10173 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10174 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 10175 does this for us.
12ffdd28
PE
10176 (AC_ISC_POSIX): Remove; we no longer support this
10177 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
10178 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10179 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10180 Do not check for C89 headers, except for locale.h which is used
10181 by the Yacc library and must port to K&R hosts.
10182 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10183 Do not check for C89 functions, except for setlocale which is
10184 used by the Yacc library.
10185 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10186 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10187 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10188 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10189 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10190 AM_GNU_GETTEXT): Remove; now done by:
10191 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10192 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10193 for us.
10194
10195 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10196 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10197 Define to empty, as gnulib.mk will do the rest for us.
10198 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10199 for us.
10200 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10201 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10202
10203 * src/files.c: Include gnulib's xstrndup.h.
10204
10205 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10206 (REALLOC): Use xnrealloc, for likewise.
10207 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10208 (strnlen, memrchr): Remove decls; functions no longer used.
10209 Include <stpcpy.h>.
10210
10211 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10212 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10213 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10214 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10215 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10216 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10217 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10218 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10219 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10220 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10221 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10222 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10223 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10224 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10225 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10226 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10227 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10228 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10229 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10230 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10231 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10232 Remove, as these files are now generated automatically
10233 by bootstrap or automake.
10234
10235 * po/ChangeLog: Remove: all but one entry was a duplicate
10236 of this file, and I moved that 2000-11-02 entry here.
10237
10238 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10239 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10240 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10241 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10242 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10243 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10244 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10245 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10246 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10247 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10248 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10249 xstrndup.h.
10250 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10251 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10252 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10253 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10254 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10255 * src/.cvsignore: Remove *_.c.
10256
10257
10258 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10259 support it. (The latest stable gzip doesn't.)
10260
102612004-04-27 Paul Eggert <eggert@twinsun.com>
10262
10263 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10264 case, as stos_ is now used by destructors due to the 2004-02-09
10265 change.
10266
10267 Remove more K&R C support.
10268 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10269 * lib/subpipe.c (errno): Remove decl.
10270 Include <stdlib.h> unconditionally.
10271 (EXIT_FAILURE): Remove macro.
10272 * src/complain.c (vfprintf, strerror): Remove.
10273 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10274 unconditionally.
10275 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10276 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10277 (strchr, strspn, memchr): Remove decls.
10278 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10279 unconditionally. Do not declare perror.
10280 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10281 unconditionally.
10282
10283 * src/complain.c (_): Remove useless defn, as system.h defines this.
10284
10285 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10286 with latest obstack.h.
10287 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10288 to procedure types, as obstack.h now does that for us.
10289 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10290
10291 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10292 so that this include file can stand alone.
10293 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10294 does this now. Include subpipe.h first after config.h, to
10295 test whether it can stand alone.
10296
10297 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10298 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10299 unused declaration.
10300
10301 * tests/synclines.at (%union synch line): Put a dummy member in
10302 the union, because empty unions aren't allowed in C. Caught
10303 by GCC 3.4.0.
10304
4f16766c
PE
103052004-04-13 Jim Meyering <jim@meyering.net>
10306
10307 * src/conflicts.c (conflicts_print): Correct format string typo:
10308 use `%%' to produce literal `%'. (trivial change)
10309
779e7ceb
PE
103102004-03-30 Paul Eggert <eggert@twinsun.com>
10311
10312 * src/getargs.c (version): Update copyright year to 2004.
10313
10314 * data/c.m4 (b4_int_type): Use 'short int' rather than
10315 'short', and similarly for 'long', 'unsigned', etc.
10316 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10317 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10318 yy_yypstack, yydumpstack): Likewise.
10319 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10320 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10321 Likewise.
10322 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10323 yy_stack_print, yyparse): Likewise.
10324 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10325 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10326 * lib/bitset.c (bitset_print): Likewise.
10327 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10328 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10329 * lib/bitsetv.c (bitsetv_dump): Likewise.
10330 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10331 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10332 Likewise.
10333 * src/LR0.c (allocate_itemsets): Likewise.
10334 * src/gram.h (rule_number, rule): Likewise.
10335 * src/lalr.h (goto_number): Likewise.
10336 * src/nullable.c (nullable_compute): Likewise.
10337 * src/output.c (prepare_rules): Likewise.
10338 * src/relation.c (relation_print, relation_digraph): Likewise.
10339 * src/relation.h (relation_node): Likewise.
10340 * src/state.h (state_number, transitions, errs, reductions,
10341 struct state): Likewise.
10342 * src/symtab.h (symbol_number, struct symbol): Likewise.
10343 * src/tables.c (vector_number, tally, action_number,
10344 default_goto, goto_actions): Likewise.
10345 * tests/existing.at (GNU Cim Grammar): Likewise.
10346 * tests/regression.at (Web2c Actions): Likewise.
10347
10348 * src/output.c (muscle_insert_short_int_table): Renamed from
10349 muscle_insert_short_table. All uses changed.
10350
d6328241
PH
103512004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10352
10353 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10354 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10355 Add %expect-rr rule.
4f16766c 10356
d6328241
PH
10357 * src/scan-gram.l: Recognize %expect-rr.
10358
4f16766c 10359 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 10360 expected_conflicts.
4f16766c 10361 (expected_rr_conflicts): Declare.
d6328241
PH
10362
10363 * src/conflicts.c (expected_sr_conflicts): Rename from
10364 expected_conflicts.
10365 (expected_rr_conflicts): Define.
10366 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10367 for GLR parsers.
10368 Use expected_sr_conflicts in place of expected_conflicts.
10369 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 10370
d6328241 10371 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 10372
1452af69
PE
103732004-03-08 Paul Eggert <eggert@gnu.org>
10374
10375 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 10376 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
10377
10378 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10379 in lalr1.cc.
10380 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10381 * src/scan-gram.l (scan_integer): New function.
10382 ({int}): Use it.
10383 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10384 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10385 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10386 Say "long int", not "long", for uniformity with GNU style.
10387
006d217d
PE
103882004-02-25 Paul Eggert <eggert@twinsun.com>
10389
10390 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10391 compilers. This fixes a problem with Intel's C++ compiler being
10392 chatty, reported by Guido Trentalancia in
161a71f3 10393 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 10394
c2729758
ADL
103952004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10396
10397 Support %destructor and merge error locations in lalr1.cc.
10398
10399 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10400 (Parser::stos_): Define unconditionally.
10401 (Parser::destruct_): New method. Generate its body with
10402 b4_yydestruct_generate.
10403 (Parser::error_start_): New attribute.
10404 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10405 token which are discarded.
10406 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10407 error_start_ when erroneous token are discarded.
10408 (Parser::parse) <yyerrlab1>: Compute the location of the error
10409 token so that it covers all the discarded tokens.
10410 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10411 it can be called with `%skeleton "lalr1.cc"', and do that.
10412
dd0e0635
PE
104132004-02-02 Paul Eggert <eggert@twinsun.com>
10414
10415 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10416 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10417 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10418 There's no need to mention top_builddir since Automake does that
10419 for us.
10420 (INCLUDES): Remove, as Automake says it's obsolescent.
10421 Contents migrated into AM_CPPFLAGS as described above.
10422 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10423
104242004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10425
10426 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10427 (yyreportSyntaxError): Handle case where lookahead token is
10428 YYEMPTY.
10429
be16239b
PH
104302004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10431
10432 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10433 resulting parsers are compilable with C++.
10434
5fa90832
PE
104352003-12-23 Paul Eggert <eggert@twinsun.com>
10436
10437 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10438 * src/output.c (output_skeleton): Rename local var.
10439 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10440 Bison tokens, as this runs afoul of the 2003-10-07 change that
10441 disallowed NUL bytes in character constants or string literals.
10442
10443 * tests/local.at: Require Autoconf 2.59's Autotest.
10444 * tests/testsuite.at: Don't include local.at, since we now assume
10445 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10446 including it.
10447 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10448 multiple inclusion warnings.
dd0e0635 10449
b165c324
AD
104502003-12-02 Akim Demaille <akim@epita.fr>
10451
10452 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10453 conditions.
10454 From Bruno Haible.
10455
26e06a21
ADL
104562003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10457
10458 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10459
92ac3705
PE
104602003-10-07 Paul Eggert <eggert@twinsun.com>
10461
6a5ecb38
PE
10462 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10463 if testsuite doesn't exist.
10464
92ac3705
PE
10465 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10466 literals, unfortunately.
10467 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10468 Complain about NUL bytes in character constants or string literals.
10469
91d2c560
PE
104702003-10-05 Paul Eggert <eggert@twinsun.com>
10471
10472 * NEWS: Don't document %no-default-prec, as it's still
10473 too experimental.
10474 * doc/bison.texinfo: Document %no-default-prec only if
10475 the defaultprec flag is set. Normally it's not.
10476
0cc3da3a
PE
104772003-10-04 Paul Eggert <eggert@twinsun.com>
10478
10479 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10480 non-modifiable lvalue, instead of a modifiable one.
10481 * doc/bison.texinfo (Actions): Document that $$ can
10482 be assigned to. Do not claim that $$ and $N are
10483 array element references: user code should not rely on this.
10484
22fccf95
PE
104852003-10-01 Paul Eggert <eggert@twinsun.com>
10486
10487 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10488 (grammar_declaration): Use it.
10489 * src/scan-gram.l: New token %no-default-prec.
10490 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10491 * NEWS, doc/bison.texinfo: Document the above.
10492
fc8f2965
AD
104932003-10-01 Akim Demaille <akim@epita.fr>
10494
10495 VCG no longer supports long_straight_phase.
10496
10497 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10498 * src/print_graph.c (print_graph): Adjust.
10499
39a06c25
PE
105002003-09-30 Frank Heckenbach <frank@g-n-u.de>
10501 and Paul Eggert <eggert@twinsun.com>
10502
10503 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10504 Table of Symbols): Document %default-prec.
10505 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10506 (grammar_declaration): Set default_prec on %default-prec.
10507 * src/scan-gram.l (%default-prec): New token.
10508 * src/reader.h (default_prec): New flag.
10509 * src/reader.c: Likewise.
10510 (packgram): Handle it.
10511 * tests/conflicts.at (%default-prec without %prec,
10512 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 10513
39a06c25
PE
105142003-09-30 Paul Eggert <eggert@twinsun.com>
10515
10516 * tests/testsuite.at: Include local.at, not input.at, fixing
10517 a typo in the 2003-08-25 patch.
10518
62b6aef9
AD
105192003-08-27 Akim Demaille <akim@epita.fr>
10520
10521 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10522 GCC warnings.
10523
89e1cc61
AD
105242003-08-26 Akim Demaille <akim@epita.fr>
10525
10526 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10527 "<\#" to avoid magic from Gnus when posting parts of this script.
10528
a08460b0
AD
105292003-08-26 Akim Demaille <akim@epita.fr>
10530
10531 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10532 (Parser::parse): here.
10533 Adjust: nerrs and errstatus is now replaced by...
10534 (Parser::nerrs_, Parser::errstatus_): New.
10535
603f1cfd
AD
105362003-08-25 Akim Demaille <akim@epita.fr>
10537
10538 * config/announce-gen, Makefile.cfg: New.
10539 * Makefile.am: Adjust.
10540 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10541 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10542
cd3684cf
AD
105432003-08-25 Akim Demaille <akim@epita.fr>
10544
10545 When reducing initial empty rules, Bison parser read an initial
10546 location that is not defined. This results in garbage, and that
10547 affects Bison's own parser. Therefore we need (i) to extend Bison
10548 to support a means to initialize this location, and (ii) to use
10549 this CVS Bison to fix CVS Bison's parser.
10550
10551 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10552 with...
10553 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10554 * src/parse-gram.y: Adjust.
10555 (%initial-action): New.
10556 (%error-verbose): Since we require CVS Bison, there is no reason
10557 not to use it.
10558 * src/scan-gram.l: Adjust.
10559 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10560 * data/yacc.c (yyparse): Use b4_initial_action.
10561
4e03e201
AD
105622003-08-25 Akim Demaille <akim@epita.fr>
10563
10564 * doc/bison.texinfo: Don't promote stdout for error messages.
10565
8c182d05
AD
105662003-08-25 Akim Demaille <akim@epita.fr>
10567
10568 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10569 From Alexandre Duret-Lutz.
10570
6a60c4cf
PE
105712003-08-25 Akim Demaille <akim@epita.fr>
10572
10573 Version 1.875c.
10574
25f66e1a
AD
105752003-08-25 Akim Demaille <akim@epita.fr>
10576
10577 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10578 Use them.
10579
5348bfbe
AD
105802003-08-25 Akim Demaille <akim@epita.fr>
10581
10582 * data/lalr1.cc (Parser::reduce_print_): New.
10583 Use it.
10584
47301314
AD
105852003-08-25 Akim Demaille <akim@epita.fr>
10586
10587 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10588 error recovery loops. This patch is based on
161a71f3 10589 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
10590 Also, augment the similarity between lalr1.cc and yacc.c.
10591 Note: the locations of error recovery rules are not correct yet.
10592
10593 * data/lalr1.cc: Comment changes to augment the similarity between
10594 lalr1.cc and yacc.c.
10595 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10596 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10597 yyerrlab), when hitting EOF, pop the whole stack here instead of
10598 merely falling thru the default error handling mechanism.
10599 (yyerrorlab): New label, with the old contents of YYERROR,
10600 plus the following change: pop the stack of rhs corresponding
10601 to the production that invoked YYERROR. That is how Yacc
10602 behaves (required by POSIX).
10603 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10604 fail.
10605
1f7a61ff
AD
106062003-08-25 Akim Demaille <akim@epita.fr>
10607
10608 Tune local.at so that people can "autom4te -l autotest calc.at -o
10609 calc" for instance, to extract a sub test suite.
10610
10611 * tests/testsuite.at: Move the initialization, Autotest version
10612 requirement, and AT_TESTED invocation into...
10613 * tests/local.at: here.
10614 * tests/testsuite.at: Include it for compatibility with Autoconf
10615 2.57.
10616 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10617 be ignore.
10618
327b5b56
PE
106192003-08-04 Paul Eggert <eggert@twinsun.com>
10620
10621 Rework code slightly to avoid gcc -Wtraditional warnings.
10622 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10623 The returned value is now stored in *YY0. All callers changed.
10624 * src/output.c (merge_output): Adjust to the above change.
10625
0051e3ed
PE
106262003-07-26 Paul Eggert <eggert@twinsun.com>
10627
10628 * data/glr.c (YYASSERT): New macro.
10629 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10630 yyresolveStates, yyprocessOneStack):
10631 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10632 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 10633
137437c6
PE
106342003-07-25 Paul Eggert <eggert@twinsun.com>
10635
5b620e06
PE
10636 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10637 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 10638 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
10639 by Frank Heckenbach, though I have omitted the structure-initialization
10640 part of his glr-knr.diff patch since I recall that the Portable
10641 C Compiler didn't require that change.
10642
137437c6
PE
10643 Let the user specify how to allocate and free memory.
10644 Derived from a suggestion by Frank Heckenbach in
161a71f3 10645 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
10646 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10647 All uses of free, malloc, realloc changed to use these macros,
10648 and unnecessary casts removed.
10649 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10650
ddb85ca5
PE
106512003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10652
10653 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10654 use s.empty() rather than s == "" to test for empty string; see
161a71f3 10655 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
10656 (trivial change)
10657
39910e09
AD
106582003-06-25 Akim Demaille <akim@epita.fr>
10659
10660 * config/depcomp, config/install-sh: Update from masters.
10661
0ae99356
PE
106622003-06-20 Paul Eggert <eggert@twinsun.com>
10663
10664 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10665 and return properly parenthesized result.
10666 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10667 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10668 Remove unnecessary parentheses from uses.
10669 * doc/bison.texinfo (Location Default Action): Describe the
10670 conventions for parentheses.
10671
cd05d13c
PE
106722003-06-19 Paul Eggert <eggert@twinsun.com>
10673
81fd08ca
PE
10674 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10675 yyreportTree): Do not assume that size_t is the same width as int,
10676 when printing sizes. Print sizes using an unsigned format.
10677 Problem reported by Frank Heckenbach in
161a71f3 10678 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 10679
cd05d13c
PE
10680 Port to Forte Developer 7 C compiler.
10681 * data/glr.c (struct YYLTYPE): If locations are not being used,
10682 declare a single dummy member, as empty structs do not conform
10683 to the C standard.
10684 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10685 the Forte Developer 7 C compiler complains that end-of-loop
10686 code is not reached.
10687
4dcf140b
PE
106882003-06-17 Paul Eggert <eggert@twinsun.com>
10689
10690 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10691 avoid warnings from picky compilers about redefinition of PARAMS.
10692
8dd76bee
PE
106932003-06-17 Paul Eggert <eggert@twinsun.com>
10694
10695 Version 1.875b.
10696
10697 * NEWS: Document 1.875b.
10698
10699 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10700 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10701 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10702 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10703 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10704 per recent gettext manual's suggestion.
10705 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10706 Use prototypes, not old-style definitions.
10707 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10708 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10709 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10710 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10711 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10712 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10713 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10714 vbitset_or_and_cmp, vbitset_copy): Likewise.
10715
10716 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10717 Do not include <stdlib.h>.
10718 (PARAMS): Define unconditionally for C89.
10719 (ATTRIBUTE_NORETURN): Remove.
10720 (ATTRIBUTE_UNUSED): Define unconditionally.
10721
10722 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 10723 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
10724 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10725 * lib/vbitset.c, lib/vbitset.h: New files.
10726 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10727 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10728 from libbitset.
10729
10730 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10731 `How Can I Reset @code{yyparse}', since texinfo does not allow
10732 arbitrary @ in node names.
10733
10734 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10735 shouldn't be needed according to the gettext 0.12.1 documentation
10736 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 10737 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 10738 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 10739 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 10740
8dd76bee
PE
10741 * lib/.cvsignore: Add stdbool.h.
10742 * m4/.cvsignore: Add nls.m4, po.m4.
10743
10744 Upgrade to CVS gnulib.
10745 * stdbool_.h: File renamed from stdbool.h.in.
10746 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10747 AC_HEADER_STDBOOL.
10748 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10749 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10750 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10751 (MOSTLYCLEANFILES): New var.
10752 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10753 (stdbool.h): New rule.
10754 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10755 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10756 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10757 m4/quote.m4: Upgrade to today's gnulib.
10758
10759 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10760 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10761 the tests right now.
10762 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10763 yyerror are declared before use; C99 requires this.
10764
25005f6a
PH
107652003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10766
10767 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10768 first.
10769 (yyrecoverSyntaxError): Correct the logic for setting and testing
10770 yyerrState.
10771 Correct comment on handling EOF.
10772 Allow states with only a default reduction, rather than failing
8dd76bee 10773 (I can't quite reconstruct why these were not allowed before).
25005f6a 10774
137437c6 10775 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 10776 buffer overruns, corrupting state.
8dd76bee
PE
10777
10778 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
10779 definition.
10780 * src/reader.h (max_left_semantic_context): New variable declaration.
10781 * src/scan-gram.l (max_left_semantic_context): Define.
10782 (handle_action_dollar): Update max_left_semantic_context.
10783 * data/glr.c (YYMAXLEFT): New definition.
10784 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10785 (yyresolveAction): Ditto.
10786
10787 Fixes to problems with location handling in GLR parsers reported by
10788 Frank Heckenbach (2003/06/05).
10789
10790 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10791 (YYRHSLOC): Add parentheses, and define only if locations used.
10792 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10793 locations not used.
10794 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10795 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 10796
25005f6a
PH
10797 * tests/cxx-type.at: Exercise location information; update tests
10798 to differentiate output with and without locations.
8dd76bee 10799 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
10800 because default YYLTYPE not yet defined.
10801 Change semantic actions to compute strings, rather than printing
10802 them directly (to test proper passing of semantics values). Change
10803 output to prefix notation and update test data and expected results.
10804 (yylex): Track locations.
10805 (stmtMerge): Return value rather than printing, and include arguments
10806 in value.
8dd76bee 10807
711f40b7
PE
108082003-06-03 Paul Eggert <eggert@twinsun.com>
10809
10810 Avoid warnings generated by GCC 2.95.4 when Bison is
10811 configured with --enable-gcc-warnings.
10812 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10813 yy::]b4_parser_class_name[::translate_,
10814 yy::Stack::operator[] (unsigned),
10815 yy::Stack::operator[] (unsigned) const,
10816 yy::Slice::operator[] (unsigned),
10817 yy::Slice::operator[] (unsigned) const):
10818 Rename local vars to avoid warnings.
10819 * tests/glr-regression.at (Improper handling of embedded actions
10820 and $-N in GLR parsers): Remove unused local variable from yylex.
10821 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10822 (void) as arg when not pure, since we now assume C89 when building
10823 Bison. Pacify GCC by using parameter.
10824
ac695f7d
PE
108252003-06-02 Paul Eggert <eggert@twinsun.com>
10826
10827 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10828 yy::Location::lines, yy::Location::columns): Rename arguments
10829 to avoid shadowing; this removes a warning generated by GCC 3.3.
10830
26ec81e0
PE
108312003-06-01 Paul Eggert <eggert@twinsun.com>
10832
10833 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10834 to g++, as GCC 3.3 complains if you do it.
10835 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10836 everything that WARNING_CFLAGS has, except omit warnings
10837 not suitable for C++.
10838 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10839 * tests/atlocal.in (CXXFLAGS): New var.
10840 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10841
10842 Fix a GLR parser bug I reported in February; see
161a71f3 10843 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
10844 The problem was that GLR parsers did not conform to the C standard,
10845 because actions like { $1 = $2 + $3; } expanded to expressions
10846 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10847 to a local variable. The C standard says that expressions
10848 like (var = f ()) + (var = f ()) have undefined behavior.
10849 Another problem was that GCC sometimes issues warnings that
10850 yyfill and its parameters are unused.
10851
10852 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10853 as possibly unused.
10854 (yyfill): New function.
10855 (YYFILL): Use it.
10856 (yyuserAction): Change type of yynormal to bool, so that it matches
10857 the new yyfill signature. Mark it as possibly unused.
10858
10859
10860 Follow up on a bug I reported in February, where a Bison-generated
10861 parser can loop. Provide a test case and a fix for yacc.c. I
10862 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10863 The original bug report is in:
161a71f3 10864 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
10865
10866 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10867 macro's size was becoming unwieldy.
10868 (yyerrlab): Do not discard an empty lookahead symbol, as this
10869 might destroy garbage.
10870 (yyerrorlab): New label, with the old contents of YYERROR,
10871 plus the following change: pop the stack of rhs corresponding
10872 to the production that invoked YYERROR. That is how Yacc
10873 behaves, and POSIX requires this behavior.
10874 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10875 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10876 Define 'alarm' to do nothing if unistd.h is not available.
10877 Add a new rule "exp: '-' error;" to test the above change to
10878 data/yacc.c. Use 'alarm' to abort any test taking longer than
10879 10 seconds, as it's probably looping.
10880 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10881 Also, the new yacc.c generates two fewer diagnostics for an
10882 existing test.
10883
d0829076
PE
108842003-05-24 Paul Eggert <eggert@twinsun.com>
10885
c6ae27df
PE
10886 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10887 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10888 This fixes a problem reported by John Bowman when the Compaq/HP
10889 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10890 -ansi -Wall -gall).
10891 * data/yacc.c (union yyalloc): Likewise.
10892 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 10893
d0829076
PE
10894 Switch from 'int' to 'bool' where that makes sense.
10895
10896 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10897 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10898 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10899 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10900 Return or accept bool, not int. All callers changed.
10901 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10902 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10903 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10904 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10905 bitset_or_and_cmp_): Likewise.
10906 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10907 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10908 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10909 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10910 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10911 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10912 bitset_stats_or_and_cmp): Likewise.
10913 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10914 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10915 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10916 ebitset_xor_cmp): Likewise.
10917 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10918 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10919 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10920 lbitset_xor_cmp): Likewise.
10921 * lib/bbitset.h: Include <stdbool.h>.
10922 (struct bitset_vtable): The following members now return bool, not
10923 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10924 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10925 or_and_cmp).
10926 * src/conflicts.c (count_rr_conflicts): Likewise.
10927 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10928 All uses changed.
10929 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10930 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10931 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10932 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10933 graph_flag): Likewise.
10934 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10935 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10936 graph_flag): Likewise.
10937 * src/output.c (error_verbose): Likewise.
10938 * src/output.h (error_verbose): Likewise.
10939 * src/reader.c (start_flag, typed): Likewise.
10940 * src/reader.h (typed): Likewise.
10941 * src/getargs.c (LOCATIONS_OPTION): New constant.
10942 (long_options, getargs): Use it.
10943 * src/lalr.c (build_relations): Use bool, not int.
10944 * src/nullable.c (nullable_compute): Likewise.
10945 * src/print.c (print_reductions): Likewise.
10946 * src/tables.c (action_row, pack_vector): Likewise.
10947 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
10948 * src/output.c (prepare): Use it.
10949 * src/output.c (token_definitions_output,
10950 symbol_destructors_output, symbol_destructors_output): Use string,
10951 not boolean integer, to keep track of whether to output separator.
10952 * src/print_graph.c (print_core): Likewise.
10953 * src/state.c (state_rule_lookaheads_print): Likewise.
10954
10955 * config/install-sh: Sync from automake 1.7.5.
10956
6b2584b7
PE
109572003-05-14 Paul Eggert <eggert@twinsun.com>
10958
10959 * src/parse-gram.y (rules_or_grammar_declaration): Require a
10960 semicolon after a grammar declaration, in the interest of possible
10961 future changes to the Bison input language.
10962 Do not allow a stray semicolon at the start of the grammar.
10963 (rhses.1): Allow one or more semicolons after any rule, including
10964 just before "|" as required by POSIX.
10965 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
10966 grammar.
10967
caf37a36
ADL
109682003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
10969
10970 %parse-param support for lalr1.cc.
10971
10972 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
10973 b4_cc_constructor_calls, b4_cc_constructor_call,
10974 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
10975 definitions.
10976 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
10977 parse-param arguments.
10978 (yy::b4_parser_class_name): Declare instance variables to
10979 hold parse-param arguments.
10980 * tests/calc.at: s/value/semantic_value/ because value clashes
10981 with a member of yy::b4_parser_class_name. Adjust C++ code
10982 to handle %parse-param. Enable %parse-param test in C++.
10983
3ab37077
PE
109842003-05-12 Paul Eggert <eggert@twinsun.com>
10985
10986 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
10987 English a bit. Fix fclose typo. Change "const char" to "char
10988 const", and use ANSI C rather than K&R for "main". Suggest
10989 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
10990 and suggest yy_switch_to_buffer.
10991
109922003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
10993
10994 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
10995 C89. This avoids a diagnostic on compilers that define __STDC__
10996 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 10997 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 10998
e743727f
PE
109992003-05-03 Paul Eggert <eggert@twinsun.com>
11000
11001 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11002 Do not overrun array bounds.
11003 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 11004 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 11005
916708d5
AD
110062003-04-29 Akim Demaille <akim@epita.fr>
11007
11008 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11009 * src/getargs.c, src/getargs.h: here, as bool, not int.
11010 (nondeterministic_parser): New.
11011 * src/parse-gram.y, src/scan-gram.l: Support
11012 %nondeterministic-parser.
11013 * src/output.c (prepare): Use nondeterministic_parser instead
11014 of glr_parser where appropriate.
11015 * src/tables.c (conflict_row, action_row, save_row)
11016 (token_actions, token_actions, pack_vector): Ditto.
11017
a06ea4aa
AD
110182003-04-29 Akim Demaille <akim@epita.fr>
11019
11020 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11021
211074ca
AD
110222003-04-29 Akim Demaille <akim@epita.fr>
11023
11024 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11025 with %pure-parser and %locations to exercise the patch from Yakov
11026 Markovitch below.
11027
6175ffe3
PE
110282003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11029
11030 * data/yacc.c: (b4_lex_param): Corrected for the case where
11031 %lex-param is provided and %pure-parser isn't.
11032
b1e95857
PE
110332003-04-27 Paul Eggert <eggert@twinsun.com>
11034
11035 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 11036 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
11037 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11038 if it is not defined.
11039 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11040
acda9df6
PE
110412003-04-26 Paul Eggert <eggert@twinsun.com>
11042
3470c57b
PE
11043 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11044 Declare to be of type suitable for the ninf value itself, not of
11045 type suitable for the corresponding table, since the latter might
11046 be unsigned but the ninf value might be negative. This fixes a
11047 bug reported by Alexandre Duret-Lutz in
161a71f3 11048 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 11049
acda9df6
PE
11050 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11051 invokes it. We shouldn't invoke it twice because it will attempt
11052 to put error.o in the archive twice. This fixes a glitch reported
11053 by Martin Mokrejs in
161a71f3 11054 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 11055
b5250f26
PE
110562003-04-21 Paul Eggert <eggert@twinsun.com>
11057
11058 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11059 to gnulib.
11060
089ac0f1
PE
110612003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11062
11063 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11064 Fix obvious typo that results in uncompilable GLR parsers
11065 when both %pure-parser and %locations are used. (trivial change)
11066
5ededac6
PE
110672003-04-17 Paul Eggert <eggert@twinsun.com>
11068
1b8f2fff
PE
11069 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11070 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11071 Do not insert the expected token via unput, as this runs afoul
11072 of a POSIX-compatibility bug in flex 2.5.31.
11073 All uses changed to BEGIN the parent state,
11074 since we no longer insert the expected token via unput.
11075 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11076 that is no longer emitted after the above change.
11077
5ededac6
PE
11078 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11079 the first one. This change is from Paul Hilfinger, and it fixes
11080 regression reported by Werner Lemberg in
161a71f3 11081 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
11082
11083 (resolve_sr_conflict): Don't invoke state_errs_set
11084 unless one or more tokens have been explicitly made errors.
11085 Otherwise, the above change causes Bison to abort.
11086
11087 * tests/existing.at (GNU pic Grammar): New test case, taken from
11088 Lemberg's email.
11089
b8be9132
AD
110902003-03-31 Akim Demaille <akim@epita.fr>
11091
11092 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11093
d423d460
AD
110942003-03-31 Akim Demaille <akim@epita.fr>
11095
11096 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11097 output.
11098
c7e441b4
AD
110992003-03-31 Akim Demaille <akim@epita.fr>
11100
11101 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11102 From Paul Hilfinger.
11103
231897ad
AD
111042003-03-29 Akim Demaille <akim@epita.fr>
11105
11106 * m4/error.m4: Do not put under dynamic conditions some code which
11107 expansion is under static control.
11108
5b066063
AD
111092003-03-29 Akim Demaille <akim@epita.fr>
11110
11111 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11112
22a74fec
AD
111132003-03-29 Akim Demaille <akim@epita.fr>
11114
11115 * doc/bison.texinfo (Strings are Destroyed): New.
11116
0eee27e7
PE
111172003-03-13 Paul Eggert <eggert@twinsun.com>
11118
11119 * .cvsignore: Add configure.lineno.
11120 * src/.cvsignore: Add yacc.
11121 * tests/.cvsignore: Add testsuite.log.
11122 * doc/fdl.texi: Sync with latest FSF version.
11123
f61aad93
PE
111242003-03-12 Paul Eggert <eggert@twinsun.com>
11125
537636c7
PE
11126 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11127 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11128 cursor, instead of leaving it undefined. This fixes a bug
11129 reported by Tim Van Holder in
161a71f3 11130 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
11131 * tests/input.at (Torturing the Scanner): Test the scanner on
11132 an empty input file, which was Tim Van Holder's test case.
11133
11134 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11135 <sys/resource.h> can be included, include sys/time.h and
11136 sys/times.h first, if available. This works around the SunOS
11137 4.1.4 porting bug reported by Bruce Becker in
161a71f3 11138 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
11139
11140 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11141 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11142 AC_HEADER_SYS_WAIT.
11143
f61aad93
PE
11144 Merge changes from gnulib. This was prompted because the CVS
11145 snapshot didn't build on Solaris 7 due to strnlen problems.
11146
11147 These changes need to be merged back into gnulib:
11148 * lib/hash.c: Include <stdbool.h> unconditionally.
11149 * m4/onceonly.m4 (m4_quote): New macro.
11150 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11151 Quote AC_FOREACH variable-expansions properly.
11152 The 2003-01-03 obstack.h change also needs merging.
11153 {end of changes requiring merging}
5b066063 11154
f61aad93
PE
11155 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11156 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11157 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11158 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11159 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11160 New files, imported from gnulib.
11161 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11162 above.
11163
11164 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11165 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11166 gnulib sources.
11167
11168 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11169 Add.
11170 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11171 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11172 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11173 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11174 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11175 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11176 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11177 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11178 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11179 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11180 (jm_PREREQ_ARGMATCH): Remove.
11181 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11182 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11183
11184 * src/system.h: Include <stdbool.h> unconditionally.
11185
11186 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11187 assuming at least C89 in the bitset code for some time now.
11188
d2ffe116
AD
111892003-03-03 Akim Demaille <akim@epita.fr>
11190
11191 * ro.po: New.
11192
052826fd
AD
111932003-03-02 Akim Demaille <akim@epita.fr>
11194
11195 * doc/bison.texinfo (Table of Symbols): Reactivate the
11196 documentation for %lex-param, and %parse-param.
11197
c4749565
AD
111982003-03-02 Akim Demaille <akim@epita.fr>
11199
11200 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11201 generate verbose error messages.
11202 Use the number of tokens as an upper bound in yytname, as it
11203 cannot be a non terminal.
11204
d5286af1
AD
112052003-03-02 Akim Demaille <akim@epita.fr>
11206
11207 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11208 message.
11209
22e304a6
AD
112102003-03-02 Akim Demaille <akim@epita.fr>
11211
22e304a6
AD
11212 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11213 Use them to exercise yycheck overrun.
11214 Based on Andrew Suffield's grammar.
11215
67a25fed
AD
112162003-03-02 Akim Demaille <akim@epita.fr>
11217
11218 Create tests/local.at for Bison generic testing macros.
11219
11220 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11221 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11222 This new file.
11223 * tests/calc.at (AT_CHECK_CALC): Adjust.
11224 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11225 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11226 * tests/local.at: here.
11227 (AT_COMPILE_CXX): Tags the tests using it as c++.
11228 Ignore the test if CXX is not functional.
11229
9c2b381f
PE
112302003-03-01 Paul Eggert <eggert@twinsun.com>
11231
11232 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11233 not loc->end, since loc->end might contain garbage and this leads
11234 to undefined behavior on some platforms.
11235 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11236 depend on *loc, so that the reader doesn't give the the false
11237 impression that *loc is initialized.
11238 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11239 does not survive the return.
11240
0433ba88
AD
112412003-03-01 Akim Demaille <akim@epita.fr>
11242
11243 * src/scan-gram.l (code_start): Always initialize it when entering
11244 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11245 yylex invocation. An alternative would be making it static, but
11246 then it starts with the second %%'s beginning, instead of its end.
11247
b305ea69
PE
112482003-02-28 Paul Eggert <eggert@twinsun.com>
11249
11250 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11251 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 11252 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 11253
c3d25e01
PE
112542003-02-26 Paul Eggert <eggert@twinsun.com>
11255
11256 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11257 Remove Sequent/Pyramid discussion (nobody uses them any more).
11258 Merge VMS and MS-DOS discussion; these ports may well be dead
11259 but let's keep mentioning them for now. Put <> around email
11260 addresses. Add copyright notice.
11261
c267ffbc
PE
112622003-02-24 Paul Eggert <eggert@twinsun.com>
11263
11264 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11265 to avoid collision with flex use of yylineno.
11266 Problem reported by Bruce Lilly in
161a71f3 11267 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
11268 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11269 * data/yacc.c (yy_reduce_print): Likewise.
11270
11271 * config/depcomp: Sync with Automake 1.7.3.
11272
f939fc12
AD
112732003-02-21 Akim Demaille <akim@epita.fr>
11274
11275 * data/lalr1.cc: Use temporary variables instead of casts to
11276 change integer types.
11277 Suggested by Paul Eggert.
11278
95923bd6
AD
112792003-02-21 Akim Demaille <akim@epita.fr>
11280
11281 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11282 to avoid confusions with lalr1.cc's notion of Position.
11283 Suggested by Paul Eggert.
11284
2cdc240e
AD
112852003-02-20 Akim Demaille <akim@epita.fr>
11286
11287 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11288 before initial_columns.
11289 (location.hh): Use consistent variable names when defining the
11290 operator<<.
11291 Use "last" so that we subtract from Positions, not from unsigned.
11292
5d003116
AD
112932003-02-20 Akim Demaille <akim@epita.fr>
11294
11295 * data/lalr1.cc (position.hh): New subfile, including the extended
11296 and Doxygen'ed documentation of class Position.
11297 (location.hh): Use it.
11298 Document a` la Doxygen.
ba1ecc07 11299 With the help of Benoit Perrot.
5d003116 11300
d02b25f9
AD
113012003-02-20 Akim Demaille <akim@epita.fr>
11302
11303 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11304 AT_YACC_IF.
11305 Redefine AT_YYERROR_SEES_LOC_IF using it.
11306 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11307 not defined.
11308 Don't use the location in yy::Parser::error_ and
11309 yy::Parser::print_ when not %locations.
11310 Activate more lalr1.cc tests.
11311
0d1c3a04
AD
113122003-02-19 Akim Demaille <akim@epita.fr>
11313
11314 * data/lalr1.cc: When displaying a line number, be sure to make it
11315 an int.
11316
60a777aa
AD
113172003-02-19 Akim Demaille <akim@epita.fr>
11318
11319 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11320 Remove, useless.
11321 (YYABORT, YYACCEPT, YYERROR): New.
11322 * tests/calc.at: Renable the lalr1.cc test.
11323
0b86fc41
AD
113242003-02-19 Akim Demaille <akim@epita.fr>
11325
11326 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11327 error recovery, mixing with/without pops and discarding of the
11328 lookahead.
11329 Exercise YYERROR.
11330 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11331
da99a5dc
PE
113322003-02-17 Paul Eggert <eggert@twinsun.com>
11333
11334 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11335 * tests/testsuite.at (AT_COMPILE): Use them.
11336 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 11337 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 11338
93b8c255
PE
113392003-02-12 Paul Eggert <eggert@twinsun.com>
11340
11341 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11342 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 11343 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
11344 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11345 Check for malloc failure, for consistency with yacc.c.
11346 (yytname_size): Remove, for consistency with yacc.c.
11347
11348 The bug still remains in data/lalr1.cc, as I didn't have time
11349 to fix it there.
11350
7548fed2
AD
113512003-02-06 Akim Demaille <akim@epita.fr>
11352
11353 * configure.ac (GXX): Rename as...
11354 (CXX): this, to keep the original Autoconf semantics.
11355 Require 2.57.
11356 * data/lalr1.cc: Fix b4_copyright invocations.
11357 If YYDEBUG is not defined, don't depend upon name_ being defined.
11358 (location.hh): Include string and iostream.
11359 (Position::filename): New member.
11360 (Position::Position ()): New.
11361 (operator<< (Position)): New.
11362 (operator- (Position, int)): New.
11363 (Location::first, Location::last): Rename as...
11364 (Location::begin, Location::end): these, to mock the conventional
11365 iterator names.
11366 (operator<< (Location)): New.
11367 * tests/atlocal.in (CXX): New.
11368 * tests/testsuite.at (AT_COMPILE_CXX): New.
11369 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11370 locations in a more synthetic way.
11371 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11372 lalr1.cc is used.
11373 Adjust the C locations to match those from Emacs: first column is
11374 column 0.
11375 Change all the expected results.
11376 Conform to the GCS: simplify the locations when applicable.
11377 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11378 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11379 these CPP macros with the m4 macros new defined by...
11380 (AT_CHECK_PUSHDEFS): this, i.e.:
11381 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 11382 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
11383 New macros.
11384 (AT_CHECK_POPDEFS): Undefine them.
11385 (AT_CHECK_CALC_LALR1_CC): New.
11386 Use it for the first lalr1.cc test.
11387
43a176ef
AD
113882003-02-04 Akim Demaille <akim@epita.fr>
11389
11390 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11391 Location as is defined.
11392
fc049e9c
AD
113932003-02-04 Akim Demaille <akim@epita.fr>
11394
11395 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11396 name_ being defined.
11397
a737b216
PE
113982003-02-03 Paul Eggert <eggert@twinsun.com>
11399
11400 * src/gram.h (start_symbol): Remove unused decl.
11401
11402 Use more-consistent naming conventions for local vars.
11403
11404 * src/derives.c (derives_compute): Change type of local var from
11405 int to rule_number.
11406 * src/gram.c (grammar_rules_partial_print): Likewise.
11407 * src/print.c (print_core): Likewise.
11408 * src/reduce.c (reduce_grammar_tables): Likewise.
11409
11410 * src/gram.c (grammar_dump): Change name of item_number *
11411 local var from r to rp.
11412 * src/nullable.c (nullable_compute): Likewise.
11413
11414 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11415
11416 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11417 for symbol or symbol_number var.
11418 * src/reader.c (grammar_start_symbol_set): Likewise.
11419 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11420 Likewise.
11421 * src/state.c (transitions_to): Likewise.
11422 * src/state.h: Likewise.
11423 * src/tables.c (symbol_number_to_vector_number): Likewise.
11424
11425 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11426 char * var.
11427
11428 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11429 var.
11430
11431 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11432 var.
11433
11434 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11435 Use str, not s, for char * var. Use ch, not c, for character var.
11436 Use size for size var.
11437
11438 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11439 char * var.
11440 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11441 uniqstr var.
11442 * src/uniqstr.h: Likewise.
11443
11444 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11445 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11446 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11447 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11448 param to have same name as that of enum, so that we don't use
11449 "s" to stand for a non-state.
11450
68e93ad5
AD
114512003-02-02 Akim Demaille <akim@epita.fr>
11452
11453 * src/scan-skel.l: Scan more than one inert character per yylex
11454 invocation.
11455
92898986
PE
114562003-02-01 Paul Eggert <eggert@twinsun.com>
11457
11458 Version 1.875a.
11459
1d9d5d71
PE
11460 * po/LINGUAS: Add ms.
11461
0435d061
AD
114622003-01-30 Akim Demaille <akim@epita.fr>
11463
11464 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11465
6029a57f
PH
114662003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11467
11468 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11469 of $1.
0435d061
AD
11470
11471 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 11472 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 11473 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 11474
6029a57f
PH
11475 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11476 (b4_rhs_location): Ditto.
0435d061 11477 (yyfill): New function to copy from stack tree into array
6029a57f 11478 incrementally.
0435d061
AD
11479 (yyuserAction): Modify to allow incremental move of semantic values
11480 to rhs array when in GLR mode.
11481 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
11482 as needed.
11483 Remove dummy use of yystack, as there is now a guaranteed use.
11484 (yydoAction): Modify to allow incremental move of semantic values
11485 to rhs array when in GLR mode.
11486 (yyresolveAction): Ditto.
11487 (yyglrShiftDefer): Update comment.
0435d061 11488 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
11489 (yyglrReduce): Ditto.
11490 (yydoAction): Ditto
0435d061 11491
6029a57f
PH
11492 * tests/glr-regr1.at: Rename to ...
11493 * tests/glr-regression.at: Add new regression test for the problems
11494 described above (adapted from S. Eken).
11495 Update copyright notice.
11496 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11497 * tests/Makefile.am: Ditto.
11498
6cee6297
PE
114992003-01-28 Paul Eggert <eggert@twinsun.com>
11500
11501 * data/lalr1.cc: Do not use @output_header_name@ unless
11502 b4_defines_flag is set. This fixes two bugs reported by
11503 Tim Van Holder in
161a71f3
PE
11504 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11505 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 11506
b2a836b5
PE
115072003-01-21 Paul Eggert <eggert@twinsun.com>
11508
11509 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11510 we don't need to worry about yyerrlab1 being reported as an
11511 "unused label" by non-GCC C compilers. The downside is that if
11512 locations are used then a couple of statements are duplicated each
11513 time YYERROR is invoked, but the upside is that the warnings
11514 should vanish.
11515 (yyerrlab1): Move code to YERROR.
11516 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11517 This reverts some of the 2002-12-27 change.
11518
4196b931
PE
115192003-01-17 Paul Eggert <eggert@twinsun.com>
11520
11521 * src/output.c (symbol_printers_output): Fix typo that led
11522 to core dump. Problem reported by Antonio Rus in
161a71f3 11523 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 11524
3ae831b4
AD
115252003-01-13 Akim Demaille <akim@epita.fr>,
11526 Quoc Peyrot <chojin@lrde.epita.fr>,
11527 Robert Anisko <anisko_r@lrde.epita.fr>
11528
11529 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11530 when the stacks contain one element, as the loop would otherwise
11531 free the last state, and then use the top state (the one we just
11532 popped). This means that the initial elements will not be freed
11533 explicitly, as is the case in yacc.c; it is not a problem, as
11534 these elements have fake values.
11535
e3aa65c5
PE
115362003-01-11 Paul Eggert <eggert@twinsun.com>
11537
11538 * NEWS: %expect-violations are now just warnings, reverting
11539 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11540 bootstrapping problem reported by Matthias Klose; see
161a71f3 11541 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
11542 * src/conflicts.c (conflicts_print): Likewise.
11543 * tests/conflicts.at (%expect not enough, %expect too much,
11544 %expect with reduce conflicts): Likewise.
11545 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11546 that the warning is enabled if the number of conflicts changes
11547 (not necessarily increases).
11548
11549 * src/getargs.c (version): Update copyright year.
11550
f0057011
AD
115512003-01-09 Akim Demaille <akim@epita.fr>
11552
11553 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11554
1ee6d2a0
PE
115552003-01-08 Paul Eggert <eggert@twinsun.com>
11556
11557 * Makefile.maint (WGETFLAGS):
11558 New macro, containing "-C off" to disable proxy caches.
11559 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11560 (rel-check): Use $(WGET) instead of wget.
11561
d4fd77c4
PE
115622003-01-06 Paul Eggert <eggert@twinsun.com>
11563
11564 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11565 the GLR paper of Scott, Johnstone and Hussain.
11566
464c6927
PE
115672003-01-04 Paul Eggert <eggert@twinsun.com>
11568
d600ee67
PE
11569 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11570 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11571 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11572 (EXTRA_LIBRARIES): New var, for liby.a.
11573 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11574 (EXTRA_SCRIPTS): New var, for yacc.
11575
464c6927
PE
11576 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11577 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11578 Problem reported by Nelson H. F. Beebe.
11579
115802003-01-03 Paul Eggert <eggert@twinsun.com>
11581
11582 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11583 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11584 when compiling Bison 1.875's `bitset bset = obstack_alloc
11585 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11586
11587 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11588 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11589 grow to a huge size with typical invocation.
d600ee67 11590
464c6927
PE
11591 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11592 Use the pattern recommended by Autoconf 2.57, except also protect
11593 against double-definition.
11594 * src/system.h: Likewise.
11595 Portability issues reported by Nelson H. F. Beebe.
d600ee67 11596
464c6927
PE
11597 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11598 All uses changed. Provide a definition in both C and C++.
11599 (yytrue, yyfalse): Define even if defined (__cplusplus).
11600
11601 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11602 Reported by Nelson H. F. Beebe.
d600ee67 11603
464c6927
PE
11604 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11605
0f42c7d5
PE
116062003-01-02 Paul Eggert <eggert@twinsun.com>
11607
11608 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11609 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11610 Bug reported by Nelson H. F. Beebe.
11611
dc546b0f
PE
116122003-01-01 Paul Eggert <eggert@twinsun.com>
11613
11614 * Version 1.875.
11615
2c09b6a7
PE
116162002-12-30 Paul Eggert <eggert@twinsun.com>
11617
11618 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11619 Moved here from...
11620 (<INITIAL>","): Here. This causes stray "," to be treated
11621 more uniformly.
11622
dc546b0f 11623 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
11624 last brace in braced code when not in Yacc mode, for compatibility
11625 with Bison 1.35. This resurrects the 2001-12-15 patch to
11626 src/reader.c.
11627
11628 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11629 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11630
535c0f63
PE
116312002-12-28 Paul Eggert <eggert@twinsun.com>
11632
11633 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11634 that of SYM's type. This fixes Debian bug 168069, reported by
11635 Thomas Olsson.
d600ee67 11636
963fcc17
PE
116372002-12-28 Paul Eggert <eggert@twinsun.com>
11638
11639 Version 1.75f.
11640
11641 Switch back to the Yacc style of conflict reports, undoing some
11642 of the 2002-07-30 change.
11643 * doc/bison.texinfo (Understanding): Use Yacc style for
11644 conflict reports. Also, use new way of locating rules.
11645 * src/conflicts.c (conflict_report):
11646 Renamed from conflict_report_yacc, removing the old
11647 'conflict_report'. Translate the entire conflict report at once,
11648 so that we don't assume that "," has the same interpretation in
11649 all languages.
11650 (conflicts_output): Use Yacc-style conflict report for each state,
11651 instead of our more-complicated style.
11652 (conflicts_print): Use Yacc-style conflict report, except print
11653 the input file name when not emulating Yacc.
11654 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11655 Conflicted Reduction, %expect not enough, %expect too much,
11656 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11657 * tests/existing.at (GNU Cim Grammar): Likewise.
11658 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11659
11660 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11661 fatal): Don't invoke fflush; it's not needed and it might even be
11662 harmful for stdout, as stdout might not be open.
11663 * src/reduce.c (reduce_print): Likewise.
11664
b1efe548
PE
116652002-12-27 Paul Eggert <eggert@twinsun.com>
11666
11667 Fix a bug where error locations were not being recorded correctly.
11668 This problem was originally reported by Paul Hilfinger in
161a71f3 11669 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
11670
11671 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11672 top of the location stack's error locations.
11673 (yyerrlab): Set it. When discarding a token, push its location
11674 onto yylerrsp so that we don't lose track of the error's end.
11675 (yyerrlab1): Now is only the target of YYERROR, so that we can
11676 properly record the location of the action that failed. For GCC
11677 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11678 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11679 (yyerrlab2): New label, which yyerrlab now falls through to.
11680 Compute the error's location by applying YYLLOC_DEFAULT to
11681 the locations of all the symbols that went into the error.
11682 * doc/bison.texinfo (Location Default Action): Mention that
11683 YYLLOC_DEFAULT is also invoked for syntax errors.
11684 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11685 Error locations include the locations of all the tokens that were
11686 discarded, not just the last token.
d600ee67 11687
983c5c2c
PE
116882002-12-26 Paul Eggert <eggert@twinsun.com>
11689
b1efe548
PE
11690 * src/files.c: Include quote.h.
11691 (compute_output_file_names): Warn if we detect conflicting
11692 outputs to the same file. This should catch the misunderstanding
11693 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11694
11695 * src/conflicts.c (conflicts_print): If the user specifies
11696 "%expect N", report an error if there are any reduce/reduce
11697 conflicts. This is what the manual says should happen.
11698 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11699 * tests/conflicts.at (%expect with reduce conflicts): New test.
11700
983c5c2c
PE
11701 Don't use m4_include on relative file names, as it doesn't work as
11702 desired if there happens to be a file with that name under ".".
d600ee67 11703
983c5c2c
PE
11704 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11705 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11706 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11707 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11708 * src/output.c (output_skeleton): Use full path names when
11709 specifying a file to include; don't rely on include path, as
11710 it's unreliable when the working file contains a file with
11711 that name.
d600ee67 11712
983c5c2c
PE
117132002-12-25 Paul Eggert <eggert@twinsun.com>
11714
11715 Remove obsolete references to bison.simple and bison.hairy.
11716 Problem mentioned by Aubin Mahe in
161a71f3 11717 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
11718 * data/glr.c: Comment fix.
11719 * doc/bison.1: Remove references. Also, mention "yacc".
11720
11721 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11722 with -g option.
11723
11724 * src/parse-gram.y (declaration): Use enum "report_states" rather
11725 than its numeric value 1.
11726
11727 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11728 opening a new one. This fixes Debian bug 165349, reported by
11729 Bruce Stephens.
11730
23f2d9dc
PE
117312002-12-24 Paul Eggert <eggert@twinsun.com>
11732
11733 Version 1.75e.
11734
11735 * Makefile.maint (cvs-update): Don't assume that the shell
11736 supports $(...), as Solaris sh doesn't.
11737
11738 * src/parse-gram.y (lloc_default): Remove test for empty
11739 nonterminals at the end, since it didn't change the result.
11740
117412002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
11742
11743 If the user does not define YYSTYPE as a macro, Bison now declares it
11744 using typedef instead of defining it as a macro. POSIX requires this.
11745 For consistency, YYLTYPE is also declared instead of defined.
11746
11747 %union directives can now have a tag before the `{', e.g., the
11748 directive `%union foo {...}' now generates the C code
11749 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11750 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11751 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11752 instead of `yyltype'.
11753
11754 `yystype' and `yyltype' are now obsolescent macros instead of being
11755 typedefs or tags; they are no longer documented and will be
11756 withdrawn in a future release.
11757
11758 * data/glr.c (b4_location_type): Remove.
11759 (YYSTYPE): Renamed from yystype.
11760 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11761 (struct YYLTYPE): Renamed from struct yyltype.
11762 (YYLTYPE): Renamed from yyltype.
11763 (yyltype, yystype): New (and obsolescent) macros,
11764 for backward compatibility.
11765 * data/yacc.c: Likewise.
11766
11767 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11768 does not specify a union tag. This is for compatibility with
11769 Solaris 9 yacc.
11770
11771 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11772 const *, since it is now modified by stripping surrounding { }.
11773 (current_braced_code): Remove.
11774 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11775 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11776 trailing " {...}". Now of type <chars>.
11777 (grammar_declaration): Adjust to bundled tokens.
11778 (code_content): Remove; stripping is now done by add_param.
11779 (print_token_value): Print contents of bundled tokens.
11780 (token_name): New function.
11781
11782 * src/reader.h (braced_code, current_braced_code): Remove.
11783 (token_name): New decl.
11784
11785 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11786 token_type, not braced_code code_kind. All uses changed.
11787 (SC_PRE_CODE): New state, for scanning after a keyword that
11788 has (or usually has) an immediately-following braced code.
11789 (token_type): New local var, to keep track of which token type
11790 to return when scanning braced code.
11791 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 11792 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
11793 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11794 instead of returning a token type immediately.
11795 (<INITIAL>"{"): Set token type.
11796 (<SC_BRACED_CODE>"}"): Use it.
11797 (handle_action_dollar, handle_action_at): Now returns bool
11798 indicating success. Fail if ! current_rule; this prevents a core dump.
11799 (handle_symbol_code_dollar, handle_symbol_code_at):
11800 Remove; merge body into caller.
11801 (handle_dollar, handle_at): Complain in invalid contexts.
11802
11803 * NEWS, doc/bison.texinfo: Document the above.
11804 * NEWS: Fix years and program names in copyright notice.
11805
879ca4f8
PE
118062002-12-17 Paul Eggert <eggert@twinsun.com>
11807
11808 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11809 Reporting, Table of Symbols): Omit mentions of %lex-param and
11810 %parse-param from the documentation for now.
11811
1c5fe69d
PE
118122002-12-15 Paul Eggert <eggert@twinsun.com>
11813
11814 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11815 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11816 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
11817 disagreed with the Bison documentation. Bug
11818 reported by Andrew Walrond.
d600ee67 11819
1c5fe69d
PE
11820 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11821 as the caller now does that.
11822 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11823 (YYEMPTY): Parenthesize right hand side, since others use it.
11824 (yyparse): Don't assume that our generated code is the only code
11825 that sets yychar.
11826
d1de5372
PE
118272002-12-13 Paul Eggert <eggert@twinsun.com>
11828
11829 Version 1.75d.
11830
11831 POSIX requires a "yacc" command.
11832 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11833 (MOSTLYCLEANFILES): Add yacc.
11834 (yacc): New rule.
1c5fe69d 11835 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
11836 as an alias for bison y.
11837
11838 * po/LINGUAS: Add da.
d600ee67 11839
d1de5372
PE
11840 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11841 problem with latest <getopt.h>.
11842 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11843
11844 * doc/fdl.texi: Upgrade to 1.2.
11845 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11846 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11847 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11848 gnulib.
11849 * config/install-sh: Sync with autotools.
11850
11851 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 11852 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
11853 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11854 locations are requested.
11855 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11856 locations are requested.
11857
d0f3fe23
PE
118582002-12-12 Paul Eggert <eggert@twinsun.com>
11859
11860 Remove unportable casts and storage allocation tricks.
11861 While we're at it, remove almost all casts, since they
11862 usually aren't needed and are a sign of trouble.
11863
11864 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11865
11866 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11867 the pointer DSET returned by malloc; this isn't portable.
11868 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11869 Similarly for DERIVES.
11870 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11871 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11872 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11873
11874 * src/derives.c (derives_compute): Do not bother invoking
11875 int_of_rule_number, since rule numbers are integers.
11876
11877 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11878 rather than XMALLOC (char, N).
11879
11880 * src/files.c (filename_split): Rewrite to avoid cast.
11881
11882 * src/gram.h (symbol_number_as_item_number,
11883 item_number_as_symbol_number, rule_number_as_item_number,
11884 item_number_as_rule_number):
11885 Now inline functions rather than macros, to avoid casts.
11886 * src/state.h (state_number_as_int): Likewise.
11887 * src/tables.c (state_number_to_vector_number,
11888 symbol_number_to_vector_number): Likewise.
11889
11890 * src/gram.h (int_of_rule_number): Remove; no longer used.
11891
11892 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11893 since the resulting storage is always stored into.
11894
11895 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11896 where it's needed.
11897
11898 * src/muscle_tab.c (muscle_m4_output):
11899 Now inline. Return bool, not int.
11900 * src/state.c (state_compare): Likewise.
11901 * src/symtab.c (symbol_check_defined,
11902 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11903 hash_compare_symbol, hash_symbol):
11904 Likewise.
11905 * src/uniqstr.c (uniqstr_print): Likewise.
11906 * src/muscle_tab.c (muscle_m4_output_processor):
11907 New function, to avoid casts.
11908 * src/state.c (state_comparator, stage_hasher): Likewise.
11909 * src/symtab.c (symbol_check_defined_processor,
11910 symbol_check_alias_consistency_processor, symbol_pack_processor,
11911 symbol_translation_processor, hash_symbol_comparator,
11912 hash_symbol_hasher): Likewise.
11913 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11914 * src/muscle_tab.c (muscles_m4_output):
11915 Use new functions instead of casting old functions unportably.
11916 * src/state.c (state_hash_new): Likewise.
11917 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11918 symbols_token_translations_init):
11919 Likewise.
11920 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11921
11922 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11923 var instead of casting to long, to avoid casts.
11924 (prepare_states): Use MALLOC rather than alloca, so that we don't
11925 have to worry about alloca.
11926 * src/state.c (state_hash_lookup): Likewise.
11927
11928 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11929 local var instead of casting to unsigned char, to avoid casts.
11930
11931 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11932 STATE_ALLOC): Remove.
11933 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11934 rather than calloc, and use offsetof to avoid allocating slightly
11935 too much storage.
11936 (state_new): Initialize all members.
11937
11938 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11939
11940 * src/symtab.c (symbol_free): Remove; unused.
11941 (symbol_get): Remove cast in lhs of assignment.
11942 (symbols_do): Now static. Accept generic arguments, not
11943 hashing-related ones.
11944
11945 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
11946 (symbol_processor): Remove.
11947 (symbols_do): Remove decl; now static.
11948
11949 * src/system.h (alloca): Remove; decl no longer needed.
11950 (<stddef.h>): Include, for offsetof.
11951 (<inttypes.>, <stdint.h>): Include if available.
11952 (uintptr_t): New type, if system lacks it.
11953 (CALLOC, MALLOC, REALLOC): New macros.
11954 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
11955 new macros.
11956
11957 * src/tables.c (table_size): Now int, to pacify GCC.
11958 (table_grow, table_ninf_remap): Use signed table size.
11959 (save_row): Don't bother initializing locals when not needed.
11960 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
11961 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
11962
11963 * src/vcg.h: Correct misspellings.
11964
11965 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
11966
11967
11968 * src/getargs.c (getargs): Don't assume EOF == -1.
11969
26b4a969
PE
119702002-12-09 Paul Eggert <eggert@twinsun.com>
11971
11972 Change identifier spellings to avoid collisions with names
11973 that are reserved by POSIX.
11974
11975 Don't use names ending in _t, since POSIX reserves them.
11976 For consistency, remove _e and _s endings -- they're weren't
11977 needed to remove ambiguity. All uses changed.
11978 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
11979 turn was just renamed from struniq_t.
11980 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
11981 which in turn was just renamed from struniq_processor_t.
11982 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
11983 in turn was renamed from hash_compare_struniq_t.
11984 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
11985 (state_list): Renamed from state_list_t.
11986 * src/assoc.h (assoc): Renamed from assoc_t.
11987 * src/conflicts.c (enum conflict_resolution): Renamed from
11988 enum conflict_resolution_e.
11989 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
11990 (rule_list): Renamed from rule_list_t.
11991 * src/getargs.h (enum trace): Renamed from enum trace_e.
11992 (enum report): Renamed from enum report_e.
11993 * src/gram.h (item_number): Renamed from item_number_t.
11994 (rule_number): Renamed from rule_number_t.
11995 (struct rule_s): Remove the "rule_s" part; not used.
11996 (rule): Renamed from rule_t.
11997 (rule_filter): Renamed from rule_filter_t.
11998 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
11999 (goto_list): Renamed from goto_list_t.
12000 * src/lalr.h (goto_number): Renamed from goto_number_t.
12001 * src/location.h (location): Renamed from location_t.
12002 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12003 and moved here from:
12004 * src/muscle_tab.h (muscle_entry_t): here.
12005 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12006 (rule_list): Renamed from rule_list_t.
12007 * src/print_graph.c (static_graph): Renamed from graph.
12008 * src/reader.h (braced_code): Renamed from braced_code_t.
12009 Remove brace_code_e tag.
12010 * src/relation.h (relation_node): Renamed from relation_node_t.
12011 (relation_nodes): Renamed from relation_nodes_t.
12012 (relation): Renamed from relation_t.
12013 * src/state.h (state_number): Renamed from state_number_t.
12014 (struct state): Renamed from struct state_s.
12015 (state): Renamed from state_t.
12016 (transitions): Renamed from transitions_t. Unused (and
12017 misspelled) transtion_s tag removed.
12018 (errs): Renamed from errs_t. Unused errs_s tag removed.
12019 (reductions): Renamed from reductions_t. Unused tag
12020 reductions_s removed.
12021 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12022 (struct symbol_list): Renamed from struct symbol_list_s.
12023 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12024 (struct symbol): Renamed from struct symbol_s.
12025 (symbol): Renamed from symbol_t.
12026 * src/tables.c (vector_number): Renamed from vector_number_t.
12027 (action_number): Renamed from action_t.
12028 * src/tables.h (base_number): Renamed from base_t.
12029 * src/vcg.h (enum color): Renamed from enum color_e.
12030 (enum textmode): Renamed from enum textmode_e.
12031 (enum shape): Renamed from enum shape_e.
12032 (struct colorentry): Renamed from struct colorentry_s.
12033 (struct classname): Renamed from struct classname_s.
12034 (struct infoname): Renamed from struct infoname_s.
12035 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12036 (enum decision): Renamed from enum decision_e.
12037 (enum orientation): Renamed from enum orientation_e.
12038 (enum alignment): Renamed from enum alignment_e.
12039 (enum arrow_mode): Renamed from enum arrow_mode_e.
12040 (enum crossing_type): Renamed from enum crossing_type_e.
12041 (enum view): Renamed from enum view_e.
12042 (struct node): Renamed from struct node_s.
12043 (node): Renamed from node_t.
12044 (enum linestyle): Renamed from enum linestyle_e.
12045 (enum arrowstyle): Renamed from enum arrowstyle_e.
12046 (struct edge): Renamed from struct edge.
12047 (edge): Renamed from edge_t.
12048 (struct graph): Renamed from struct graph_s.
12049 (graph): Renamed from graph_t.
12050 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12051 Rename value_t -> value.
12052 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12053 value_t_as_yystype -> value_as_yystype.
12054
12055 Don't include <errno.h> in the mainstream code, since it
12056 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12057 * lib/get-errno.c, lib/get-errno.h: New files.
12058 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12059 get-errno.c.
12060 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12061 * src/output.c (output_skeleton): Likewise.
12062 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12063 instead of errno.
12064 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12065 Likewise.
12066 (handle_action_dollar, handle_action_at): Likewise.
12067 * src/system.h: Do not include <errno.h>.
12068 (TAB_EXT): Renamed from EXT_TAB.
12069 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12070
12071 Avoid str[a-z]*, since <string.h> reserves that name space.
12072 Change all instances of "struniq" in names to "uniqstr", and
12073 likewise for "STRUNIQ" and "UNIQSTR".
12074 * src/uniqstr.c: Renamed from src/struniq.c.
12075 * src/uniqstr.h: Renamed from src/struniq.h.
12076 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12077 * src/files.c (strsuffix): Remove; unused.
12078 (concat2): Renamed from stringappend. Now static.
12079 * src/files.h (strsuffix, stringappend): Remove; unused.
12080 * src/parse-gram.y (<chars>): Renamed from <string>.
12081 (<uniqstr>): Renamed from <struniq>.
12082 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12083 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12084 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12085 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12086 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12087 (N_EXPAND): Renamed from N_STRETCH.
12088
12089 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12090 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12091 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12092 Remove; unused.
12093 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12094 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12095 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12096 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12097 (BASE_MAXIMUM): Renamed from BASE_MAX.
12098 (BASE_MINIMUM): Renamed from BASE_MIN.
12099 (ACTION_MAX): Remove; unused.
12100 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12101 Unnecessary casts removed from above defines.
12102
12103
12104 Fix misspelling in names.
12105 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12106 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12107 G_NODE_ALIGNEMENT.
12108
12109
12110 * lib/timevar.c (timevar_report): Renamed from time_report,
12111 for consistency with other names.
12112 * lib/timevar.h (timevar_report): New decl.
12113 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12114
12115
12116 Sort include-file uses.
12117
12118 Reorder all include files under src to be in the order "system.h".
12119 then the ../lib include files in angle brackets (alphabetized),
12120 then the . include files in double-quotes (alphabetized). Fix
12121 dependency breakages encountered in this process, as follows:
12122 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12123 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12124 * src/state.h: Include "symtab.h".
12125
996b1c7e
PE
121262002-12-08 Paul Eggert <eggert@twinsun.com>
12127
12128 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12129 since this causes problems when __file__ contains character
12130 sequences like "@" that are treated specially by src/scan-skel.l.
12131 Instead, just use the file's basename. This fixes the bug
12132 reported by Martin Mokrejs in
161a71f3 12133 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 12134
e19c4e5d
PE
121352002-12-06 Paul Eggert <eggert@twinsun.com>
12136
12137 Add support for rules that do not have trailing semicolons, as
12138 POSIX requires. Improve the quality of locations in Bison
12139 diagnostics.
26b4a969 12140
e19c4e5d
PE
12141 * src/location.c: Include <quotearg.h>.
12142 (empty_location): Now const.
12143 (location_print): New function. Follow the recommendation of the
12144 GNU Coding Standards for locations that span file boundaries.
12145 * src/location.h: Do not include <quotearg.h>; no longer needed.
12146 (boundary): New type.
12147 (location_t): Use it. This allows locations to span file boundaries.
12148 All member uses changed: file -> start.file or end.file (as needed),
12149 first_line -> start.line, first_column -> start.column,
12150 last_line -> end.line, last_column -> end.column.
12151 (equal_boundaries): New function.
12152 (LOCATION_RESET, LOCATION_STEP): Remove.
12153 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12154 (empty_location): Now const.
12155 (location_print): New decl.
12156 * src/parse-gram.y (lloc_default): New function, which handles
12157 empty locations more accurately.
12158 (YYLLOC_DEFAULT): Use it.
12159 (%token COLON): Remove.
12160 (%token ID_COLON): New token.
26b4a969 12161 (rules): Use it.
e19c4e5d
PE
12162 (declarations, rules): Remove trailing semicolon.
12163 (declaration, rules_or_grammar_declaration):
12164 Allow empty (";") declaration.
12165 (symbol_def): Remove empty actions; no longer needed.
12166 (rules_or_grammar_declaration): Remove trailing semicolon.
12167 (semi_colon.opt): Remove.
12168 * src/reader.h: Include location.h.
12169 (scanner_cursor): New decl.
12170 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12171 rolling our own.
12172 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12173 of *loc.
12174 (STEP): Remove. No longer needed, now that adjust_location does
12175 the work. All uses removed.
12176 (scanner_cursor): New var.
12177 (adjust_location): Renamed from extend_location. It now sets
12178 *loc and adjusts the scanner cursor. All uses changed.
12179 Don't bother testing for CR.
12180 (handle_syncline): Remove location arg; now updates scanner cursor.
12181 All callers changed.
12182 (unexpected_end_of_file): Now accepts start boundary of token or
12183 comment, not location. All callers changed. Update scanner cursor,
12184 not the location.
12185 (SC_AFTER_IDENTIFIER): New state.
12186 (context_state): Renamed from c_context. All uses changed.
12187 (id_loc, code_start, token_start): New local vars.
12188 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12189 processing of Yacc white space and equivalents here.
12190 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12191 instead of returning ID immediately, since we need to search for
12192 a subsequent colon.
12193 (<INITIAL>"'", "\""): Save token_start.
12194 (<INITIAL>"%{", "{", "%%"): Save code_start.
12195 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12196 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12197 BEGIN context_state at end, not INITIAL.
12198 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12199 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12200 Return correct token start.
12201 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12202 the start of a character, string or multiline comment is found.
12203 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12204 Reduction): Adjust reported locations to match the more-precise
12205 results now expected.
12206 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12207 * tests/reduce.at (Useless Rules, Reduced Automaton,
12208 Underivable Rules): Likewise.
12209 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12210 or "|"' now that so many other tokens are allowed by the new grammar.
12211
12212 * src/complain.h (current_file): Remove duplicate decl;
12213 current_file is now owned by files.h.
12214 * src/complain.c, src/scan-gram.l: Include files.h.
12215
122162002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 12217
e19c4e5d
PE
12218 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12219 promotes to int; it might be unsigned int.
12220 * data/yacc.c (yy_reduce_print): Likewise.
12221
12222 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12223 be #defined in the prologue, not in the Bison declarations.
12224 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 12225
b64755e3
PE
122262002-12-02 Paul Eggert <eggert@twinsun.com>
12227
12228 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12229 * lib/strtoul.c: New file, from gnulib.
12230 This fixes a porting bug reported by Peter Klein in
161a71f3 12231 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 12232
6e746484
PE
122332002-11-30 Paul Eggert <eggert@twinsun.com>
12234
b64755e3
PE
12235 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12236 and put only a forward declaration in the prologue. This is for
12237 consistency with the other scanner helper functions.
12238
6ba55592
PE
12239 Type clashes now generate warnings, not errors, since it
12240 appears that POSIX may allow some grammars with type clashes.
12241 * src/reader.c (grammar_current_rule_check): Warn about
12242 type clashes instead of complaining.
12243 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12244
6e746484
PE
12245 Add Yacc library, since POSIX requires it.
12246 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12247 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12248 * lib/main.c, lib/yyerror.c: New files.
12249
12250 gram_error can be static; it need not be extern.
12251 * src/reader.h (gram_error): Remove decl.
12252 * src/parse-gram.y (gram_error): Now static. Add static decl.
12253 (print_token_value): Omit parameter names from forward decl,
12254 for consistency.
12255
88510f9c
PE
122562002-11-29 Paul Eggert <eggert@twinsun.com>
12257
6e746484
PE
12258 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12259 be declared before being used. E.g., one should typically
12260 declare them in the prologue. Use GNU coding style in examples.
12261 Put "const" consistently after the type it modifies. Mention
12262 that C99 supports "inline". Mention that yyerror traditionally
12263 returns "int".
12264
88510f9c
PE
12265 %parse-param and %lex-param now take just one argument, the
12266 declaration; the argument name is deduced from the declaration.
12267
12268 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12269 Reporting, Table of Symbols): Document this.
12270 * src/parse-gram.y (add_param): New function.
12271 (COMMA): Remove.
12272 (declaration): Implement new rule for %parse-param and %lex-param.
12273 * src/scan-gram.l: "," now elicits a warning, rather than being
12274 a token; this is more compatible with byacc.
12275 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12276
bb92250c
PE
122772002-11-27 Paul Eggert <eggert@twinsun.com>
12278
12279 Rename identifiers to avoid real and potential collisions.
12280
12281 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12282 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 12283 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
12284 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12285 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12286 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12287 All uses changed.
12288 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12289 The name "yycontrol" violates the name space rules, and this stuff
12290 wasn't being used anyway.
12291 (input): Remove action; this stuff wasn't being used.
12292 (gram_error): Rename local variable yylloc -> loc.
12293 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12294 (YY_DECL): Don't use "yy" at start of local variables.
12295 All uses changed, e.g., yylloc -> loc.
12296 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12297 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12298 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12299 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12300
12301 * src/parse-gram.y (gram_error): loc is now const *.
12302 * src/reader.h (gram_error): Likewise.
12303
3af4feb2
PE
123042002-11-24 Paul Eggert <eggert@twinsun.com>
12305
12306 Version 1.75c.
12307
12308 * tests/actions.at (Actions after errors): Use an output format
12309 more similar to that of the Printers and Destructors test.
12310 Test the position of the ';' token too.
12311 (Printers and Destructors): Likewise.
12312 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12313 unnecessarily alarming people when the test fails.
12314
12315 * data/yacc.c (yyerrlab1): Move this label down, so that the
12316 parser does not discard the lookahead token if the user code
12317 invokes YYERROR. This change is required for POSIX conformance.
12318
12319 * lib/error.c: Sync with gnulib.
12320
123212002-11-22 Paul Eggert <eggert@twinsun.com>
12322
12323 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12324 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12325 * lib/xmalloc.c: Likewise.
26b4a969 12326
58004308
PE
123272002-11-20 Paul Eggert <eggert@twinsun.com>
12328
12329 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12330
123312002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 12332
58004308
PE
12333 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12334 should use `if (! x) abort ();' rather than `assert (x);', and
12335 anyway it's one less thing to worry about configuring.
12336
12337 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12338 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12339 and replace all instances of assert with abort.
12340 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12341 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12342
12343 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12344 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12345 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12346 hash_find_entry, hash_rehash, hash_insert): Likewise.
12347 * src/conflicts.c (resolve_sr_conflict): Likewise.
12348 * src/lalr.c (set_goto_map, map_goto): Likewise.
12349 * src/nullable.c (nullable_compute): Likewise.
12350 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12351 * src/reader.c (packgram, reader): Likewise.
12352 * src/state.c (state_new, state_free, state_transitions_set,
12353 state_reduction_find): Likewise.
12354 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12355 symbol_pack): Likewise.
12356 * src/tables.c (conflict_row, pack_vector): Likewise.
12357 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12358 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12359 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12360 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12361
12362 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12363 (ARGMATCH_CONSTRAINT): New macro.
12364 (ARGMATCH_ASSERT): Use it.
12365
12366 * src/system.h (verify): New macro.
12367 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12368 rather than assert.
12369 * src/tables.c (tables_generate): Likewise.
12370
12371 * src/struniq.c (struniq_assert): Now returns void, and aborts
12372 if the assertion is false.
12373 (struniq_assert_p): Remove.
12374 * src/struniq.h: Likewise.
12375
76ae8198
PE
123762002-11-18 Paul Eggert <eggert@twinsun.com>
12377
12378 * data/glr.c (yygetLRActions): Replace `yyindex' with
12379 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12380 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 12381 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 12382
d3c4e709
AD
123832002-11-18 Akim Demaille <akim@epita.fr>
12384
12385 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12386 space.
12387 From Tim Van Holder.
12388
8d8a7238
PE
123892002-11-17 Paul Eggert <eggert@twinsun.com>
12390
12391 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12392 to "SyntaxError" for consistency with my 2002-11-15 change.
12393
12394 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12395 not define to {}, since this breaks the common use of `YYDPRINTF
12396 ((...));' if a single statement is desired (e.g. before `else').
12397 Work around GCC warnings by surrounding corresponding calls with
12398 {} if needed.
12399 (yyhasResolvedValue): Remove unused function.
12400 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12401 loop body.
12402 (yyreportSyntaxError): Renamed from yyreportParseError.
12403 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12404 All uses changed.
12405 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12406 extern when possible. Remove unused initializations.
12407
b0937b22
AD
124082002-11-16 Akim Demaille <akim@epita.fr>
12409
12410 Augment the similarity between GLR and LALR traces.
12411
12412 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12413 (YY_REDUCE_PRINT): New.
12414 (yyparse): Use them.
12415 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12416 YYDPRINT here.
12417 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12418 state reached after the reduction/recovery, since...
12419 (yyparse, yyprocessOneStack): Report the state we are entering in.
12420
c5e3e510
AD
124212002-11-16 Akim Demaille <akim@epita.fr>
12422
12423 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12424 Add support for --trace=skeleton.
12425 * src/scan-skel.l: %option debug.
12426 Scan strings of non-@ or \n instead of character by character.
12427 (scan_skel): Handle trace_skeleton.
12428 (QPUTS): New.
12429 (@output_parser_name@, @output_header_name@): ``Restore'' their
12430 support (used to be M4 macros).
12431 * data/yacc.c: Quote larger chunks, a la glr.c.
12432 * data/lalr1.cc: Likewise.
12433 The header guards are no longer available, so use some other
12434 string than `YYLSP_NEEDED'.
12435
4c6cc1db
AD
124362002-11-16 Akim Demaille <akim@epita.fr>
12437
12438 Make the ``Printers and Destructors'' test more verbose, taking
12439 `yacc.c''s behavior as (possibly wrong) reference.
12440
12441 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12442 instead of fprint on stdout.
12443 Set and report the last_line of the symbols.
12444 Consistently display values and locations.
12445
6d9e8019
PE
124462002-11-16 Paul Eggert <eggert@twinsun.com>
12447
12448 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12449
6e649e65
PE
124502002-11-15 Paul Eggert <eggert@twinsun.com>
12451
b25d88f6
PE
12452 * tests/actions.at (Actions after errors): New test case.
12453
6e649e65
PE
12454 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12455 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12456 tests/action.at, tests/calc.at, tests/conflicts.at,
12457 tests/cxx-type.at, tests/regression.at:
12458 "parse error" -> "syntax error" for POSIX compatibility.
12459 "parsing stack overflow..." -> "parser stack overflow" so
12460 that code matches Bison documentation.
12461
0f39aab9
AD
124622002-11-15 Akim Demaille <akim@epita.fr>
12463
12464 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12465 take two BRACED_CODE, not two string_content.
12466 Free the scanner's obstack when we are done.
12467 (code_content): New.
12468 * tests/calc.at: Adjust.
12469 * doc/bison.texinfo: Adjust.
12470 Also, make sure to include the `,' for these declarations.
12471
761c1926
AD
124722002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12473
12474 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12475 definition; avoids potential autoreconf problems.
12476
b0f98b10
AD
124772002-11-15 Akim Demaille <akim@epita.fr>
12478
12479 Always check the value returned by yyparse.
12480
12481 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12482 returned by yyparse.
12483 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12484 Adjust calls.
12485 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12486 returned by yyparse.
12487
970785f1
PH
124882002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12489
12490 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12491 on input.at test.
12492
8fcc7db1
PE
124932002-11-14 Paul Eggert <eggert@twinsun.com>
12494
7ec1b48e
PE
12495 * src/output.c (output_skeleton): Call xfopen instead of
12496 duplicating xfopen's body.
12497
cfff7583 12498 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 12499 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 12500
8fcc7db1
PE
12501 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12502 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12503 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12504 file twice in the grammar, as an extra check.
12505
12506 * tests/input.at (Torturing the Scanner): Surround the
12507 backslash-newline tests with "#if 0", to make it less likely that
12508 we'll run into compiler bugs. Bring back solitary \ inside
12509 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 12510 test backslash-newline in C character constant.
8fcc7db1 12511
4e8d992c
AD
125122002-11-14 Akim Demaille <akim@epita.fr>
12513
12514 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12515 status of the compiler.
f32b346d 12516 Calling `exit 1' is no longer needed.
4e8d992c
AD
12517 Reported by Nelson H. F. Beebe.
12518
9501dc6e
AD
125192002-11-14 Akim Demaille <akim@epita.fr>
12520
12521 * tests/atlocal.in (CPPFLAGS): We have config.h.
12522 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12523 New.
12524 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12525 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12526 * tests/regression.at, tests/torture.at: Use them for all the
12527 grammars that are to be compiled.
12528 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12529 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12530 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12531
18b519c0
AD
125322002-11-14 Akim Demaille <akim@epita.fr>
12533
12534 * doc/bison.texinfo: Various formatting changes (alignments in
12535 samples, additional @group/@end group, GCS in samples.
12536 Use @deffn instead of simple @table to define the directives,
12537 macros, variables etc.
12538
9a86cdb9
PE
125392002-11-13 Paul Eggert <eggert@twinsun.com>
12540
daa33def 12541 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 12542 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 12543
daa33def 12544 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 12545 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
12546 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12547 * tests/headers.at (export YYLTYPE): Likewise.
12548
12549 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 12550 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 12551
9a86cdb9
PE
12552 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12553 comments, since they're not portable. Use GNU coding style.
12554
9c1e26bd
AD
125552002-11-13 Akim Demaille <akim@epita.fr>
12556
12557 * data/yacc.c: Leave bigger chunks of quoted text.
12558 (YYDSYMPRINTF): New.
12559 Use it to report symbol activities.
12560 * data/glr.c (YYDSYMPRINTF): New.
12561 Use it.
12562
87f721cc
PE
125632002-11-12 Paul Eggert <eggert@twinsun.com>
12564
12565 Version 1.75b.
12566
12567 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12568 (yyglrReduce): Return yyok, not 0.
12569 This should avoid the enumerated-type warnings reported
464c6927 12570 by Nelson H. F. Beebe in
161a71f3 12571 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
12572
12573 * lib/bbitset.h (BITSET_INLINE): Remove.
12574 * lib/bitset.h [! BITSET_INLINE]: Remove.
12575 (bitset_set, bitset_reset, bitset_test): Rename local vars
12576 to avoid shadowing warnings by GCC.
12577
12578 * data/glr.c (inline): Remove #define. It's the user's
12579 responsibility to #define it away, just like 'const'.
464c6927 12580 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 12581 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 12582
87f721cc
PE
12583 * Makefile.maint (po-check): Scan .l and .y files instead of the
12584 .c and the .h files that they generate. This fixes the bug
12585 reported by Tim Van Holder in:
161a71f3 12586 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
12587 Look for N_ as well as for _. Try to avoid matching #define for
12588 N_ and _.
12589 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12590 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12591 * src/scan-gram.l: Revamp regular expressions so that " and '
12592 do not confuse xgettext.
12593
12594 * src/struniq.h (struniq_new): Do not declare the return type
12595 to be 'const'; this violates the C standard.
12596 * src/struniq.c (struniq_new): Likewise.
12597
be14ade5
AD
125982002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12599
12600 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12601 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12602 linker.
12603
05291fbc
AD
126042002-11-12 Akim Demaille <akim@epita.fr>
12605
12606 * Makefile.maint: Sync with Autoconf:
12607 (local_updates): New.
12608
1f5fd52e
AD
126092002-11-12 Akim Demaille <akim@epita.fr>
12610
12611 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12612
283f1e64
AD
126132002-11-12 Akim Demaille <akim@epita.fr>
12614
12615 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12616 locations.
12617
886b69d1
AD
126182002-11-12 Akim Demaille <akim@epita.fr>
12619
12620 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12621 not yyvalue.
12622
3df37415
AD
126232002-11-12 Akim Demaille <akim@epita.fr>
12624
12625 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12626 Use it to test the GLR parser.
12627
7bd6c77e
AD
126282002-11-12 Akim Demaille <akim@epita.fr>
12629
12630 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12631 defines it.
12632 * data/glr.c (yystos): New.
12633 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12634 (YYDSYMPRINT): New.
12635 (yyval): Don't define it, it is handled via M4.
12636 (yyrecoverParseError): Free verbosely the discarded symbols.
12637 * data/yacc.c (yysymprint): Remove, rather...
12638 (b4_yysymprint_generate): invoke.
12639 * data/c.m4 (b4_yysymprint_generate): New.
12640 Accept pointers as arguments, as opposed to the version from
12641 yacc.c.
12642 (b4_yydestruct_generate): Likewise.
12643 * tests/cations.at (Printers and Destructors): Use Bison directives
12644 instead of CPP macros.
12645 Don't rely on internal details.
12646
b0400cc6
AD
126472002-11-12 Akim Demaille <akim@epita.fr>
12648
12649 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12650 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12651 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12652 it against YYEMPTY and so forth), work on yytoken (i.e., set
12653 it to YYEMPTY etc.).
12654 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12655 (b4_symbol_actions): Remove.
12656 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12657 for 0, end-of-input.
12658
72f889cc
AD
126592002-11-12 Akim Demaille <akim@epita.fr>
12660
12661 * doc/bison.texinfo (Destructor Decl): New.
12662
b1ae9233
AD
126632002-11-12 Akim Demaille <akim@epita.fr>
12664
12665 * src/tables.c (tables_generate): Use free for pointers that
12666 cannot be NULL, not XFREE.
12667 (pack_vector): Use assert, not fatal, for bound violations.
12668 * src/state.c (state_new): Likewise.
12669 * src/reader.c (reader): Likewise.
12670 * src/lalr.c (set_goto_map): Likewise.
72f889cc 12671 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
12672 the file name.
12673
7ec2d4cd
AD
126742002-11-12 Akim Demaille <akim@epita.fr>
12675
12676 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12677 Restore.
12678 * src/scan-gram.l (last_string): Is global to the file, not to
12679 yylex.
12680 * src/parse-gram.y (input): Don't append the epilogue here,
12681 (epilogue.opt): do it here, and free the scanner's obstack.
12682 * src/reader.c (epilogue_set): Rename as...
12683 (epilogue_augment): this.
12684 * data/c.m4 (b4_epilogue): Defaults to empty.
12685
573a6cd3
AD
126862002-11-12 Akim Demaille <akim@epita.fr>
12687
12688 * src/getargs.c (long_options): Remove duplicates.
12689 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12690 Remove.
12691 * doc/bison.rnh: Remove.
12692 * doc/bison.texinfo (VMS Invocation): Remove.
12693
95612cfa
AD
126942002-11-12 Akim Demaille <akim@epita.fr>
12695
12696 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12697 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12698
12699 Use struniq for symbols.
12700
12701 * src/symtab.h (symbol_t): The tag member is a struniq.
12702 (symbol_type_set): Adjust.
12703 * src/symtab.c (symbol_new): Takes a struniq.
12704 (symbol_free): Don't free the tag member.
12705 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12706 (hash_compare_symbol, hash_symbol): these.
12707 Use the fact that tags as struniqs.
12708 (symbol_get): Use struniq_new.
12709 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12710 Returns a strniq.
12711 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12712 and type members are struniqs.
12713 * src/reader.c (get_merge_function)
12714 (grammar_current_rule_merge_set): Adjust.
12715 (TYPE, current_type): Are struniq.
12716
12717 Use struniq for file names.
12718
12719 * src/files.h, src/files.c (infile): Split into...
12720 (grammar_file, current_file): these.
12721 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12722 * src/reduce.c (reduce_print): Likewise.
12723 * src/getargs.c (getargs): Likewise.
12724 * src/complain.h, src/complain.c: Likewise.
12725 * src/main.c (main): Call struniqs_new early enough to use it for
12726 file names.
12727 Don't free the input file name.
12728
3e6656f9
AD
127292002-11-12 Akim Demaille <akim@epita.fr>
12730
12731 * src/symtab.c (symbol_free): Remove dead deactivated code:
12732 type_name are properly removed.
12733 Don't use XFREE to free items that cannot be NULL.
12734 * src/struniq.h, src/struniq.c: New.
12735 * src/main.c (main): Initialize/free struniqs.
12736 * src/parse-gram.y (%union): Add astruniq member.
12737 (yyprint): Adjust.
12738 * src/scan-gram.l (<{tag}>): Return a struniq.
12739 Free the obstack bit that used to store it.
12740 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12741
7672019c
PE
127422002-11-11 Paul Eggert <eggert@twinsun.com>
12743
12744 Revamp to fix many (but not all) of the C- and M4-related quoting
12745 problems. Among other things, this fixes the Bison bug reported
12746 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 12747 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
12748
12749 Use new @ escapes consistently. Represent brackets with @{ and @}
12750 rather than @<:@ and @:>@, since this works a bit better with dumb
12751 editors like vi. Represent @ with @@, since @ is now consistently
12752 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12753 __ofile__, to avoid unexpected expansions. Similarly, use @output
12754 rather than #output.
12755
12756 * data/c.m4 (b4_copyright): Omit file name from comment, since
12757 the file name could contain "*/".
12758 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12759 be quoted. All uses changed.
12760
12761 * data/glr.c: Use new @ escapes consistently.
12762 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12763 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12764 Remove, since they couldn't handle arbitrary characters in file
12765 names.
12766 * data/lalr1.cc: Likewise.
12767 * data/yacc.c: Likewise.
12768
12769 * src/files.c (output_infix): Remove; all uses removed.
12770 * src/files.h: Likewise.
12771
12772 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12773 mishandled funny characters in file names, and anyway it isn't
12774 needed any more.
12775 * data/yacc.c: Likewise.
12776 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12777
12778 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12779 * data/yacc.c: Likewise.
12780
12781 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12782 strings now.
12783 (muscle_init): Quote filename as a C string.
12784 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12785 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12786 * src/output.c (escaped_file_name_output): New function.
12787 (prepare_symbols): Quote tokens for M4.
12788 (prepare): Don't insert output_infix, output_prefix,
12789 output_parser_name, output_header_name; this is now down by scan-skel.
12790 Insert skeleton as a C string.
12791
12792 * src/output.c (user_actions_output, symbol_destructors_output,
12793 symbol_printers_output): Quote filenames for C and M4.
12794 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12795
12796 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12797 escapes other than \\ and \'; this simplifies the code.
12798 (<SC_STRING>): Likewise, for \\ and \".
12799 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12800 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12801 Use new escapes @{ and @} for [ and ].
12802
12803 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12804 them with auto vars.
12805 Switch to new escape scheme, where @ is the escape character uniformly.
12806 Abort if a stray escape character is found. Avoid unbounded input
12807 buffer when parsing non-escaped text.
12808
12809 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12810 __oline__, #output, $@, and @{ do not have unintended meanings.
12811
acea4f3b
PE
128122002-11-09 Paul Eggert <eggert@twinsun.com>
12813
12814 Fix the test failure due to GCC warnings described in
161a71f3 12815 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
12816 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12817 evaluate to 0 if it's impossible for NINF to be in the respective
12818 table.
12819 (yygetLRActions, yyrecoverParseError): Use them.
12820
12821 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12822 counted in the token inserted at end of file. Now takes
12823 location_t *, not location_t, so that the location can be
12824 adjusted. All uses changed.
12825
12826 * tests/regression.at (Invalid inputs): Adjust wording in
12827 diagnostic to match the new behavior.
12828
12829 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12830 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12831 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12832 abort ();'. This reduces the runtime of the "Many lookaheads"
12833 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12834 GCC 3.2.
12835
20ef1ad5
PE
128362002-11-07 Paul Eggert <eggert@twinsun.com>
12837
12838 * src/parse-gram.y (CHARACTER): Remove unused token.
12839 All uses removed.
12840
12841 * src/scan-gram.l: Remove stack option. We no longer use the
12842 stack, since the stack was never deeper than 1; instead, use the
12843 new auto var c_context to record the stacked value.
12844
12845 Remove nounput option. At an unexpected end of file, we now unput
12846 the minimal input necessary to end cleanly; this simplifies the
12847 code.
12848
12849 Avoid unbounded token sizes where this is easy.
12850
12851 (unexpected_end_of_file): New function.
12852 Use it to systematize the error message on unexpected EOF.
12853 (last-string): Now auto, not static.
12854 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12855 (scanner_last_string_free): Remove; not used.
12856 (percent_percent_count): Move decl to just before use.
12857 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12858 not the (never otherwised-used) CHARACTER.
12859
93724f13
AD
128602002-11-07 Akim Demaille <akim@epita.fr>
12861
12862 Let yyerror always receive the msg as last argument, so that
12863 yyerror can be variadic.
12864
12865 * data/yacc.c (b4_yyerror_args): New.
12866 Use it when calling yyerror.
12867 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12868 Use it when calling yyerror.
12869 * doc/bison.texinfo (Error Reporting): Adjust.
12870 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12871 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12872
6e40b4eb
AD
128732002-11-06 Akim Demaille <akim@epita.fr>
12874
12875 #line should have quoted strings.
12876 Ideally, this should be done by m4_quotearg.
12877
12878 * src/scan-skel.l: Include quotearg.h.
12879 Quote __ofile__.
12880 * src/output.c (symbol_printers_output)
12881 (symbol_destructors_output): Quote the file name.
12882
2dfbfc12
AD
128832002-11-06 Akim Demaille <akim@epita.fr>
12884
12885 * tests/regression.at (Invalid inputs): Adjust to the recent
12886 messages.
12887
437c2d80
AD
128882002-11-06 Akim Demaille <akim@epita.fr>
12889
12890 Restore --no-lines.
12891 Reported by Jim Kent.
12892
12893 * data/c.m4 (b4_syncline): New.
12894 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12895 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12896 * src/output.c (user_actions_output): Likewise.
12897 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 12898 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 12899
900c5db5
AD
129002002-11-06 Akim Demaille <akim@epita.fr>
12901
12902 * src/main.c (main): Free `infile'.
12903 * src/scan-gram.l (handle_syncline): New.
12904 Recognize `#line'.
12905 * src/output.c (user_actions_output, symbol_destructors_output)
12906 (symbol_printers_output): Use the location's file name, not
12907 infile.
12908 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12909
e183b123 129102002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 12911
e183b123 12912 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 12913 either has GLR conflict entries.
e183b123 12914
193eb6b7
PE
129152002-11-05 Paul Eggert <eggert@twinsun.com>
12916
e183b123
PE
12917 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12918 "integer out of range" rather than "invalid value".
12919 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12920 accordingly.
12921
193eb6b7
PE
12922 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12923 Also, remove one static variable in the scanner.
12924
12925 * src/scan-gram.l (braces_level): Now auto, not static.
12926 Initialize to zero if the compiler is being picky.
12927 (INITIAL): Clear braces_level instead of incrementing it.
12928 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12929 as POSIX 1003.1-2001 requires.
12930 * src/system.h (IF_LINT): New macro, taken from coreutils.
12931 * configure.ac: Define "lint" if --enable-gcc-warnings.
12932
29c01725
AD
129332002-11-05 Akim Demaille <akim@epita.fr>
12934
12935 * src/scan-gram.l: When it starts with `%', complain about the
12936 whole directive, not just that `invalid character: %'.
12937
8aeac3ca
AD
129382002-11-04 Akim Demaille <akim@epita.fr>
12939
12940 * Makefile.maint: Update from Autoconf.
12941 (update, cvs-update, po-update, do-po-update): New.
12942
793a58bb
AD
129432002-11-04 Akim Demaille <akim@epita.fr>
12944
12945 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
12946 and yyerror.
12947 Have yyerror `use' its arguments.
12948 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
12949 returns true when location & yacc & pure & parse-param.
12950 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
12951
c4d720cd
AD
129522002-11-04 Akim Demaille <akim@epita.fr>
12953
12954 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
12955 clashes.
12956 * src/scan-gram.l: Use [\'] instead of ['] to pacify
12957 font-lock-mode.
12958 Use complain_at.
12959 Use quote, not quote_n since LOCATION_PRINT no longer uses the
12960 slot 0.
12961
613a0dc5
PE
129622002-11-03 Paul Eggert <eggert@twinsun.com>
12963
12964 * src/reader.c (get_merge_function, grammar_current_rule_check):
12965 Use consistent diagnostics for reporting type name clashes.
12966 Quote the types with <>, for consistency with Yacc.
12967 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
12968
2a8d363a
AD
129692002-11-03 Akim Demaille <akim@epita.fr>
12970
12971 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
12972 New.
12973 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
12974 (b4_parse_param): Remove.
12975 Use b4_identification.
12976 Propagate b4_pure_args where needed to pass them to yyerror.
12977 * data/glr.m4 (b4_parse_param): Remove.
12978 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
12979 (b4_lpure_formals): New.
12980 Use b4_identification.
12981 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
12982 b4_user_formals and b4_user_args.
12983 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
12984 (yyreportAmbiguity): When using a pure parser, also need
12985 the location, and the parse-params.
12986 Adjust callers.
12987 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
12988 When using a pure parser, also need the parse-params.
12989 Adjust callers.
12990 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
12991 (%pure-parser + %parse-param) LALR and GLR parsers.
12992 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
12993 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
12994 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
12995 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
12996 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
12997 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
12998 * doc/bison.texinfo: Untabify the whole file.
12999 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13000 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13001 (Error Reporting): Adjust to these new directives.
13002 Document %error-verbose, deprecate YYERROR_VERBOSE.
13003
9e32add8
AD
130042002-11-03 Akim Demaille <akim@epita.fr>
13005
13006 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13007 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13008 command line options.
13009 * tests/cxx-type.at: Formatting changes.
13010
b02d90a5
PE
130112002-11-03 Paul Eggert <eggert@twinsun.com>
13012
13013 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13014 to count columns correctly, and to check for invalid inputs.
9e32add8 13015
b02d90a5
PE
13016 Use mbsnwidth to count columns correctly. Account for tabs, too.
13017 Include mbswidth.h.
13018 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13019 (extend_location): New function.
13020 (YY_LINES): Remove.
13021
13022 Handle CRLF in C code rather than in Lex code.
13023 (YY_INPUT): New macro.
13024 (no_cr_read): New function.
13025
13026 Scan UCNs, even though we don't fully handle them yet.
13027 (convert_ucn_to_byte): New function.
13028
13029 Handle backslash-newline correctly in C code.
13030 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13031 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13032 all uses changed.
13033 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13034 Use {splice} wherever C allows backslash-newline.
13035 YY_STEP after space, newline, vertical-tab.
13036 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 13037
b02d90a5
PE
13038 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13039
13040 ({int}, handle_action_dollar, handle_action_at): Check for integer
13041 overflow.
9e32add8 13042
b02d90a5
PE
13043 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13044
13045 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13046 as well as \000. Check for UCHAR_MAX, not 255.
13047 Allow \x with an arbitrary positive number of digits, as in C.
13048 Check for overflow here.
13049 Allow \? and UCNs, for compatibility with C.
13050
13051 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13052 with quote slot used by complain_at.
13053
13054 * tests/input.at: Add tests for backslash-newline, m4 quotes
13055 in symbols, long literals, and funny escapes in strings.
13056
13057 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13058 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13059 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13060 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13061 * m4/mbswidth.m4: New file, from GNU coreutils.
13062
13063 * doc/bison.texinfo (Grammar Outline): Document // comments.
13064 (Symbols): Document that trigraphs have no special meaning in Bison,
13065 nor is backslash-newline allowed.
13066 (Actions): Document that trigraphs have no special meaning.
13067
13068 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13069 no longer used.
13070
130712002-11-02 Paul Eggert <eggert@twinsun.com>
13072
13073 * src/reader.c: Don't include quote.h; not needed.
13074 (get_merge_function): Reword warning to be consistent with
13075 type clash diagnostic in grammar_current_rule_check.
13076
13077 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13078 bug in trigraph handling.
13079
13080 * src/output.c (prepare_symbols): When printing token names,
13081 escape "[" as "@<:@" and likewise for "]".
13082
13083 * src/system.h (errno): Remove declaration, as we are now
13084 assuming C89 or better, and C89 guarantees errno.
13085
762b212b
PE
130862002-10-30 Paul Eggert <eggert@twinsun.com>
13087
13088 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13089 Check for close failures.
13090 * src/files.h (xfclose): Return void, not int, since it always
13091 returned zero.
13092 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13093 indicates one.
13094 * src/output.c (output_skeleton): Use xfclose rather than fclose
13095 and ferror. xfclose now checks ferror.
13096
13097 * data/glr.c (YYLEFTMOST_STATE): Remove.
13098 (yyreportTree): Use a stack-based leftmost state. This avoids
13099 our continuing battles with bogus warnings about initializers.
13100
56100c60
AD
131012002-10-30 Akim Demaille <akim@epita.fr>
13102
13103 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13104 #if.
13105
51b4a04c
PH
131062002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13107
13108 * tests/glr-regr1.at: New test for reported regressions.
13109 * tests/testsuite.at: Add glr-regr1.at test.
13110 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 13111
bf1ebda2
PE
131122002-10-24 Paul Eggert <eggert@twinsun.com>
13113
5c16c6b1
PE
13114 Version 1.75a.
13115
bf1ebda2
PE
13116 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13117 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13118 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13119 Don't assume strdup exists; POSIX says its an XSI extension.
13120 Check for buffer overflow on input.
13121
b526ee61
AD
131222002-10-24 Akim Demaille <akim@epita.fr>
13123
13124 * src/output.c (output_skeleton): Don't disable M4sugar comments
13125 too soon: it results in comments being expanded.
13126 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13127 first output.
13128
f1886bb2
AD
131292002-10-24 Akim Demaille <akim@epita.fr>
13130
13131 * data/yacc.c (m4_int_type): New.
13132 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13133 char' as only yacc.c wants K&R portability.
13134 * data/glr.c (yysigned_char): Remove.
13135 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13136 Reported by Quoc Peyrot.
13137
c5576256
PE
131382002-10-23 Paul Eggert <eggert@twinsun.com>
13139
13140 * src/main.c (main): With --trace=time, report times even if a
13141 non-fatal error occurs. Formerly, the times were reported in some
13142 such cases but not in others.
13143 * src/reader.c (reader): Just return if a complaint has been issued,
13144 instead of exiting, so that 'main' can report times.
13145
27b0ffea
AD
131462002-10-22 Akim Demaille <akim@epita.fr>
13147
13148 * src/system.h: Include sys/types.
13149 Reported by Bert Deknuydt.
13150
223a7883
PE
131512002-10-23 Paul Eggert <eggert@twinsun.com>
13152
13153 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13154 Suggested by Art Haas.
13155
131562002-10-22 Paul Eggert <eggert@twinsun.com>
13157
13158 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13159 decl; not needed any more.
13160 * src/main.c (main): Use return to exit, undoing yesterday's change.
13161 The last OS that we could find where this wouldn't work is
13162 SunOS 3.5, and that's too old to worry about now.
13163
13164 * data/glr.c (struct yyltype): Define members even when not
13165 doing locations. This is more consistent with yacc.c, and it
13166 works around the following bug reports:
161a71f3
PE
13167 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13168 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 13169
223a7883
PE
13170 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13171 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13172 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13173
8b76775a
AD
131742002-10-22 Akim Demaille <akim@epita.fr>
13175
13176 * data/README: New.
13177
6db10d14
PE
131782002-10-21 Paul Eggert <eggert@twinsun.com>
13179
13180 Be consistent about 'bool'; the old code used an enum in one
13181 module and an int in another, and this violates the C standard.
13182 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13183 * configure.ac (AC_HEADER_STDBOOL): Add.
13184 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13185 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13186 * src/symtab.c (hash_compare_symbol_t): Likewise.
13187 * src/system.h (bool, false, true): Use a definition consistent
13188 with ../lib/hash.c. All uses changed.
13189
13190 * src/complain.c (warning_issued): Renamed from warn_message_count,
13191 so that we needn't worry about integer overflow (!).
13192 Now of type bool. All uses changed.
13193 (complaint_issued): Renamed from complain_message_count; likewise.
13194
13195 * src/main.c (main): Use exit to exit with failure.
27b0ffea 13196
6db10d14
PE
13197 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13198 rather than 1 and 0.
13199 * src/main.c (main): Likewise.
13200 * src/getargs.c (getargs): Likewise.
13201 * src/reader.c (reader): Likewise.
13202
13203 * src/getarg.c (getargs): Remove duplicate code for
13204 "Try `bison --help'".
13205
13206 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13207 What was that "2" for?
13208
13209 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13210 * src/getargs.c (usage): Likewise.
13211
13212 * src/getargs.c (getargs): When there are too few operands, report
13213 the last one. When there are too many, report the first extra
13214 one. This is how diffutils does it.
13215
92a060fd
PE
132162002-10-20 Paul Eggert <eggert@twinsun.com>
13217
13218 Remove K&R vestiges.
13219 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13220 * src/complain.c (VA_START): Remove. Assume prototypes.
13221 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13222 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13223 fatal): Assume prototypes.
13224 * src/complain.h: Assume prototypes.
13225 * src/system.h (PARAMS): Remove.
13226 Include <limits.h> unconditionally, since it's guaranteeed even
13227 for a freestanding C89 compiler.
13228 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13229 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 13230
e7cb57c0
AD
132312002-10-20 Akim Demaille <akim@epita.fr>
13232
13233 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13234 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13235 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13236 (yyresolveStates, yyresolveAction, yyresolveStack)
13237 (yyprocessOneStack): Use them.
13238 (yy_reduce_print): New.
13239 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13240
0245f82d
AD
132412002-10-20 Akim Demaille <akim@epita.fr>
13242
13243 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13244 arguments and output `void'.
13245 (b4_c_function): Rename as...
13246 (b4_c_function_def): this.
13247 (b4_c_function_decl, b4_c_ansi_function_def)
13248 (b4_c_ansi_function_decl): New.
13249 Change the interpretation of the arguments: before `int, foo', now
13250 `int foo, foo'.
13251 * data/yacc.c (yyparse): Prototype and define thanks to these.
13252 Adjust b4_c_function_def uses.
13253 * data/glr.c (yyparse): Likewise, but ANSI only.
13254
39912f52
AD
132552002-10-20 Akim Demaille <akim@epita.fr>
13256
13257 * src/output.c (prepare): Move the definition of `tokens_number',
13258 `nterms_number', `undef_token_number', `user_token_number_max'
13259 to...
13260 (prepare_tokens): Here.
13261 (prepare_tokens): Rename as...
13262 (prepare_symbols): this.
13263 (prepare): Move the definition of `rules_number' to...
13264 (prepare_rules): here.
13265 (prepare): Move the definition of `last', `final_state_number',
13266 `states_number' to...
13267 (prepare_states): here.
13268 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13269
20c1e2ad
AD
132702002-10-20 Akim Demaille <akim@epita.fr>
13271
13272 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13273
21964f43
AD
132742002-10-20 Akim Demaille <akim@epita.fr>
13275
13276 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13277 * data/c.m4: here.
13278
66d30cd4
AD
132792002-10-20 Akim Demaille <akim@epita.fr>
13280
13281 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13282 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13283 `pair'.
13284 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13285 `name' to...
13286 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13287 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13288 These.
13289
95f2c9fe
PE
132902002-10-19 Paul Eggert <eggert@twinsun.com>
13291
13292 Do not create a temporary file, as that involves security and
13293 cleanup headaches. Instead, use a pair of pipes.
13294 Derived from a suggestion by Florian Krohm.
13295 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13296 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13297 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13298 (BISON_PREREQ_SUBPIPE): Add.
13299 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13300 Add subpipe.h, subpipe.c.
13301 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13302 * po/POTFILES.in: Add lib/subpipe.c.
13303 * src/output.c: Include "subpipe.h".
13304 (m4_invoke): Remove decl.
13305 (scan_skel): New decl.
13306 (output_skeleton): Use pipe rather than temporary file for m4 input.
13307 Check that m4sugar.m4 is readable, to avoid deadlock.
13308 Check for pipe I/O error.
13309 * src/scan-skel.l (readpipe): Remove decl.
13310 (scan_skel): New function, to be used in place of m4_invoke.
13311 Read from stream rather than file.
66d30cd4 13312
95f2c9fe
PE
13313 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13314 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13315 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13316 this generates a more-accurate value anyway.
13317
13318 * lib/timevar.c (timervar_accumulate): Rename locals to
13319 avoid confusion with similarly-named more-global.
13320 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13321
13322 * src/output.c (prepare): Use xstrdup to convert char const *
13323 to char *, to avoid GCC warning.
13324
c19988b7
AD
133252002-10-19 Akim Demaille <akim@epita.fr>
13326
13327 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13328 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13329 Use them to have `calc.y' ready for %pure-parser.
13330 * data/yacc.c (YYLEX): Pass a yylex return type to
13331 b4_c_function_call.
13332
ae7453f2
AD
133332002-10-19 Akim Demaille <akim@epita.fr>
13334
13335 Prototype support of %lex-param and %parse-param.
13336
13337 * src/parse-gram.y: Add the definition of the %lex-param and
13338 %parse-param tokens, plus their rules.
13339 Drop the `_' version of %glr-parser.
13340 Add the "," token.
13341 * src/scan-gram.l (INITIAL): Scan them.
13342 * src/muscle_tab.c: Comment changes.
13343 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13344 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13345 (muscle_entry_s): The `value' member is no longer const.
13346 Adjust all dependencies.
13347 * src/muscle_tab.c (muscle_init): Adjust: use
13348 MUSCLE_INSERT_STRING.
13349 Initialize the obstack earlier.
13350 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13351 (muscle_pair_list_grow): New.
13352 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13353 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13354 * tests/calc.at: Use %locations, not --locations.
13355 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13356
0e575721
AD
133572002-10-19 Akim Demaille <akim@epita.fr>
13358
13359 * src/getargs.c (usage): Take status as argument and exit
13360 accordingly.
13361 Report the traditional `Try ... --help' message when status != 0.
13362 (usage, version): Don't take a FILE * as arg, it is pointless.
13363 (getargs): When there is an incorrect number of arguments, make it
13364 an error, and report it GNUlically thanks to `usage ()'.
13365
724ce7f5
PE
133662002-10-18 Paul Eggert <eggert@twinsun.com>
13367
3a781eb2
PE
13368 * data/glr.c (yyreportParseError): Don't assume that sprintf
13369 yields the length of the printed string, as this is not true
13370 on SunOS 4.1.4. Reported by Peter Klein.
13371
724ce7f5
PE
13372 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13373 * tests/conflicts.at (%nonassoc and eof): Likewise.
13374 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13375
473d0a75
AD
133762002-10-17 Akim Demaille <akim@epita.fr>
13377
13378 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13379 * src/getargs.c (trace_types, trace_args): Adjust.
13380 * src/reader.c (grammar_current_rule_prec_set)
13381 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13382 Standardize error messages.
13383 And s/@prec/%prec/!
13384 (reader): Use trace_flag to enable scanner/parser debugging,
13385 instead of an adhoc scheme.
13386 * src/scan-gram.l: Remove trailing debugging code.
13387
e76d2469
PE
133882002-10-16 Paul Eggert <eggert@twinsun.com>
13389
93e2236a
PE
13390 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13391 MUSCLE_TAB_H.
13392
e76d2469
PE
13393 * NEWS: Officially drop support for building Bison with K&R C,
13394 since it didn't work anyway and it's not worth worrying about.
13395 * Makefile.maint (wget_files): Remove ansi2knr.c.
13396 (ansi2knr.c-url_prefix): Remove.
13397 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13398 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13399 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13400
5bd1c419
PE
134012002-10-15 Paul Eggert <eggert@twinsun.com>
13402
13403 Stop using the "enum_" trick for K&R-style function definitions;
13404 it confused me, and I was the author! Instead, assume that people
13405 who want to use K&R C compilers (when using these modules in GCC,
13406 perhaps?) will run ansi2knr.
13407
13408 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13409 All uses of "enum_" changed to "enum ".
13410 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13411 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 13412
5bd1c419
PE
13413 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13414 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13415 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13416 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13417 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13418 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13419 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13420 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13421 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13422 Use function prototypes; this removes the need for declaring
13423 static functions simply to provide their prototypes.
13424 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13425 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13426 bitset_count_, bitset_create, bitset_dump, bitset_first,
13427 bitset_free, bitset_init, bitset_last, bitset_next,
13428 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13429 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13430 bitset_print, bitset_release_memory, bitset_toggle_,
13431 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13432 debug_bitset): Likewise.
13433 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13434 * lib/bitset_stats.c (bitset_log_histogram_print,
13435 bitset_percent_histogram_print, bitset_stats_and,
13436 bitset_stats_and_cmp, bitset_stats_and_or,
13437 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13438 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13439 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13440 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13441 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13442 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13443 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13444 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13445 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13446 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13447 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13448 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13449 bitset_stats_zero): Likewise.
13450 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13451 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13452 bitsetv_dump, debug_bitsetv): Likewise.
13453 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13454 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13455 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13456 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13457 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13458 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13459 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13460 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13461 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13462 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13463 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13464 Likewise.
13465 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13466 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13467 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13468 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13469 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13470 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13471 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13472 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13473 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13474 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13475 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 13476
ae26e1f0
AD
134772002-10-14 Akim Demaille <akim@epita.fr>
13478
13479 Version 1.75.
13480
d43baf71
AD
134812002-10-14 Akim Demaille <akim@epita.fr>
13482
13483 * tests/Makefile.am (maintainer-check-posix): New.
13484
7ebc83e3
AD
134852002-10-14 Akim Demaille <akim@epita.fr>
13486
13487 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13488 member.
13489
05846dae
AD
134902002-10-14 Akim Demaille <akim@epita.fr>
13491
13492 * src/tables.c (table_ninf_remap): base -> tab.
13493 Reported by Matt Rosing.
13494
1318e37d
PE
134952002-10-14 Paul Eggert <eggert@twinsun.com>
13496
447fbb17
PE
13497 * tests/action.at, tests/calc.at, tests/conflicts.at,
13498 tests/cxx-type.at, tests/headers.at, tests/input.at,
13499 tests/regression.at, tests/synclines.at, tests/torture.at:
13500 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13501 so that the tests still work even if POSIXLY_CORRECT is set.
13502 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 13503
1318e37d
PE
13504 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13505 for portability to K&R hosts. Fix typo: signed char is guaranteed
13506 only to 127, not to 128.
13507 * data/glr.c (yysigned_char): New type.
13508 * data/yacc.c (yysigned_char): Likewise.
13509 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13510
cc0f0794
PE
135112002-10-13 Paul Eggert <eggert@twinsun.com>
13512
5038f418
PE
13513 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13514 true due to limited range of data type" warning from GCC.
13515
cc0f0794
PE
13516 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13517 by wrapping enum yytokentype's definition inside #ifndef
13518 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13519
6fed0802
AD
135202002-10-13 Akim Demaille <akim@epita.fr>
13521
13522 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13523 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13524
32f0598d
AD
135252002-10-13 Akim Demaille <akim@epita.fr>
13526
13527 * Makefile.maint: Update from Autoconf 2.54.
13528 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13529
7ea9a33f
AD
135302002-10-13 Akim Demaille <akim@epita.fr>
13531
13532 * src/print.c (print_state): Separate the list of solved conflicts
13533 from the other items.
13534 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13535
ea99527d
AD
135362002-10-13 Akim Demaille <akim@epita.fr>
13537
13538 Let nondeterministic skeletons be usable with deterministic
13539 tables.
13540
13541 With the patch, GAWK compiled by GCC without -O2 passes its test
13542 suite using a GLR parser driven by LALR tables. It fails with -O2
13543 because `struct stat' gives two different answers on my machine:
13544 88 (definition of an auto var) and later 96 (memset on this var).
13545 Hence the stack is badly corrumpted. The headers inclusion is to
13546 blame: if I move the awk.h inclusion before GLR's system header
13547 inclusion, the two struct stat have the same size.
13548
13549 * src/tables.c (pack_table): Always create conflict_table.
13550 (token_actions): Always create conflict_list.
13551 * data/glr.c (YYFLAG): Remove, unused.
13552
f377f69f
AD
135532002-10-13 Akim Demaille <akim@epita.fr>
13554
13555 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13556 (O0FLAGS): New.
13557 (VALGRIND, GXX): New.
13558 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13559 * tests/bison.in: Run $PREBISON a pre-command.
13560 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13561 (maintainer-check-g++): New.
13562 * Makefile.am (maintainer-check): New.
13563
2a1fe6ed
AD
135642002-10-13 Akim Demaille <akim@epita.fr>
13565
13566 * data/glr.c: Formatting changes.
13567 Tweak some trace messages to match yacc.c's.
13568
f50adbbd
AD
135692002-10-13 Akim Demaille <akim@epita.fr>
13570
13571 GLR parsers sometimes raise parse errors instead of performing the
13572 default reduction.
13573 Reported by Charles-Henry de Boysson.
13574
13575 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 13576 check the length of the traces when %glr.
f50adbbd
AD
13577 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13578 GLR's traces.
13579 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13580 Test GLR parsers.
13581 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13582 (yyltype): Remove the yy prefix from the member names.
13583 (yytable): Complete its comment.
13584 (yygetLRActions): Map error action number from YYTABLE from
13585 YYTABLE_NINF to 0.
13586 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13587 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13588 not satisfying as we could compare an YYACTION computed from
13589 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13590 only value for error actions.
13591 (yyreportParseError): In verbose parse error messages, don't issue
13592 `error' in the list of expected tokens.
13593 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13594 next action to perform to match glr.c's decoding.
13595 (yytable): Complete its comment.
13596
bcbad5b9
PE
135972002-10-13 Paul Eggert <eggert@twinsun.com>
13598
13599 Fix problem reported by Henrik Grubbstroem in
161a71f3 13600 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
13601 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13602 because the Bison parser reads the second action before reducing
13603 the first one.
13604 * src/scan-gram.l (rule_length): New static var.
13605 Use it to keep track of the rule length in the scanner, since
13606 we can't expect the parser to be in lock-step sync with the scanner.
13607 (handle_action_dollar, handle_action_at): Use this var.
13608 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 13609
14904b89
PE
136102002-10-12 Paul Eggert <eggert@twinsun.com>
13611
1fe611e5
PE
13612 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13613 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13614 Include <sys/time.h> when checking for clock_t and struct tms.
13615 Use same include order as source.
13616 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 13617 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 13618
1fe611e5
PE
13619 * lib/timevar.c: Update copyright date and clarify comments.
13620 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 13621
1fe611e5
PE
13622 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13623 GCC version as of today, then merge Bison's changes.
13624 Change "GCC" to "Bison" in copyright notice. timevar.def's
13625 author is Akim, so change that too.
13626
98194095
PE
13627 * src/reader.c (grammar_current_rule_check):
13628 Don't worry about the default action if $$ is untyped.
13629 Prevents bogus warnings reported by Jim Gifford in
161a71f3 13630 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 13631
14904b89
PE
13632 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13633 * data/glr.c, data/lalr1.cc, data/yacc.c:
13634 Output token definitions before the first part of user declarations.
13635 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 13636 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 13637
ff6dca18
PE
136382002-10-11 Paul Eggert <eggert@twinsun.com>
13639
13640 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13641 (yyparse): here. This undoes some of the 2002-07-25 change.
13642 Compatibility problem reported by Ralf S. Engelschall with
13643 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13644
eb714592
AD
136452002-10-11 Akim Demaille <akim@epita.fr>
13646
13647 * tests/regression.at Characters Escapes): New.
13648 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13649 characters.
13650 Reported by Jan Nieuwenhuizen.
13651
b7195100
AD
136522002-10-11 Akim Demaille <akim@epita.fr>
13653
13654 * po/id.po: New.
13655
f28a0f2d
PE
136562002-10-10 Paul Eggert <eggert@twinsun.com>
13657
13658 Portability fixes for bitsets; this also avoids several GCC
13659 warnings.
13660
13661 * lib/abitset.c: Include <stddef.h>, for offsetof.
13662 * lib/lbitset.c: Likewise.
13663
13664 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13665 properly for vectors of objects. Do not assume that adding a
13666 header size to a multiple of a word size yields a value that is
13667 properly aligned for the whole union.
13668 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13669
13670 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13671 unique names for structures.
13672 * lib/ebitset.c (ebitset_bytes): Likewise.
13673 * lib/lbitset.c (lbitset_bytes): Likewise.
13674
13675 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13676 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13677 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13678 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13679 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13680 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13681 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13682 to improve the type-checking that GCC can do.
13683 * lib/bitset.c (bitset_op4_cmp): Likewise.
13684 * lib/bitset_stats.c (bitset_stats_count,
13685 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13686 bitset_stats_copy, bitset_stats_disjoint_p,
13687 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13688 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13689 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13690 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13691 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13692 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13693 bitset_stats_or_and_cmp): Likewise.
13694 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13695 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13696 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13697 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13698
13699 * lib/abitset.h: Include bitset.h, not bbitset.h.
13700 * lib/ebitset.h: Likewise.
13701 * lib/lbitset.h: Likewise.
13702
13703 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13704 All instances of parameters of type enum bitset_opts are now of
13705 type enum_bitset_opts, to conform to the C Standard, and similarly
13706 for enum_bitset_type.
13707 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13708 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13709
13710 Do not use "struct bitset_struct" to mean different things in
13711 different modules. Not only is this confusing, it violates
13712 the C Standard, which requires that structure types in different
13713 modules must be compatible if one is to be passed to the other.
13714 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13715 All instances of "struct bitset_struct *" replaced with "bitset".
13716 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13717 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13718 struct lbitset_struct, struct bitset_stats_struct): New types.
13719 All uses of struct bitset_struct changed to union bitset_union,
13720 etc.
ba0fe3c7 13721 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
13722 struct bitset_struct): Remove.
13723 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13724 struct bitset_struct): Remove.
13725 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13726 bitset_struct): Remove.
13727 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13728 Likewise.
13729
13730 Do not call a function of type T using a call that assumes the
13731 function is of a different type U. Standard C requires that a
13732 function must be called with a type that is compatible with its
13733 definition.
13734 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13735 New decls.
13736 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13737 New functions.
13738 * lib/ebitset.c (PFV): Remove.
13739 * lib/lbitset.c (PFV): Likewise.
13740 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13741 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13742 decls.
13743 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13744 (ebitset_vtable): Use them.
13745 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13746 lbitset_xor): New functions.
13747 (lbitset_vtable): Use them.
13748
13749 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13750 Declare.
13751
13752 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13753 GCC warning.
13754 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13755 Use offsetof, for simplicity.
13756
6fbe4984
PE
137572002-10-06 Paul Eggert <eggert@twinsun.com>
13758
13759 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13760 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 13761 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
13762 which was inadvertently undone by the 2002-09-30 patch.
13763 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13764 the same width as int.
13765
420f93c8
PE
137662002-10-04 Paul Eggert <eggert@twinsun.com>
13767
13768 Version 1.50.
13769
13770 * configure.ac (AC_INIT), NEWS: Increment version number.
13771
13772 * doc/bison.texinfo: Minor spelling, grammar, and white space
13773 fixes.
13774 (Symbols): Mention that any negative value returned from yylex
13775 signifies end-of-input. Warn about negative chars. Mention
13776 the portable Standard C character set.
13777
13778 The GNU coding standard says CFLAGS and YFLAGS are reserved
13779 for the installer to set.
13780 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13781 * src/Makefile.am (AM_CFLAGS): Likewise.
13782 (AM_YFLAGS): Renamed from YFLAGS.
13783
13784 Fix some MAX and MIN problems.
13785 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13786 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13787 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13788 * src/reader.c (reader): Use it.
13789
13790 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13791 POSIX 1003.1-2001 has removed fgrep.
13792
137932002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13794
13795 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13796 interpreted as signed.
13797 * lib/ebitset.c (ebitset_list): Fix bug.
13798
ff68026d
PE
137992002-10-01 Paul Eggert <eggert@twinsun.com>
13800
13801 More fixes for 64-bit hosts and large bitsets.
13802
13803 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13804 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13805 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13806 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13807 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13808 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13809 bitset_count_): Likewise.
13810 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13811 bitset_first, bitset_last): Likewise.
13812 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13813 bitset_stats_list_reverse, bitset_stats_size,
13814 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13815 Likewise.
13816 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13817 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13818 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13819 bitsetv_reflexive_transitive_closure): Likewise.
13820 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13821 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13822 Likewise.
13823 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13824 Likewise.
420f93c8 13825
ff68026d
PE
13826 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13827 Use size_t, not unsigned int, to count bytes.
13828 * lib/abitset.h (abitset_bytes): Likewise.
13829 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13830 Likewise.
13831 * lib/bitset.h (bitset_bytes): Likewise.
13832 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13833 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13834 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13835 * lib/ebitset.c (ebitset_bytes): Likewise.
13836 * lib/ebitset.h (ebitset_bytes): Likewise.
13837 * lib/lbitset.c (lbitset_bytes): Likewise.
13838 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 13839
ff68026d
PE
13840 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13841 abitset_subset_p, abitset_disjoint_p, abitset_and,
13842 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13843 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13844 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13845 abitset_or_and, abitset_or_and_cmp):
13846 Use bitset_windex instead of unsigned int.
13847 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13848 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13849 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13850 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13851 Likewise.
13852 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 13853
ff68026d
PE
13854 * lib/bitset.c (bitset_print):
13855 Use proper printf formats for widths of integer types.
13856 * lib/bitset_stats.c (bitset_percent_histogram_print,
13857 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13858 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13859 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13860 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 13861
ff68026d
PE
13862 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13863 BITSET_SIZE_MAX): New macros.
13864 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13865 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13866 to BITSET_WINDEX_MAX.
13867
13868 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13869 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13870 since we now return the bitset_bindex type (not int).
13871
13872 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13873 when computing sizes.
13874 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13875
13876 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13877 and avoid cast to unsigned.
13878
6aa452a6
AD
138792002-09-30 Akim Demaille <akim@epita.fr>
13880
13881 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13882 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13883 Updates from Michael Hayes.
13884
927f7817
AD
138852002-09-30 Art Haas <ahaas@neosoft.com>
13886
13887 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13888 invocations.
13889 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13890 defined.
13891
9738f41e
AD
138922002-09-27 Akim Demaille <akim@epita.fr>
13893
13894 Version 1.49c.
13895
a5c75d7f
AD
138962002-09-27 Akim Demaille <akim@epita.fr>
13897
13898 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13899 (Because of AC_LIBSOURCE).
13900
8280e179
AD
139012002-09-27 Akim Demaille <akim@epita.fr>
13902
13903 Playing with Autoscan.
13904
13905 * configure.ac: Remove the old LIBOBJ tweaks.
13906 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13907 * lib/strrchr.c: New.
13908 * lib/strtol.c: New, from the Coreutils 4.5.1.
13909
ae64af35
AD
139102002-09-27 Akim Demaille <akim@epita.fr>
13911
13912 Playing with Autoscan.
13913
13914 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13915 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13916 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13917 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13918 Coreutils 4.5.1.
13919
d1a1114f
AD
139202002-09-24 Akim Demaille <akim@epita.fr>
13921
13922 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13923 (Frequently Asked Questions, Parser Stack Overflow): New.
13924
b906441c
AD
139252002-09-13 Akim Demaille <akim@epita.fr>
13926
13927 Playing with autoscan.
13928
13929 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13930 * src/files.c (skeleton_find): Remove, unused.
13931 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13932 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13933
bd701811
AD
139342002-09-13 Akim Demaille <akim@epita.fr>
13935
13936 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13937 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13938
e0a13e7b
AD
139392002-09-13 Akim Demaille <akim@epita.fr>
13940
13941 * configure.ac: Require 2.54.
13942 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
13943 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
13944 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
13945 Remove, provided by Autoconf macros.
13946
c97011bf
AD
139472002-09-12 Akim Demaille <akim@epita.fr>
13948
13949 * m4/prereq.m4: Update, from Coreutils 4.5.1.
13950
d862b1be
AD
139512002-09-12 Akim Demaille <akim@epita.fr>
13952
13953 * m4/prereq.m4: Update, from Fileutils 4.1.5.
13954 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
13955 Reported by Martin Mokrejs.
13956
3d38c03a
AD
139572002-09-10 Akim Demaille <akim@epita.fr>
13958
13959 * src/parse-gram.y: Associate a human readable string to each
13960 token type.
13961 * tests/regression.at (Invalid inputs): Adjust.
13962
b6347355
AD
139632002-09-10 Gary V. Vaughan <gary@gnu.org>
13964
13965 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
13966 with an Autoconf-2.5x style configure.ac.
13967
09ba4ab2
PE
139682002-09-06 Paul Eggert <eggert@twinsun.com>
13969
13970 * doc/bison.texinfo (Conditions): Make explicit that the GPL
13971 exception applies only to yacc.c. This is a modification of a
13972 patch originally suggested by Akim Demaille.
13973
21846f69
AD
139742002-09-06 Akim Demaille <akim@epita.fr>
13975
09ba4ab2
PE
13976 * data/c.m4 (b4_copyright): Move the GPL exception comment from
13977 here to...
13978 * data/yacc.c: here.
13979
21846f69
AD
13980 * data/lalr1.cc (struct yyltype): Don't define it, since we use
13981 LocationType.
13982 (b4_ltype): Default to yy::Location from location.hh.
13983
c0ad8bf3
AD
139842002-09-04 Jim Meyering <jim@meyering.net>
13985
13986 * data/yacc.c: Guard the declaration of yytoknum also with
13987 `#ifdef YYPRINT', so it is declared only when used.
13988
3a93251e
AD
139892002-09-04 Akim Demaille <akim@epita.fr>
13990
13991 * configure.in: Rename as...
13992 * configure.ac: this.
13993 Bump to 1.49c.
13994
427c0dda
AD
139952002-09-04 Akim Demaille <akim@epita.fr>
13996
13997 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
13998 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
13999 translate maintainer only messages.
14000
6a254321
PE
140012002-08-12 Paul Eggert <eggert@twinsun.com>
14002
645e30d1
PE
14003 Version 1.49b.
14004
6a254321
PE
14005 * Makefile.am (SUBDIRS): Remove intl.
14006 (DISTCLEANFILES): Remove.
14007 * NEWS: Mention that GNU M4 is now required. Clarify what is
14008 meant by "larger grammars". Mention the pt_BR translation.
14009 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14010 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14011 Bump version from 0.11.2 to 0.11.5.
14012 (BISON_PREREQ_STAGE): Remove.
14013 (AM_GNU_GETTEXT): Use external gettext.
14014 (AC_OUTPUT): Remove intl/Makefile.
14015
14016 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14017
14018 * data/glr.c: Include string.h, for strlen.
14019 (yyreportParseError): Use size_t for yysize.
14020 (yy_yypstack): No longer nested inside yypstates, as nested
14021 functions are not portable. Do not assume size_t is the
14022 same width as int.
14023 (yypstates): Do not assume that ptrdiff_t is the same width
14024 as int, and similarly for yyposn and YYINDEX.
14025
14026 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14027
14028 * lib/Makefile.am (INCLUDES): Do not include from the intl
14029 directory, which has been removed.
14030 * src/Makefile.am (INCLUDES): Likewise.
14031
14032 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14033 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14034 New vars.
14035
14036 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14037 * tests/Makefile.am (EXTRA_DIST): Likewise.
14038
14039 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14040 Do not assume that bitset_windex is the same width as unsigned.
14041
14042 * lib/abitset.c (abitset_unused_clear): Do not assume that
14043 bitset_word is the same width as int.
14044 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14045 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14046 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14047 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14048 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14049
14050 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14051 portability to one's complement hosts!).
14052 * lib/ebitset.c (ebitset_op1): Likewise.
14053 * lib/lbitset.c (lbitset_op1): Likewise.
14054
14055 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14056 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14057 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14058 Sync with fileutils.
14059 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14060 lib/gettext.h: Sync with diffutils.
14061
14062 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14063 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14064
14065 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14066 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14067 check for void *.
14068
14069 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14070 size_t; the old version tried to do this but casted improperly.
14071 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14072 (bitset_test): Now returns int, not unsigned long.
14073
14074 * lib/bitset_stats.c: Include "gettext.h".
14075 (_): New macro.
14076 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14077 name locals "index", as it generates unnecessary warnings on some
14078 hosts that have an "index" function.
14079
14080 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14081 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14082 they need translation.
14083 * src/LR0.c (state_list_append, new_itemsets, get_state,
14084 append_states, generate_states): Likewise.
14085 * src/assoc.c (assoc_to_string): Likewise.
14086 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14087 * src/gram.c (grammar_dump): Likewise.
14088 * src/injections.c (injections_compute): Likewise.
14089 * src/lalr.c (lookaheads_print): Likewise.
14090 * src/relation.c (relation_transpose): Likewise.
14091 * src/scan-gram.l: Likewise.
14092 * src/tables.c (table_grow, pack_vector): Likewise.
14093
14094 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14095 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14096 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14097 * m4/mbstate_t.m4: Sync with fileutils.
14098 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14099
14100 * po/LINGUAS: Add pt_BR.
14101 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14102 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14103 lib/timevar.c.
14104 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14105 manual recommends.
14106 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14107
14108 * src/complain.c (strerror_r): Remove decl; not needed.
14109 (strerror): Use same pattern as ../lib/error.c.
14110
14111 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14112
14113 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14114
14115 * src/main.c (main): Cast result of bindtextdomain and textdomain
14116 to void, to avoid a GCC warning when --disable-nls is in effect.
14117
14118 * src/scan-gram.l: Use strings rather than escapes when possible,
14119 to minimize the number of warnings from xgettext.
14120 (handle_action_dollar, handle_action_at): Don't use isdigit,
14121 as it mishandles negative chars and it may not work as expected
14122 outside the C locale.
14123
14124 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14125 this is a GCC extension and is not portable to other compilers.
14126
14127 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14128 Do not include <ctype.h>; no longer needed.
14129 Do not include <malloc.h>; no longer needed (and generates
14130 warnings on OpenBSD 3.0).
14131
14132 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14133 it's not portable.
14134
14135 * tests/regression.at: Do not use 'cc -c input.c -o input';
14136 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14137
14138 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14139 exit status as failure, not just exit status 1. Sun C exits
14140 with status 2 sometimes.
14141
14142 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14143 Use it for the two large tests.
14144
c8f002c7
AD
141452002-08-02 Akim Demaille <akim@epita.fr>
14146
14147 * src/conflicts.c (conflicts_output): Don't output rules never
14148 reduced here, since anyway that computation doesn't work.
14149 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14150 (rule_useless_p, rule_never_reduced_p): New.
14151 (grammar_rules_partial_print): Use a filter instead of a range.
14152 Display the title only if needed.
14153 (grammar_rules_print): Adjust.
14154 (grammar_rules_never_reduced_report): New.
14155 * src/tables.c (action_row): Move the computation of rules never
14156 reduced to...
14157 (token_actions): here.
14158 * src/main.c (main): Make the parser before making the report, so
14159 that rules never reduced are computed.
14160 Call grammar_rules_never_reduced_report.
14161 * src/print.c (print_results): Report rules never reduced.
14162 * tests/conflicts.at, tests/reduce.at: Adjust.
14163
cd08e51e
AD
141642002-08-01 Akim Demaille <akim@epita.fr>
14165
14166 Instead of attaching lookaheads and duplicating the rules being
14167 reduced by a state, attach the lookaheads to the reductions.
14168
14169 * src/state.h (state_t): Remove the `lookaheads',
14170 `lookaheads_rule' member.
14171 (reductions_t): Add a `lookaheads' member.
14172 Use a regular array for the `rules'.
14173 * src/state.c (reductions_new): Initialize the lookaheads member
14174 to 0.
14175 (state_rule_lookaheads_print): Adjust.
14176 * src/state.h, src/state.c (state_reductions_find): New.
14177 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14178 (count_rr_conflicts): Adjust.
14179 * src/lalr.c (LArule): Remove.
14180 (add_lookback_edge): Adjust.
14181 (state_lookaheads_count): New.
14182 (states_lookaheads_initialize): Merge into...
14183 (initialize_LA): this.
14184 (lalr_free): Adjust.
14185 * src/main.c (main): Don't free nullable and derives too early: it
14186 is used by --verbose.
14187 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14188
bb0027a9
AD
141892002-08-01 Akim Demaille <akim@epita.fr>
14190
14191 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14192 `rule_number_t**'.
14193 (set_derives, free_derives): Rename as...
14194 (derives_compute, derives_free): this.
14195 Adjust all dependencies.
14196 * src/nullable.c (set_nullable, free_nullable): Rename as...
14197 (nullable_compute, nullable_free): these.
14198 (rule_list_t): Store rule_t *, not rule_number_t.
14199 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14200 pointers, instead of their numbers.
14201 * src/main.c (main): Call nullable_free, and derives_free earlier,
14202 as they were lo longer used.
14203
3325ddc4
AD
142042002-08-01 Akim Demaille <akim@epita.fr>
14205
14206 * lib/timevar.c (get_time): Include children time.
14207 * src/lalr.h (LA, LArule): Don't export them: used with the
14208 state_t.
14209 * src/lalr.c (LA, LArule): Static.
14210 * src/lalr.h, src/lalr.c (lalr_free): New.
14211 * src/main.c (main): Call it.
14212 * src/tables.c (pack_vector): Check whether loc is >= to the
14213 table_size, not >.
14214 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14215 (tables_generate): do it, since that's also it which allocates
14216 them.
14217 Don't free LA and LArule, main does.
14218
c6f1a33c
AD
142192002-07-31 Akim Demaille <akim@epita.fr>
14220
14221 Separate parser tables computation and output.
14222
14223 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14224 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14225 (yydefgoto, yydefact, high): Move to...
14226 * src/tables.h, src/tables.c: here.
14227 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14228 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14229 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14230 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14231 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14232 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14233 (action_row, save_row, token_actions, save_column, default_goto)
14234 (goto_actions, sort_actions, matching_state, pack_vector)
14235 (table_ninf_remap, pack_table, prepare_actions): Move to...
14236 * src/tables.c: here.
14237 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14238 * src/output.c (token_actions, output_base, output_conflicts)
14239 (output_check): Merge into...
14240 (prepare_actions): this.
14241 (actions_output): Rename as...
14242 (user_actions_output): this.
14243 * src/main.c (main): Call tables_generate and tables_free.
14244
1509d42f
AD
142452002-07-31 Akim Demaille <akim@epita.fr>
14246
14247 Steal GCC's --time-report support.
14248
14249 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14250 stolen/adjusted from GCC.
14251 * m4/stage.m4: Remove time related checks.
14252 * m4/timevar.m4: New.
14253 * configure.in: Adjust.
14254 * src/system.h: Adjust to using timevar.h.
14255 * src/getargs.h, src/getargs.c: Support trace_time for
14256 --trace=time.
14257 * src/main.c (stage): Remove.
14258 (main): Replace `stage' invocations with timevar calls.
14259 * src/output.c: Insert pertinent timevar calls.
14260
273a74fa
AD
142612002-07-31 Akim Demaille <akim@epita.fr>
14262
14263 Let --trace have arguments.
14264
14265 * src/getargs.h (enum trace_e): New.
14266 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14267 (long_options, short_options): --trace/-T takes an optional
14268 argument.
14269 Change all the uses of trace_flag to reflect the new flags.
14270 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14271
14272 Strengthen `stage' portability.
14273
14274 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14275 * configure.in: Use it.
14276 Don't check for malloc.h and sys/times.h.
14277 * src/system.h: Include them when appropriate.
14278 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14279 times and struct tms are available.
14280
217598da
AD
142812002-07-30 Akim Demaille <akim@epita.fr>
14282
14283 In verbose parse error message, don't report `error' as an
14284 expected token.
14285 * tests/actions.at (Printers and Destructors): Adjust.
14286 * tests/calc.at (Calculator $1): Adjust.
14287 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14288 error message, do not report the parser accepts the error token in
14289 that state.
14290
52489d44
AD
142912002-07-30 Akim Demaille <akim@epita.fr>
14292
14293 Normalize conflict related messages.
14294
14295 * src/complain.h, src/complain.c (warn, complain): New.
14296 * src/conflicts.c (conflicts_print): Use them.
14297 (conflict_report_yacc): New, extracted from...
14298 (conflicts_print): here.
14299 * tests/conflicts.at, tests/existing.at: Adjust.
14300
e8832397
AD
143012002-07-30 Akim Demaille <akim@epita.fr>
14302
14303 Report rules which are never reduced by the parser: those hidden
14304 by conflicts.
14305
14306 * src/LR0.c (save_reductions): Don't make the final state too
14307 different: save its reduction (accept) instead of having a state
14308 without any action (no shift or goto, no reduce).
14309 Note: the final state is now a ``regular'' state, i.e., the
14310 parsers now contain `reduce 0' as default reduction.
14311 Nevertheless, since they decide to `accept' when yystate =
14312 final_state, they still will not reduce rule 0.
14313 * src/print.c (print_actions, print_reduction): Adjust.
14314 * src/output.c (action_row): Track reduced rules.
14315 (token_actions): Report rules never reduced.
14316 * tests/conflicts.at, tests/regression.at: Adjust.
14317
caf23d24
AD
143182002-07-30 Akim Demaille <akim@epita.fr>
14319
14320 `stage' was accidently included in a previous patch.
14321 Initiate its autoconfiscation.
14322
14323 * configure.in: Look for malloc.h and sys/times.h.
14324 * src/main.c (stage): Adjust.
14325 Report only when trace_flag.
14326
640748ee
AD
143272002-07-29 Akim Demaille <akim@epita.fr>
14328
14329 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14330 state_number_t.
14331 (errs_t): symbol_t*, not symbol_number_t.
14332 (reductions_t): rule_t*, not rule_number_t.
14333 (FOR_EACH_SHIFT): New.
14334 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14335 * src/print.c, src/print_graph.c: Adjust.
14336
88bce5a2
AD
143372002-07-29 Akim Demaille <akim@epita.fr>
14338
14339 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14340
14341 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14342 (endtoken, accept): these.
14343 * src/reader.c (reader): Set endtoken's default tag to "$end".
14344 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14345 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14346 Adjust.
14347
1bfb97db
AD
143482002-07-29 Akim Demaille <akim@epita.fr>
14349
14350 * src/reduce.c (reduce_grammar): When the language is empty,
14351 complain about the start symbol, not the axiom.
14352 Use its location.
14353 * tests/reduce.at (Empty Language): New.
14354
fc5734fe
AD
143552002-07-26 Akim Demaille <akim@epita.fr>
14356
14357 * src/reader.h, src/reader.c (gram_error): ... can't get
14358 yycontrol without making too strong assumptions on the parser
14359 itself.
14360 * src/output.c (prepare_tokens): Use the real 0th value of
14361 token_translations instead of `0'.
14362 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14363 visible here.
14364 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14365 for the time being: %locations ought to provide it to yyerror.
14366
3650b4b8
AD
143672002-07-25 Akim Demaille <akim@epita.fr>
14368
14369 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14370 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14371 * tests/regression.at (Web2c Actions): Adjust.
14372
4b3d3a8e
AD
143732002-07-25 Akim Demaille <akim@epita.fr>
14374
14375 Stop storing rules from 1 to nrules + 1.
14376
14377 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14378 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14379 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14380 Iterate from 0 to nrules.
14381 Use rule_number_as_item_number and item_number_as_rule_number.
14382 Adjust to `derive' now containing possibly 0.
14383 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14384 Handle the `- 1' part in rule numbers from/to item numbers.
14385 * src/conflicts.c (log_resolution): Fix the message which reversed
14386 shift and reduce.
14387 * src/output.c (action_row): Initialize default_rule to -1.
14388 (token_actions): Adjust.
14389 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14390 expected output.
14391 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14392
4a2a22f4
AD
143932002-07-25 Akim Demaille <akim@epita.fr>
14394
14395 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14396 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14397 (b4_c_knr_arg_decl): New.
14398 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14399 yyreport_parse_error.
14400
b8df3223
AD
144012002-07-25 Akim Demaille <akim@epita.fr>
14402
14403 * data/yacc.c (yyreport_parse_error): New, extracted from...
14404 (yyparse): here.
14405 (yydestruct, yysymprint): Move above yyparse.
14406 Be K&R compliant.
14407
a762e609
AD
144082002-07-25 Akim Demaille <akim@epita.fr>
14409
14410 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14411 replace...
14412 (b4_sint_type, b4_uint_type): these.
14413 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14414 * tests/regression.at (Web2c Actions): Adjust.
14415
12b0043a
AD
144162002-07-25 Akim Demaille <akim@epita.fr>
14417
14418 * src/gram.h (TIEM_NUMBER_MAX): New.
14419 (item_number_of_rule_number, rule_number_of_item_number): Rename
14420 as...
14421 (rule_number_as_item_number, item_number_as_rule_number): these.
14422 Adjust dependencies.
14423 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14424 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14425 (symbol_number_to_vector_number): New.
14426 (order): Of vector_number_t* type.
14427 (base_t, BASE_MAX, BASE_MIN): New.
14428 (froms, tos, width, pos, check): Of base_t type.
14429 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14430 (actrow): Of action_number_t type.
14431 (conflrow): Of unsigned int type.
14432 (table_ninf, base_ninf): New.
14433 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14434 (muscle_insert_int_table, muscle_insert_base_table)
14435 (muscle_insert_rule_number_table): New.
14436 (prepare_tokens): Output `toknum' as int_table.
14437 (action_row): Returns a rule_number_t.
14438 Use ACTION_MIN, not SHRT_MIN.
14439 (token_actions): yydefact is rule_number_t*.
14440 (table_ninf_remap): New.
14441 (pack_table): Use it for `base' and `table'.
14442 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14443 replaced with...
14444 (YYPACT_NINF, YYTABLE_NINF): these.
14445 (yypact, yytable): Compute their types instead of hard-coded
14446 `short'.
14447 * tests/regression.at (Web2c Actions): Adjust.
14448
5dde258a
AD
144492002-07-19 Akim Demaille <akim@epita.fr>
14450
14451 * src/scan-gram.l (id): Can start with an underscore.
14452
a945ec39
AD
144532002-07-16 Akim Demaille <akim@epita.fr>
14454
14455 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14456 Adjust all former `associativity' dependencies.
14457 * src/symtab.c (symbol_new): Default associativity is `undef', not
14458 `right'.
14459 (symbol_check_alias_consistence): Adjust.
14460
fae437e8
AD
144612002-07-09 Akim Demaille <akim@epita.fr>
14462
14463 * doc/bison.texinfo: Properly set the ``header'' part.
14464 Use @dircategory ``GNU programming tools'' as per Texinfo's
14465 documentation.
14466 Use @copying.
14467
1a715ef2
AD
144682002-07-09 Akim Demaille <akim@epita.fr>
14469
14470 * lib/quotearg.h: Protect against multiple inclusions.
14471 * src/location.h (location_t): Add a `file' member.
14472 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14473 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14474 `error_one_per_line' support.
14475
a5d50994
AD
144762002-07-09 Akim Demaille <akim@epita.fr>
14477
14478 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14479 * src/reader.c (lineno): Remove.
14480 Adjust all dependencies.
14481 (get_merge_function): Take a location and use complain_at.
14482 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14483 * tests/regression.at (Invalid inputs, Mixing %token styles):
14484 Adjust.
14485
b275314e
AD
144862002-07-09 Akim Demaille <akim@epita.fr>
14487
14488 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14489 recovery rule, and forbid extensions when --yacc.
14490 (gram_error): Use complain_at.
14491 * src/reader.c (reader): Exit if there were parse errors.
14492
865b9df1
AD
144932002-07-09 Akim Demaille <akim@epita.fr>
14494
14495 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14496 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14497 Reported by R Blake <blakers@mac.com>.
14498
c76e14da
AD
144992002-07-09 Akim Demaille <akim@epita.fr>
14500
14501 * data/yacc.c: Output the copyright notive in the header.
14502
7db2ed2d
AD
145032002-07-03 Akim Demaille <akim@epita.fr>
14504
14505 * src/output.c (froms, tos): Are state_number_t.
14506 (save_column): sp, sp1, and sp2 are state_number_t.
14507 (prepare): Rename `final' as `final_state_number', `nnts' as
14508 `nterms_number', `nrules' as `rules_number', `nstates' as
14509 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14510 unused.
14511 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14512 * data/lalr1.cc (nsym_): Remove, unused.
14513
e68e0410
AD
145142002-07-03 Akim Demaille <akim@epita.fr>
14515
14516 * src/lalr.h, src/lalr.c (goto_number_t): New.
14517 * src/lalr.c (goto_list_t): New.
14518 Propagate them.
14519 * src/nullable.c (rule_list_t): New.
14520 Propagate.
14521 * src/types.h: Remove.
14522
e1a4f3a4
AD
145232002-07-03 Akim Demaille <akim@epita.fr>
14524
14525 * src/closure.c (print_fderives): Use rule_rhs_print.
14526 * src/derives.c (print_derives): Use rule_rhs_print.
14527 (rule_list_t): New, replaces `shorts'.
14528 (set_derives): Add comments.
14529 * tests/sets.at (Nullable, Firsts): Adjust.
14530
536545f3
AD
145312002-07-03 Akim Demaille <akim@epita.fr>
14532
14533 * src/output.c (prepare_actions): Free `tally' and `width'.
14534 (prepare_actions): Allocate and free `order'.
14535 * src/symtab.c (symbols_free): Free `symbols'.
14536 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14537 * src/output.c (m4_invoke): Move to...
14538 * src/scan-skel.l: here.
14539 (<<EOF>>): Close yyout, and free its name.
14540
8b752b00
AD
145412002-07-03 Akim Demaille <akim@epita.fr>
14542
14543 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14544
14545 * src/LR0.c (new_state): Merge into...
14546 (state_list_append): this.
14547 (new_states): Merge into...
14548 (generate_states): here.
14549 (set_states): Don't ensure a proper `errs' state member here, do it...
14550 * src/conflicts.c (conflicts_solve): here.
14551 * src/state.h, src/state.c: Comment changes.
14552 (state_t): Rename member `shifts' as `transitions'.
14553 Adjust all dependencies.
14554 (errs_new): For consistency, also take the values as argument.
14555 (errs_dup): Remove.
14556 (state_errs_set): New.
14557 (state_reductions_set, state_transitions_set): Assert that no
14558 previous value was assigned.
14559 (state_free): New.
14560 (states_free): Use it.
14561 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14562 temporary storage: use `errs' and `nerrs' as elsewhere.
14563 (set_conflicts): Allocate and free this `errs'.
14564
613f5e1a
AD
145652002-07-02 Akim Demaille <akim@epita.fr>
14566
14567 * lib/libiberty.h: New.
14568 * lib: Update the bitset implementation from upstream.
14569 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14570 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14571 * src/main.c: Adjust bitset stats calls.
14572
26e0cadc
PE
145732002-07-01 Paul Eggert <eggert@twinsun.com>
14574
14575 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14576 char, so that negative chars don't collide with $.
14577
1154cced
AD
145782002-06-30 Akim Demaille <akim@epita.fr>
14579
14580 Have the GLR tests be `warning' checked, and fix the warnings.
14581
14582 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14583 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14584 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14585 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14586 (yyaddDeferredAction): static.
14587 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14588 (yyreportParseError): yyprefix is const.
14589 yytokenp is used only when verbose.
14590 (yy__GNUC__): Replace with __GNUC__.
14591 (yypdumpstack): yyi is size_t.
14592 (yypreference): Un-yy local variables and arguments, to avoid
14593 clashes with `yyr1'. Anyway, we are not in the user name space.
14594 (yytname_size): be an int, as is compared with ints.
14595 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14596 Use them.
14597 * tests/cxx-gram.at: Use quotation to protect $1.
14598 Use AT_COMPILE to enable warnings hunts.
14599 Prototype yylex and yyerror.
14600 `Use' argc.
14601 Include `string.h', not `strings.h'.
14602 Produce and prototype stmtMerge only when used.
14603 yylex takes a location.
14604
97650f4e
AD
146052002-06-30 Akim Demaille <akim@epita.fr>
14606
14607 We spend a lot of time in quotearg, in particular when --verbose.
14608
14609 * src/symtab.c (symbol_get): Store a quoted version of the key.
14610 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14611 Adjust all callers.
14612
d2576365
AD
146132002-06-30 Akim Demaille <akim@epita.fr>
14614
14615 * src/state.h (reductions_t): Rename member `nreds' as num.
14616 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14617 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14618
ccaf65bc
AD
146192002-06-30 Akim Demaille <akim@epita.fr>
14620
14621 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14622 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14623 (shifts_to): Rename as...
14624 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14625 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14626 (TRANSITION_IS_DISABLED, transitions_to): these.
14627
87675353
AD
146282002-06-30 Akim Demaille <akim@epita.fr>
14629
14630 * src/print.c (print_shifts, print_gotos): Merge into...
14631 (print_transitions): this.
14632 (print_transitions, print_errs, print_reductions): Align the
14633 lookaheads columns.
14634 (print_core, print_transitions, print_errs, print_state,
14635 print_grammar): Output empty lines separator before, not after.
14636 (state_default_rule_compute): Rename as...
14637 (state_default_rule): this.
14638 * tests/conflicts.at (Defaulted Conflicted Reduction),
14639 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14640 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14641
ce4ccb4b
AD
146422002-06-30 Akim Demaille <akim@epita.fr>
14643
14644 Display items as we display rules.
14645
14646 * src/gram.h, src/gram.c (rule_lhs_print): New.
14647 * src/gram.c (grammar_rules_partial_print): Use it.
14648 * src/print.c (print_core): Likewise.
14649 * tests/conflicts.at (Defaulted Conflicted Reduction),
14650 (Unresolved SR Conflicts): Adjust.
14651 (Unresolved SR Conflicts): Adjust and rename as...
14652 (Resolved SR Conflicts): this, as was meant.
14653 * tests/regression.at (Web2c Report): Adjust.
14654
bc933ef1
AD
146552002-06-30 Akim Demaille <akim@epita.fr>
14656
14657 * src/print.c (state_default_rule_compute): New, extracted from...
14658 (print_reductions): here.
14659 Pessimize, but clarify the code.
14660 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14661
53d4308d
AD
146622002-06-30 Akim Demaille <akim@epita.fr>
14663
14664 * src/output.c (action_row): Let default_rule be always a rule
14665 number.
14666
574fb2d5
AD
146672002-06-30 Akim Demaille <akim@epita.fr>
14668
14669 * src/closure.c (print_firsts, print_fderives, closure):
14670 Use BITSET_EXECUTE.
14671 * src/lalr.c (lookaheads_print): Likewise.
14672 * src/state.c (state_rule_lookaheads_print): Likewise.
14673 * src/print_graph.c (print_core): Likewise.
14674 * src/print.c (print_reductions): Likewise.
14675 * src/output.c (action_row): Likewise.
14676 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14677
05811fd7
AD
146782002-06-30 Akim Demaille <akim@epita.fr>
14679
14680 * src/print_graph.c: Use report_flag.
14681
0e4d5753
AD
146822002-06-30 Akim Demaille <akim@epita.fr>
14683
14684 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14685 to...
14686 * src/relation.h, src/relation.c (traverse, relation_digraph)
14687 (relation_print, relation_transpose): New.
14688
24c7d800
AD
146892002-06-30 Akim Demaille <akim@epita.fr>
14690
14691 * src/state.h, src/state.c (shifts_to): New.
14692 * src/lalr.c (build_relations): Use it.
14693
9222837b
AD
146942002-06-30 Akim Demaille <akim@epita.fr>
14695
14696 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14697 (item_number_of_rule_number, rule_number_of_item_number): New.
14698 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14699 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14700 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14701 Propagate their use.
14702 Much remains to be done, in particular wrt `shorts' from types.h.
14703
260008e5
AD
147042002-06-30 Akim Demaille <akim@epita.fr>
14705
14706 * src/symtab.c (symbol_new): Initialize the `printer' member.
14707
8a731ca8
AD
147082002-06-30 Akim Demaille <akim@epita.fr>
14709
14710 * src/LR0.c (save_reductions): Remove, replaced by...
14711 * src/state.h, src/state.c (state_reductions_set): New.
14712 (reductions, errs): Rename as...
14713 (reductions_t, errs_t): these.
14714 Adjust all dependencies.
14715
32e1e0a4
AD
147162002-06-30 Akim Demaille <akim@epita.fr>
14717
14718 * src/LR0.c (state_list_t, state_list_append): New.
14719 (first_state, last_state): Now symbol_list_t.
14720 (this_state): Remove.
14721 (new_itemsets, append_states, save_reductions): Take a state_t as
14722 argument.
14723 (set_states, generate_states): Adjust.
14724 (save_shifts): Remove, replaced by...
14725 * src/state.h, src/state.c (state_shifts_set): New.
14726 (shifts): Rename as...
14727 (shifts_t): this.
14728 Adjust all dependencies.
14729 * src/state.h (state_t): Remove the `next' member.
14730
e5fb6710
AD
147312002-06-30 Akim Demaille <akim@epita.fr>
14732
14733 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14734 escaped in slot 0.
14735
c7ca99d4
AD
147362002-06-30 Akim Demaille <akim@epita.fr>
14737
14738 Use hash.h for the state hash table.
14739
14740 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14741 (allocate_storage): Use state_hash_new.
14742 (free_storage): Use state_hash_free.
14743 (new_state, get_state): Adjust.
14744 * src/lalr.h, src/lalr.c (states): Move to...
14745 * src/states.h (state_t): Remove the `link' member, no longer
14746 used.
14747 * src/states.h, src/states.c: here.
14748 (state_hash_new, state_hash_free, state_hash_lookup)
14749 (state_hash_insert, states_free): New.
14750 * src/states.c (state_table, state_compare, state_hash): New.
14751 * src/output.c (output_actions): Do not free states now, since we
14752 still need to know the final_state number in `prepare', called
14753 afterwards. Do it...
14754 * src/main.c (main): here: call states_free after `output'.
14755
df0e7316
AD
147562002-06-30 Akim Demaille <akim@epita.fr>
14757
14758 * src/state.h, src/state.c (state_new): New, extracted from...
14759 * src/LR0.c (new_state): here.
14760 * src/state.h (STATE_ALLOC): Move to...
14761 * src/state.c: here.
14762 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14763 * src/state.h, src/state.c: here.
14764
39f41916
AD
147652002-06-30 Akim Demaille <akim@epita.fr>
14766
14767 * src/reader.c (gensym): Rename as...
14768 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14769 (getsym): Rename as...
14770 (symbol_get): this.
14771
d57650a5
AD
147722002-06-30 Akim Demaille <akim@epita.fr>
14773
14774 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14775 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14776 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14777 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14778
5a08f1ce
AD
147792002-06-30 Akim Demaille <akim@epita.fr>
14780
14781 Make the test suite pass with warnings checked.
14782
14783 * tests/actions.at (Printers and Destructors): Improve.
14784 Avoid unsigned vs. signed issues.
14785 * tests/calc.at: Don't exercise the scanner here, do it...
14786 * tests/input.at (Torturing the Scanner): here.
14787
720623af
PH
147882002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14789
88e7e941 14790 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
14791 reorganize first lines parallel to yacc.c.
14792
fb8135fa
AD
147932002-06-28 Akim Demaille <akim@epita.fr>
14794
14795 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14796 (b4_token_enum, b4_token_defines): New, factored from...
14797 * data/lalr1.cc, data/yacc.c, glr.c: here.
14798
41442480
AD
147992002-06-28 Akim Demaille <akim@epita.fr>
14800
14801 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14802 unused variables.
14803 * src/output.c (merger_output): static.
14804
e0e5bf84
AD
148052002-06-28 Akim Demaille <akim@epita.fr>
14806
ba0fe3c7 14807 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
14808 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14809 pacify GCC.
14810 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 14811
676385e2
PH
148122002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14813
14814 Accumulated changelog for new GLR parsing features.
14815
6a254321 14816 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
14817 conflicts_total_count.
14818 * src/conflicts.h: Ditto.
14819 * src/output.c (token_actions): Use the new name.
14820 (output_conflicts): Change conflp => conflict_list_heads, and
14821 confl => conflict_list for better readability.
14822 * data/glr.c: Use the new names.
14823 * NEWS: Add self to GLR announcement.
e0e5bf84 14824
676385e2
PH
14825 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14826
14827 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14828 Akim Demaille.
14829
14830 * data/bison.glr: Change name to glr.c
14831 * data/glr.c: Renamed from bison.glr.
14832 * data/Makefile.am: Add glr.c
e0e5bf84
AD
14833
14834 * src/getargs.c:
14835
676385e2 14836 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 14837 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 14838
676385e2
PH
14839 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14840
14841 * data/bison.glr: Be sure to restore the
14842 current #line when returning to the skeleton contents after having
14843 exposed the input file's #line.
14844
14845 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14846
14847 * data/bison.glr: Bring up to date with changes to bison.simple.
14848
14849 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14850
14851 * data/bison.glr: Correct definitions that use b4_prefix.
14852 Various reformatting.
14853 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14854 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14855 yytokenp argument; now part of stack.
14856 (yychar): Define to behave as documented.
14857 (yyclearin): Ditto.
e0e5bf84 14858
676385e2
PH
14859 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14860
14861 * src/reader.h: Add declaration for free_merger_functions.
14862
14863 * src/reader.c (merge_functions): New variable.
14864 (get_merge_function): New function.
14865 (free_merger_functions): New function.
14866 (readgram): Check for %prec that is not followed by a symbol.
14867 Handle %dprec and %merge declarations.
14868 (packgram): Initialize dprec and merger fields in rules array.
14869
14870 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14871 conflict_list_cnt, conflict_list_free): New variables.
14872 (table_grow): Also grow conflict_table.
e0e5bf84 14873 (prepare_rules): Output dprec and merger tables.
676385e2 14874 (conflict_row): New function.
e0e5bf84 14875 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
14876 default reduction in conflicted states for GLR parser so that there
14877 are spaces for the conflict lists.
14878 (save_row): Also save conflict information.
14879 (token_actions): Allocate conflict list.
14880 (merger_output): New function.
14881 (pack_vector): Pack conflict table, too.
14882 (output_conflicts): New function to output yyconflp and yyconfl.
14883 (output_check): Allocate conflict_tos.
14884 (output_actions): Output conflict tables, also.
14885 (output_skeleton): Output b4_mergers definition.
14886 (prepare): Output b4_max_rhs_length definition.
14887 Use 'bison.glr' as default skeleton for GLR parsers.
14888
14889 * src/gram.c (glr_parser): New flag.
14890 (grammar_free): Call free_merger_functions.
14891
14892 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14893 all pairs of conflicting reductions, rather than just all tokens
14894 causing conflicts. Needed to size conflict tables.
e0e5bf84 14895 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
14896 interface.
14897 (conflicts_print): Ditto.
14898 (count_total_conflicts): New function.
14899
14900 * src/reader.h (merger_list): New type.
14901 (merge_functions): New variable.
14902
14903 * src/lex.h (tok_dprec, tok_merge): New token types.
14904
14905 * src/gram.h (rule_s): Add dprec and merger fields.
14906 (glr_parser): New flag.
14907
14908 * src/conflicts.h (count_total_conflicts): New function.
14909
14910 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14911
14912 * doc/bison.texinfo (Generalized LR Parsing): New section.
14913 (GLR Parsers): New section.
14914 (Language and Grammar): Mention GLR parsing.
14915 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14916 Correct typo ("tge" -> "the").
14917
14918 * data/bison.glr: New skeleton for GLR parsing.
14919
14920 * tests/cxx-gram.at: New tests for GLR parsing.
14921
14922 * tests/testsuite.at: Include cxx-gram.at.
14923
14924 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 14925
676385e2
PH
14926 * src/parse-gram.y:
14927
14928 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14929
14930 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 14931
b5480d74 149322002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
14933
14934 * src/options.h, src/options.c: Remove.
14935 * src/getargs.c (short_options, long_options): New.
14936
60491a94
AD
149372002-06-27 Akim Demaille <akim@epita.fr>
14938
14939 * data/bison.simple, data/bison.c++: Rename as...
14940 * data/yacc.c, data/lalr1.cc: these.
14941 * doc/bison.texinfo (Environment Variables): Remove.
14942
9be0c25b
AD
149432002-06-25 Raja R Harinath <harinath@cs.umn.edu>
14944
14945 * src/getargs.c (report_argmatch): Initialize strtok().
14946
1ae72863
AD
149472002-06-20 Akim Demaille <akim@epita.fr>
14948
14949 * data/bison.simple (b4_symbol_actions): New, replaces...
14950 (b4_symbol_destructor, b4_symbol_printer): these.
14951 (yysymprint): Be sure to call YYPRINT only for tokens, and using
14952 user token numbers.
14953
87542d29
AD
149542002-06-20 Akim Demaille <akim@epita.fr>
14955
14956 * data/bison.simple (yydestructor): Rename as...
14957 (yydestruct): this.
14958
1a31ed21
AD
149592002-06-20 Akim Demaille <akim@epita.fr>
14960
14961 * src/symtab.h, src/symtab.c (symbol_type_set)
14962 (symbol_destructor_set, symbol_precedence_set): The location is
14963 the last argument.
14964 Adjust all callers.
14965
e776192e
AD
149662002-06-20 Akim Demaille <akim@epita.fr>
14967
14968 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
14969 internals.
14970 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
14971 Takes a location.
14972 * src/symtab.h, src/symtab.c (symbol_class_set)
14973 (symbol_user_token_number_set): Likewise.
14974 Adjust all callers.
14975 Promote complain_at.
14976 * tests/input.at (Type Clashes): Adjust.
14977
5c1180b3
AD
149782002-06-20 Akim Demaille <akim@epita.fr>
14979
14980 * data/bison.simple (YYLEX): Fix the declaration when
14981 %pure-parser.
14982
e3170060
AD
149832002-06-20 Akim Demaille <akim@epita.fr>
14984
14985 * data/bison.simple (yysymprint): Don't print the token number,
14986 just its name.
14987 * tests/actions.at (Destructors): Rename as...
14988 (Printers and Destructors): this.
14989 Also exercise %printer.
14990
253862fd
AD
149912002-06-20 Akim Demaille <akim@epita.fr>
14992
14993 * data/bison.simple (YYDSYMPRINT): New.
14994 Use it to remove many of the #if YYDEBUG/if (yydebug).
14995
366eea36
AD
149962002-06-20 Akim Demaille <akim@epita.fr>
14997
14998 * src/symtab.h, src/symtab.c (symbol_t): printer and
14999 printer_location are new members.
15000 (symbol_printer_set): New.
15001 * src/parse-gram.y (PERCENT_PRINTER): New token.
15002 Handle its associated rule.
15003 * src/scan-gram.l: Adjust.
15004 (handle_destructor_at, handle_destructor_dollar): Rename as...
15005 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15006 * src/output.c (symbol_printers_output): New.
15007 (output_skeleton): Call it.
15008 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15009 since there are already many grammar files with a user `yyprint'.
15010 Replace the calls to YYPRINT to calls to yysymprint.
15011 * tests/calc.at: Adjust.
15012 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15013 taking advantage of parser very internal details (stack size!).
15014
4f25ebb0
AD
150152002-06-20 Akim Demaille <akim@epita.fr>
15016
15017 * src/scan-gram.l: Complete the scanner with the missing patterns
15018 to pacify Flex.
15019 Use `quote' and `symbol_tag_get' where appropriate.
15020
93b68a0e
AD
150212002-06-19 Akim Demaille <akim@epita.fr>
15022
15023 * tests/actions.at (Destructors): Augment to test locations.
15024 * data/bison.simple (yydestructor): Pass it the current location
15025 if locations are enabled.
15026 Prototype only when __STDC__ or C++.
15027 Change the argument names to move into the yy name space: there is
15028 user code here.
15029
58612f1d
AD
150302002-06-19 Akim Demaille <akim@epita.fr>
15031
74310291
AD
15032 * data/bison.simple (b4_pure_if): New.
15033 Use it instead of #ifdef YYPURE.
15034
150352002-06-19 Akim Demaille <akim@epita.fr>
15036
15037 * data/bison.simple (b4_location_if): New.
58612f1d
AD
15038 Use it instead of #ifdef YYLSP_NEEDED.
15039
f25bfb75
AD
150402002-06-19 Akim Demaille <akim@epita.fr>
15041
15042 Prepare @$ in %destructor, but currently don't bind it in the
15043 skeleton, as %location use is not cleaned up yet.
15044
15045 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15046 (handle_action_at): New.
15047 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15048 a braced_code_t and a location as additional arguments.
15049 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15050 unquote one when outputting `b4_dollar_dollar'.
15051 Adjust callers.
15052 * data/bison.simple (b4_eval): Remove.
15053 (b4_symbol_destructor): Adjust.
15054 * tests/input.at (Invalid @n): Adjust.
15055
c732d2c6
AD
150562002-06-19 Zack Weinberg <zack@codesourcery.com>
15057
15058 * doc/bison.texinfo: Document ability to have multiple
15059 prologue sections.
15060
8c165d89
AD
150612002-06-18 Akim Demaille <akim@epita.fr>
15062
15063 * src/files.c (compute_base_names): When computing the output file
15064 names from the input file name, strip the directory part.
15065
ca98bf57
AD
150662002-06-18 Akim Demaille <akim@epita.fr>
15067
15068 * data/bison.simple.new: Comment changes.
15069 Reported by Andreas Schwab.
15070
0bfb02ff
AD
150712002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15072
15073 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15074 there are no `label `yyoverflowlab' defined but not used' warnings
15075 when yyoverflow is defined.
15076
24c0aad7
AD
150772002-06-18 Akim Demaille <akim@epita.fr>
15078
15079 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15080 new member.
15081 (symbol_destructor_set): Adjust.
15082 * src/output.c (symbol_destructors_output): Output the destructor
15083 locations.
15084 Output the symbol name.
15085 * data/bison.simple (b4_symbol_destructor): Adjust.
15086
5719c109
AD
150872002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15088 and Akim Demaille <akim@epita.fr>
15089
15090 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15091 what's left on the stack when the error recovery hits EOF.
15092 * tests/actions.at (Destructors): Complete to exercise this case.
15093
9280d3ef
AD
150942002-06-17 Akim Demaille <akim@epita.fr>
15095
15096 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15097 arguments is really empty, not only equal to `[]'.
15098 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15099 member.
15100 (symbol_destructor_set): New.
15101 * src/output.c (symbol_destructors_output): New.
15102 * src/reader.h (brace_code_t, current_braced_code): New.
15103 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15104 (handle_dollar): Rename as...
15105 (handle_action_dollar): this.
15106 (handle_destructor_dollar): New.
15107 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15108 (grammar_declaration): Use it.
15109 * data/bison.simple (yystos): Is always defined.
15110 (yydestructor): New.
15111 * tests/actions.at (Destructors): New.
15112 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15113
dafdc66f
AD
151142002-06-17 Akim Demaille <akim@epita.fr>
15115
15116 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15117 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15118 rule_length only when needed.
15119 * src/output.c (actions_output, token_definitions_output): Output
15120 the full M4 block.
15121 * src/symtab.c: Don't access directly to the symbol tag, use
15122 symbol_tag_get.
15123 * src/parse-gram.y: Use symbol_list_free.
15124
56c47203
AD
151252002-06-17 Akim Demaille <akim@epita.fr>
15126
15127 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15128 (symbol_list_prepend, get_type_name): Move to...
15129 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15130 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15131 Adjust all callers.
15132 (symbol_list_free): New.
15133 * src/scan-gram.l (handle_dollar): Takes a location.
15134 * tests/input.at (Invalid $n): Adjust.
15135
1e0bab92
AD
151362002-06-17 Akim Demaille <akim@epita.fr>
15137
15138 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15139 (symbol_list_prepend): New.
15140 * src/parse-gram.y (%union): `list' is a new member.
15141 (symbols.1): New, replaces...
15142 (terms_to_prec.1, nterms_to_type.1): these.
15143 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15144 Take a location as additional argument.
15145 Adjust all callers.
15146
04e60654
AD
151472002-06-15 Akim Demaille <akim@epita.fr>
15148
15149 * src/parse-gram.y: Move %token in the declaration section so that
15150 we don't depend upon CVS Bison.
15151
10e5b8bd
AD
151522002-06-15 Akim Demaille <akim@epita.fr>
15153
15154 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15155 * src/print.c (print_core): Use it.
15156
9801d40c
AD
151572002-06-15 Akim Demaille <akim@epita.fr>
15158
15159 * src/conflicts.c (log_resolution): Accept the rule involved in
15160 the sr conflicts instead of the lookahead number that points to
15161 that rule.
15162 (flush_reduce): Accept the current lookahead vector as argument,
15163 instead of the index in LA.
15164 (resolve_sr_conflict): Accept the current number of lookahead
15165 bitset to consider for the STATE, instead of the index in LA.
15166 (set_conflicts): Adjust.
15167 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15168
c0263492
AD
151692002-06-15 Akim Demaille <akim@epita.fr>
15170
15171 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15172 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15173 Adjust all dependencies.
15174 * src/lalr.c (initialize_lookaheads): Split into...
15175 (states_lookaheads_count, states_lookaheads_initialize): these.
15176 (lalr): Adjust.
15177
9757c359
AD
151782002-06-15 Akim Demaille <akim@epita.fr>
15179
15180 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15181 out of...
15182 (grammar_rules_print): here.
15183 * src/reduce.c (reduce_output): Use it.
15184 * tests/reduce.at (Useless Rules, Reduced Automaton)
15185 (Underivable Rules): Adjust.
15186
6b98e4b5
AD
151872002-06-15 Akim Demaille <akim@epita.fr>
15188
15189 Copy BYacc's nice way to report the grammar.
15190
15191 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15192 New.
15193 Don't print the rules' location, it is confusing and useless.
15194 (rule_print): Use grammar_rhs_print.
15195 * src/print.c (print_grammar): Use grammar_rules_print.
15196
6b98e4b5
AD
151972002-06-15 Akim Demaille <akim@epita.fr>
15198
15199 Complete and rationalize `useless thing' warnings.
15200
15201 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15202 (symbol_tag_print): New.
15203 Use them everywhere in place of accessing directly the tag member.
15204 * src/gram.h, src/gram.c (rule_print): New.
15205 Use it where a rule used to be printed `by hand'.
15206 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15207 (reduce_grammar_tables): Report the useless rules.
15208 (reduce_print): Useless things are a warning, not an error.
15209 Report it as such.
15210 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15211 (Reduced Automaton, Underivable Rules): Adjust.
15212 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15213 * tests/conflicts.at (Unresolved SR Conflicts)
15214 (Solved SR Conflicts): Adjust.
15215
ee000ba4
AD
152162002-06-15 Akim Demaille <akim@epita.fr>
15217
15218 Let symbols have a location.
15219
15220 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15221 (getsym): Adjust.
15222 Adjust all callers.
15223 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15224 Use location_t, not int.
15225 * src/symtab.c (symbol_check_defined): Take advantage of the
15226 location.
15227 * tests/regression.at (Invalid inputs): Adjust.
15228
8efe435c
AD
152292002-06-15 Akim Demaille <akim@epita.fr>
15230
15231 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15232 (input): Don't try to initialize yylloc here, do it in the
15233 scanner.
15234 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15235 * src/gram.h (rule_t): Change line and action_line into location
15236 and action_location, of location_t type.
15237 Adjust all dependencies.
15238 * src/location.h, src/location.c (empty_location): New.
15239 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15240 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15241 (grammar_current_rule_symbol_append)
15242 (grammar_current_rule_action_append): Expect a location as argument.
15243 * src/reader.c (grammar_midrule_action): Adjust to attach an
15244 action's location as dummy symbol location.
15245 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15246 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15247 the line numbers.
15248
1921f1d7
AD
152492002-06-14 Akim Demaille <akim@epita.fr>
15250
15251 Grammar declarations may be found in the grammar section.
15252
15253 * src/parse-gram.y (rules_or_grammar_declaration): New.
15254 (declarations): Each declaration may end with a semicolon, not
15255 just...
15256 (grammar_declaration): `"%union"'.
15257 (grammar): Branch to rules_or_grammar_declaration.
15258
4515534c
AD
152592002-06-14 Akim Demaille <akim@epita.fr>
15260
15261 * src/main.c (main): Invoke scanner_free.
15262
f958596b
AD
152632002-06-14 Akim Demaille <akim@epita.fr>
15264
15265 * src/output.c (m4_invoke): Extracted from...
15266 (output_skeleton): here.
15267 Free tempfile.
15268
2c569025
AD
152692002-06-14 Akim Demaille <akim@epita.fr>
15270
15271 * src/parse-gram.y (directives, directive, gram)
15272 (grammar_directives, precedence_directives, precedence_directive):
15273 Rename as...
15274 (declarations, declaration, grammar, grammar_declaration)
15275 (precedence_declaration, precedence_declarator): these.
15276 (symbol_declaration): New.
15277
592e8d4d
AD
152782002-06-14 Akim Demaille <akim@epita.fr>
15279
15280 * src/files.c (action_obstack): Remove, unused.
15281 (output_obstack): Remove it, and all its dependencies, as it is no
15282 longer needed.
15283 * src/reader.c (epilogue_set): Build the epilogue in the
15284 muscle_obstack.
15285 * src/output.h, src/output.c (muscle_obstack): Move to...
15286 * src/muscle_tab.h, src/muscle_tab.h: here.
15287 (muscle_init): Initialize muscle_obstack.
15288 (muscle_free): New.
15289 * src/main.c (main): Call it.
15290
0c15323d
AD
152912002-06-14 Akim Demaille <akim@epita.fr>
15292
15293 * src/location.h: New, extracted from...
15294 * src/reader.h: here.
15295 * src/Makefile.am (noinst_HEADERS): Merge into
15296 (bison_SOURCES): this.
15297 Add location.h.
15298 * src/parse-gram.y: Use location_t instead of Bison's.
15299 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15300 Use location_t instead of ints.
15301
e96c9728
AD
153022002-06-14 Akim Demaille <akim@epita.fr>
15303
15304 * data/bison.simple, data/bison.c++: Be sure to restore the
15305 current #line when returning to the skeleton contents after having
15306 exposed the input file's #line.
15307
75d1fe16
AD
153082002-06-12 Akim Demaille <akim@epita.fr>
15309
15310 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15311 eager.
15312 * tests/actions.at (Exotic Dollars): New.
15313
6c35d22c
AD
153142002-06-12 Akim Demaille <akim@epita.fr>
15315
15316 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15317 ['"/] too eagerly.
15318 * tests/input.at (Torturing the Scanner): New.
15319
1d6412ad
AD
153202002-06-11 Akim Demaille <akim@epita.fr>
15321
15322 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15323 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15324 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15325 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15326 * src/reader.c (reader): Use it.
15327
4cdb01db
AD
153282002-06-11 Akim Demaille <akim@epita.fr>
15329
15330 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15331 Adjust all callers.
15332 (scanner_last_string_free): New.
15333
44995b2e
AD
153342002-06-11 Akim Demaille <akim@epita.fr>
15335
15336 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15337 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15338 (last_string, YY_OBS_FREE): New.
15339 Use them when returning an ID.
15340
e9955c83
AD
153412002-06-11 Akim Demaille <akim@epita.fr>
15342
15343 Have Bison grammars parsed by a Bison grammar.
15344
15345 * src/reader.c, src/reader.h (prologue_augment): New.
15346 * src/reader.c (copy_definition): Remove.
15347
15348 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15349 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15350 (grammar_current_rule_prec_set, grammar_current_rule_check)
15351 (grammar_current_rule_symbol_append)
15352 (grammar_current_rule_action_append): Export.
15353 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15354 (symbol_list_action_append): Remove.
15355 Hook the routines from reader.
15356 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15357 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15358
15359 * src/reader.c (read_declarations): Remove, unused.
15360
15361 * src/parse-gram.y: Handle the epilogue.
15362 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15363 (grammar_start_symbol_set): this.
15364 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15365 * src/reader.c (readgram): Remove, unused.
15366 (reader): Adjust to insert eoftoken and axiom where appropriate.
15367
15368 * src/reader.c (copy_dollar): Replace with...
15369 * src/scan-gram.h (handle_dollar): this.
15370 * src/parse-gram.y: Remove `%thong'.
15371
15372 * src/reader.c (copy_at): Replace with...
15373 * src/scan-gram.h (handle_at): this.
15374
15375 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15376 New.
15377
15378 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15379 time being.
15380
15381 * src/reader.h, src/reader.c (grammar_rule_end): New.
15382
15383 * src/parse.y (current_type, current_class): New.
15384 Implement `%nterm', `%token' support.
15385 Merge `%term' into `%token'.
15386 (string_as_id): New.
15387 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15388 type name.
15389
15390 * src/parse-gram.y: Be sure to handle properly the beginning of
15391 rules.
15392
15393 * src/parse-gram.y: Handle %type.
15394 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15395
15396 * src/parse-gram.y: More directives support.
15397 * src/options.c: No longer handle source directives.
15398
15399 * src/parse-gram.y: Fix %output.
15400
15401 * src/parse-gram.y: Handle %union.
15402 Use the prologue locations.
15403 * src/reader.c (parse_union_decl): Remove.
15404
15405 * src/reader.h, src/reader.c (epilogue_set): New.
15406 * src/parse-gram.y: Use it.
15407
15408 * data/bison.simple, data/bison.c++: b4_stype is now either not
15409 defined, then default to int, or to the contents of %union,
15410 without `union' itself.
15411 Adjust.
15412 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15413
15414 * src/output.c (actions_output): Don't output braces, as they are
15415 already handled by the scanner.
15416
15417 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15418 characters to themselves.
15419
15420 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15421 that the epilogue has a proper #line.
15422
15423 * src/parse-gram.y: Handle precedence/associativity.
15424
15425 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15426 a terminal.
15427 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15428 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15429 at all to define terminals that cannot be emitted.
15430
15431 * src/scan-gram.l: Escape M4 characters.
15432
15433 * src/scan-gram.l: Working properly with escapes in user
15434 strings/characters.
15435
15436 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15437 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15438 grammar.
15439 Use more modest sizes, as for the time being the parser does not
15440 release memory, and therefore the process swallows a huge amount
15441 of memory.
15442
15443 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15444 stricter %token grammar.
15445
15446 * src/symtab.h (associativity): Add `undef_assoc'.
15447 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15448 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15449
15450 * tests/regression.at (Invalid %directive): Remove, as it is now
15451 meaningless.
15452 (Invalid inputs): Adjust to the new error messages.
15453 (Token definitions): The new grammar doesn't allow too many
15454 eccentricities.
15455
15456 * src/lex.h, src/lex.c: Remove.
15457 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15458 (copy_character, copy_string2, copy_string, copy_identifier)
15459 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15460 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15461 (parse_action): Remove.
15462 * po/POTFILES.in: Adjust.
15463
2e047461
AD
154642002-06-11 Akim Demaille <akim@epita.fr>
15465
cd05d13c 15466 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
15467 rule's action member: return the action as a string.
15468 Don't require `rule_length' as an argument: compute it.
15469 (grammar_current_rule_symbol_append)
15470 (grammar_current_rule_action_append): New, eved out from
15471 (readgram): here.
15472 Remove `action_flag', `rulelength', unused now.
15473
9af3fbce
AD
154742002-06-11 Akim Demaille <akim@epita.fr>
15475
15476 * src/reader.c (grammar_current_rule_prec_set).
15477 (grammar_current_rule_check): New, eved out from...
15478 (readgram): here.
15479 Remove `xaction', `first_rhs': useless.
15480 * tests/input.at (Type clashes): New.
15481 * tests/existing.at (GNU Cim Grammar): Adjust.
15482
1485e106
AD
154832002-06-11 Akim Demaille <akim@epita.fr>
15484
15485 * src/reader.c (grammar_midrule_action): New, Eved out from
15486 (readgram): here.
15487
da4160c3
AD
154882002-06-11 Akim Demaille <akim@epita.fr>
15489
15490 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15491 New.
15492 (readgram): Use them as replacement of inlined code, crule and
15493 crule1.
15494
f6d0f937
AD
154952002-06-11 Akim Demaille <akim@epita.fr>
15496
15497 * src/reader.c (grammar_end, grammar_symbol_append): New.
15498 (readgram): Use them.
15499 Make the use of `p' as local as possible.
15500
69078d4b
AD
155012002-06-10 Akim Demaille <akim@epita.fr>
15502
15503 GCJ's parser requires the tokens to be defined before the prologue.
15504
15505 * data/bison.simple: Output the token definition before the user's
15506 prologue.
15507 * tests/regression.at (Braces parsing, Duplicate string)
15508 (Mixing %token styles): Check the output from bison.
15509 (Early token definitions): New.
15510
5e424082
AD
155112002-06-10 Akim Demaille <akim@epita.fr>
15512
15513 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15514 assigning twice the same user number to a token, so that we can
15515 use it in...
15516 * src/lex.c (lex): here.
15517 Also use `symbol_class_set' instead of hand written code.
15518 * src/reader.c (parse_assoc_decl): Likewise.
15519
44536b35
AD
155202002-06-10 Akim Demaille <akim@epita.fr>
15521
15522 * src/symtab.c, src/symtab.c (symbol_class_set)
15523 (symbol_user_token_number_set): New.
15524 * src/reader.c (parse_token_decl): Use them.
15525 Use a switch instead of ifs.
15526 Use a single argument.
15527
8b9f2372
AD
155282002-06-10 Akim Demaille <akim@epita.fr>
15529
15530 Remove `%thong' support as it is undocumented, unused, duplicates
15531 `%token's job, and creates useless e-mail traffic with people who
15532 want to know what it is, why it is undocumented, unused, and
15533 duplicates `%token's job.
15534
15535 * src/reader.c (parse_thong_decl): Remove.
15536 * src/options.c (option_table): Remove "thong".
15537 * src/lex.h (tok_thong): Remove.
15538
3ae2b51f
AD
155392002-06-10 Akim Demaille <akim@epita.fr>
15540
15541 * src/symtab.c, src/symtab.c (symbol_type_set)
15542 (symbol_precedence_set): New.
15543 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15544 (value_components_used): Remove, unused.
15545
2f1afb73
AD
155462002-06-09 Akim Demaille <akim@epita.fr>
15547
15548 Move symbols handling code out of the reader.
15549
15550 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15551 (axiom): Move to...
15552 * src/symtab.h, src/symtab.c: here.
15553
15554 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15555 * src/reader.c (startval): Rename as...
15556 * src/symtab.h, src/symtab.c (startsymbol): this.
15557 * src/reader.c: Adjust.
15558
15559 * src/reader.c (symbol_check_defined, symbol_make_alias)
15560 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15561 (token_translations_init)
15562 Move to...
15563 * src/symtab.c: here.
15564 * src/reader.c (packsymbols): Move to...
15565 * src/symtab.h, src/symtab.c (symbols_pack): here.
15566 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15567 argument.
15568
e9bca3ad
AD
155692002-06-03 Akim Demaille <akim@epita.fr>
15570
15571 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15572 then statements.
15573
86eff183
AD
155742002-06-03 Akim Demaille <akim@epita.fr>
15575
15576 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15577 structs with non literals.
15578 * src/scan-skel.l: never-interactive.
15579 * src/conflicts.c (enum conflict_resolution_e): No trailing
15580 comma.
15581 * src/getargs.c (usage): Split long literal strings.
15582 Reported by Hans Aberg.
15583
717be197
AD
155842002-05-28 Akim Demaille <akim@epita.fr>
15585
15586 * data/bison.c++: Use C++ ostreams.
15587 (cdebug_): New member.
15588
670ddffd
AD
155892002-05-28 Akim Demaille <akim@epita.fr>
15590
15591 * src/output.c (output_skeleton): Be sure to allocate enough room
15592 for `/' _and_ for `\0' in full_skeleton.
15593
769b430f
AD
155942002-05-28 Akim Demaille <akim@epita.fr>
15595
15596 * data/bison.c++: Catch up with bison.simple:
15597 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15598 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15599 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15600 and popping traces.
15601
7067cb36
PH
156022002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15603
15604 * src/output.c (output_skeleton): Put an explicit path in front of
15605 the skeleton file name, rather than relying on the -I directory,
15606 to partially alleviate effects of having a skeleton file lying around
15607 in the current directory.
769b430f 15608
4a713ec2
PH
156092002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15610
769b430f 15611 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
15612 obstack_printf should be obstack_fgrow1.
15613
b408954b
AD
156142002-05-26 Akim Demaille <akim@epita.fr>
15615
15616 * src/state.h (state_t): `solved_conflicts' is a new member.
15617 * src/LR0.c (new_state): Set it to 0.
15618 * src/conflicts.h, src/conflicts.c (print_conflicts)
15619 (free_conflicts, solve_conflicts): Rename as...
15620 (conflicts_print, conflicts_free, conflicts_solve): these.
15621 Adjust callers.
15622 * src/conflicts.c (enum conflict_resolution_e)
15623 (solved_conflicts_obstack): New, used by...
15624 (log_resolution): this.
15625 Adjust to attach the conflict resolution to each state.
15626 Complete the description with the precedence/associativity
15627 information.
15628 (resolve_sr_conflict): Adjust.
15629 * src/print.c (print_state): Output its solved_conflicts.
15630 * tests/conflicts.at (Unresolved SR Conflicts)
15631 (Solved SR Conflicts): Exercise --report=all.
15632
a49aecd5
AD
156332002-05-26 Akim Demaille <akim@epita.fr>
15634
15635 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15636 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15637 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15638 (token_number_t, item_number_as_token_number)
15639 (token_number_as_item_number, muscle_insert_token_number_table):
15640 Rename as...
15641 (symbol_number_t, item_number_as_symbol_number)
15642 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15643 these, since it is more appropriate.
15644
5504898e
AD
156452002-05-26 Akim Demaille <akim@epita.fr>
15646
15647 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15648 `Error:' lines.
15649 * data/bison.simple (yystos) [YYDEBUG]: New.
15650 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15651 error recovery.
15652 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15653
ec3bc396
AD
156542002-05-25 Akim Demaille <akim@epita.fr>
15655
15656 * doc/bison.texinfo (Debugging): Split into...
15657 (Tracing): this new section, its former contents, and...
15658 (Understanding): this new section.
15659 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15660 by...
15661 (report_flag): this.
15662 Adjust all dependencies.
15663 (report_args, report_types, report_argmatch): New.
15664 (usage, getargs): Report/support -r, --report.
15665 * src/options.h
15666 (struct option_table_struct): Rename as..,
15667 (struct option_table_s): this.
15668 Rename the `set_flag' member to `flag' to match with getopt_long's
15669 struct.
15670 * src/options.c (option_table): Split verbose into an entry for
15671 %verbose, and another for --verbose.
15672 Support --report/-r, so remove -r from the obsolete --raw.
15673 * src/print.c: Attach full item sets and lookaheads reports to
15674 report_flag instead of trace_flag.
15675 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15676
78df8250
PE
156772002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15678 and Paul Eggert <eggert@twinsun.com>
769b430f 15679
78df8250
PE
15680 * data/bison.simple (yyparse): Correct error handling to conform to
15681 POSIX and yacc. Specifically, after syntax error is discovered,
15682 do not reduce further before shifting the error token.
15683 Clean up the code a bit by removing the labels yyerrdefault,
15684 yyerrhandle, yyerrpop.
15685 * NEWS: Document the above.
15686
c0c9ea05
PH
156872002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15688
15689 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15690 type; it isn't always big enough, since it doesn't necessarily
15691 include non-terminals.
769b430f 15692 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
15693 the latter can be removed.
15694 (yy_token_number_type): Remove, only one use.
15695 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15696 don't use TokenNumberType as element type.
769b430f 15697
c0c9ea05
PH
15698 * tests/regression.at: Modify expected output to agree with change
15699 to yyr1 and yytranslate.
769b430f 15700
6390a83f
FK
157012002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15702
15703 * src/reader.c (parse_action): Use copy_character instead of
15704 obstack_1grow.
15705
db7c8e9a
AD
157062002-05-13 Akim Demaille <akim@epita.fr>
15707
15708 * tests/regression.at (Token definitions): Prototype yylex and
15709 yyerror.
15710
fcc61800
PH
157112002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15712
158c687b 15713 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
15714 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15715 32-bit arithmetic.
15716 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15717
5683e9b2
AD
157182002-05-07 Akim Demaille <akim@epita.fr>
15719
15720 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15721 avoid GCC warnings.
15722
0c2d3f4c
AD
157232002-05-07 Akim Demaille <akim@epita.fr>
15724
15725 Kill GCC warnings.
15726
15727 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15728 over the RHS of each rule.
15729 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15730 * src/state.h (state_t): Member `nitems' is unsigned short.
15731 * src/LR0.c (get_state): Adjust.
15732 * src/reader.c (packgram): Likewise.
15733 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15734 `Type'.
15735 (muscle_insert_int_table): Remove, unused.
15736 (prepare_rules): Remove `max'.
15737
1565b720
AD
157382002-05-06 Akim Demaille <akim@epita.fr>
15739
15740 * src/closure.c (print_firsts): Display of the symbol tags.
15741 (bitmatrix_print): Move to...
15742 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15743 here.
15744 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15745
cfaee611
AD
157462002-05-06 Akim Demaille <akim@epita.fr>
15747
15748 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15749 hash_do_for_each.
15750
458be8e0
AD
157512002-05-06 Akim Demaille <akim@epita.fr>
15752
15753 * src/LR0.c (new_state, get_state): Instead of using the global
15754 `kernel_size' and `kernel_base', have two new arguments:
15755 `core_size' and `core'.
15756 Adjust callers.
15757
a900a624
AD
157582002-05-06 Akim Demaille <akim@epita.fr>
15759
15760 * src/reader.c (packgram): No longer end `ritem' with a 0
15761 sentinel: it is not used.
15762
d4e7d3a1
AD
157632002-05-05 Akim Demaille <akim@epita.fr>
15764
15765 New experimental feature: display the lookaheads in the report and
15766 graph.
15767
15768 * src/print (print_core): When --trace-flag, display the rules
15769 lookaheads.
15770 * src/print_graph.c (print_core): Likewise.
15771 Swap the arguments.
15772 Adjust caller.
15773
39ceb25b
AD
157742002-05-05 Akim Demaille <akim@epita.fr>
15775
15776 * tests/torture.at (Many lookaheads): New test.
15777
5372019f
AD
157782002-05-05 Akim Demaille <akim@epita.fr>
15779
15780 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15781 (GENERATE_MUSCLE_INSERT_TABLE): this.
15782 (output_int_table, output_unsigned_int_table, output_short_table)
15783 (output_token_number_table, output_item_number_table): Replace with...
15784 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15785 (muscle_insert_short_table, muscle_insert_token_number_table)
15786 (muscle_insert_item_number_table): these.
15787 Adjust all callers.
15788 (prepare_tokens): Don't free `translations', since...
15789 * src/reader.h, src/reader.c (grammar_free): do it.
15790 Move to...
15791 * src/gram.h, src/gram.c (grammar_free): here.
15792 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15793 b4_translate_max.
15794
5df5f6d5
AD
157952002-05-05 Akim Demaille <akim@epita.fr>
15796
15797 * src/output.c (output_unsigned_int_table): New.
15798 (prepare_rules): `i' is unsigned.
15799 `prhs', `rline', `r2' are unsigned int.
15800 Rename muscle `rhs_number_max' as `rhs_max'.
15801 Output muscles `prhs_max', `rline_max', and `r2_max'.
15802 Free rline and r1.
15803 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15804 to compute types instead of constant types.
15805 * tests/regression.at (Web2c Actions): Adjust.
15806
b87f8b21
AD
158072002-05-04 Akim Demaille <akim@epita.fr>
15808
15809 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15810 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15811 Adjust dependencies.
15812 * src/output.c (token_definitions_output): Be sure not to output a
15813 `#define 'a'' when fed with `%token 'a' "a"'.
15814 * tests/regression.at (Token definitions): New.
15815
8bb936e4
PE
158162002-05-03 Paul Eggert <eggert@twinsun.com>
15817
15818 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15819 for K&R C.
15820
158212002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15822
15823 * Makefile.am (SUBDIRS): Remove intl.
15824 (EXTRA_DIST): Add config/config.rpath.
15825
53c71a12
AD
158262002-05-03 Akim Demaille <akim@epita.fr>
15827
15828 * data/bison.simple (m4_if): Don't output empty enums.
15829 And actually, output valid enum definitions :(.
15830
289dd0cf
AD
158312002-05-03 Akim Demaille <akim@epita.fr>
15832
15833 * configure.bat: Remove, completely obsolete.
15834 * Makefile.am (EXTRA_DIST): Adjust.
15835 Don't distribute config.rpath...
15836 * config/Makefile.am (EXTRA_DIST): Do it.
15837
db85e524
AD
158382002-05-03 Akim Demaille <akim@epita.fr>
15839
15840 * configure.in (GETTEXT_VERSION): New.
15841 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15842
83ccf991
AD
158432002-05-03 Akim Demaille <akim@epita.fr>
15844
15845 * data/bison.simple (b4_token_enum): New.
15846 (b4_token_defines): Use it to output tokens both as #define and
15847 enums.
15848 Suggested by Paul Eggert.
15849 * src/output.c (token_definitions_output): Don't output spurious
15850 white spaces.
15851
1f418995
AD
158522002-05-03 Akim Demaille <akim@epita.fr>
15853
15854 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15855
45119f04
RA
158562002-05-02 Robert Anisko <robert@lrde.epita.fr>
15857
15858 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15859 Update the stack class, give a try to deque as the default container.
15860
b2d52318
AD
158612002-05-02 Akim Demaille <akim@epita.fr>
15862
15863 * data/bison.simple (yyparse): Do not implement @$ = @1.
15864 (YYLLOC_DEFAULT): Adjust to do it.
15865 * doc/bison.texinfo (Location Default Action): Fix.
15866
3a8b4109
AD
158672002-05-02 Akim Demaille <akim@epita.fr>
15868
15869 * src/reader.c (parse_braces): Merge into...
15870 (parse_action): this.
15871
84614e13
AD
158722002-05-02 Akim Demaille <akim@epita.fr>
15873
15874 * configure.in (ALL_LINGUAS): Remove.
15875 * po/LINGUAS, hr.po: New.
15876
fdbcd8e2
AD
158772002-05-02 Akim Demaille <akim@epita.fr>
15878
15879 Remove the so called hairy (semantic) parsers.
15880
15881 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15882 * src/gram.h, src/gram.c (semantic_parser): Remove.
15883 (rule_t): Remove the guard and guard_line members.
15884 * src/lex.h (token_t): remove tok_guard.
15885 * src/options.c (option_table): Remove %guard and %semantic_parser
15886 support.
15887 * src/output.c, src/output.h (guards_output): Remove.
15888 (prepare): Adjust.
15889 (token_definitions_output): Don't output the `T'
15890 tokens (???).
15891 (output_skeleton): Don't output the guards.
15892 * src/files.c, src/files.c (attrsfile): Remove.
15893 * src/reader.c (symbol_list): Remove the guard and guard_line
15894 members.
15895 Adjust dependencies.
15896 (parse_guard): Remove.
15897 * data/bison.hairy: Remove.
15898 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15899 BISON_HAIRY.
15900
82b6cb3f
AD
159012002-05-02 Akim Demaille <akim@epita.fr>
15902
15903 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15904 (parse_guard): Rename the formal argument `stack_offset' as
15905 `rule_length', which is more readable.
15906 Adjust callers.
15907 (copy_at, copy_dollar): Instead of outputting the hard coded
15908 values of $$, $n and so forth, output invocation to b4_lhs_value,
15909 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
15910 Note: this patch partially drops `semantic-parser' support: it
15911 always does `rule_length - n', where semantic parsers ought to
15912 always use `-n'.
82b6cb3f
AD
15913 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15914 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15915
6cbfbcc5
AD
159162002-05-02 Akim Demaille <akim@epita.fr>
15917
15918 * configure.in (AC_INIT): Bump to 1.49b.
15919 (AM_INIT_AUTOMAKE): Short invocation.
15920
b8548114
AD
159212002-05-02 Akim Demaille <akim@epita.fr>
15922
15923 Version 1.49a.
15924
c20cd1fa
AD
159252002-05-01 Akim Demaille <akim@epita.fr>
15926
15927 * src/skeleton.h: Remove.
15928
8a9566d4
AD
159292002-05-01 Akim Demaille <akim@epita.fr>
15930
15931 * src/skeleton.h: Fix the #endif.
15932 Reported by Magnus Fromreide.
15933
8c6d399a
PE
159342002-04-26 Paul Eggert <eggert@twinsun.com>
15935
15936 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15937 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 15938 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 15939
2b7ed18a
RA
159402002-04-25 Robert Anisko <robert@lrde.epita.fr>
15941
15942 * src/scan-skel.l: Postprocess quadrigraphs.
15943
15944 * src/reader.c (copy_character): New function, used to output
15945 single characters while replacing `[' and `]' with quadrigraphs, to
15946 avoid troubles with M4 quotes.
15947 (copy_comment): Output characters with copy_character.
15948 (read_additionnal_code): Likewise.
15949 (copy_string2): Likewise.
15950 (copy_definition): Likewise.
15951
15952 * tests/calc.at: Exercise M4 quoting.
15953
34a89c50
AD
159542002-04-25 Akim Demaille <akim@epita.fr>
15955
15956 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
15957 between `!' and the command.
15958 Reported by Paul Eggert.
15959
0dd1580a
RA
159602002-04-24 Robert Anisko <robert@lrde.epita.fr>
15961
15962 * tests/calc.at: Exercise prologue splitting.
15963
15964 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
15965 `b4_post_prologue' instead of `b4_prologue'.
15966
15967 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
15968 muscles.
15969 (output): Free pre_prologue_obstack and post_prologue_obstack.
15970 * src/files.h, src/files.c (attrs_obstack): Remove.
15971 (pre_prologue_obstack, post_prologue_obstack): New.
15972 * src/reader.c (copy_definition): Add a parameter to specify the
15973 obstack to fill, instead of using attrs_obstack unconditionally.
15974 (read_declarations): Pass pre_prologue_obstack to copy_definition if
15975 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
15976
83c1796f
PE
159772002-04-23 Paul Eggert <eggert@twinsun.com>
15978
15979 * data/bison.simple: Remove unnecessary commentary and white
15980 space differences from 1_29-branch.
15981 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
15982
15983 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
15984 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
15985 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
15986 constructors or destructors.
15987
15988 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
15989
1207eeac
AD
159902002-04-23 Akim Demaille <akim@epita.fr>
15991
15992 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
15993 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
15994 location with columns.
15995 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
15996 All reported by Paul Eggert.
15997
78ab8f67
AD
159982002-04-22 Akim Demaille <akim@epita.fr>
15999
16000 * src/reduce.c (dump_grammar): Move to...
16001 * src/gram.h, src/gram.c (grammar_dump): here.
16002 Be sure to separate long item numbers.
16003 Don't read the members of a rule's prec if its nil.
16004
133c20e2
AD
160052002-04-22 Akim Demaille <akim@epita.fr>
16006
16007 * src/output.c (table_size, table_grow): New.
16008 (MAXTABLE): Remove, replace uses with table_size.
16009 (pack_vector): Instead of dying when the table is too big, grow it.
16010
9515e8a7
AD
160112002-04-22 Akim Demaille <akim@epita.fr>
16012
16013 * data/bison.simple (yyr1): Its type is that of a token number.
16014 * data/bison.c++ (r1_): Likewise.
16015 * tests/regression.at (Web2c Actions): Adjust.
16016
23c5a174
AD
160172002-04-22 Akim Demaille <akim@epita.fr>
16018
16019 * src/reader.c (token_translations_init): 256 is now the default
16020 value for the error token, i.e., it will be assigned another
16021 number if the user assigned 256 to one of her tokens.
16022 (reader): Don't force 256 to error.
16023 * doc/bison.texinfo (Symbols): Adjust.
16024 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16025 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16026 etc. instead of 10, 20, 30 (which was used to `jump' over error
16027 (256) and undefined (2)).
16028
5fbb0954
AD
160292002-04-22 Akim Demaille <akim@epita.fr>
16030
16031 Propagate more token_number_t.
16032
16033 * src/gram.h (token_number_as_item_number)
16034 (item_number_as_token_number): New.
16035 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16036 Use it to create output_item_number_table and
16037 output_token_number_table.
16038 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16039 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16040 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16041 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16042
4f940944
AD
160432002-04-22 Akim Demaille <akim@epita.fr>
16044
16045 * src/output.h, src/output.c (get_lines_number): Remove.
16046
3ded9a63
AD
160472002-04-19 Akim Demaille <akim@epita.fr>
16048
16049 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16050 as Lex/Flex'.
16051 (Debugging): More details about enabling the debugging features.
16052 (Table of Symbols): Describe $$, $n, @$, and @n.
16053 Suggested by Tim Josling.
16054
e0c471a9
AD
160552002-04-19 Akim Demaille <akim@epita.fr>
16056
16057 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16058
fecc10cd
AD
160592002-04-10 Akim Demaille <akim@epita.fr>
16060
16061 * src/system.h: Rely on HAVE_LIMITS_H.
16062 Suggested by Paul Eggert.
16063
51dec47b
AD
160642002-04-09 Akim Demaille <akim@epita.fr>
16065
16066 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16067 full stderr, and strip it according to the bison options, instead
16068 of composing the error message from different bits.
16069 This makes it easier to check for several error messages.
16070 Adjust all the invocations.
16071 Add an invocation exercising the error token.
16072 Add an invocation demonstrating a stupid error message.
16073 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16074 Adjust the tests.
16075 Error message are for stderr, not stdout.
16076
007a50a4
AD
160772002-04-09 Akim Demaille <akim@epita.fr>
16078
16079 * src/gram.h, src/gram.c (error_token_number): Remove, use
16080 errtoken->number.
16081 * src/reader.c (reader): Don't specify the user token number (2)
16082 for $undefined, as it uselessly prevents using it.
16083 * src/gram.h (token_number_t): Move to...
16084 * src/symtab.h: here.
16085 (state_t.number): Is a token_number_t.
16086 * src/print.c, src/reader.c: Use undeftoken->number instead of
16087 hard coded 2.
16088 (Even though this 2 is not the same as above: the number of the
16089 undeftoken remains being 2, it is its user token number which
16090 might not be 2).
16091 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16092 `user_token_number_max'.
16093 Output `undef_token_number'.
16094 * data/bison.simple, data/bison.c++: Use them.
16095 Be sure to map invalid yylex return values to
16096 `undef_token_number'. This saves us from gratuitous SEGV.
16097
16098 * tests/conflicts.at (Solved SR Conflicts)
16099 (Unresolved SR Conflicts): Adjust.
16100 * tests/regression.at (Web2c Actions): Adjust.
16101
06446ccf
AD
161022002-04-08 Akim Demaille <akim@epita.fr>
16103
16104 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16105 Adding #line.
16106 Remove the duplicate `typedefs'.
16107 (RhsNumberType): Fix the declaration and various other typos.
16108 Use __ofile__.
16109 * data/bison.simple: Use __ofile__.
16110 * src/scan-skel.l: Handle __ofile__.
16111
62a3e4f0
AD
161122002-04-08 Akim Demaille <akim@epita.fr>
16113
16114 * src/gram.h (item_number_t): New, the type of item numbers in
16115 RITEM. Note that it must be able to code symbol numbers as
16116 positive number, and the negation of rule numbers as negative
16117 numbers.
16118 Adjust all dependencies (pretty many).
16119 * src/reduce.c (rule): Remove this `short *' pointer: use
16120 item_number_t.
16121 * src/system.h (MINSHORT, MAXSHORT): Remove.
16122 Include `limits.h'.
16123 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16124 (shortcpy): Remove.
16125 (MAXTABLE): Move to...
16126 * src/output.c (MAXTABLE): here.
16127 (prepare_rules): Use output_int_table to output rhs.
16128 * data/bison.simple, data/bison.c++: Adjust.
16129 * tests/torture.at (Big triangle): Move the limit from 254 to
16130 500.
16131 * tests/regression.at (Web2c Actions): Ajust.
16132
16133 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16134 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16135 passes, but produces negative #line number, once fixed, GCC is
16136 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16137 C), it passes.
16138 * src/state.h (state_h): Code input lines on ints, not shorts.
16139
bb88b0fc
AD
161402002-04-08 Akim Demaille <akim@epita.fr>
16141
16142 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16143 and then the grammar.
16144
9a636f47
AD
161452002-04-08 Akim Demaille <akim@epita.fr>
16146
16147 * src/system.h: No longer using strndup.
16148
680e8701
AD
161492002-04-07 Akim Demaille <akim@epita.fr>
16150
16151 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16152 * src/output.c (output_table_data): Return the longest number.
16153 (prepare_tokens): Output `token_number_max').
16154 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16155 New.
16156 Use them to define yy_token_number_type/TokenNumberType.
16157 Use this type for yytranslate.
16158 * tests/torture.at (Big triangle): Push the limit from 124 to
16159 253.
16160 * tests/regression.at (Web2c Actions): Adjust.
16161
817e9f41
AD
161622002-04-07 Akim Demaille <akim@epita.fr>
16163
16164 * tests/torture.at (Big triangle): New.
16165 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16166 * tests/existing.at: here.
16167
5123689b
AD
161682002-04-07 Akim Demaille <akim@epita.fr>
16169
16170 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16171 nritems.
16172 Adjust dependencies.
16173
f3849179
AD
161742002-04-07 Akim Demaille <akim@epita.fr>
16175
16176 * src/reader.c: Normalize increments to prefix form.
16177
bd02036a
AD
161782002-04-07 Akim Demaille <akim@epita.fr>
16179
16180 * src/reader.c, symtab.c: Remove debugging code.
16181
db8837cb
AD
161822002-04-07 Akim Demaille <akim@epita.fr>
16183
16184 Rename all the `bucket's as `symbol_t'.
16185
16186 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16187 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16188 * src/symtab.c, src/symtab.h (bucket): Rename as...
16189 (symbol_t): this.
16190 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16191 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16192 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16193 (buckets_new, buckets_free, buckets_do): Rename as...
16194 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16195 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16196 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16197 (symbols_new, symbols_free, symbols_do): these.
16198
72a23c97
AD
161992002-04-07 Akim Demaille <akim@epita.fr>
16200
16201 Use lib/hash for the symbol table.
16202
16203 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16204 EOF.
16205 * src/lex.c (lex): Set the `number' member of new terminals.
16206 * src/reader.c (bucket_check_defined, bucket_make_alias)
16207 (bucket_check_alias_consistence, bucket_translation): New.
16208 (reader, grammar_free, readgram, token_translations_init)
16209 (packsymbols): Adjust.
16210 (reader): Number the predefined tokens.
16211 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16212 for predefined tokens.
16213 * src/symtab.h (bucket): Remove all the hash table related
16214 members.
16215 * src/symtab.c (symtab): Replace by...
16216 (bucket_table): this.
16217 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16218 (buckets_new, buckets_do): New.
16219
280a38c3
AD
162202002-04-07 Akim Demaille <akim@epita.fr>
16221
16222 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16223 (start_symbol, max_user_token_number, semantic_parser)
16224 (error_token_number): Initialize.
16225 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16226 Initialize.
16227 (reader): Don't.
16228 (errtoken, eoftoken, undeftoken, axiom): Extern.
16229
03b31c0c
AD
162302002-04-07 Akim Demaille <akim@epita.fr>
16231
16232 * src/gram.h (rule_s): prec and precsym are now pointers
16233 to the bucket giving the priority/associativity.
16234 Member `associativity' removed: useless.
16235 * src/reduce.c, src/conflicts.c: Adjust.
16236
8b3df748
AD
162372002-04-07 Akim Demaille <akim@epita.fr>
16238
16239 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16240 Properly escape the symbols' TAG when outputting them.
16241
e601aa1d
AD
162422002-04-07 Akim Demaille <akim@epita.fr>
16243
16244 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16245
b0299a2e
AD
162462002-04-07 Akim Demaille <akim@epita.fr>
16247
16248 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16249 (LArule): this, which is an array to rule_t*.
16250 * src/print.c, src/conflicts.c: Adjust.
16251
d7e1f00c
AD
162522002-04-07 Akim Demaille <akim@epita.fr>
16253
16254 * src/gram.h (rule_t): Rename `number' as `user_number'.
16255 `number' is a new member.
16256 Adjust dependencies.
16257 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16258
cc9305dd
AD
162592002-04-07 Akim Demaille <akim@epita.fr>
16260
16261 As a result of the previous patch, it is no longer needed
16262 to reorder ritem itself.
16263
16264 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16265
b0940840
AD
162662002-04-07 Akim Demaille <akim@epita.fr>
16267
16268 Be sure never to walk through RITEMS, but use only data related to
16269 the rules themselves. RITEMS should be banished.
16270
16271 * src/output.c (output_token_translations): Rename as...
16272 (prepare_tokens): this.
16273 In addition to `translate', prepare the muscles `tname' and
16274 `toknum', which were handled by...
16275 (output_rule_data): this.
16276 Remove, and move the remainder of its outputs into...
16277 (prepare_rules): this new routines, which also merges content from
16278 (output_gram): this.
16279 (prepare_rules): Be sure never to walk through RITEMS.
16280 (output_stos): Rename as...
16281 (prepare_stos): this.
16282 (output): Always invoke prepare_states, after all, just don't use it
16283 in the output if you don't need it.
16284
643a5994
AD
162852002-04-07 Akim Demaille <akim@epita.fr>
16286
16287 * src/LR0.c (new_state): Display `nstates' as the name of the
16288 newly created state.
16289 Adjust to initialize first_state and last_state if needed.
16290 Be sure to distinguish the initial from the final state.
16291 (new_states): Create the itemset of the initial state, and use
16292 new_state.
16293 * src/closure.c (closure): Now that the initial state has its
16294 items properly set, there is no need for a special case when
16295 creating `ruleset'.
16296
16297 As a result, now the rule 0, reducing to $axiom, is visible in the
16298 outputs. Adjust the test suite.
16299
16300 * tests/conflicts.at (Solved SR Conflicts)
16301 (Unresolved SR Conflicts): Adjust.
16302 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16303 * tests/conflicts.at (S/R in initial): New.
16304
b4c4ccc2
AD
163052002-04-07 Akim Demaille <akim@epita.fr>
16306
16307 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16308 the RHS of the rules.
16309 * src/output.c (output_gram): Likewise.
16310
bba97eb2
AD
163112002-04-07 Akim Demaille <akim@epita.fr>
16312
16313 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16314 bucket.
16315 Adjust all dependencies.
16316 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16317 `number' of the buckets too.
16318 * src/gram.h: Include `symtab.h'.
16319 (associativity): Move to...
16320 * src/symtab.h: here.
16321 No longer include `gram.h'.
16322
c3b407f4
AD
163232002-04-07 Akim Demaille <akim@epita.fr>
16324
16325 * src/gram.h, src/gram.c (rules_rhs_length): New.
16326 (ritem_longest_rhs): Use it.
16327 * src/gram.h (rule_t): `number' is a new member.
16328 * src/reader.c (packgram): Set it.
16329 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16330 the end of `rules', and count them out of `nrules'.
16331 (reduce_output, dump_grammar): Adjust.
16332 * src/print.c (print_grammar): It is no longer needed to check for
16333 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16334 * tests/reduce.at (Reduced Automaton): New test.
16335
11652ab3
AD
163362002-04-07 Akim Demaille <akim@epita.fr>
16337
16338 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16339 lacking `+ 1' to nrules, Bison reported as useless a token if it
16340 was used solely to set the precedence of the last rule...
16341
26b23c1a
AD
163422002-04-07 Akim Demaille <akim@epita.fr>
16343
16344 * data/bison.c++, data/bison.simple: Don't output the current file
16345 name in #line, to avoid useless diffs between two identical
16346 outputs under different names.
16347
18bcecb0
AD
163482002-04-07 Akim Demaille <akim@epita.fr>
16349
16350 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16351 Normalize loops to using `< nrules + 1', not `<= nrules'.
16352
fa770c86
AD
163532002-04-07 Akim Demaille <akim@epita.fr>
16354
16355 * TODO: Update.
16356
d9b739c3
AD
163572002-04-07 Akim Demaille <akim@epita.fr>
16358
16359 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16360 bucket.value as bucket.number.
16361
99013900
AD
163622002-04-07 Akim Demaille <akim@epita.fr>
16363
16364 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16365 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16366 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16367 RHS, instead of being an index in RITEMS.
16368
e966383b
PE
163692002-04-04 Paul Eggert <eggert@twinsun.com>
16370
16371 * doc/bison.texinfo: Update copyright date.
16372 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16373 (Symbols): Warn about running Bison in one character set,
16374 but compiling and/or running in an incompatible one.
16375 Warn about character code 256, too.
16376
163772002-04-03 Paul Eggert <eggert@twinsun.com>
16378
16379 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16380 YYERROR_VERBOSE is nonzero, not whether it is defined.
16381
16382 Merge changes from bison-1_29-branch.
c307773e 16383
8d6c48b9
PE
163842002-03-20 Paul Eggert <eggert@twinsun.com>
16385
16386 Merge fixes from Debian bison_1.34-1.diff.
16387
16388 * configure.in (AC_PREREQ): 2.53.
16389
e53c6322
AD
163902002-03-20 Akim Demaille <akim@epita.fr>
16391
16392 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16393
9ffbeca7
PE
163942002-03-19 Paul Eggert <eggert@twinsun.com>
16395
21db0b2a
PE
16396 * src/bison.simple (YYCOPY): New macro.
16397 (YYSTACK_RELOCATE): Use it.
16398 Remove Type arg; no longer needed. All callers changed.
16399 (yymemcpy): Remove; no longer needed.
16400
9ffbeca7
PE
16401 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16402 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16403
642cb8f8
AD
164042002-03-19 Akim Demaille <akim@epita.fr>
16405
16406 Test and fix the #line outputs.
16407
16408 * tests/atlocal.at (GCC): New.
16409 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 16410 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
16411 (Action synch line, Epilogue synch line): New tests.
16412 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16413 * data/bison.simple, data/bison.c++: Use it.
16414
3c31a486
AD
164152002-03-19 Akim Demaille <akim@epita.fr>
16416
16417 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16418 (Solved SR Conflicts, %expect not enough, %expect right)
16419 (%expect too much): Move to...
16420 * tests/conflicts.at: this new file.
16421
0d8bed56
AD
164222002-03-19 Akim Demaille <akim@epita.fr>
16423
16424 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16425 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16426 that we can move to enums for instance.
16427 * src/output.c (token_definitions_output): Output a list of
16428 `token-name, token-number' instead of the #define.
16429 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16430
9208d17f
AD
164312002-03-14 Akim Demaille <akim@epita.fr>
16432
16433 Use Gettext 0.11.1.
16434
af27eacb
RA
164352002-03-09 Robert Anisko <robert@lrde.epita.fr>
16436
16437 * data/bison.c++: Make the user able to add members to the generated
16438 parser by subclassing.
16439
9101a310
RA
164402002-03-05 Robert Anisko <robert@lrde.epita.fr>
16441
16442 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16443 a character.
16444 Reported by Nicolas Tisserand and Nicolas Burrus.
16445
fff9bf0b
RA
164462002-03-04 Robert Anisko <robert@lrde.epita.fr>
16447
16448 * src/reader.c: Warn about lacking semi-colons, do not complain.
16449
64dba31e
RA
164502002-03-04 Robert Anisko <robert@lrde.epita.fr>
16451
16452 * data/bison.c++: Remove a debug line.
16453
374f5a14
RA
164542002-03-04 Robert Anisko <robert@lrde.epita.fr>
16455
16456 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16457 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16458 provide a default implementation.
16459
bfcf1f3a
AD
164602002-03-04 Akim Demaille <akim@epita.fr>
16461
16462 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16463 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16464 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16465 * tests/semantic.at (Parsing Guards): Similarly.
16466 * src/reader.at (readgram): Complain if the last rule is not ended
16467 with a semi-colon.
16468
65ccf9fc
AD
164692002-03-04 Akim Demaille <akim@epita.fr>
16470
16471 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16472 * src/closure.c: here.
16473 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16474 RTC.
16475 * src/warshall.h, src/warshall.c: Remove.
16476 * tests/sets.at (Broken Closure): Adjust.
16477
d0039cbc
AD
164782002-03-04 Akim Demaille <akim@epita.fr>
16479
16480 * src/output.c (output_skeleton): tempdir is const.
16481 bytes_read is unused.
16482
345cea78
AD
164832002-03-04 Akim Demaille <akim@epita.fr>
16484
16485 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16486 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16487 Update.
16488 From Michael Hayes.
16489
564801f7
AD
164902002-03-04 Akim Demaille <akim@epita.fr>
16491
16492 * src/closure.c (closure): `r' is unused.
16493
e5352bc7
AD
164942002-03-04 Akim Demaille <akim@epita.fr>
16495
16496 * tests/sets.at (Broken Closure): Add the ending `;'.
16497 * src/reader.at (readgram): Complain if a rule is not ended with a
16498 semi-colon.
16499
914feea9
AD
165002002-03-04 Akim Demaille <akim@epita.fr>
16501
16502 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16503 (count_sr_conflicts): Use bitset_count.
16504 * src/reduce.c (inaccessable_symbols): Ditto.
16505 (bits_size): Remove.
16506 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16507
f0250de6
AD
165082002-03-04 Akim Demaille <akim@epita.fr>
16509
16510 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16511 * src/reduce.c: Remove the `bitset_zero's following the
16512 `bitset_create's, as now it is performed by the latter.
16513
ef017502
AD
165142002-03-04 Akim Demaille <akim@epita.fr>
16515
16516 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16517 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16518 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16519 latest sources from Michael.
16520
76514394
AD
165212002-03-04 Akim Demaille <akim@epita.fr>
16522
16523 * src/output.c (output): Don't free the grammar.
16524 * src/reader.c (grammar_free): New.
16525 * src/main.c (main): Call it and don't free symtab here.
16526
55024580
AD
165272002-03-04 Akim Demaille <akim@epita.fr>
16528
16529 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16530 before returning.
16531 Reported by Benoit Perrot.
16532
f9abaa2c
AD
165332002-03-04 Akim Demaille <akim@epita.fr>
16534
16535 Use bitset operations when possible, not loops over bits.
16536
16537 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16538 bitset_or.
16539 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16540 * src/reduce.c (useless_nonterminals): Formatting changes.
16541 * src/warshall.c (TC): Use bitset_or.
16542
0e721e75
AD
165432002-03-04 Akim Demaille <akim@epita.fr>
16544
16545 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16546 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16547 Ditto.
16548
0fb1ffb1
AD
165492002-03-04 Akim Demaille <akim@epita.fr>
16550
16551 * src/lalr.c (F): Now a bitset*.
16552 Adjust all dependencies.
16553
b86796bf
AD
165542002-03-04 Akim Demaille <akim@epita.fr>
16555
16556 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16557 Adjust all dependencies.
16558
602bbf31
AD
165592002-03-04 Akim Demaille <akim@epita.fr>
16560
16561 * src/L0.c, src/LR0.h (nstates): Be size_t.
16562 Adjust comparisons (signed vs unsigned).
16563 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16564 bitset*.
16565 Adjust all dependencies.
16566
d8a0245c
AD
165672002-03-04 Akim Demaille <akim@epita.fr>
16568
16569 * src/closure.c (firsts): Now, also a bitset.
16570 Adjust all dependencies.
16571 (varsetsize): Remove, now unused.
16572 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16573
34ba9743
AD
165742002-03-04 Akim Demaille <akim@epita.fr>
16575
16576 * src/print.c: Convert to use bitset.h, not hand coded iterations
16577 over ints.
16578
ed86e78c
AD
165792002-03-04 Akim Demaille <akim@epita.fr>
16580
16581 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16582
dfdb1797
AD
165832002-03-04 Akim Demaille <akim@epita.fr>
16584
16585 * src/closure.c (ruleset): Be a bitset.
16586 (rulesetsize): Remove.
16587
7086e707
AD
165882002-03-04 Akim Demaille <akim@epita.fr>
16589
16590 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16591 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16592 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16593 * src/closure.c (fderives): Be an array of bitsets.
16594
98254360
RA
165952002-02-28 Robert Anisko <robert@lrde.epita.fr>
16596
16597 * data/bison.c++: Merge the two generated headers. Insert a copyright
16598 notice in each output file.
16599
a75c057f
AD
166002002-02-28 Akim Demaille <akim@epita.fr>
16601
16602 * data/bison.c++: Copy the prologue of bison.simple to fetch
16603 useful M4 definitions, such as b4_header_guard.
16604
06b00abc
AD
166052002-02-25 Akim Demaille <akim@epita.fr>
16606
16607 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
16608 translator friendly scheme for the bgr
16609 copyright notice.
06b00abc 16610
70e7d534
AD
166112002-02-25 Akim Demaille <akim@epita.fr>
16612
16613 * src/output.c (header_output): Remove, now handled completely via
16614 M4.
16615
abe017f6
AD
166162002-02-25 Akim Demaille <akim@epita.fr>
16617
16618 * m4/m4.m4: New, from CVS Autoconf.
16619 * configure.in: Invoke it.
16620 * src/output.c (output_skeleton): Use its result instead of the
16621 hard coded name.
16622
381fb12e
AD
166232002-02-25 Akim Demaille <akim@epita.fr>
16624
16625 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16626 Fileutils 4.1.5.
16627 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16628 * src/output.c (output_skeleton): Use mkstemp to create a real
16629 temporary file.
16630 Move the filling of `skeleton' and its muscle to...
16631 (prepare): here.
16632 (output): Move the definition of the prologue muscle to...
16633 (prepare): here.
16634 * src/system.h (DEFAULT_TMPDIR): New.
16635
6f38107f
PE
166362002-02-14 Paul Eggert <eggert@twinsun.com>
16637
16638 Remove the support for C++ namespace cleanliness; it was
16639 causing more problems than it was curing, since it didn't work
16640 properly on some nonstandard C++ compilers. This can wait
16641 for a proper C++ parser.
16642
16643 * NEWS: Document this.
16644 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16645 of C++, as it's treated like C now.
16646 * src/bison.simple (YYSTD): Remove.
16647 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16648 Treat C++ just like Standard C instead of trying to support
16649 namespace cleanliness.
16650
80cce3da
AD
166512002-02-14 Akim Demaille <akim@epita.fr>
16652
16653 * tests/regression.at (else): Adjust to Andreas' change.
16654
842e8679
AD
166552002-02-14 Akim Demaille <akim@epita.fr>
16656
16657 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16658
4bda3f10
AD
166592002-02-13 Andreas Schwab <schwab@suse.de>
16660
16661 * src/output.c (output_rule_data): Don't output NULL, it might
16662 not be defined yet.
16663
4162fa07 166642002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 16665
4162fa07
RA
16666 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16667 (Copyright notice): Update.
b418ecd8 16668
bd16a5dc
AD
166692002-02-11 Akim Demaille <akim@epita.fr>
16670
16671 * tests/regression.at (%nonassoc and eof): Don't include
16672 nonportable headers.
16673
8d69a1a3
RA
166742002-02-08 Robert Anisko <robert@lrde.epita.fr>
16675
16676 * data/bison.c++: Correct error recovery. Make the user able to
16677 initialize the starting location.
16678
9b2d0677
AD
166792002-02-07 Akim Demaille <akim@epita.fr>
16680
16681 * tests/input.at: New.
16682
69e2658b
RA
166832002-02-07 Robert Anisko <robert@lrde.epita.fr>
16684
16685 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 16686 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
16687 directives around tables only needed for debugging.
16688
4aacc3a7
RA
166892002-02-07 Robert Anisko <robert@lrde.epita.fr>
16690
16691 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16692 C++ parsers.
16693 (yy::b4_name::parse): Use print_.
16694
762a801e
RA
166952002-02-07 Robert Anisko <robert@lrde.epita.fr>
16696
16697 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16698
4bb2bc3f
RA
166992002-02-07 Robert Anisko <robert@lrde.epita.fr>
16700
16701 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16702 C++ parsers.
16703 (yy::b4_name::parse): Build verbose error messages, and use error_.
16704
6b45a3ca
RA
167052002-02-06 Robert Anisko <robert@lrde.epita.fr>
16706
16707 * data/bison.c++: Fix m4 quoting in comments.
16708
50997c6e
RA
167092002-02-06 Robert Anisko <robert@lrde.epita.fr>
16710
16711 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16712 not expanded by m4.
16713
3f3eed27
AD
167142002-02-05 Akim Demaille <akim@epita.fr>
16715
16716 * data/bison.c++: Adjust to the M4 back end.
16717 More is certainly needed.
16718
be2a1a68
AD
167192002-02-05 Akim Demaille <akim@epita.fr>
16720
16721 Give a try to M4 as a back end.
16722
16723 * lib/readpipe.c: New, from wdiff.
16724 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16725 BISON_HAIRY.
16726 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16727 specific values. Now it is m4 that performs the lookup.
16728 * src/parse-skel.y: Remove.
16729 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16730 * src/output.c (actions_output, guards_output)
16731 (token_definitions_output): No longer keeps track of the output
16732 line number, hence remove the second argument.
16733 (guards_output): Check against the guard member of a rule, not the
16734 action member.
16735 Adjust callers.
16736 (output_skeleton): Don't look for the skeleton location, let m4 do
16737 that.
16738 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16739 file will be used.
16740 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16741 (prepare): Given that for the time being changesyntax is not
16742 usable in M4, rename the muscles using `-' to `_'.
16743 Define `defines_flag', `output_parser_name' and `output_header_name'.
16744 * src/output.h (actions_output, guards_output)
16745 (token_definitions_output): Adjust prototypes.
16746 * src/scan-skel.l: Instead of scanning the skeletons, it now
16747 processes the output of m4: `__oline__' and `#output'.
16748 * data/bison.simple: Adjust to be used by M4(sugar).
16749 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16750 to date.
16751 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16752 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16753 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16754 shamelessly stolen from CVS Autoconf.
16755
beda758b
AD
167562002-02-05 Akim Demaille <akim@epita.fr>
16757
16758 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16759 * configure.in: Check for the declarations of free and malloc.
16760 * src/muscle_tab.c: Adjust.
16761
5ece6d43
AD
167622002-02-05 Akim Demaille <akim@epita.fr>
16763
16764 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16765 which have no values.
16766
5bb18f9a
AD
167672002-02-05 Akim Demaille <akim@epita.fr>
16768
16769 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16770 * data/: here.
16771
894dd62e
PE
167722002-01-29 Paul Eggert <eggert@twinsun.com>
16773
16774 * src/bison.simple (YYSIZE_T): Do not define merely because
16775 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16776 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16777
82841af7
AD
167782002-01-27 Akim Demaille <akim@epita.fr>
16779
16780 Fix `%nonassoc and eof'.
16781
16782 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16783 which were not properly copied! Replace
16784 memcpy (res->errs, src->errs, src->nerrs);
16785 with
16786 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16787 !!!
16788 * tests/regression.at (%nonassoc and eof): Adjust to newest
16789 Autotest: `.' is not in the PATH.
16790
318b76e9
AD
167912002-01-27 Akim Demaille <akim@epita.fr>
16792
16793 * tests/sets.at (AT_EXTRACT_SETS): New.
16794 (Nullable): Use it.
16795 (Firsts): New.
16796
30d2f3d5
AD
167972002-01-26 Akim Demaille <akim@epita.fr>
16798
16799 * tests/actions.at, tests/calc.at, tests/headers.at,
16800 * tests/torture.at: Adjust to the newest Autotest which no longer
16801 forces `.' in the PATH.
16802
30f8c395
AD
168032002-01-25 Akim Demaille <akim@epita.fr>
16804
16805 * tests/regression.at (%nonassoc and eof): New.
16806 Suggested by Robert Anisko.
16807
29ae55f1
AD
168082002-01-24 Akim Demaille <akim@epita.fr>
16809
16810 Bison dumps core when trying to complain about broken input files.
16811 Reported by Cris van Pelt.
16812
16813 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16814 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16815 into...
16816 (Invalid inputs): Strengthen: exercise parse_percent_token.
16817
2b548aa6
RA
168182002-01-24 Robert Anisko <robert.anisko@epita.fr>
16819
16820 * src/Makefile.am: Add bison.c++.
16821 * src/bison.c++: New skeleton.
16822
bb0146c2
AD
168232002-01-21 Paolo Bonzini <bonzini@gnu.org>
16824
16825 * po/it.po: New.
16826
bec30531
AD
168272002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16828
16829 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16830
fc6edc45
MA
168312002-01-20 Marc Autret <marc@gnu.org>
16832
16833 * src/files.c (compute_output_file_names): Fix
16834
5e5d5415
MA
168352002-01-20 Marc Autret <marc@gnu.org>
16836
16837 * tests/output.at: New test.
16838 * src/files.c (compute_base_names): Don't map extensions when
16839 the YACC flag is set, use defaults.
16840 Reported by Evgeny Stambulchik.
16841
44ea3fbd
MA
168422002-01-20 Marc Autret <marc@gnu.org>
16843
ba0fe3c7
PE
16844 * src/system.h: Need to define __attribute__ away for non-GCC
16845 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
16846 Suggested by Albert Chin-A-Young.
16847
338963d1
TVH
168482002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16849
16850 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16851 canonical definition.
16852 * src/system.h: Use the canonical definition for PARAMS (avoids
16853 a conflict with the macro from lib/hash.h).
16854
c57b2479
AD
168552002-01-11 Akim Demaille <akim@epita.fr>
16856
16857 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 16858 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 16859
b85810ae
AD
168602002-01-09 Akim Demaille <akim@epita.fr>
16861
16862 * src/files.c, src/files.h (output_infix): New.
16863 (tab_extension): Remove.
16864 (compute_base_names): Compute the former, drop the latter.
16865 * src/output.c (prepare): Insert the muscles `output-infix', and
16866 `output-suffix'.
16867 * src/parse-skel.y (string, string.1): New.
16868 (section.header): Use it.
16869 (section.yacc): Remove.
16870 (prefix): Remove too.
16871 * src/scan-skel.l: Adjust.
16872 * src/bison.simple, src/bison.hairy: Adjust.
16873
cae60122
AD
168742002-01-09 Akim Demaille <akim@epita.fr>
16875
16876 * configure.in (WERROR_CFLAGS): Compute it.
16877 * src/Makefile.am (CFLAGS): Pass it.
16878 * tests/atlocal.in (CFLAGS): Idem.
16879 * src/files.c: Fix a few warnings.
16880 (get_extension_index): Remove, unused.
16881
ae404801
AD
168822002-01-08 Akim Demaille <akim@epita.fr>
16883
16884 * src/getargs.c (AS_FILE_NAME): New.
16885 (getargs): Use it to convert DOSish file names.
16886 * src/files.c (base_name): Rename as full_base_name to avoid
16887 clashes with `base_name ()'.
16888 (filename_split): New.
16889 (compute_base_names): N-th rewrite, using filename_split.
16890
22312b71
AD
168912002-01-08 Akim Demaille <akim@epita.fr>
16892
16893 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16894 New, stolen from the Fileutils 4.1.
16895 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16896 * configure.in: Check for the presence of memrchr, and of its
16897 prototype.
16898
a67cef01
TVH
168992002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16900
16901 * lib/hash.h (__P): Added definition for this macro.
16902 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16903 BUILT_SOURCES, to ensure they are generated first.
16904 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16905 %error-verbose to allow bootstrapping with bison 1.30x.
16906
2b25d624
AD
169072002-01-06 Akim Demaille <akim@epita.fr>
16908
16909 * src/reader.c (parse_braces): Don't fetch the next char, the
16910 convention is to fetch on entry.
16911 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16912 'switch' without a following semicolon.
16913 * tests/regression.at (braces parsing): New.
16914
3460813b
AD
169152002-01-06 Akim Demaille <akim@epita.fr>
16916
16917 Bison is dead wrong in its RR conflict reports.
16918
16919 * tests/torture.at (GNU Cim Grammar): New.
16920 * src/conflicts.c (count_rr_conflicts): Fix.
16921
73784c64
AD
169222002-01-06 Akim Demaille <akim@epita.fr>
16923
16924 Creating package.m4 from configure.ac causes too many problems.
16925
16926 * tests/Makefile.am (package.m4): Create it by hand,
16927 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16928
25d81090
AD
169292002-01-06 Akim Demaille <akim@epita.fr>
16930
16931 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16932 skeleton.h.
16933
a9b8959e
PE
169342002-01-04 Paul Eggert <eggert@twinsun.com>
16935
16936 * doc/bison.texinfo (Debugging):
16937 Remove YYSTDERR; it's no longer defined or used.
16938 Also, s/cstdio.h/cstdio/.
16939
25d81090
AD
169402002-01-03 Akim Demaille <akim@epita.fr>
16941
16942 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
16943
1109455c
AD
169442002-01-03 Akim Demaille <akim@epita.fr>
16945
16946 * src/parse-skel.y (process_skeleton): Don't bind the parser's
16947 tracing code to --trace, wait for a better --trace option, with
16948 args.
16949
7ea5e977
AD
169502002-01-03 Akim Demaille <akim@epita.fr>
16951
16952 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
16953 The ISO C++ standard is extremely clear about it: stderr is
16954 considered a macro, not a regular symbol (see table 94 `Header
16955 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
16956 Therefore std:: does not apply to it. It still does with fprintf.
16957 Also, s/cstdio.h/cstdio/.
16958
fab5b110
AD
169592002-01-03 Akim Demaille <akim@epita.fr>
16960
16961 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
16962 for non system headers.
16963
aed7fd9b
AD
169642002-01-02 Akim Demaille <akim@epita.fr>
16965
16966 Equip the skeleton chain with location tracking, runtime trace,
16967 pure parser and scanner.
16968
16969 * src/parse-skel.y: Request a pure parser, locations, and prefix
16970 renaming.
16971 (%union): Having several members with the same type does not help
16972 type mismatches, simplify.
16973 (YYPRINT, yyprint): New.
16974 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
16975 (skel_error): this.
16976 Handle locations.
16977 * src/scan-skel.l: Adjust to these changes.
16978 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
16979 (LOCATION_PRINT, skel_control_t): New.
16980
24fad99e
AD
169812001-12-30 Akim Demaille <akim@epita.fr>
16982
16983 * src/parse-skel.y: Get rid of the shift/reduce conflict:
16984 replace `gb' with BLANKS.
16985 * src/scan-skel.l: Adjust.
16986
a4b36db4
AD
169872001-12-30 Akim Demaille <akim@epita.fr>
16988
16989 * src/system.h: We don't need nor want bcopy.
16990 Throw away MS-DOS crap: we don't need getpid.
16991 * configure.in: We don't need strndup. It was even causing
16992 problems: because Flex includes the headers *before* us,
16993 _GNU_SOURCE is not defined by config.h, and therefore strndup was
16994 not visible.
16995 * lib/xstrndup.c: New.
16996 * src/scan-skel.l: Use it.
16997 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
16998 * src/parse-skel.y: Use %directives instead of #defines.
16999
1239777d
AD
170002001-12-30 Akim Demaille <akim@epita.fr>
17001
17002 * src/skeleton.h: New.
17003 * src/output.c (output_parser, output_master_parser): Remove, dead
17004 code.
17005 * src/output.h (get_lines_number, actions_output, guards_output)
17006 (token_definitions_output): Prototype them.
17007 * src/parse-skel.y: Add the license notice.
17008 Include output.h and skeleton.h.
17009 (process_skeleton): Returns void, and takes a single parameter.
17010 * src/scan-skel.l: Add the license notice.
17011 Include skeleton.h.
17012 Don't use %option yylineno: it seems that then Flex imagines
17013 REJECT has been used, and therefore it won't reallocate its
17014 buffers (which makes no other sense to me than a bug). It results
17015 in warnings for `unused: yy_flex_realloc'.
17016
9b3add5b
RA
170172001-12-30 Robert Anisko <robert.anisko@epita.fr>
17018
17019 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17020 (MUSCLE_INSERT_PREFIX): ...to there.
17021 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17022 (MUSCLE_INSERT_PREFIX): Move from here...
17023
17024 * src/bison.hairy: Add a section directive. Put braces around muscle
17025 names. This parser skeleton is still broken, but Bison should not
17026 choke on a bad muscle 'syntax'.
17027 * src/bison.simple: Add a section directive. Put braces around muscle
17028 names.
17029
17030 * src/files.h (strsuffix, stringappend): Add declarations.
17031 (tab_extension): Add declaration.
17032 (short_base_name): Add declaration.
17033
17034 * src/files.c (strsuffix, stringappend): No longer static. These
17035 functions are used in the skeleton parser.
17036 (tab_extension): New.
17037 (compute_base_names): Use the computations done in this function
fab5b110 17038 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
17039 names.
17040 (short_base_name): No longer static.
17041
17042 * src/output.c (output_skeleton): New.
17043 (output): Disable call to output_master_parser, and give a try to
17044 a new skeleton handling system.
17045 (guards_output, actions_output): No longer static.
17046 (token_definitions_output, get_lines_number): No longer static.
17047
17048 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17049
fab5b110 17050 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
17051 parse-skel.y.
17052
17053 * src/parse-skel.y: New file.
17054 * src/scan-skel.l: New file.
17055
b5b61c61
AD
170562001-12-29 Akim Demaille <akim@epita.fr>
17057
17058 %name-prefix is broken.
17059
17060 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17061 Adjust all dependencies.
17062 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17063 %name-prefix.
17064
17065 Renaming yylval but not yylloc is not consistent. Now we do.
17066
17067 * src/bison.simple: Prefix yylloc if used.
17068 * doc/bison.texinfo (Decl Summary): Document that.
17069
8c9a50be
AD
170702001-12-29 Akim Demaille <akim@epita.fr>
17071
17072 * doc/bison.texinfo: Promote `%long-directive' over
17073 `%long_directive'.
17074 Remove all references to fixed-output-files, yacc is enough.
17075
d99361e6
AD
170762001-12-29 Akim Demaille <akim@epita.fr>
17077
17078 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17079 user prologue. These are defaults.
17080 * tests/actions.at (Mid-rule actions): Make sure the user can
17081 define YYDEBUG and YYERROR_VERBOSE.
17082
b9cecb91
AD
170832001-12-29 Akim Demaille <akim@epita.fr>
17084
17085 * src/output.c (header_output): Don't forget to export YYLTYPE and
17086 yylloc.
17087 * tests/headers.at (export YYLTYPE): New, make sure it does.
17088 * tests/regression.at (%union and --defines, Invalid CPP headers):
17089 Move to...
17090 * tests/headers.at: here.
17091
aea13e97
AD
170922001-12-29 Akim Demaille <akim@epita.fr>
17093
17094 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17095
931394cb
AD
170962001-12-29 Akim Demaille <akim@epita.fr>
17097
17098 * tests/actions.at (Mid-rule actions): Output on a single line
17099 instead of several.
17100
704a47c4
AD
171012001-12-29 Akim Demaille <akim@epita.fr>
17102
17103 * doc/bison.texinfo: Formatting changes.
17104
091e20bb
AD
171052001-12-29 Akim Demaille <akim@epita.fr>
17106
17107 Don't store the token defs in a muscle, just be ready to output it
17108 on command. Now possible via `symbols'. Fixes a memory leak.
17109
17110 * src/output.c (token_definitions_output): New.
17111 (output_parser, header_output): Use it.
17112 * src/reader.c (symbols_save): Remove.
17113
cce71710
AD
171142001-12-29 Akim Demaille <akim@epita.fr>
17115
17116 * src/bison.simple: Do not provide a default for YYSTYPE and
17117 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17118 default.
17119
82c035a8
AD
171202001-12-29 Akim Demaille <akim@epita.fr>
17121
17122 Mid-rule actions are simply... ignored!
17123
17124 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17125 the empty-rule associated to the dummy symbol, not to the host
17126 rule.
17127 * tests/actions.at (Mid-rule actions): New.
17128
8419d367
AD
171292001-12-29 Akim Demaille <akim@epita.fr>
17130
17131 Memory leak.
17132
17133 * src/reader.c (reader): Free grammar.
17134
375d5806
AD
171352001-12-29 Akim Demaille <akim@epita.fr>
17136
17137 Memory leak.
17138
17139 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17140 since it allocates it for each state, although only one is needed.
17141 (allocate_storage): Do it here.
17142
f51cb8ff
AD
171432001-12-29 Akim Demaille <akim@epita.fr>
17144
17145 * src/options.h, src/options.c (create_long_option_table): Rename
17146 as...
17147 (long_option_table_new): this, with a clearer prototype.
17148 (percent_table): Remove, unused,
17149 * src/getargs.c (getargs): Adjust.
17150
29e88316
AD
171512001-12-29 Akim Demaille <akim@epita.fr>
17152
17153 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17154 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17155 as states.
17156
b9f71f19
AD
171572001-12-29 Akim Demaille <akim@epita.fr>
17158
17159 * src/lalr.c (build_relations): Rename `states' as `states1'.
17160 Sorry, I don't understand exactly what it is, no better name...
17161
1a2b5d37
AD
171622001-12-29 Akim Demaille <akim@epita.fr>
17163
17164 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17165 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17166 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17167 as rules.
17168
1cca533e
AD
171692001-12-29 Akim Demaille <akim@epita.fr>
17170
17171 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17172 ago.
17173
c03ae966
AD
171742001-12-29 Akim Demaille <akim@epita.fr>
17175
17176 * src/reader.c, src/reader.h (user_toknums): Remove.
17177 Adjust all users to use symbols[i]->user_token_number.
17178
5a670b1e
AD
171792001-12-29 Akim Demaille <akim@epita.fr>
17180
17181 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17182 Adjust all users to use symbols[i]->prec or ->assoc.
17183
ad949da9
AD
171842001-12-29 Akim Demaille <akim@epita.fr>
17185
17186 * src/reader.c, src/reader.h (tags): Remove.
17187 Adjust all users to use symbols[i]->tag.
17188
0e78e603
AD
171892001-12-29 Akim Demaille <akim@epita.fr>
17190
17191 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17192 and rule_table.
17193 * src/reader.c (packsymbols): Fill this table.
17194 Drop sprec.
17195 * src/conflicts.c (resolve_sr_conflict): Adjust.
17196 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17197 single table.
17198 Use symbols[i]->tag instead of tags[i].
17199
213e640e
AD
172002001-12-29 Akim Demaille <akim@epita.fr>
17201
17202 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17203 In addition, put a comment in there, to replace...
17204 * tests/regression.at (%union and C comments): Remove.
17205
e7b8bef1
AD
172062001-12-29 Akim Demaille <akim@epita.fr>
17207
17208 * tests/regression.at (Web2c Actions): Blindly move the actual
17209 output as expected output. The contents *seem* right to me, but I
17210 can't pretend reading perfectly parser tables... Nonetheless, all
17211 the other tests pass correctly, the table look OK, even though the
17212 presence of `$axiom' is to be noted: AFAICS it is useless (but
17213 harmless).
17214
b68e7744
AD
172152001-12-29 Akim Demaille <akim@epita.fr>
17216
17217 * src/reader.c (readgram): Don't add the rule 0 if there were no
17218 rules read. In other words, add it _after_ having performed
17219 grammar sanity checks.
17220 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17221
78d5bae9
AD
172222001-12-29 Akim Demaille <akim@epita.fr>
17223
17224 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17225 visible, and some states have now a different number.
17226
ff442794
AD
172272001-12-29 Akim Demaille <akim@epita.fr>
17228
17229 * src/reader.c (readgram): Bind the initial rule's lineno to that
17230 of the first rule.
17231 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17232 (Solved SR Conflicts): Adjust rule 0's line number.
17233
610ab194
AD
172342001-12-29 Akim Demaille <akim@epita.fr>
17235
17236 Fix the `GAWK Grammar' failure.
17237
17238 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17239 the reductions of the first state which was mistakenly confused
17240 with the final state because precisely final_state was initialized
17241 to 0.
17242 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17243 now noticed by Bison.
17244 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17245 have a reduction on $default.
17246
29d29c8f
AD
172472001-12-29 Akim Demaille <akim@epita.fr>
17248
17249 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17250 rule line numbers.
17251 * src/closure.c (print_closure): Likewise.
17252 * src/derives.c (print_derives): Likewise.
17253 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17254 now.
17255
7c6b64d0
AD
172562001-12-29 Akim Demaille <akim@epita.fr>
17257
17258 * src/lalr.c (lookaheads_print): New.
17259 (lalr): Call it when --trace-flag.
17260 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17261 are dumped.
17262
3d4daee3
AD
172632001-12-29 Akim Demaille <akim@epita.fr>
17264
17265 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17266 when walking through ritem, even via rule->rhs.
17267 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17268 (useful_production, useless_nonterminals): Likewise.
17269 (reduce_grammar_tables): Likewise, plus update nritems.
17270 * src/nullable.c (set_nullable): Likewise.
17271 * src/lalr.c (build_relations): Likewise.
17272 * tests/sets.at (Nullable): Adjust.
17273 Fortunately, now, the $axiom is no longer nullable.
17274
9e7f6bbd
AD
172752001-12-29 Akim Demaille <akim@epita.fr>
17276
17277 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17278 the 0-sentinel.
17279 * src/gram.c (ritem_longest_rhs): Likewise.
17280 * src/reduce.c (nonterminals_reduce): Likewise.
17281 * src/print_graph.c (print_graph): Likewise.
17282 * src/output.c (output_rule_data): Likewise.
17283 * src/nullable.c (set_nullable): Likewise.
17284
255ef638
AD
172852001-12-29 Akim Demaille <akim@epita.fr>
17286
17287 * src/output.c: Comment changes.
17288
0d8a7363
AD
172892001-12-27 Paul Eggert <eggert@twinsun.com>
17290
17291 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17292 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17293 Sparc, as they were causing more porting problems than the
17294 (minor) performance improvement was worth.
17295
17296 Also, catch up with 1.31's YYSTD.
17297
3db472b9
AD
172982001-12-27 Akim Demaille <akim@epita.fr>
17299
17300 * src/output.c (output_gram): Rely on nritems, not the
17301 0-sentinel. See below.
17302 Use -1 as separator, not 0.
17303 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17304 Rely on -1 as separator in yyrhs, instead of 0.
17305 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17306 twice `Now at end of input', therefore there are two lines less to
17307 expect.
17308
b365aa05
AD
173092001-12-27 Akim Demaille <akim@epita.fr>
17310
17311 * tests/regression.at (Unresolved SR Conflicts):
17312 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17313 below.
17314
30171f79
AD
173152001-12-27 Akim Demaille <akim@epita.fr>
17316
17317 * src/LR0.c (new_state): Recognize the final state by the fact it
17318 is reached by eoftoken.
17319 (insert_start_shifting_state, insert_eof_shifting_state)
17320 (insert_accepting_state, augment_automaton): Remove, since now
17321 these states are automatically computed from the initial state.
17322 (generate_states): Adjust.
17323 * src/print.c: When reporting a rule number to the user, substract
17324 1, so that the axiom rule is rule 0, and the first user rule is 1.
17325 * src/reduce.c: Likewise.
17326 * src/print_graph.c (print_core): For the time being, just as for
17327 the report, depend upon --trace-flags to dump the full set of
17328 items.
17329 * src/reader.c (readgram): Once the grammar read, insert the rule
17330 0: `$axiom: START-SYMBOL $'.
17331 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17332 number of the states has changed (the final state is no longer
17333 necessarily the last), catch up.
17334
75142d45
AD
173352001-12-27 Akim Demaille <akim@epita.fr>
17336
17337 Try to make the use of the eoftoken valid. Given that its value
17338 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17339 is used instead of > 0 where appropriate, (ii), depend upon nritems
17340 instead of the 0-sentinel.
17341
17342 * src/gram.h, src/gram.c (nritems): New.
17343 Expected to be duplication of nitems, but for the time being...
17344 * src/reader.c (packgram): Assert nritems and nitems are equal.
17345 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17346 * src/closure.c (print_closure, print_fderives): Likewise.
17347 * src/gram.c (ritem_print): Likewise.
17348 * src/print.c (print_core, print_grammar): Likewise.
17349 * src/print_graph.c: Likewise.
17350
b7c49edf
AD
173512001-12-27 Akim Demaille <akim@epita.fr>
17352
17353 * src/main.c (main): If there are complains after grammar
17354 reductions, then output the report anyway if requested, then die.
17355 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17356 * src/reader.c (eoftoken): New.
17357 (parse_token_decl): If the token being defined has value `0', it
17358 is the eoftoken.
17359 (packsymbols): No longer hack `tags' to insert `$' by hand.
17360 Be sure to preserve the value of the eoftoken.
17361 (reader): Make sure eoftoken is defined.
17362 Initialize nsyms to 0: now eoftoken is created just like the others.
17363 * src/print.c (print_grammar): Don't special case the eof token.
17364 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17365 lie anyway, albeit pleasant.
17366 * tests/calc.at: Exercise error messages with eoftoken.
17367 Change the grammar so that empty input is invalid.
17368 Adjust expectations.
17369 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17370
ec2da99f
AD
173712001-12-27 Akim Demaille <akim@epita.fr>
17372
17373 * configure.in: Check the protos of strchr ans strspn.
17374 Replace strchr if needed.
17375 * src/system.h: Provide the protos of strchr, strspn and memchr if
17376 missing.
17377 * lib/strchr.c: New.
17378 * src/reader.c (symbols_save): Use strchr.
17379
8adfa272
AD
173802001-12-27 Akim Demaille <akim@epita.fr>
17381
17382 * src/print.c, src/print_graph.c (escape): New.
17383 Use it to quote the TAGS outputs.
17384 * src/print_graph.c (print_state): Now errors are in red, and
17385 reductions in green.
17386 Prefer high to wide: output the state number on a line of its own.
17387
80dac38c
AD
173882001-12-27 Akim Demaille <akim@epita.fr>
17389
17390 * src/state.h, src/state.c (reductions_new): New.
17391 * src/LR0.c (set_state_table): Let all the states have a
17392 `reductions', even if reduced to 0.
17393 (save_reductions): Adjust.
17394 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17395 * src/print.c (print_reductions, print_actions): Adjust.
17396 * src/output.c (action_row): Adjust.
17397
2cec70b9
AD
173982001-12-27 Akim Demaille <akim@epita.fr>
17399
17400 * src/state.h, src/state.c (errs_new, errs_dup): New.
17401 * src/LR0.c (set_state_table): Let all the states have an errs,
17402 even if reduced to 0.
17403 * src/print.c (print_errs, print_reductions): Adjust.
17404 * src/output.c (output_actions, action_row): Adjust.
17405 * src/conflicts.c (resolve_sr_conflict): Adjust.
17406
13ca549a
AD
174072001-12-27 Akim Demaille <akim@epita.fr>
17408
17409 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17410
5092aba5
AD
174112001-12-27 Akim Demaille <akim@epita.fr>
17412
17413 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17414 * src/print.c: here.
17415 (lookaheadset, shiftset): New, used as additional storage by
17416 print_reductions.
17417 (print_results): Adjust.
17418 (print_shifts, print_gotos, print_errs): New, extracted from...
17419 (print_actions): here.
17420 * src/print_graph.c (print_actions): Remove dead code.
17421
11e2beca
AD
174222001-12-27 Akim Demaille <akim@epita.fr>
17423
17424 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17425 `$n' and `@n'.
17426
dac3c910
AD
174272001-12-27 Akim Demaille <akim@epita.fr>
17428
17429 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17430 (build_relations): Adjust.
17431
d0b0fefa
AD
174322001-12-27 Akim Demaille <akim@epita.fr>
17433
17434 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17435 duplication.
17436
adc8c848
AD
174372001-12-27 Akim Demaille <akim@epita.fr>
17438
17439 * src/reader.c (packgram): Catch nitems overflows.
17440
14d293ac
AD
174412001-12-27 Akim Demaille <akim@epita.fr>
17442
17443 * src/files.c, src/files.h (guard_obstack): Remove.
17444 * src/output.c (output): Adjust.
17445 * src/reader.c (parse_braces): New, factoring...
17446 (copy_action, copy_guard): these two which are renamed as...
17447 (parse_action, parse_guard): these.
17448 As a voluntary consequence, using braces around guards is now
17449 mandatory.
17450
f499b062
AD
174512001-12-27 Akim Demaille <akim@epita.fr>
17452
17453 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17454 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17455 members.
17456 (symbol_list_new): Adjust.
17457 (copy_action): action_line is the first line, not the last.
17458 (copy_guard): Just as for actions, store the `action' only, not
17459 the switch/case/break flesh.
17460 Don't parse the user action that might follow the guard, let...
17461 (readgram): do it, i.e., now, there can be an action after a
17462 guard.
17463 In other words the guard is just explicitly optional.
17464 (packgram): Adjust.
17465 * src/output.c (guards_output): New.
17466 (output_parser): Call it when needed.
17467 (output): Also free the guard and attrs obstacks.
17468 * src/files.c, src/files.h (obstack_save): Remove.
17469 (output_files): Remove.
17470 As a result, if one needs the former `.act' file, using an
17471 appropriate skeleton which requires actions and guards is now
17472 required.
17473 * src/main.c (main): Adjust.
17474 * tests/semantic.at: New.
17475 * tests/regression.at: Use `input.y' as input file name.
17476 Avoid 8+3 problems by requiring input.c when the test needs the
17477 parser.
17478
d945f5cd
AD
174792001-12-27 Akim Demaille <akim@epita.fr>
17480
17481 * src/reader.c (symbol_list_new): Be sure to initialize all the
17482 fields.
17483
d200e455
AD
174842001-12-27 Akim Demaille <akim@epita.fr>
17485
17486 All the hacks using a final pseudo state are now useless.
17487
17488 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17489 * src/lalr.c (nLA): New.
17490 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17491 instead of lookaheadsp from the pseudo state (nstate + 1).
17492
f9507c28
AD
174932001-12-27 Akim Demaille <akim@epita.fr>
17494
17495 * src/output.c (action_row, token_actions): Use a state_t instead
17496 of a integer, and nlookaheads instead of the following state's
17497 lookaheadsp.
17498
065fbd27
AD
174992001-12-27 Akim Demaille <akim@epita.fr>
17500
17501 * src/conflicts.c (log_resolution, flush_shift)
17502 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17503 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17504 (conflicts_print, print_reductions): Use a state_t instead of an
17505 integer when referring to a state.
17506 As much as possible, depend upon nlookaheads, instead of the
17507 `lookaheadsp' member of the following state (since lookaheads of
17508 successive states are successive, the difference between state n + 1
17509 and n served as the number of lookaheads for state n).
17510 * src/lalr.c (add_lookback_edge): Likewise.
17511 * src/print.c (print_core, print_actions, print_state)
17512 (print_results): Likewise.
17513 * src/print_graph.c (print_core, print_actions, print_state)
17514 (print_graph): Likewise.
17515 * src/conflicts.h: Adjust.
17516
1b177bd7
AD
175172001-12-27 Akim Demaille <akim@epita.fr>
17518
17519 * src/bison.hairy: Formatting/comment changes.
17520 ANSIfy.
17521 Remove `register' indications.
17522 Add plenty of `static'.
17523
7742ddeb
AD
175242001-12-27 Akim Demaille <akim@epita.fr>
17525
17526 * src/output.c (prepare): Drop the muscle `ntbase' which
17527 duplicates ntokens.
17528 * src/bison.simple: Formatting/comment changes.
17529 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17530 is an undocumented synonym.
17531
1fa14068
AD
175322001-12-22 Akim Demaille <akim@epita.fr>
17533
17534 * src/output.c (output_table_data): Change the prototype to use
17535 `int' for array ranges: some invocations do pass an int, not a
17536 short.
17537 Reported by Wayne Green.
17538
b9752825
AD
175392001-12-22 Akim Demaille <akim@epita.fr>
17540
17541 Some actions of web2c.y are improperly triggered.
17542 Reported by Mike Castle.
17543
17544 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17545 * tests/regression.at (Web2c): Rename as...
17546 (Web2c Report): this.
17547 (Web2c Actions): New.
17548
776209d6
AD
175492001-12-22 Akim Demaille <akim@epita.fr>
17550
17551 Reductions in web2c.y are improperly reported.
17552 Reported by Mike Castle.
17553
17554 * src/conflicts.c (print_reductions): Fix.
17555 * tests/regression.at (Web2c): New.
17556
275fc3ad
AD
175572001-12-18 Akim Demaille <akim@epita.fr>
17558
17559 Some host fail on `assert (!"foo")', which expands to
17560 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17561 Reported by Nelson Beebee.
17562
17563 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17564 `#define it_succeeded 0' and `assert (it_succeeded)'.
17565
897668ee
MA
175662001-12-17 Marc Autret <autret_m@epita.fr>
17567
17568 * src/bison.simple: Don't hard code the skeleton line and filename.
17569 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17570 New line counter 'skeleton_line' (skeleton-line muscle).
17571
ab3399e0
PE
175722001-12-17 Paul Eggert <eggert@twinsun.com>
17573
17574 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17575 YYDEBUG must be defined to a nonzero value.
17576
17577 * src/bison.simple (yytname): Do not assume that the user defines
17578 YYDEBUG to a properly parenthesized expression.
17579
3877f72b
AD
175802001-12-17 Akim Demaille <akim@epita.fr>
17581
17582 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17583 nlookaheads is a new member.
17584 Adjust all users.
17585 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17586 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17587 state.
776209d6 17588
331dbc1b
AD
175892001-12-17 Akim Demaille <akim@epita.fr>
17590
17591 * src/files.h, src/files.c (open_files, close_files): Remove.
17592 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17593 let...
17594 * src/reader.c (reader): Do it.
776209d6 17595
be750e4c
AD
175962001-12-17 Akim Demaille <akim@epita.fr>
17597
17598 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 17599
709ae8c6
AD
176002001-12-17 Akim Demaille <akim@epita.fr>
17601
17602 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17603 (flush_reduce): New.
17604 (resolve_sr_conflict): Adjust.
776209d6 17605
f87685c3
AD
176062001-12-17 Akim Demaille <akim@epita.fr>
17607
17608 * src/output.c (output_obstack): Be static and rename as...
17609 (format_obstack): this, to avoid any confusion with files.c's
17610 output_obstack.
17611 * src/reader.h (muscle_obstack): Move to...
17612 * src/output.h: here, since it's defined in output.c.
17613
837491d8
AD
176142001-12-17 Akim Demaille <akim@epita.fr>
17615
17616 * src/output.c (action_row, save_column, default_goto)
17617 (sort_actions, matching_state, pack_vector): Better variable
17618 locality.
17619
796d61fb
AD
176202001-12-17 Akim Demaille <akim@epita.fr>
17621
17622 * src/output.c: Various formatting changes.
776209d6 17623
64d15509
AD
176242001-12-17 Akim Demaille <akim@epita.fr>
17625
17626 * src/files.c (output_files): Free the output_obstack.
17627 * src/main.c (main): Call print and print_graph conditionally.
17628 * src/print.c (print): Work unconditionally.
17629 * src/print_graph.c (print_graph): Work unconditionally.
17630 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17631
fbc8ecb7
MA
176322001-12-16 Marc Autret <autret_m@epita.fr>
17633
17634 * src/output.c (actions_output): Fix. When we use %no-lines,
17635 there is one less line per action.
17636
f0440388
MA
176372001-12-16 Marc Autret <autret_m@epita.fr>
17638
17639 * src/bison.simple: Remove a useless #line directive.
17640 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17641 * src/output.c (get_lines_number): New.
776209d6 17642 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
17643 output muscles.
17644 Fix line numbering.
17645 (actions_output): Computes the number of lines taken by actions.
17646 (output_master_parser): Insert new skeleton which is the name of
17647 the output parser file name.
17648
a79986b8
MA
176492001-12-15 Marc Autret <autret_m@epita.fr>
17650
17651 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17652
4ec8e00f
MA
176532001-12-15 Marc Autret <autret_m@epita.fr>
17654
17655 * src/output.c (output_gram): Keep track of the hairy one.
17656
1a4648ff
AD
176572001-12-15 Akim Demaille <akim@epita.fr>
17658
17659 Make `make distcheck' work.
17660
17661 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17662 system.h which uses libgettext.h.
17663
9c2c67e6
AD
176642001-12-15 Akim Demaille <akim@epita.fr>
17665
17666 * src/nullable.c (set_nullable): Useless rules must be skipped,
17667 otherwise, since we range over their symbols, we might look at a
17668 nonterminal which no longer ``exists'', i.e., it is not counted in
17669 `nvars', hence we overflow our arrays.
17670
93ede233
AD
176712001-12-15 Akim Demaille <akim@epita.fr>
17672
17673 The header can also be produced directly, without any obstack!
17674 Yahoo!
17675
17676 * src/files.c, src/files.h (defines_obstack): Remove.
17677 (compute_header_macro): Global.
17678 (defines_obstack_save): Remove.
17679 * src/reader.c (parse_union_decl): No longer output to
17680 defines_obstack: its content can be found in the `stype' muscle
17681 anyway.
17682 (output_token_translations): Merge into...
17683 (symbols_output): this.
17684 Rename as...
17685 (symbols_save): this.
17686 (reader): Adjust.
17687 * src/output.c (header_output): New.
17688 (output): Call it.
17689
2666f928
AD
176902001-12-15 Akim Demaille <akim@epita.fr>
17691
17692 * src/reader.c (parse_union_decl): Instead of handling two obstack
17693 simultaneously, use one to define the `stype' muscle, and use the
17694 value of the latter to fill defines_obstack.
17695 (copy_comment): Remove.
17696 (copy_comment2): Work for a single obstack.
17697 Rename as...
17698 (copy_comment): this.
17699
428046f8
AD
177002001-12-15 Akim Demaille <akim@epita.fr>
17701
17702 * src/lex.c, src/lex.h (xgetc): No longer static.
17703 * src/reader.c (parse_union_decl): Revamp.
17704
ea52d706
AD
177052001-12-15 Akim Demaille <akim@epita.fr>
17706
17707 Still making progress in separating Bison into (i) input, (ii)
17708 process, (iii) output: now we can directly output the parser file
17709 without using table_obstack at all.
17710
17711 * src/files.c, src/files.h (table_obstack): Bye bye.
17712 (parser_file_name): New.
17713 * src/files.c (compute_output_file_names): Compute it.
17714 * src/output.c (actions_output, output_parser)
17715 (output_master_parser): To a file instead of an obstack.
17716
3f96f4dc
AD
177172001-12-15 Akim Demaille <akim@epita.fr>
17718
17719 Attach actions to rules, instead of pre-outputting them to
17720 actions_obstack.
17721
17722 * src/gram.h (rule_t): action and action_line are new members.
17723 * src/reader.c (symbol_list): Likewise.
17724 (copy_action): Save the actions within the rule.
17725 (packgram): Save them in rule_table.
17726 * src/output.c (actions_output): New.
17727 (output_parser): Use it on `%%actions'.
17728 (output_rule_data): Don't free rule_table.
17729 (output): Do it.
17730 (prepare): Don't save the `action' muscle.
17731 * src/bison.simple: s/%%action/%%actions/.
17732
51576fb3
AD
177332001-12-15 Akim Demaille <akim@epita.fr>
17734
17735 * src/reader.c (copy_action): When --yacc, don't append a `;'
17736 to the user action: let it fail if lacking.
dee049eb 17737 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 17738
2648a72d
AD
177392001-12-14 Akim Demaille <akim@epita.fr>
17740
17741 * src/lex.c (literalchar): Simply return the char you decoded, non
17742 longer mess around with obstacks and int pointers.
17743 Adjust all callers.
17744
92790e5b
AD
177452001-12-14 Akim Demaille <akim@epita.fr>
17746
17747 * src/lex.c (literalchar): Don't escape the special characters,
17748 just decode them, and keep them as char (before, eol was output as
17749 the 2 char string `\n' etc.).
17750 * src/output.c (output_rule_data): Use quotearg to output the
17751 token strings.
17752
927c1557
PE
177532001-12-13 Paul Eggert <eggert@twinsun.com>
17754
17755 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17756 Do not infringe on the global user namespace when using C++.
17757 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17758 All uses of `fprintf' and `stderr' changed.
17759
17760 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17761
ed8e1f68
AD
177622001-12-13 Akim Demaille <akim@epita.fr>
17763
17764 The computation of nullable is broken: it doesn't handle empty
17765 RHS's properly.
17766
17767 * tests/torture.at (GNU AWK Grammar): New.
17768 * tests/sets.at (Nullable): New.
17769 * src/nullable.c (set_nullable): Instead of blindly looping over
17770 `ritems', loop over the rules, and then over their rhs's.
17771
17772 Work around Autotest bugs.
17773
17774 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17775 frame, because Autotest understand lines starting with a `+' as
17776 traces from the shell. Then, they are not processed properly.
17777 Admittedly an Autotest bug, but we don't have time to wait for
17778 Autotest to catch up.
17779 * tests/regression.at (Broken Closure): Adjust to the new table
17780 frames.
17781 Move to...
17782 * tests/sets.at: here.
17783
cb581495
AD
177842001-12-13 Akim Demaille <akim@epita.fr>
17785
17786 * src/closure.c (closure): Use nrules instead of playing tricks
17787 with BITS_PER_WORD.
17788
2e729273
AD
177892001-12-13 Akim Demaille <akim@epita.fr>
17790
17791 * src/print.c (print_actions): Output the handling of `$' as the
17792 traces do: shifting the token EOF. Before EOF was treated as a
17793 nonterminal.
17794 * tests/regression.at: Adjust some tests.
17795 * src/print_graph.c (print_core): Complete the set of items via
17796 closure. The next-to-final and final states are still unsatisfying,
17797 but that's to be addressed elsewhere.
17798 No longer output the rule numbers, but do output the state number.
17799 A single loop for the shifts + gotos is enough, but picked a
17800 distinct color for each.
17801 (print_graph): Initialize and finalize closure.
17802
107f7dfb
AD
178032001-12-13 Akim Demaille <akim@epita.fr>
17804
17805 * src/reader.c (readgram): Remove dead code, an strip useless
17806 braces.
17807 (get_type): Remove, unused.
17808
9b53a24f
AD
178092001-12-12 Akim Demaille <akim@epita.fr>
17810
17811 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17812 on that of lib/error.c.
17813
dbfb6dcd
AD
178142001-12-12 Akim Demaille <akim@epita.fr>
17815
17816 Some hosts don't like `/' in includes.
17817
17818 * src/system.h: Include libgettext.h without qualifying the path.
17819 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17820 $(top_srcdir).
17821
c25fb648
MA
178222001-12-11 Marc Autret <autret_m@epita.fr>
17823
17824 * src/output.c (output_parser): Remove useless muscle.
17825
710ddc4f
MA
178262001-12-11 Marc Autret <autret_m@epita.fr>
17827
17828 * src/bison.simple: Remove #line just before %%epilogue. It
17829 is now handled in ...
17830 * src/reader.c (read_additionnal_code): Add the output of a
17831 #line for the epilogue.
17832
e83d80b8
MA
178332001-12-10 Marc Autret <autret_m@epita.fr>
17834
927c1557 17835 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
17836 replace precedent remove.
17837 * src/bison.simple: Remove #line before %%prologue because
17838 %%input-line is wrong at this time.
17839
971d5158
MA
178402001-12-10 Marc Autret <autret_m@epita.fr>
17841
17842 * src/reader.c (symbols_output): Clean up.
927c1557 17843 * src/output.c (output_gram, output): Clean up.
971d5158 17844
5edafffd
AD
178452001-12-10 Akim Demaille <akim@epita.fr>
17846
17847 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17848 * src/LR0.c (set_state_table): here.
17849 * src/lalr.c (lalr): Call it.
17850
0279f8e9
AD
178512001-12-10 Akim Demaille <akim@epita.fr>
17852
17853 * src/state.h (shifts): Remove the `number' member: shifts are
17854 attached to state, hence no longer need to be labelled with a
17855 state number.
17856
190c4f5f
AD
178572001-12-10 Akim Demaille <akim@epita.fr>
17858
17859 Now that states have a complete set of members, the linked list of
17860 shifts is useless: just fill directly the state's shifts member.
17861
17862 * src/state.h (shifts): Remove the `next' member.
17863 * src/LR0.c (first_state, last_state): Remove.
17864 Adjust the callers.
17865 (augment_automaton): Don't look for the shifts that must be added
17866 a shift on EOF: it is those of the state we looked for! But now,
17867 since shifts are attached, it is no longer needed to looking
17868 merely by its id: its number.
17869
2a73b93d
AD
178702001-12-10 Akim Demaille <akim@epita.fr>
17871
17872 * src/LR0.c (augment_automaton): Better variable locality.
17873 Remove an impossible branch: if there is a state corresponding to
17874 the start symbol being shifted, then there is shift for the start
17875 symbol from the initial state.
17876
74392f6a
AD
178772001-12-10 Akim Demaille <akim@epita.fr>
17878
17879 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17880 only when appropriate: when insert_start_shifting_state' is not
17881 invoked.
17882 * tests/regression.at (Rule Line Numbers): Adjust.
17883
37c82725
AD
178842001-12-10 Akim Demaille <akim@epita.fr>
17885
17886 * src/LR0.c (augment_automaton): Now that all states have shifts,
17887 merge the two cases addition shifts to the initial state.
17888
6a164e0c
AD
178892001-12-10 Akim Demaille <akim@epita.fr>
17890
17891 * src/lalr.c (set_state_table): Move to...
17892 * src/LR0.c: here.
17893 * src/lalr.c (lalr): Don't call it...
17894 * src/LR0.c (generate_states): do it.
17895 * src/LR0.h (first_state): Remove, only the table is used.
17896
7215de24
AD
178972001-12-10 Akim Demaille <akim@epita.fr>
17898
17899 * src/LR0.h (first_shift, first_reduction): Remove.
17900 * src/lalr.c: Don't use first_shift: find shifts through the
17901 states.
17902
80e25d4d
AD
179032001-12-10 Akim Demaille <akim@epita.fr>
17904
17905 * src/LR0.c: Attach shifts to states as soon as they are
17906 computed.
17907 * src/lalr.c (set_state_table): Instead of assigning shifts to
17908 state, just assert that the mapping was properly done.
17909
0ab3728b
AD
179102001-12-10 Akim Demaille <akim@epita.fr>
17911
17912 * src/LR0.c (insert_start_shift): Rename as...
17913 (insert_start_shifting_state): this.
17914 (insert_eof_shifting_state, insert_accepting_state): New.
17915 (augment_automaton): Adjust.
17916 Better locality of the variables.
17917 When looking if the start_symbol is shifted from the initial
17918 state, using `while (... symbol != start_symbol ...)' sounds
17919 better than `while (... symbol < start_symbol ...)': If fail
17920 to see how the order between symbols could be relevant!
17921
78af9bbc
AD
179222001-12-10 Akim Demaille <akim@epita.fr>
17923
17924 * src/getargs.h: Don't declare `spec_name_prefix' and
17925 `spec_file_prefix', declared by src/files.h.
17926 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17927 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17928 * src/output.c (prepare): Adjust.
17929 * src/reader.c (symbols_output): Likewise.
17930 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17931
bdef2a41
AD
179322001-12-10 Akim Demaille <akim@epita.fr>
17933
17934 * src/muscle_tab.c (muscle_init): NULL is a better default than
17935 `"0"'.
17936
3735969c
AD
179372001-12-10 Akim Demaille <akim@epita.fr>
17938
17939 * src/reader.c (reader): Calling symbols_output once is enough.
17940
49701457
AD
179412001-12-10 Akim Demaille <akim@epita.fr>
17942
17943 Now that states have a complete set of members, the linked list of
17944 reductions is useless: just fill directly the state's reductions
17945 member.
17946
17947 * src/state.h (struct reductions): Remove member `number' and
17948 `next'.
17949 * src/LR0.c (first_reduction, last_reduction): Remove.
17950 (save_reductions): Don't link the new reductions, store them in
17951 this_state.
17952 * src/lalr.c (set_state_table): No need to attach reductions to
17953 states, it's already done.
17954 * src/output.c (output_actions): No longer free the shifts, then
17955 the reductions, then the states: free all the states and their
17956 members.
17957
0edad749
AD
179582001-12-10 Akim Demaille <akim@epita.fr>
17959
17960 * src/options.c (OPTN, DRTV, BOTH): New.
17961 (option_table): Use them.
17962
0edad749
AD
17963 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
17964 the job of system.h.
17965 * src/options.c: Don't include stdio.h and xalloc.h for the same
17966 reasons.
17967
5449dd0f
AD
179682001-12-10 Akim Demaille <akim@epita.fr>
17969
17970 * src/output.c (output, prepare): Make sure the values of the
17971 muscles `action' and `prologue' are 0-terminated.
17972
a870c567
AD
179732001-12-10 Akim Demaille <akim@epita.fr>
17974
17975 Clean up GCC warnings.
17976
17977 * src/reader.c (copy_action): `buf' is not used.
17978 (parse_skel_decl): Be static.
17979 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
17980 * src/options.h (create_long_option_table): Have a real prototype.
17981 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
17982 (hash_delete_at): Return const void *.
17983 Adjust casts to preserve the const.
17984
80df8768
AD
179852001-12-10 Akim Demaille <akim@epita.fr>
17986
17987 * configure.in: Require 2.52g.
17988 M4 is not needed, but AUTOM4TE is.
17989 * m4/m4.m4: Remove.
17990 * tests/Makefile.am: Adjust.
17991
f693ad14
AD
179922001-12-10 Akim Demaille <akim@epita.fr>
17993
17994 One structure for states is enough, even though theoretically
17995 there are LR(0) states and LALR(1) states.
17996
17997 * src/lalr.h (state_t): Remove.
17998 (state_table): Be state_t **, not state_t *.
17999 * src/state.h (core, CORE_ALLOC): Rename as...
18000 (state_t, STATE_ALLOC): this.
18001 Add the LALR(1) members: shifts, reductions, errs.
18002 * src/LR0.c (state_table): Rename as...
18003 (state_hash): this, to avoid name clashes with the global
18004 `state_table'.
18005 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18006 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18007
74ffbcb6
AD
180082001-12-10 Akim Demaille <akim@epita.fr>
18009
18010 Bison dumps core on bash.y.
18011 Reported by Pascal Bart.
18012
18013 * src/warshall.c (bitmatrix_print): New.
18014 (TC): Use it.
ba0fe3c7 18015 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
18016 j must be the outer loop.
18017 * tests/regression.at (Broken Closure): New.
18018
07708e19
AD
180192001-12-05 Akim Demaille <akim@epita.fr>
18020
18021 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18022 its argument.
ba1ecc07 18023 Reported by Peter Hamorsky.
07708e19 18024
92b16366
AD
180252001-12-05 Akim Demaille <akim@epita.fr>
18026
18027 * src/conflicts.c (err_table): Remove.
18028 (resolve_sr_conflict): Adjust.
18029 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18030 Rename as...
18031 (state_t.reductions, state_t.shifts): this.
18032
076ab033
AD
180332001-12-05 Akim Demaille <akim@epita.fr>
18034
18035 * src/reduce.c (reduce_grammar_tables): No longer disable the
18036 removal of useless rules via CPP but via `if (0)', so that the
18037 compiler still check the code is valid.
18038 For instance, it should have noticed `rline' no longer exists: use
18039 the `line' member of rule_t.
18040 * src/gram.c (dummy, rline): Remove, unused.
18041
3843c413
AD
180422001-12-05 Akim Demaille <akim@epita.fr>
18043
18044 * src/output.c (pack_vector): Use assert, not berror.
18045 * src/main.c (berror): Remove, unused.
18046
43168960
AD
180472001-12-05 Akim Demaille <akim@epita.fr>
18048
18049 New experimental feature: if --verbose --trace output all the
18050 items of a state, not only its kernel.
18051
18052 * src/print.c (print_core): If `trace_flag', then invoke closure
18053 before outputting the items of the state (print_core is no longer
18054 a correct name them).
18055 (print_results): Invoke new_closure/free_closure if needed.
18056
b2872512
AD
180572001-12-05 Akim Demaille <akim@epita.fr>
18058
18059 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18060 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18061 (nitemset): for consistency with the rest of the project.
18062
23cbcc6c
AD
180632001-12-05 Akim Demaille <akim@epita.fr>
18064
18065 * src/closure.c (print_closure): Improve.
18066 (closure): Use it for printing input and output.
18067
03ec521c
AD
180682001-12-05 Akim Demaille <akim@epita.fr>
18069
18070 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18071 indexed by nonterminals.
18072
3a7456dd
AD
180732001-12-05 Akim Demaille <akim@epita.fr>
18074
18075 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18076 what it was!).
18077 * src/warshall.h: Remove accidental duplication of the content.
18078
1cbcf2e7
AD
180792001-12-05 Akim Demaille <akim@epita.fr>
18080
18081 * src/closure.c (set_fderives): De-obfuscate.
18082
84182270
AD
180832001-12-05 Akim Demaille <akim@epita.fr>
18084
18085 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18086
3f6f053c
AD
180872001-12-05 Akim Demaille <akim@epita.fr>
18088
18089 * src/closure.c (set_firsts): De-obfuscate.
18090
7a5350ba
AD
180912001-12-05 Akim Demaille <akim@epita.fr>
18092
18093 * src/output.c (action_row): De-obfuscate
18094 using the good o' techniques: arrays not pointers, variable
18095 locality, BITISSET, RESETBIT etc.
18096
d954473d
AD
180972001-12-05 Akim Demaille <akim@epita.fr>
18098
18099 Pessimize the code to simplify it: from now on, all the states
18100 have a valid SHIFTS, which NSHIFTS is possibly 0.
18101
18102 * src/LR0.c (shifts_new): Be global and move to..
18103 * src/state.c, src/state.h: here.
18104 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18105 * src/print_graph: Adjust.
18106
9839bbe5
AD
181072001-12-05 Akim Demaille <akim@epita.fr>
18108
18109 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18110 * src/conflicts.c: Use it.
18111 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18112 incorrectly ``simplified''.
18113
9f136c07
AD
181142001-12-05 Akim Demaille <akim@epita.fr>
18115
18116 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18117 using the good o' techniques: arrays not pointers, variable
18118 locality, BITISSET, RESETBIT etc.
18119
b608206e
AD
181202001-12-05 Akim Demaille <akim@epita.fr>
18121
18122 * src/state.h (SHIFT_SYMBOL): New.
18123 * src/conflicts.c: Use it to deobfuscate.
18124
52afa962
AD
181252001-12-05 Akim Demaille <akim@epita.fr>
18126
18127 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18128 (print_reductions): De-obfuscate using the good o' techniques:
18129 arrays not pointers, variable locality, BITISSET.
18130
e74dc321
AD
181312001-12-05 Akim Demaille <akim@epita.fr>
18132
18133 * src/conflicts.c (print_reductions): Arrays, not pointers.
18134 Use BITISSET.
18135
768fca83
AD
181362001-12-05 Akim Demaille <akim@epita.fr>
18137
18138 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18139
a17e599f
AD
181402001-12-05 Akim Demaille <akim@epita.fr>
18141
18142 * src/conflicts.c (print_reductions): Improve variable locality.
18143
a04bc341
AD
181442001-12-05 Akim Demaille <akim@epita.fr>
18145
18146 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18147
c8ea038e
AD
181482001-12-05 Akim Demaille <akim@epita.fr>
18149
18150 * src/conflicts.c (print_reductions): Improve variable locality.
18151
aa2aab3c
AD
181522001-12-05 Akim Demaille <akim@epita.fr>
18153
18154 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18155 * src/lalr.c: Use them.
18156
b178c8cc
AD
181572001-12-05 Akim Demaille <akim@epita.fr>
18158
18159 * src/LR0.c (augment_automaton): Formatting changes.
18160 Better variable locality.
18161
f67d13aa
AD
181622001-12-05 Akim Demaille <akim@epita.fr>
18163
18164 * src/lalr.c (matrix_print): New.
18165 (transpose): Use it.
18166 Use arrays instead of pointers.
18167
c2713865
AD
181682001-12-05 Akim Demaille <akim@epita.fr>
18169
18170 * src/lalr.c (maxrhs): Move to...
18171 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18172 * src/lalr.c (build_relations): Adjust.
18173
9887c18a
AD
181742001-12-05 Akim Demaille <akim@epita.fr>
18175
18176 * src/lalr.c (transpose): Free the memory allocated to the
18177 argument, as it is replaced by the results by the unique caller.
18178 (build_relations): Merely invoke transpose: it handles the memory
18179 deallocation.
18180 Improve variable locality.
18181 Avoid variables used as mere abbreviations.
18182 (compute_lookaheads): Use arrays instead of pointers.
18183
4d4f699c
AD
181842001-12-05 Akim Demaille <akim@epita.fr>
18185
18186 * src/lalr.c (initialize_F): Improve variable locality.
18187 Avoid variables used as mere abbreviations.
18188
80a69750
AD
181892001-12-05 Akim Demaille <akim@epita.fr>
18190
18191 * src/derives.c (print_derives): Display the ruleno.
18192 * src/lalr.c (initialize_F, transpose): Better variable locality
18193 to improve readability.
18194 Avoid variables used as mere abbreviations.
18195
fe961097
AD
181962001-12-05 Akim Demaille <akim@epita.fr>
18197
18198 * src/lalr.c (traverse): Use arrays instead of pointers.
18199
e3e4e814
AD
182002001-12-05 Akim Demaille <akim@epita.fr>
18201
18202 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18203 the handling of squeue.
18204 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18205
630e182b
AD
182062001-12-05 Akim Demaille <akim@epita.fr>
18207
18208 Because useless nonterminals are now kept alive (instead of being
18209 `destroyed'), we now sometimes examine them, and store information
18210 related to them. Hence we need to know their number, and adjust
18211 memory allocations.
18212
18213 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18214 static.
18215 * src/LR0.c (allocate_itemsets): The memory allocated to
18216 `symbol_count' was used for two different purpose: once to count
18217 the number of occurrences of each symbol, and later reassigned to
18218 `shift_symbol', containing the symbol that can be shifted from a
18219 given state.
18220 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18221 only, and...
18222 (new_itemsets): Allocate `shift_symbol' here.
18223 (allocate_itemsets): symbol_count includes useless nonterminals.
18224 Make room for them.
18225 (free_storage): Use `free', not `XFREE', for pointers that cannot
18226 be null.
18227
81b51460
AD
182282001-12-05 Akim Demaille <akim@epita.fr>
18229
18230 * src/nullable.c (set_nullable): Deobfuscate the handling of
18231 ritem.
18232 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18233
3067fbef
AD
182342001-12-05 Akim Demaille <akim@epita.fr>
18235
18236 * src/gram.c, src/gram.h (ritem_print): New.
18237 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18238 (This useless function was defined only to work around VMS linkers
18239 that can't handle compilation units with variables only).
18240 * src/reduce.c (dump_grammar): Use it to trace the construction of
18241 ritem.
18242
c2bea5f9
PE
182432001-12-04 Paul Eggert <eggert@twinsun.com>
18244
7d27c823
PE
18245 * src/bison.simple (union yyalloc): Change member names
18246 to be the same as the stack names.
18247 (yyparse): yyptr is now union yyalloc *, not char *.
18248 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18249 and may generate better code on some machines.
c2bea5f9
PE
18250 (yystpcpy): Use prototype if __STDC__ is defined, not just
18251 if __cplusplus is defined.
35687a9d 18252
2c8a9dfa
AD
182532001-11-30 Akim Demaille <akim@epita.fr>
18254
18255 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18256 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18257 Gettext doesn't compile cleanly, and dies with -Werror.
18258 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18259 Include WARNING_CFLAGS here.
18260 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18261 before being defined.
18262
f4e421e6
AD
182632001-11-27 Paul Eggert <eggert@twinsun.com>
18264
18265 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18266 First arg is int, not unsigned.
18267 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18268 (SIZE_MAX, UINT_MAX): New macros.
18269 (quotearg_n_options): Abort if N is negative.
18270 Avoid overflow check on hosts where size_t is 64 bits and int
18271 is 32 bits, as overflow is impossible there.
18272 Fix off-by-one typo that caused unnecessary reallocation.
18273
7093d0f5
AD
182742001-11-29 Paul Eggert <eggert@twinsun.com>
18275
18276 Name space cleanup in generated parser.
18277
18278 * doc/bison.texinfo (Bison Parser): Discuss system headers
18279 and their effect on the user name space.
18280
18281 * src/bison.simple:
18282 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18283 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18284 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18285
18286 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18287 on user names when possible.
18288
18289 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18290 Simplify test for whather <alloca.h> exists.
18291
18292 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18293
18294 (<stdio.h>): Include if YYDEBUG.
18295
18296 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18297 ! defined (yyoverflow) && ! defined (yymemcpy).
18298
18299 (yymemcpy, yyparse): Rename local variables as needed so that
18300 they all begin with 'yy'.
18301
18302 (yystrlen, yystpcpy): New functions.
18303
18304 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18305 All uses changed.
18306
18307 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18308 instead of relying on string.h functions. Use YYSTACK_ALLOC
18309 and YYSTACK_FREE instead of malloc and free.
18310
fd51e5ff
AD
183112001-11-30 Akim Demaille <akim@epita.fr>
18312
18313 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18314 before their first uses.
18315 (YYBISON, YYPURE): Move to the top of the output.
18316
7d13ff5f
AD
183172001-11-30 Akim Demaille <akim@epita.fr>
18318
18319 * tests/reduce.at (Useless Nonterminals): Fix.
18320
892a3995
AD
183212001-11-30 Akim Demaille <akim@epita.fr>
18322
18323 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18324 if body instead of `;' to pacify GCC's warnings.
18325
68f1e3ed
AD
183262001-11-30 Akim Demaille <akim@epita.fr>
18327
18328 Instead of mapping the LHS of unused rules to -1, keep the LHS
18329 valid, but flag the rules as invalid.
18330
18331 * src/gram.h (rule_t): `useful' is a new member.
18332 * src/print.c (print_grammar): Adjust.
18333 * src/derives.c (set_derives): Likewise.
18334 * src/reader.c (packgram, reduce_output): Likewise.
18335 * src/reduce.c (reduce_grammar_tables): Likewise.
18336 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18337
d2d1b42b
AD
183382001-11-30 Akim Demaille <akim@epita.fr>
18339
18340 * src/reduce.c (reduce_output): Formatting changes.
18341 * src/print.c (print_results, print_grammar): Likewise.
18342 * tests/regression.at (Rule Line Numbers)
18343 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18344
760b53a8
AD
183452001-11-30 Akim Demaille <akim@epita.fr>
18346
18347 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18348 useless nonterminals, move them at the end of the symbol arrays.
18349 (reduce_output): Adjust.
18350 * tests/reduce.at (Useless Nonterminals): Adjust.
18351
00238958
AD
183522001-11-30 Akim Demaille <akim@epita.fr>
18353
18354 * src/reduce.c: Various comment/formatting changes.
18355 (nonterminals_reduce): New, extracted from...
18356 (reduce_grammar_tables): here.
18357 (reduce_grammar): Call nonterminals_reduce.
18358
396452de
PE
183592001-11-29 Paul Eggert <eggert@twinsun.com>
18360
18361 * src/bison.simple (YYSTACK_REALLOC): Remove.
18362 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18363 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18364 New macros.
18365 (union yyalloc): New type.
18366 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18367 an arbitrary restriction on hosts where size_t is wider than int.
18368
18369 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18370 a parser stack overflow. Allocate just one block of memory for all
18371 three stacks, instead of allocating three blocks; this typically is
18372 faster and reduces fragmentation.
18373
18374 Do not limit the number of items in the stack to a value that fits
18375 in 'int', as this is an arbitrary limit on hosts with 64-bit
18376 size_t and 32-bit int.
18377
147e184c
MA
183782001-11-29 Marc Autret <autret_m@epita.fr>
18379
18380 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18381 of defining YYERROR_VERBOSE.
18382 [AT_DATA]: $4 is now out of C declarations in the prologue.
18383
426cf563
MA
183842001-11-28 Marc Autret <autret_m@epita.fr>
18385
18386 * src/reader.c (parse_dquoted_param): New.
18387 (parse_skel_decl): Use it.
18388 * src/lex.h: Add its prototype.
18389 * src/lex.c (literalchar): Become not static.
18390
c7925b99
MA
183912001-11-28 Marc Autret <autret_m@epita.fr>
18392
18393 * src/output.h: And put its extern declaration here.
18394 * src/output.c (error_verbose): Define here.
18395 (prepare): Echo name modification.
18396 * src/getargs.h: Clean its extern declaration.
18397 * src/getargs.c (error_verbose_flag): Remove.
18398 (getargs): Remove case 'e'.
18399 * src/options.c (option_table): 'error-verbose' is now seen as simple
18400 percent option.
18401 Include output.h.
18402
18403 * src/reader.c (read_declarations): Remove case tok_include.
18404 (parse_include_decl): Remove.
18405 * src/lex.h (token_t): Remove tok_include.
18406 * src/options.c (option_table): 'include' is now a simple command line
18407 option.
18408
5b5d1929
MA
184092001-11-28 Marc Autret <autret_m@epita.fr>
18410
18411 * src/bison.simple: Adjust muscle names.
18412 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18413 * src/output.c (prepare): s/_/-/ for the muscles names.
18414 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18415
8850be4b
MA
184162001-11-28 Marc Autret <autret_m@epita.fr>
18417
18418 * src/bison.simple: Fix debug.
18419 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18420
4a38e613
AD
184212001-11-28 Akim Demaille <akim@epita.fr>
18422
18423 * src/LR0.c (shifts_new): New.
18424 (save_shifts, insert_start_shift, augment_automaton): Use it.
18425
4b35e1c1
AD
184262001-11-28 Akim Demaille <akim@epita.fr>
18427
18428 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18429 keep ruleno only.
18430
d2b04478
AD
184312001-11-28 Akim Demaille <akim@epita.fr>
18432
18433 * src/closure.c (closure): Instead of looping over word in array
18434 then bits in words, loop over bits in array.
18435
2c4c30aa
AD
184362001-11-28 Akim Demaille <akim@epita.fr>
18437
18438 * src/closure.c (closure): No longer optimize the special case
18439 where all the bits of `ruleset[r]' are set to 0, to make the code
18440 clearer.
18441
576890b7
AD
184422001-11-28 Akim Demaille <akim@epita.fr>
18443
18444 * src/closure.c (closure): `r' and `c' are new variables, used to
18445 de-obfuscate accesses to RULESET and CORE.
18446
cb487d7d
AD
184472001-11-28 Akim Demaille <akim@epita.fr>
18448
18449 * src/reduce.c (reduce_print): Use ngettext.
18450 (dump_grammar): Improve the trace accuracy.
18451
6013d43f
AD
184522001-11-28 Akim Demaille <akim@epita.fr>
18453
18454 * src/reduce.c (dump_grammar): Don't translate trace messages.
18455
cb4956ee
AD
184562001-11-28 Akim Demaille <akim@epita.fr>
18457
18458 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18459 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18460 as all tags are free'ed afterwards.
18461 From Enrico Scholz.
18462
648185ab
PE
184632001-11-27 Paul Eggert <eggert@twinsun.com>
18464
18465 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18466 use alloca when we didn't want to, and vice versa.
18467
68254a03
MA
184682001-11-27 Marc Autret <autret_m@epita.fr>
18469
9113b58f
AD
18470 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18471 initialization.
68254a03
MA
18472 * src/output.c (prepare): Remove its update.
18473
04d843a2
MA
184742001-11-27 Marc Autret <autret_m@epita.fr>
18475
18476 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18477 Use %error-verbose.
18478
d2079671 184792001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
18480
18481 * src/bison.simple: Remove YYERROR_VERBOSE using.
18482 Use %%error_verbose.
18483 (yyparse): Likewise.
18484 * src/output.c (prepare): Give its final value.
18485 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18486 * src/getargs.h: Add its extern declaration.
18487 * src/getargs.c (error_verbose_flag): New int.
18488 (getargs): Update to catch new case.
18489 * src/options.c (option_table): 'error-verbose' is a new option.
18490 (shortopts): Update.
18491
e0327bc8
AD
184922001-11-27 Akim Demaille <akim@epita.fr>
18493
18494 * src/system.h: Use intl/libgettext.h.
18495 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18496
000f1a3c
AD
184972001-11-27 Akim Demaille <akim@epita.fr>
18498
18499 * tests/torture.at (Exploding the Stack Size with Malloc):
18500 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18501
26cfe0be
AD
185022001-11-27 Akim Demaille <akim@epita.fr>
18503
18504 * src/files.c: Include error.h.
18505 Reported by Hans Aberg.
18506
f6bd5427
MA
185072001-11-26 Marc Autret <autret_m@epita.fr>
18508
d2079671 18509 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
18510 (read_declarations): Add case tok_include.
18511 * src/getargs.h (include): Add its extern definition.
18512 * src/getargs.c (include): New const char *.
18513 (getargs): Add case '-I'.
18514 * src/options.c (option_table): Add include as command line and
18515 percent option.
18516 * src/lex.h (token_t): Add tok_include.
18517
2ca209c1
AD
185182001-11-26 Akim Demaille <akim@epita.fr>
18519
18520 * src/reader.c (readgram): Make sure rules for mid-rule actions
18521 have a lineno equal to that of their host rule.
18522 Reported by Hans Aberg.
18523 * tests/regression.at (Rule Line Numbers): New.
18524
0e41b407
AD
185252001-11-26 Akim Demaille <akim@epita.fr>
18526
18527 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18528 size_ts.
18529
185302001-11-26 Akim Demaille <akim@epita.fr>
18531
18532 * src/complain.c, src/complain.h (error): Remove, provided by
18533 lib/error.[ch].
18534
e0c40012
AD
185352001-11-26 Akim Demaille <akim@epita.fr>
18536
18537 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18538 issue an error message.
18539 * tests/regression.at (Invalid %directive): New.
18540 Reported by Hans Aberg.
18541
5e147124
AD
185422001-11-26 Akim Demaille <akim@epita.fr>
18543
18544 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18545 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18546
a034c8b8
AD
185472001-11-26 Akim Demaille <akim@epita.fr>
18548
18549 * src/conflicts.c (conflicts_print): Don't complain at all when
18550 there are no reduce/reduce conflicts, and as many shift/reduce
18551 conflicts as expected.
18552 * tests/regression.at (%expect right): Adjust.
18553
c64a20f3
AD
185542001-11-23 Akim Demaille <akim@epita.fr>
18555
18556 * lib/alloca.c: Update, from fileutils.
18557
5b0d29bb
AD
185582001-11-23 Akim Demaille <akim@epita.fr>
18559
18560 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18561
722c4bfe
AD
185622001-11-23 Akim Demaille <akim@epita.fr>
18563
18564 * src/system.h: Include alloca.h.
18565 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18566
6255b435
AD
185672001-11-23 Akim Demaille <akim@epita.fr>
18568
18569 * src/print_graph.c (print_actions): Remove `rule', unused.
18570 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18571 pacify GCC's signed < unsigned warnings.
18572 * src/closure.c (itemsetsize): Likewise.
18573 * src/reader.c (symbol_list_new): Static.
18574
b29b2ed5
AD
185752001-11-23 Akim Demaille <akim@epita.fr>
18576
18577 Attaching lineno to buckets is stupid, since only one copy of each
18578 symbol is kept, only the line of the first occurrence is kept too.
18579
18580 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18581 * src/reader.c (rline_allocated): Remove, unused.
18582 (symbol_list): Have a `line' member.
18583 (symbol_list_new): New.
18584 (readgram): Use it.
18585 * src/print.c (print_grammar): Output the rule line numbers.
18586 * tests/regression.at (Solved SR Conflicts)
18587 (Unresolved SR Conflicts): Adjust.
18588 Reported by Hans Aberg.
18589
a81b1d4a
MA
185902001-11-22 Marc Autret <autret_m@epita.fr>
18591
18592 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18593
c1ecb3c1
MA
185942001-11-22 Marc Autret <autret_m@epita.fr>
18595
18596 * src/muscle_tab.c (muscle_init): Remove initialization of
18597 skeleton muscle.
18598 * src/output.c (output_master_parser): Do it here.
18599
fbe01355
AD
186002001-11-20 Akim Demaille <akim@epita.fr>
18601
18602 * po/sv.po: New.
18603 * configure.in (ALL_LINGUAS): Adjust.
18604 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18605 longer contains strings to translate.
18606
81e895c0
AD
186072001-11-19 Akim Demaille <akim@epita.fr>
18608
18609 * src/conflicts.c (conflicts_print): Add a missing \n.
18610
6bb1878b
AD
186112001-11-19 Akim Demaille <akim@epita.fr>
18612
18613 * src/nullable.c (nullable_print): New.
18614 (set_nullable): Call it when tracing.
18615 Better locality of variables.
18616
d9ec2d07
AD
186172001-11-19 Akim Demaille <akim@epita.fr>
18618
18619 * src/print.c (print_actions): Better locality of variables.
18620
720e5c1b
AD
186212001-11-19 Akim Demaille <akim@epita.fr>
18622
18623 * src/derives.c (print_derives): Fix and enrich.
18624 * src/closure.c (print_fderives): Likewise.
18625
fb908786
AD
186262001-11-19 Akim Demaille <akim@epita.fr>
18627
18628 * src/closure.c (itemsetend): Remove, replaced with...
18629 (itemsetsize): new.
18630
125ecb56
AD
186312001-11-19 Akim Demaille <akim@epita.fr>
18632
18633 * src/LR0.c (kernel_end): Remove, replaced with...
18634 (kernel_size): new.
18635
d8cf039f
AD
186362001-11-19 Akim Demaille <akim@epita.fr>
18637
18638 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18639 to clarify.
18640
7bec0760
AD
186412001-11-19 Akim Demaille <akim@epita.fr>
18642
18643 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18644
c87d4863
AD
186452001-11-19 Akim Demaille <akim@epita.fr>
18646
18647 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18648 trace messages.
18649 * src/LR0.c: Likewise.
18650 (allocate_itemsets): Use arrays instead of pointers to clarify.
18651
9bfe901c
AD
186522001-11-19 Akim Demaille <akim@epita.fr>
18653
18654 * src/getargs.c (statistics_flag): Replace with...
18655 (trace_flag): New.
18656 (longopts): Accept --trace instead of --statistics.
18657 * src/getargs.h, src/options.c: Adjust.
18658 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18659 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18660
97db7bd4
AD
186612001-11-19 Akim Demaille <akim@epita.fr>
18662
cc72668c 18663 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
18664 pointers to clarify the code.
18665 (save_reductions, save_shifts): Factor common parts of alternatives.
18666
2c5f66ed
AD
186672001-11-19 Akim Demaille <akim@epita.fr>
18668
18669 * src/LR0.c (new_state, get_state): Complete TRACE code.
18670 * src/closure.c: Include `reader.h' to get `tags', needed by the
18671 trace code.
18672 Rename the conditional DEBUG as TRACE.
18673 Output consistently TRACEs to stderr, not stdout.
18674 * src/derives.c: Likewise.
18675 * src/reduce.c: (inaccessable_symbols): Using if is better style
18676 than goto.
18677 Use `#if TRACE' instead of `#if 0' for tracing code.
18678
300f275f
AD
186792001-11-19 Akim Demaille <akim@epita.fr>
18680
18681 * src/system.h (LIST_FREE, shortcpy): New.
18682 * src/LR0.c: Use them.
18683 * src/output.c (free_itemsets, free_reductions, free_shifts):
18684 Remove, replaced by LIST_FREE.
18685
f59c437a
AD
186862001-11-19 Akim Demaille <akim@epita.fr>
18687
18688 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18689 (REDUCTIONS_ALLOC): New.
18690 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18691 allocation.
18692
6986fd9e
AD
186932001-11-19 Akim Demaille <akim@epita.fr>
18694
18695 * src/LR0.c (new_state): Complete trace code.
18696 * src/nullable.c (set_nullable): Don't translate traces.
18697
4bc30f78
AD
186982001-11-19 Akim Demaille <akim@epita.fr>
18699
18700 * src/print_graph.c (print_core): Better locality of variables.
18701 * src/print.c (print_core): Likewise.
18702
08a946e0
AD
187032001-11-19 Akim Demaille <akim@epita.fr>
18704
18705 * src/vcg.c: You do the output, so you are responsible of the
18706 handling of VCG syntax, in particular: use quotearg.
18707 * src/print_graph.c: Don't.
18708 (print_actions): Don't output the actions as part of the nodes,
18709 since that's the job of the edges.
18710 (print_state): Don't output by hand: fill the node description,
9bfe901c 18711 and ask for its output.
08a946e0 18712
f0473484
AD
187132001-11-19 Akim Demaille <akim@epita.fr>
18714
cc72668c
AD
18715 * src/bison.simple (yyparse): When verbosely reporting an error,
18716 no longer put additional quotes around token names.
f0473484
AD
18717 * tests/calc.at: Adjust.
18718
e41dc700
AD
187192001-11-19 Akim Demaille <akim@epita.fr>
18720
18721 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18722 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18723 * src/output.c: Adjust.
18724
652a871c
AD
187252001-11-19 Akim Demaille <akim@epita.fr>
18726
18727 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18728 (rule_t): this.
18729 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18730
b2ed6e58
AD
187312001-11-19 Akim Demaille <akim@epita.fr>
18732
18733 * src/gram.h (rule_t): New.
18734 (rule_table): New.
18735 (rrhs, rlhs): Remove, part of state_t.
18736 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18737 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18738 * src/reader.c, src/reduce.c: Adjust.
18739
edad7067
AD
187402001-11-19 Akim Demaille <akim@epita.fr>
18741
18742 * src/reader.c (symbols_output): New, extracted from...
18743 (packsymbols): Here.
18744 (reader): Call it.
18745
3feec034
AD
187462001-11-19 Akim Demaille <akim@epita.fr>
18747
18748 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18749 (maxrhs): this new function.
18750
ddcd5fdf
AD
187512001-11-19 Akim Demaille <akim@epita.fr>
18752
cc72668c 18753 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
18754 Adjust.
18755
bb527fc2
AD
187562001-11-19 Akim Demaille <akim@epita.fr>
18757
cc72668c 18758 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
18759 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18760 * src/lalr.c: Adjust.
18761
a845a697
AD
187622001-11-19 Akim Demaille <akim@epita.fr>
18763
18764 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18765 (set_state_table): handle the `lookaheads' members.
18766
f004bf6a
AD
187672001-11-19 Akim Demaille <akim@epita.fr>
18768
cc72668c
AD
18769 * src/lalr.h (lookaheads): Removed array, whose contents is now
18770 a member of...
f004bf6a
AD
18771 (state_t): this structure.
18772 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18773 Adjust.
18774
de326cc0
AD
187752001-11-19 Akim Demaille <akim@epita.fr>
18776
cc72668c
AD
18777 * src/lalr.h (consistent): Removed array, whose contents is now
18778 a member of...
de326cc0
AD
18779 (state_t): this structure.
18780 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18781 Adjust.
18782
90b4416b
AD
187832001-11-19 Akim Demaille <akim@epita.fr>
18784
cc72668c
AD
18785 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18786 contents are now members of...
90b4416b
AD
18787 (state_t): this structure.
18788 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18789 Adjust.
18790
9703cc49
AD
187912001-11-19 Akim Demaille <akim@epita.fr>
18792
18793 * src/lalr.h (state_t): New.
18794 (state_table): Be a state_t * instead of a core **.
18795 (accessing_symbol): Remove, part of state_t.
18796 * src/lalr.c: Adjust.
18797 (set_accessing_symbol): Merge into...
18798 (set_state_table): this.
18799 * src/print_graph.c, src/conflicts.c: Adjust.
18800
d803322e
AD
188012001-11-14 Akim Demaille <akim@epita.fr>
18802
18803 * tests/calc.at, tests/output.at, tests/regression.at,
18804 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18805 now the tests are run in private dirs, therefore AC_CLEANUP and
18806 family can be simplified to 0-ary.
18807 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18808 use abs. path to find config.h.
18809 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18810 stderr, there can be way too much random noise.
18811 Instead pass -Werror to GCC and rely on the exit status.
18812 Reported by Wolfram Wagner.
18813
3d76b07d
AD
188142001-11-14 Akim Demaille <akim@epita.fr>
18815
18816 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18817 defined only if yyoverflow is defined, to avoid `warning: unused
18818 variable `yyvs1''.
18819 Reported by The Test Suite.
18820
09b503c8
AD
188212001-11-14 Akim Demaille <akim@epita.fr>
18822
18823 * src/print.c: Include reduce.h.
18824 Reported by Hans Aberg.
18825
188262001-11-14 Akim Demaille <akim@epita.fr>
18827
18828 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18829 Revert a previous patch: these are really const.
18830 * src/conflicts.c (conflict_report): Additional useless pair of
18831 braces to pacify GCC's warnings for `if () if () {} else {}'.
18832 * src/lex.c (parse_percent_token): Replace equal_offset with
18833 arg_offset.
18834 arg is const.
18835 Be sure to strdup `arg' when used, since there is no reason for
18836 token_buffer not to change.
18837
0f37a994
AD
188382001-11-14 Akim Demaille <akim@epita.fr>
18839
18840 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18841 definition.
18842 * src/main.c (main): Use them.
18843 Suggested by Hans Aberg.
18844
d39d93b8
AD
188452001-11-12 Akim Demaille <akim@epita.fr>
18846
18847 * src/system.h (ngettext): Now that we use ngettext, be sure to
18848 provide a default definition when NLS are not used.
18849
9edcd895
AD
188502001-11-12 Akim Demaille <akim@epita.fr>
18851
18852 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18853 Use @kbd to denote user input.
18854 (Language and Grammar): ANSIfy the example.
18855 Adjust its layout for info/notinfo.
18856 (Location Tracking Calc): Output error messages to stderr.
18857 Output locations in a more GNUtically correct way.
18858 Fix a couple of Englishos.
18859 Adjust @group/@end group pairs.
18860
7da99ede
AD
188612001-11-12 Akim Demaille <akim@epita.fr>
18862
e3aa65c5 18863 %expect was not functioning at all.
7da99ede
AD
18864
18865 * src/conflicts.c (expected_conflicts): Set to -1.
18866 (conflict_report): Use ngettext.
18867 (conflicts_print): Check %expect and make its violation an error.
18868 * doc/bison.texinfo (Expect Decl): Adjust.
18869 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18870 * tests/regression.at (%expect not enough, %expect right)
18871 (%expect too much): New.
18872
ba9dda1a
AD
188732001-11-12 Akim Demaille <akim@epita.fr>
18874
18875 * tests/regression.at (Conflicts): Rename as...
18876 (Unresolved SR Conflicts): this.
18877 (Solved SR Conflicts): New.
18878
337c5bd1
AD
188792001-11-12 Akim Demaille <akim@epita.fr>
18880
18881 * src/reduce.c (print_results): Rename as...
18882 (reduce_output): This.
18883 Output to OUT, passed as argument, instead of output_obstack.
18884 (dump_grammar): Likewise.
18885 (reduce_free): New.
18886 Also free V1.
18887 (reduce_grammar): No longer call reduce_output, since...
18888 * src/print.c (print_results): do it.
18889 * src/main.c (main): Call reduce_free;
18890
c73a41af
AD
188912001-11-12 Akim Demaille <akim@epita.fr>
18892
18893 * src/conflicts.c (print_reductions): Accept OUT as argument.
18894 Output to it, not to output_obstack.
18895 * src/print.c (print_actions): Adjust.
18896
0df87bb6
AD
188972001-11-12 Akim Demaille <akim@epita.fr>
18898
18899 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18900 the result instead of using...
18901 (src_total, rrc_total, src_count, rrc_count): Remove.
18902 (any_conflicts): Remove.
18903 (print_conflicts): Split into...
18904 (conflicts_print, conflicts_output): New.
18905 * src/conflicts.h: Adjust.
18906 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 18907 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
18908 * tests/regression.at (Conflicts): New.
18909 Reported by Tom Lane.
18910
e4d3d4de
AD
189112001-11-12 Akim Demaille <akim@epita.fr>
18912
18913 * tests/regression.at (Invalid input): Remove, duplicate with
18914 ``Invalid input: 1''.
18915
6d7d248e
AD
189162001-11-12 Akim Demaille <akim@epita.fr>
18917
18918 * tests/torture.at (AT_DATA_STACK_TORTURE)
18919 (Exploding the Stack Size with Alloca)
18920 (Exploding the Stack Size with Malloc): New.
18921
e9e4c321
AD
189222001-11-12 Akim Demaille <akim@epita.fr>
18923
18924 * src/bison.simple (YYSTACK_REALLOC): New.
18925 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 18926 Reported by Per Allansson.
e9e4c321 18927
5f7e0832
AD
189282001-11-12 Pascal Bart <pascal.bart@epita.fr>
18929
18930 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18931 define CPP macro, which substitute YYSTYPE by yystype.
18932 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18933 with yyltype/YYLTYPE. This allows inclusion of the generated
18934 header within the parser if the compiler, such as GGC, accepts
18935 multiple equivalent #defines.
18936 From Akim.
18937
e3f1699f
AD
189382001-11-05 Akim Demaille <akim@epita.fr>
18939
18940 * src/reader.c (symbols_output): New, extracted from...
18941 (packsymbols): here.
18942 (reader): Adjust.
18943
65be0866
AD
189442001-11-05 Akim Demaille <akim@epita.fr>
18945
18946 * src/lex.c (parse_percent_token): s/quotearg/quote/.
18947
e4d910bf
AD
189482001-11-05 Akim Demaille <akim@epita.fr>
18949
18950 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
18951 pattern.
18952
951366c1
AD
189532001-11-05 Akim Demaille <akim@epita.fr>
18954
18955 * src/options.h (struct option_table_struct): set_flags is void*.
18956 * src/options.c (longopts): Support `--output' and `%output'.
18957 (usage): Adjust.
18958 * src/lex.h (tok_setopt): Remove, replaced with...
18959 (tok_intopt, tok_stropt): these new guys.
18960 * src/lex.c (getopt.h): Not needed.
18961 (token_buffer, unlexed_token_buffer): Not const.
18962 (percent_table): Promote `-' over `_' in directive names.
18963 Active `%name-prefix', `file-prefix', and `output'.
18964 (parse_percent_token): Accept possible arguments to directives.
18965 Promote `-' over `_' in directive names.
18966
d8988b2f
AD
189672001-11-04 Akim Demaille <akim@epita.fr>
18968
18969 * doc/bison.texinfo (Decl Summary): Split the list into
18970 `directives for grammars' and `directives for bison'.
18971 Sort'em.
18972 Add description of `%name-prefix', `file-prefix', and `output'.
18973 Promote `-' over `_' in directive names.
18974 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
18975 Simplify the description of `--name-prefix'.
18976 Promote `-' over `_' in directive names.
18977 Promote `--output' over `--output-file'.
18978 Fix the description of `--defines'.
18979 * tests/output.at: Exercise %file-prefix and %output.
18980
6468d18e
AD
189812001-11-02 Akim Demaille <akim@epita.fr>
18982
18983 * doc/refcard.tex: Update.
18984
6b7e85b9
AD
189852001-11-02 Akim Demaille <akim@epita.fr>
18986
18987 * src/symtab.h (SUNDEF): New.
18988 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
18989 stand for `uninitialized', instead of 0.
18990 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
18991 * src/lex.c (lex): Adjust.
18992
18993 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
18994 Number it 0.
18995 Let yylex return it instead of a plain 0.
18996 Reported by Dick Streefland.
18997
cd5aafcf
AD
189982001-11-02 Akim Demaille <akim@epita.fr>
18999
19000 * tests/regression.at (Mixing %token styles): New test.
19001
037ca2f1
AD
190022001-11-02 Akim Demaille <akim@epita.fr>
19003
19004 * src/reader.c (parse_thong_decl): Formatting changes.
19005 (token_translations_init): New, extracted from...
19006 (packsymbols): Here.
19007 Adjust.
19008
270a173c
AD
190092001-11-01 Akim Demaille <akim@epita.fr>
19010
19011 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19012 Check that `9foo.y' produces correct cpp guards.
19013 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19014 guards.
19015 Reported by Wwp.
19016
561f9a30
AD
190172001-11-01 Akim Demaille <akim@epita.fr>
19018
19019 * tests/regression.at (Invalid input: 2): New.
19020 * src/lex.c (unlexed_token_buffer): New.
19021 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19022 too.
19023 Reported by Wwp.
19024
f987e9d2
AD
190252001-11-01 Akim Demaille <akim@epita.fr>
19026
19027 * tests/calc.at: Catch up with 1.30.
19028 * configure.in: Bump to 1.49a.
19029 Adjust to newer Autotest.
19030
0846f581
PB
190312001-10-19 Pascal Bart <pascal.bart@epita.fr>
19032
19033 * src/conflicts.c: Move global variables rrc_total and src_total ...
19034 (print_conflicts): here.
19035 * src/output.c (output): Free global variable user_toknums.
19036 * src/lex.c (token_obstack): Become static.
19037
3c1a79b3
AD
190382001-10-18 Akim Demaille <akim@epita.fr>
19039
19040 * tests/atlocal.in (GCC): Add.
19041 * tests/calc.at: s/m4_match/m4_bmatch/.
19042 s/m4_patsubst/m4_bpatsubst/.
19043 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19044 * configure.in: AC_SUBST(GCC).
19045
5d52e7d0
MA
190462001-10-14 Marc Autret <autret_m@epita.fr>
19047
19048 * src/options.c (create_long_option_table): Fix.
19049
631aa1d3
AD
190502001-10-10 Akim Demaille <akim@epita.fr>
19051
19052 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19053
f6ec6d13
AD
190542001-10-04 Akim Demaille <akim@epita.fr>
19055
19056 * src/reader.c (parse_union_decl): Push the caracters in
19057 union_obstack, not attrs_obstack.
19058
342b8b6e
AD
190592001-10-04 Akim Demaille <akim@epita.fr>
19060
19061 Merge in the branch 1.29.
19062
19063 * src/reader.c (packsymbols): Use a temporary obstack for
19064 `%%tokendef', since output_stack is already used elsewhere.
19065
19066 2001-10-02 Akim Demaille <akim@epita.fr>
19067
19068 Bump 1.29d.
19069
19070 2001-10-02 Akim Demaille <akim@epita.fr>
19071
19072 Version 1.29c.
19073
19074 2001-10-02 Akim Demaille <akim@epita.fr>
19075
19076 * tests/regression.at (Invalid CPP headers): New.
19077 From Alexander Belopolsky.
19078 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19079
19080 2001-10-02 Akim Demaille <akim@epita.fr>
19081
19082 * tests/regression.at (Invalid input): New.
19083 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19084 Reported by Shura.
19085
19086 2001-10-02 Akim Demaille <akim@epita.fr>
19087
19088 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19089
19090 2001-10-02 Akim Demaille <akim@epita.fr>
19091
19092 * src/output.c (output_parser): Assert `skeleton'.
19093 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19094 systems.
19095 From Shura.
19096
19097 2001-10-01 Marc Autret <autret_m@epita.fr>
19098
19099 * src/lex.h: Echo modifications.
19100 * src/lex.c (unlex): Parameter is now token_t.
19101 From Hans Aberg.
19102
19103 2001-10-01 Marc Autret <autret_m@epita.fr>
19104
19105 * src/main.c: Include lex.h.
19106 From Hans Aberg.
19107
19108 2001-09-29 Akim Demaille <akim@epita.fr>
19109
19110 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19111
19112 2001-09-28 Akim Demaille <akim@epita.fr>
19113
19114 * tests/testsuite.at: Update to newer Autotest.
19115 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19116
19117 2001-09-27 Akim Demaille <akim@epita.fr>
19118
19119 Position independent wrapper.
19120
19121 * tests/bison: Remove.
19122 * tests/bison.in: New.
19123 * configure.in: Adjust.
19124
19125 2001-09-27 Paul Eggert <eggert@twinsun.com>
19126
19127 Port quotearg fixes from tar 1.13.24.
19128
19129 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19130 tm to be declared.
19131 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19132 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19133
19134 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19135 * m4/mbrtowc.m4: New file.
19136 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19137 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19138
19139 2001-09-27 Akim Demaille <akim@epita.fr>
19140
19141 Bump to 1.29c.
19142
19143 2001-09-27 Akim Demaille <akim@epita.fr>
19144
19145 Version 1.29b.
19146
19147 2001-09-25 Akim Demaille <akim@epita.fr>
19148
19149 * src/system.h: Include `xalloc.h'.
19150 Remove it from the C files.
19151 * src/files.c (output_files): Free the obstacks.
19152 * src/lex.c (init_lex): Rename as...
19153 (lex_init): this.
19154 (lex_free): New.
19155 * src/main.c (main): Use it.
19156
19157 2001-09-24 Marc Autret <autret_m@epita.fr>
19158
19159 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19160 to output informations in fout (FILE*).
19161 (open_graph, close_graph): Likewise.
19162 (output_graph, output_edge, output_node): Likewise.
19163 * src/vcg.h: Update function prototypes.
19164 * src/print_graph.c (print_graph): Open output graph file.
19165 (print_actions): Adjust.
19166 * src/files.h: Remove extern declaration.
19167 * src/files.c: Remove graph_obstack declaration.
19168 (open_files): Remove graph_obstack initialization.
19169 (output_files): Remove graph_obstack saving.
19170
19171 2001-09-24 Marc Autret <autret_m@epita.fr>
19172
19173 * src/files.c (compute_output_file_names): Fix.
19174
19175 2001-09-24 Marc Autret <autret_m@epita.fr>,
19176 Akim Demaille <akim@epita.fr>
19177
19178 * src/reader.c (reader): Remove call to free_symtab ().
19179 * src/main.c (main): Call it here.
19180 Include symtab.h.
19181 * src/conflicts.c (initialize_conflicts): Rename as...
19182 (solve_conflicts): this.
19183 * src/print.c (print_core, print_actions, print_state)
19184 (print_grammar): Dump to a file instead a `output_obstack'.
19185 (print_results): Dump `output_obstack', and then proceed with the
19186 FILE *.
19187 * src/files.c (compute_output_file_names, close_files): New.
19188 (output_files): Adjust.
19189 * src/main.c (main): Adjust.
19190
19191 2001-09-23 Marc Autret <autret_m@epita.fr>
19192
19193 * src/files.c (compute_header_macro): Computes header macro name
19194 from spec_defines_file when given.
19195
19196 2001-09-23 Marc Autret <autret_m@epita.fr>
19197
19198 * src/files.c (output_files): Add default extensions.
19199
19200 2001-09-22 Akim Demaille <akim@epita.fr>
19201
19202 * src/conflicts.c (finalize_conflicts): Rename as...
19203 (free_conflicts): this.
19204
19205 2001-09-22 Akim Demaille <akim@epita.fr>
19206
19207 * src/gram.c (gram_free): Rename back as...
19208 (dummy): this.
19209 (output_token_translations): Free `token_translations'.
19210 * src/symtab.c (free_symtab): Free the tag field.
19211
19212 2001-09-22 Akim Demaille <akim@epita.fr>
19213
19214 Remove `translations' as it is always set to true.
19215
19216 * src/gram.h: Adjust.
19217 * src/reader.c (packsymbols, parse_token_decl): Adjust
19218 * src/print.c (print_grammar): Adjust.
19219 * src/output.c (output_token_translations): Adjust.
19220 * src/lex.c (lex): Adjust.
19221 * src/gram.c: Be sure the set pointers to NULL.
19222 (dummy): Rename as...
19223 (gram_free): this.
19224
19225 2001-09-22 Akim Demaille <akim@epita.fr>
19226
19227 * configure.in: Invoke AM_LIB_DMALLOC.
19228 * src/system.h: Use dmalloc.
19229 * src/LR0.c: Be sure to have pointers initialized to NULL.
19230 (allocate_itemsets): Allocate kernel_items only if needed.
19231
19232 2001-09-22 Akim Demaille <akim@epita.fr>
19233
19234 * configure.in: Bump to 1.29b.
19235 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19236 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19237 need xmalloc.c in calc.y.
19238 From Pascal Bart.
19239
19240 2001-09-21 Akim Demaille <akim@epita.fr>
19241
19242 Version 1.29a.
19243 * Makefile.maint, config/config.guess, config/config.sub,
19244 * config/missing: Update from masters.
19245 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19246 upon package.m4.
19247 * configure.in (ALL_LINGUAS): Add `tr'.
19248
19249 2001-09-21 Akim Demaille <akim@epita.fr>
19250
19251 * tests/Makefile.am (package.m4): Move to...
19252 ($(srcdir)/$(TESTSUITE)): here.
19253
19254 2001-09-20 Akim Demaille <akim@epita.fr>
19255
19256 * src/complain.c: No longer try to be standalone: use system.h.
19257 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19258 * src/complain.h: Likewise.
19259 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19260 Remove the unused variable `n'.
19261 From Albert Chin-A-Young.
19262
19263 2001-09-18 Marc Autret <autret_m@epita.fr>
19264
19265 * doc/bison.1: Update.
19266 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19267 descriptions.
19268 (Option Cross Key): Update.
19269 Add --graph.
19270
19271 2001-09-18 Marc Autret <autret_m@epita.fr>
19272
19273 * tests/regression.at: New test (comment in %union).
19274
19275 2001-09-18 Marc Autret <autret_m@epita.fr>
19276
19277 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19278 do that.
19279 Reported by Keith Browne.
19280
19281 2001-09-18 Marc Autret <autret_m@epita.fr>
19282
19283 * tests/output.at: Add tests for --defines and --graph.
19284
19285 2001-09-18 Marc Autret <autret_m@epita.fr>
19286
19287 * tests/output.at: Removes tests of %{header,src}_extension features.
19288
19289 2001-09-18 Akim Demaille <akim@epita.fr>
19290
19291 * tests/Makefile.am (package.m4): New.
19292 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19293 (_AT_CHECK_CALC_ERROR): Likewise.
19294 Factor the `, ' part of verbose error messages.
19295
19296 2001-09-18 Marc Autret <autret_m@epita.fr>
19297
19298 * src/getargs.c (longopts): Declare --defines and --graph as options
19299 with optional arguments.
19300 * src/files.h: Add extern declarations.
19301 * src/files.c (spec_graph_file, spec_defines_file): New.
19302 (output_files): Update.
19303 Remove CPP-outed code.
19304
19305 2001-09-18 Marc Autret <autret_m@epita.fr>
19306
19307 Turn off %{source,header}_extension feature.
19308
19309 * src/files.c (compute_exts_from_gf): Update.
19310 (compute_exts_from_src): Update.
19311 (output_files): CPP-out useless code.
19312 * src/files.h: Remove {header,source}_extension extern declarations.
19313 * src/reader.c (parse_dquoted_param): CPP-out.
19314 (parse_header_extension_decl): Remove.
19315 (parse_source_extension_decl): Remove.
19316 (read_declarations): Remove cases tok_{hdrext,srcext}.
19317 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19318 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19319
19320 2001-09-10 Akim Demaille <akim@epita.fr>
19321
19322 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19323 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19324 (AT_CHECK_OUTPUT): this.
19325 Merely check ls' exit status, its output is useless.
19326
19327 2001-09-10 Akim Demaille <akim@epita.fr>
19328
19329 * tests/calc.at: Use m4_match.
19330 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19331
19332 2001-09-10 Marc Autret <autret_m@epita.fr>,
19333 Akim Demaille <akim@epita.fr>
19334
19335 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19336 enum color_e.
19337 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19338 to `normal'.
19339 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19340 * src/lex.h: Adjust prototype.
19341 (token_t): Add `tok_undef'.
19342 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19343 (parse_percent_token): Now returns token_t.
19344 Add default statement in switch.
19345 (lex): Separate `c' as an input variable, from the token_t result
19346 part.
19347 (unlexed): Is a token_t.
19348
19349 2001-09-10 Akim Demaille <akim@epita.fr>
19350
19351 * configure.in: Bump to 1.29a.
19352
19353 2001-09-07 Akim Demaille <akim@epita.fr>
19354
19355 Version 1.29.
19356
19357 2001-08-30 Akim Demaille <akim@epita.fr>
19358
19359 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19360 * m4/atconfig.m4: Remove.
19361 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19362 * tests/bison: New.
19363 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19364 m4_if, m4_patsubst, and m4_regexp.
19365 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19366 `input' file instead of echo.
19367
19368 2001-08-29 Akim Demaille <akim@epita.fr>
19369
19370 Bump to 1.28e.
19371
19372 2001-08-29 Akim Demaille <akim@epita.fr>
19373
19374 Version 1.28d.
19375
19376 2001-08-29 Paul Eggert <eggert@twinsun.com>
19377
19378 * src/bison.simple (yyparse): Don't take the address of an
19379 item before the start of an array, as that doesn't conform to
19380 the C Standard.
19381
19382 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19383
19384 * doc/bison.texinfo (Location Tracking Calc): New node.
19385
19386 2001-08-29 Paul Eggert <eggert@twinsun.com>
19387
19388 * src/output.c (output): Do not define const, as this now
19389 causes more problems than it cures.
19390
19391 2001-08-29 Akim Demaille <akim@epita.fr>
19392
19393 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19394 the nodes.
19395 Be sure to tag the `detailmenu'.
19396
19397 2001-08-29 Akim Demaille <akim@epita.fr>
19398
19399 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19400 download in a tmp dir.
19401
19402 2001-08-28 Marc Autret <autret_m@epita.fr>
19403
19404 * config/depcomp: New file.
19405
19406 2001-08-28 Marc Autret <autret_m@epita.fr>
19407
19408 * doc/bison.1 (mandoc): Adjust.
19409 From Juan Manuel Guerrero.
19410
19411 2001-08-28 Marc Autret <autret_m@epita.fr>
19412
19413 * src/print_graph.c (print_state): Fix.
19414
19415 2001-08-27 Marc Autret <autret_m@epita.fr>
19416
19417 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19418 char * members.
19419 Echo modifications to the functions prototypes.
19420 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19421
19422 2001-08-27 Marc Autret <autret_m@epita.fr>
19423
19424 * src/vcg.c: Include `xalloc.h'.
19425 (add_colorentry): New.
19426 (add_classname): New.
19427 (add_infoname): New.
19428 * src/vcg.h: Add new prototypes.
19429
19430 2001-08-27 Akim Demaille <akim@epita.fr>
19431
19432 * Makefile.maint: Sync. again with CVS Autoconf.
19433
19434 2001-08-27 Akim Demaille <akim@epita.fr>
19435
19436 * Makefile.maint: Formatting changes.
19437 (po-update, cvs-update, update): New targets.
19438 (AMTAR): Remove.
19439
19440 2001-08-27 Akim Demaille <akim@epita.fr>
19441
19442 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19443 * Makefile.maint: Sync. with CVS Autoconf.
19444
19445 2001-08-27 Marc Autret <autret_m@epita.fr>
19446
19447 * src/vcg.h (struct infoname_s): New.
19448 (struct colorentry_s): New.
19449 (graph_s): New fields {vertical,horizontal}_order in structure.
19450 Add `infoname' field.
19451 Add `colorentry' field;
19452 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19453 (G_HORIZONTAL_ORDER): New.
19454 (G_INFONAME): New.
19455 (G_COLORENTRY): New.
19456 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19457 Add output of `infoname'.
19458 Add output of `colorentry'.
19459
19460 2001-08-27 Marc Autret <autret_m@epita.fr>
19461
19462 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19463 This one shadowed a global parameter.
19464
19465 2001-08-24 Marc Autret <autret_m@epita.fr>
19466
19467 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19468 instead of `unsigned'.
19469 (print_state): Do not call obstack_object_size () in obstack_grow ()
19470 to avoid macro variables shadowing.
19471
19472 2001-08-23 Marc Autret <autret_m@epita.fr>
19473
19474 * src/lex.c (percent_table): Typo: s/naem/name/.
19475 Add graph option.
19476 Normalize new options declarations.
19477
19478 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19479
19480 * tests/suite.at: Exercise %header_extension and %source_extension.
19481
19482 2001-08-16 Marc Autret <autret_m@epita.fr>
19483
19484 * src/reader.c (parse_dquoted_param): New.
19485 (parse_header_extension_decl): Use it.
19486 (parse_source_extension_decl): Likewise.
19487
19488 2001-08-16 Marc Autret <autret_m@epita.fr>
19489
19490 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19491 (get_xxxx_str): Use assert () instead of complain ().
19492 Remove return invokations in default cases.
19493 (get_decision_str): Modify default behaviour. Remove second argument.
19494 Echo modifications on calls.
19495 (output_graph): Fix.
19496
19497 2001-08-16 Marc Autret <autret_m@epita.fr>
19498
19499 * src/getargs.c (usage): Update with ``-g, --graph''.
19500
19501 2001-08-16 Marc Autret <autret_m@epita.fr>
19502
19503 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19504 (Option Cross Key): Likewise.
19505 * doc/bison.1: Update.
19506
1c8c2190
PB
195072001-09-25 Pascal Bart <pascal.bart@epita.fr>
19508
19509 * src/output.c (output_master_parser): Don't finish action_obstack.
19510 (output_parser): Don't care about the muscle action, here.
19511 (prepare): Copy the action_obstack in the action muscle.
19512 (output): Free action_obstack.
19513
180d45ba
PB
195142001-09-23 Pascal Bart <pascal.bart@epita.fr>
19515
19516 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19517 will contain `%union' declaration.
19518 (parse_union_decl): Delete #line directive output.
19519 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19520 informations about %union.
19521 (parse_union_decl): Copy the union_obstack in the muscle stype.
19522 * src/bison.simple: Add new #line directive.
19523 Add typdef %%stype YYSTYPE.
19524
c51d1a19
PB
195252001-09-23 Pascal Bart <pascal.bart@epita.fr>
19526
19527 * src/bison.simple: Add new `#line' directive.
19528
6f9344da
PB
195292001-09-22 Pascal Bart <pascal.bart@epita.fr>
19530
19531 * src/bison.simple: New `#line' directive.
19532 * src/output.c (output_parser): Support new dynamic muscle input_line.
19533
652def80
MA
195342001-09-22 Marc Autret <autret_m@epita.fr>
19535
19536 * src/output.c (output_master_parser): New.
19537 (output_parser): Be more re-entrant.
19538
25b222fa
MA
195392001-09-21 Marc Autret <autret_m@epita.fr>
19540
19541 * src/reader.c (copy_definition, parse_union_decl): Update and use
19542 `linef' muscle.
19543 (copy_action): Likewise.
19544 Use obstack_1grow ().
19545 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19546
6bc35ae5
MA
195472001-09-21 Marc Autret <autret_m@epita.fr>
19548
19549 * src/options.c (option_table): Adjust.
19550 * src/lex.c (parse_percent_token): Fix.
19551
c0629aa1
PB
195522001-09-20 Pascal Bart <pascal.bart@epita.fr>
19553
19554 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 19555
82b6d266
PB
195562001-09-20 Pascal Bart <pascal.bart@epita.fr>
19557
19558 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19559 is now an option_table_struct*.
19560 (option_strcmp): New function option_strcmp.
19561 (parse_percent_token): Call option_strcmp.
19562 * src/getargs.c (xalloc.h, options.h): Include it.
19563 (getargs): Call create_long_option_table.
19564 (getargs): Free longopts at the end of the function.
19565 (shortopts): Move in options.c.
19566 * src/options.c (create_long_option_table): New function. Convert
19567 information from option_table to option structure.
19568 * src/reader.c (options.h): Include it.
19569
19570 * src/Makefile.am: Adjust.
19571 * src/options.c (option_table): Create from longopts and percent_table.
19572 * src/getargs.c (longopts): Delete.
19573 * src/lex.c (struct percent_table_struct): Delete.
19574 (percent_table): Delete.
19575 (options.h): Include it.
19576 * src/options.c: Create.
19577 * src/options.h: Create.
19578 Declare enum opt_access_e.
19579 Define struct option_table_struct.
19580
75f5aaea
MA
195812001-09-20 Marc Autret <autret_m@epita.fr>
19582
19583 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19584 sections of Bison.
19585
f508cb0a
PB
195862001-09-19 Pascal Bart <pascal.bart@epita.fr>
19587
19588 * src/bison.simple: s/%%filename/%%skeleton.
19589 * src/muscle_tab.c (getargs.h): Include it.
19590 (muscle_init): Insert new muscle skeleton.
19591
13105fc1
PB
195922001-09-18 Pascal Bart <pascal.bart@epita.fr>
19593
19594 * src/output.c (output_parser): Delete unused variable actions_dumped.
19595
b0c4483e
PB
195962001-09-07 Pascal Bart <pascal.bart@epita.fr>
19597
19598 * src/output.c (output): Delete call to reader_output_yylsp.
19599 * src/reader.c (reader): Likewise.
ba0fe3c7 19600 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 19601
11d82f03
MA
196022001-09-02 Marc Autret <autret_m@epita.fr>
19603
19604 * src/reader.c: Include muscle_tab.h.
19605 (parse_union_decl): Update.
19606 (parse_macro_decl): Rename parse_muscle_decl.
19607 Update to use renamed functions and variable.
19608 (read_declarations, copy_action, read_additionnal_code, : Updated
19609 with correct variables and functions names.
19610 (packsymbols, reader): Likewise.
342b8b6e 19611
11d82f03 19612 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 19613
11d82f03
MA
19614 * src/output.c: Include muscle_tab.h
19615 In all functions using macro_insert, change by using muscle_insert ().
19616 (macro_obstack): Rename muscle_obstack.
19617 Echo modifications in the whole file.
19618 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19619 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19620 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19621
19622 * src/muscle_tab.h: Update double inclusion macros.
19623 (macro_entry_s): Rename muscle_entry_s.
19624 Update prototypes.
342b8b6e 19625
11d82f03
MA
19626 * src/muscle_tab.c: Include muscle_tab.h.
19627 Rename macro_tabble to muscle_table.
19628 (mhash1, mhash2, mcmp): Use muscle_entry.
19629 (macro_init): Rename muscle_init. Update.
19630 (macro_insert): Rename muscle_insert. Update.
19631 (macro_find): Rename muscle_find. Update.
19632
19633 * src/main.c: Include muscle_tab.h.
19634 (main): Call muscle_init ().
19635 * src/Makefile.am (bison_SOURCES): Echo modifications.
19636
93a37297
MA
196372001-09-02 Marc Autret <autret_m@epita.fr>
19638
f753cd62 19639 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 19640
f753cd62
MA
19641 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19642
196432001-09-02 Marc Autret <autret_m@epita.fr>
19644
19645 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 19646
682d48cd
PB
196472001-09-01 Pascal Bart <pascal.bart@epita.fr>
19648
342b8b6e 19649 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
19650 filename.
19651
087c8fda
MA
196522001-09-01 Marc Autret <autret_m@epita.fr>
19653
19654 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19655 to an explicit value to activate the feature. We do it here.
19656
dda680cb
PB
196572001-08-31 Pascal Bart <pascal.bart@epita.fr>
19658
19659 * src/output.c (prepare): Delete the `filename' muscule insertion.
19660 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19661 (parse_union_decl): Likewise.
19662 * src/macrotab.c (macro_init): Initialize filename by infile.
19663
9e644e64
MA
196642001-08-31 Marc Autret <autret_m@epita.fr>
19665
19666 * src/bison.simple (YYLSP_NEEDED): New definition.
19667 * src/output.c (prepare): Add macro insertion of `locations_flag'
19668
17da6427
PB
196692001-08-31 Pascal Bart <pascal.bart@epita.fr>
19670
19671 * src/output.c (prepare): Delete insertion of previous muscles,
19672 and insert the `prefix' muscles.
19673 * src/macrotab.c (macro_init): Likewise.
19674 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 19675 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
19676 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19677 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 19678 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
19679 name_prefix.
19680
e8cb70b9
PB
196812001-08-31 Pascal Bart <pascal.bart@epita.fr>
19682
19683 * src/main.c (main): Standardize.
19684 * src/output.c (output_table_data, output_parser): Likewise.
19685 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19686
63c2d5de
MA
196872001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19688
342b8b6e 19689 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
19690 %%epilogue.
19691 * src/output.c (output): Rename %%declarations to %%prologue.
19692 * src/bison.simple: Echo modifications.
342b8b6e 19693
d8cb5183
MA
196942001-08-31 Marc Autret <autret_m@epita.fr>
19695
19696 * src/reader.c (readgram): CleanUp.
19697 (output_token_defines): Likewise.
19698 (packsymbols): Likewise.
19699 (reader): Likewise.
19700 * src/output.c (output): CPP-out useless code.
19701
6c686258
PB
197022001-08-31 Pascal Bart <pascal.bart@epita.fr>
19703
342b8b6e 19704 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
19705 output_trailers and output_headers.
19706 * src/output.h: Remove obsolete functions prototypes of output_headers
19707 and output_trailers.
19708
8f451ef7
PB
197092001-08-30 Pascal Bart <pascal.bart@epita.fr>
19710
19711 * src/main.c: Include macrotab.h.
342b8b6e 19712 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
19713 Adjust functions prototypes.
19714 * src/macrotab.c (macro_insert): Constify key and value.
19715 (macro_find): Constify key.
19716 (macro_insert): Include 'xalloc.h'
19717 (macro_insert): Use XMALLOC.
19718 (macro_find): Constify return value.
19719 * src/output.c (output_table_data): Rename table to table_data.
19720 (output_parser): Constify macro_key, macro_value.
19721
997b6fd0 197222001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
19723
19724 * src/reader.c (parse_skel_decl): New.
342b8b6e 19725 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
19726 * src/lex.h (token_t): New token `tok_skel'.
19727 * src/lex.c (percent_table): Add skeleton option entry.
19728 Standardize.
19729
ff48177d
MA
197302001-08-29 Marc Autret <autret_m@epita.fr>
19731
19732 * src/bison.simple: Add %%user_code directive at the end.
19733 * src/reader.c (read_additionnal_code): New.
19734 (reader): Use it.
19735 * src/output.c (output_program): Remove.
19736 (output): Update.
19737
b33160bf
MA
197382001-08-28 Marc Autret <autret_m@epita.fr>
19739
19740 * src/output.c (output_actions): Clean up.
4e5caae2 19741 (output_gram): CPP-out useless code.
b33160bf
MA
19742 * src/reader.c (reader): Clean up, CPP-out useless code.
19743
d1a2daf7
PB
197442001-08-28 Pascal Bart <pascal.bart@epita.fr>
19745
342b8b6e 19746 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 19747 directive.
d1a2daf7
PB
19748 * src/bison.simple: Add `%%definitions'.
19749
2b763dfe
MA
197502001-08-28 Marc Autret <autret_m@epita.fr>
19751
19752 * config/depcomp: New file.
19753
f1a87ef6
PE
197542001-08-27 Paul Eggert <eggert@twinsun.com>
19755
19756 * src/bison.simple (yyparse): Don't take the address of an
19757 item before the start of an array, as that doesn't conform to
19758 the C Standard.
19759
82e236e2
RA
197602001-08-27 Robert Anisko <robert.anisko@epita.fr>
19761
f1a87ef6 19762 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
19763 obstack. It was done too late here.
19764
19765 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19766 completely wrong.
19767 (reader): Initialize the macro obstack here, since we need it to grow
19768 '%define' directives.
19769
19770 * src/reader.h: Declare the macro obstack as extern.
19771
b0cfa28a
RA
197722001-08-27 Robert Anisko <robert.anisko@epita.fr>
19773
19774 * src/output.c (output_parser): Fix. Store single '%' characters in
19775 the output obstack instead of throwing them away.
19776
6fc74234
AD
197772001-08-27 Akim Demaille <akim@epita.fr>
19778
19779 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19780
9c76d118
RA
197812001-08-25 Robert Anisko <robert.anisko@epita.fr>
19782
19783 * lib/Makefile.am: Adjust.
19784
a8289c62
RA
197852001-08-25 Robert Anisko <robert.anisko@epita.fr>
19786
19787 * src/bison.simple: Update and add '%%' directives.
19788
b6610515
RA
197892001-08-25 Robert Anisko <robert.anisko@epita.fr>
19790
19791 * src/reader.c (reader): Remove calls to 'output_headers' and
19792 'output_trailers'. Remove some C output.
19793 (readgram): Disable a piece of code that was writing a default
19794 definition for 'YYSTYPE'.
19795 (reader_output_yylsp): Remove.
19796 (packsymbols): Output token defintions to a macro.
19797 (copy_definition): Disable C output.
6fc74234 19798
b6610515
RA
19799 * src/reader.c (parse_macro_decl): New function used to parse macro
19800 declarations.
19801 (copy_string2): Put the body of copy_string into this new function.
19802 Add a parameter to let the caller choose whether he wants to copy the
19803 string delimiters or not.
19804 (copy_string): Be a simple call to copy_string2 with the last argument
19805 bound to true.
19806 (read_declarations): Add case for macro definition.
19807 (copy_identifier): New.
6fc74234 19808 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
19809 rather than lex.
19810
26f609ff
RA
198112001-08-25 Robert Anisko <robert.anisko@epita.fr>
19812
19813 * src/output.c (prepare): Add prefixed names.
19814 (output_parser): Output semantic actions.
19815 (output_parser): Fix bug on '%%line' directives.
6fc74234 19816
26f609ff
RA
19817 * src/output.c (output_headers): Remove. The C code printed by this
19818 function should now be in the skeletons.
19819 (output_trailers): Remove.
19820 (output): Disable call to 'reader_output_yylsp'.
19821 (output_rule_data): Do not output tables to the table obstack.
19822
19823 * src/output.c: Remove some C dedicated output.
19824 Improve the use of macro and output obstacks.
19825 (output_defines): Remove.
6fc74234 19826
26f609ff
RA
19827 * src/output.c (output_token_translations): Associate 'translate'
19828 table with a macro. No output to the table obstack.
19829 (output_gram): Same for 'rhs' and 'prhs'.
19830 (output_stos): Same for 'stos'.
19831 (output_rule_data): Same for 'r1' and 'r2'.
19832 (token_actions): Same for 'defact'.
19833 (goto_actions): Same for 'defgoto'.
19834 (output_base): Same for 'pact' and 'pgoto'.
19835 (output_table): Same for 'table'.
19836 (output_check): Same for 'check'.
6fc74234 19837
26f609ff
RA
19838 * src/output.c (output_table_data): New function.
19839 (output_short_table): Remove.
19840 (output_short_or_char_table): Remove.
6fc74234 19841
26f609ff
RA
19842 * src/output.c (output_parser): Replace most of the skeleton copy code
19843 with something new. Skeletons are now processed character by character
19844 rather than line by line, and Bison looks for '%%' macros. This is the
19845 first step in making Bison's output process (a lot) more flexible.
19846 (output_parser): Use the macro table.
19847
6f43b113
RA
198482001-08-25 Robert Anisko <robert.anisko@epita.fr>
19849
19850 * src/main.c (main): Initialize the macro table.
19851
dd3127cf
RA
198522001-08-25 Robert Anisko <robert.anisko@epita.fr>
19853
19854 * src/lex.c (percent_table): Add tok_define.
19855 * src/lex.h: Add tok_define.
19856
aa321494
RA
198572001-08-25 Robert Anisko <robert.anisko@epita.fr>
19858
19859 * src/macrotab.c: New file.
19860 * src/macrotab.h: New file.
19861 * src/Makefile.am: Update.
19862
68bd3b6b
RA
198632001-08-25 Robert Anisko <robert.anisko@epita.fr>
19864
19865 * lib/hash.c: New file.
19866 * lib/hash.h: New file.
19867 * lib/Makefile.am: Update.
19868
45f8dd1e
AD
198692001-08-15 Akim Demaille <akim@epita.fr>
19870
19871 Version 1.28c.
19872
40a64a7a 198732001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
19874
19875 * src/reader.c (readgram): Indent output macro YYSTYPE.
19876 (packsymbols): Likewise.
19877 (output_token_defines): Likewise.
19878 * src/files.c: Standardize.
19879 (compute_header_macro): New.
19880 (defines_obstack_save): New. Use compute_header_macro.
19881 (output_files): Update. Use defines_obstack_save.
19882
f9a8293a
AD
198832001-08-15 Akim Demaille <akim@epita.fr>
19884
19885 * doc/bison.texinfo (Table of Symbols): Document
19886 YYSTACK_USE_ALLOCA.
19887
150ca7a7
AD
198882001-08-15 Akim Demaille <akim@epita.fr>
19889
19890 * missing: Update from CVS Automake.
19891 * config/config.guess, config/config.sub, config/texinfo.tex:
19892 Update from gnu.org.
19893
69b5cec4
AD
198942001-08-15 Akim Demaille <akim@epita.fr>
19895
19896 * Makefile.maint: Sync with CVS Autoconf.
19897
f2b5126e
PB
198982001-08-14 Pascal Bart <pascal.bart@epita.fr>
19899
69b5cec4 19900 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
19901 `fdl.texi'.
19902 * doc/fdl.texi: Add to package.
19903
4ecbf796
MA
199042001-08-14 Marc Autret <autret_m@epita.fr>
19905
19906 Turn on %{source,header}_extension features.
19907
69b5cec4 19908 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
19909 source_extension.
19910 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 19911 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
19912 between options.
19913
95fb5662
MA
199142001-08-14 Marc Autret <autret_m@epita.fr>
19915
19916 * src/files.c (compute_base_names): Add extensions computing when
19917 `--file-prefix' used.
19918 Standardize function calls.
19919
78d09da9
MA
199202001-08-13 Marc Autret <autret_m@epita.fr>
19921
69b5cec4 19922 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
19923 defining it (defined but null disables alloca).
19924
5a009f2c
MA
199252001-08-13 Marc Autret <autret_m@epita.fr>
19926
19927 * src/bison.simple (_yy_memcpy): CPP reformat.
19928
1e41465a
PB
199292001-08-13 Pascal Bart <pascal.bart@epita.fr>
19930
19931 * tests/atconfig.in (CPPFLAGS): Fix.
19932
c67a198d
PB
199332001-08-10 Pascal Bart <pascal.bart@epita.fr>
19934
79282c6c 19935 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
19936 `gpl.texi'.
19937 * doc/gpl.texi: Add to package.
19938
09a6de7e
MA
199392001-08-10 Marc Autret <autret_m@epita.fr>
19940
19941 * src/print_graph.h: Fix.
19942 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
19943
b77b9ee0
AD
199442001-08-10 Akim Demaille <akim@epita.fr>
19945
19946 * src/system.h: Provide default declarations for stpcpy, strndup,
19947 and strnlen.
19948
3e259915
MA
199492001-08-10 Robert Anisko <anisko_r@epita.fr>
19950
19951 * doc/bison.texinfo (Locations): Update @$ stuff.
19952
ca96bc2d
MA
199532001-08-09 Robert Anisko <anisko_r@epita.fr>
19954
19955 * src/bison.simple (YYLLOC_DEFAULT): Update.
19956 (yyparse): Adjust.
19957
fdc6758b
MA
199582001-08-08 Marc Autret <autret_m@epita.fr>
19959
b77b9ee0 19960 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
19961 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
19962 Reported by Fabrice Bauzac.
957d4dbf 19963
600cad3b
MA
199642001-08-08 Marc Autret <autret_m@epita.fr>
19965
19966 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
19967 * src/vcg.c (output_node): Fix.
19968 * src/vcg.h: Cleanup.
19969 * src/print_graph.c: Add comments.
b77b9ee0 19970 (node_output_size): New global variable. Simplify the formatting of
600cad3b 19971 the VCG graph output.
b77b9ee0 19972 (print_actions): Unused code is now used. It notifies the final state
600cad3b 19973 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 19974 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
19975 blue.
19976 Get the current node name and node_obstack by argument.
19977 (node_obstack): New variable.
19978 (print_state): Manage node_obstack.
19979 (print_core): Use node_obstack given by argument.
19980 A node is not only computed here but in print_actions also.
19981 (print_graph): CPP out useless code instead of commenting it.
19982
976e528f
AD
199832001-08-07 Pascal Bart <pascal.bart@epita.fr>
19984
19985 * tests/atconfig.in (CPPFLAGS): Fix.
19986
20e8e5ca
AD
199872001-08-07 Akim Demaille <akim@epita.fr>
19988
19989 * src/print_graph.c (quote): New.
19990 (print_core): Use it.
19991
957d4dbf 199922001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 19993
3e3da797
AD
19994 * src/vcg.c (complain.h): Include it.
19995 Unepitaize `return' invocations.
c4b66126 19996 [NDEBUG] (main): Remove.
79282c6c 19997 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
19998 * src/files.c (open_files): Initialize graph_obstack.
19999 * src/print_graph.c (print_actions): CPP out useless code.
20000 (print_core): Don't output the last `\n' in labels.
20001 Use `quote'.
20002 * src/files.c (output_files): Output the VCG file.
20003 * src/main.c (main): Invoke print_graph ();
3e3da797 20004
957d4dbf 200052001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
20006
20007 Automaton VCG graph output.
20008 Using option ``-g'' or long option ``--graph'', you can generate
20009 a gram_filename.vcg file containing a VCG description of the LALR (1)
20010 automaton of your grammar.
20011
20012 * src/main.c: Call to print_graph() function.
20013 * src/getargs.h: Update.
20014 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20015 (graph_flag): New flag.
20016 (longopts): Update.
20017 (getargs): Add case `g'.
20018 * src/files.c (graph_obstack): New obstack struct.
20019 (open_files): Initialize new obstack.
20020 (output_files): Saves graph_obstack if required.
20021 * src/files.h (graph_obstack): New extern declaration.
20022 * src/Makefile.am: Add new source files.
20023
927c1557 200242001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
20025
20026 * src/print_graph.c, src/print_graph.h (graph): New.
20027 * src/vcg.h: New file.
20028 * src/vcg.c: New file, VCG graph handling.
20029
7333d403
AD
200302001-08-06 Marc Autret <autret_m@epita.fr>
20031
20032 Add of %source_extension and %header_extension which specify
20033 the source or/and the header output file extension.
20034
20035 * src/files.c (compute_base_names): Remove initialisation of
20036 src_extension and header_extension.
20037 (compute_exts_from_gf): Update.
20038 (compute_exts_from_src): Update.
20039 (output_files): Update.
20040 * src/reader.c (parse_header_extension_decl): New.
20041 (parse_source_extension_decl): New.
20042 (read_declarations): New case statements for the new tokens.
20043 * src/lex.c (percent_table): Add entries for %source_extension
20044 and %header_extension.
20045 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20046
84163231
AD
200472001-08-06 Marc Autret <autret_m@epita.fr>
20048
20049 * configure.in: Bump to 1.28c.
20050 * doc/bison.texinfo: Texinfo thingies.
20051
8303fc42
AD
200522001-08-04 Pascal Bart <pascal.bart@epita.fr>
20053
20054 * tests/atconfig.in (CPPFLAGS): Add.
20055 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20056
70a84437
AD
200572001-08-03 Akim Demaille <akim@epita.fr>
20058
20059 Version 1.28b.
20060
2ce10144
AD
200612001-08-03 Akim Demaille <akim@epita.fr>
20062
20063 * tests/Makefile.am (check-local): Ship testsuite.
20064 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20065 Include `string.h'.
20066
1e3e4bc1
AD
200672001-08-03 Akim Demaille <akim@epita.fr>
20068
20069 * configure.in: Try using -Wformat when compiling.
20070
42b45b7f
AD
200712001-08-03 Akim Demaille <akim@epita.fr>
20072
20073 * configure.in: Bump to 1.28b.
20074
8f13fe33
AD
200752001-08-03 Akim Demaille <akim@epita.fr>
20076
20077 * src/complain.c: Adjust strerror_r portability issues.
20078
b37ba92c
AD
200792001-08-03 Akim Demaille <akim@epita.fr>
20080
20081 Version 1.28a.
20082
b0ce6046
AD
200832001-08-03 Akim Demaille <akim@epita.fr>
20084
20085 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20086 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20087 * src/getargs.c: Include complain.h.
20088 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20089 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20090
d01c415b
AD
200912001-08-03 Akim Demaille <akim@epita.fr>
20092
20093 * src/reader.c (readgram): Display hidden chars in error messages.
20094
459dd1a6
AD
200952001-08-03 Akim Demaille <akim@epita.fr>
20096
20097 Update to gettext 0.10.39.
20098
53b74c0c
AD
200992001-08-03 Akim Demaille <akim@epita.fr>
20100
20101 * lib/strspn.c: New.
20102
234a3be3
AD
201032001-08-01 Marc Autret <autret_m@epita.fr>
20104
20105 * doc/bison.texinfo: Update.
20106 * doc/bison.1 (mandoc): Update.
20107 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20108 * src/files.c: Support output files extensions computing.
20109 (src_extension): New static variable.
20110 (header_extension): New static variable.
20111 (tr): New function.
20112 (get_extension_index): New function, gets the index of an extension
20113 filename in a string.
20114 (compute_exts_from_gf): New function, computes extensions from the
20115 grammar file extension.
20116 (compute_exts_from_src): New functions, computes extensions from the
20117 C source file extension, file given by ``-o'' option.
20118 (compute_base_names): Update.
20119 (output_files): Update.
20120
847bf1f5
AD
201212001-08-01 Robert Anisko <anisko_r@epita.fr>
20122
d995fee7 20123 * doc/bison.texi: Document @$.
847bf1f5
AD
20124 (Locations): New section.
20125
d074a105
AD
201262001-07-18 Akim Demaille <akim@epita.fr>
20127
20128 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20129 * config/prev-version.txt, config/move-if-change: New.
20130 * Makefile.am: Adjust.
20131
3419715d
AD
201322001-07-08 Pascal Bart <pascal.bart@epita.fr>
20133
20134 * src/bison.simple (yyparse): Suppress warning `comparaison
20135 between signed and unsigned'.
20136
62ab6972
AD
201372001-07-05 Pascal Bart <pascal.bart@epita.fr>
20138
20139 * src/getargs.h (raw_flag): Remove.
20140 * src/getargs.c: Die on `-r'/`--raw'.
20141 * src/lex.c (parse_percent_token): Die on `%raw'.
20142 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20143 * tests/calc.at: Suppress test with option `--raw'.
20144
1e24cc5b
AD
201452001-07-14 Akim Demaille <akim@epita.fr>
20146
20147 * config/: New.
20148 * configure.in: Require Autoconf 2.50.
20149 Update to gettext 0.10.38.
20150
32dfccf8
AD
201512001-03-16 Akim Demaille <akim@epita.fr>
20152
20153 * doc/bison.texinfo: ANSIfy the examples.
20154
cd5bd6ac
AD
201552001-03-16 Akim Demaille <akim@epita.fr>
20156
20157 * getargs.c (skeleton): New variable.
20158 (longopts): --skeleton is a new option.
20159 (shortopts, getargs): -S is a new option.
20160 * getargs.h: Declare skeleton.
20161 * output.c (output_parser): Use it.
20162
5141b016
AD
201632001-03-16 Akim Demaille <akim@epita.fr>
20164
20165 * m4/strerror_r.m4: New.
20166 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20167 * lib/error.h, lib/error.c: Update.
20168
447992b9
AD
201692001-03-16 Akim Demaille <akim@epita.fr>
20170
20171 * src/getargs.c (longopts): Clean up.
20172
274d42ce
AD
201732001-02-21 Akim Demaille <akim@epita.fr>
20174
20175 * src/reader.c (gensym): `gensym_count' is your own.
20176 Use a static buf to create the symbol name, as token_buffer is no
20177 longer a buffer.
20178
22c821f3
AD
201792001-02-08 Akim Demaille <akim@epita.fr>
20180
20181 * src/conflicts.c (conflict_report): Be sure not to append to res
20182 between two calls, which could happen if both first sprintf were
20183 skipped, but not the first cp += strlen.
20184
18569462
AD
201852001-02-08 Akim Demaille <akim@epita.fr>
20186
20187 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20188 New, from fileutils 4.0.37.
20189 * configure.in: Require Autoconf 2.49c. I took some time before
20190 making this decision. This is the only way out for portability
20191 issues in Bison, it would mean way too much duplicate effort to
20192 import in Bison features implemented in 2.49c since 2.13.
20193 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20194
0d8f3c8a
AD
201952001-02-02 Akim Demaille <akim@epita.fr>
20196
20197 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 20198 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 20199
f17bcd1f
AD
202002001-01-19 Akim Demaille <akim@epita.fr>
20201
20202 Get rid of the ad hoc handling of token_buffer in the scanner: use
20203 the obstacks.
20204
20205 * src/lex.c (token_obstack): New.
20206 (init_lex): Initialize it. No longer call...
20207 (grow_token_buffer): this. Remove it.
20208 Adjust all the places which used it to use the obstack.
20209
511e79b3
AD
202102001-01-19 Akim Demaille <akim@epita.fr>
20211
20212 * src/lex.h: Rename all the tokens:
20213 s/\bENDFILE\b/tok_eof/g;
20214 s/\bIDENTIFIER\b/tok_identifier/g;
20215 etc.
20216 Let them be enums, not #define, to ease debugging.
20217 Adjust all the code.
20218
0d6508ef
AD
202192001-01-18 Akim Demaille <akim@epita.fr>
20220
20221 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20222 * src/lex.c (maxtoken, grow_token_buffer): Static.
20223
6deb4447
AD
202242001-01-18 Akim Demaille <akim@epita.fr>
20225
20226 Since we now use obstacks, more % directives can be enabled.
20227
20228 * src/lex.c (percent_table): Also accept `%yacc',
20229 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20230 `%debug'.
20231 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20232 instead of returning a token.
20233 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20234 * src/reader.c (read_declarations): Adjust.
20235 * src/files.c (open_files): Don't call `compute_base_names', don't
20236 compute `attrsfile' since they depend upon data which might be
20237 *in* the input file now.
20238 (output_files): Do it here.
20239 * src/output.c (output_headers): Document the fact that this patch
20240 introduces a guaranteed SEGV for semantic parsers.
20241 * doc/bison.texinfo: Document them.
20242 * tests/suite.at: Exercise these %options.
20243
ff4423cc
AD
202442000-12-20 Akim Demaille <akim@epita.fr>
20245
20246 Also handle the output file (--verbose) with obstacks.
20247
20248 * files.c (foutput): Remove.
20249 (output_obstack): New.
20250 Adjust all dependencies.
20251 * src/conflicts.c: Return a string.
20252 * src/system.h (obstack_grow_string): Rename as...
20253 (obstack_sgrow): this. Be ready to work with non literals.
20254 (obstack_fgrow4): New.
20255
956dba3a
AD
202562000-12-20 Akim Demaille <akim@epita.fr>
20257
20258 * src/files.c (open_files): Fix the computation of short_base_name
20259 in the case of `-o foo.tab.c'.
20260
337bab46
AD
202612000-12-20 Akim Demaille <akim@epita.fr>
20262
20263 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20264 (copy_dollar): Now that everything uses obstacks, get rid of the
20265 FILE * parameters.
20266
5d3214b8
AD
202672000-12-20 Akim Demaille <akim@epita.fr>
20268
20269 * src/files.c (open_files): Actually the `.output' file is based
20270 on the short_base_name, not base_name.
20271 * tests/suite.at (Checking output file names): Adjust.
20272
29092a57
AD
202732000-12-20 Akim Demaille <akim@epita.fr>
20274
20275 * src/bison.s1: Remove, we now use directly...
20276 * src/bison.simple: this.
20277 * src/Makefile.am: Use pkgdata instead of data.
20278
ea5607fd
AD
202792000-12-20 Akim Demaille <akim@epita.fr>
20280
20281 * src/files.c (guard_obstack): New.
20282 (open_files): Initialize it.
20283 (output_files): Dump it...
20284 * src/files.h: Export it.
20285 * src/reader.c (copy_guard): Use it.
20286
27110317
AD
202872000-12-19 Akim Demaille <akim@epita.fr>
20288
20289 * src/files.c (outfile, defsfile, actfile): Removed as global
20290 vars.
20291 (open_files): Don't compute them.
20292 (output_files): Adjust.
20293 (base_name, short_base_name): Be global.
20294 Adjust dependencies.
20295
19c50364
AD
202962000-12-19 Akim Demaille <akim@epita.fr>
20297
20298 * src/files.c (strsuffix): New.
20299 (stringappend): Be just like strcat but allocate.
20300 (base_names): Eve out from open_files.
20301 Try to simplify the rather hairy computation of base_name and
20302 short_base_name.
20303 (open_files): Use it.
20304 * tests/suite.at (Checking output file names): New test.
20305
573c1d9f
AD
203062000-12-19 Akim Demaille <akim@epita.fr>
20307
20308 * src/system.h (obstack_grow_literal_string): Rename as...
20309 (obstack_grow_string): this.
20310 * src/output.c (output_parser): Recognize `%% actions' instead of
20311 `$'.
20312 * src/bison.s1: s/$/%% actions/.
20313 * src/bison.hairy: Likewise.
20314
ef7ddedd
AD
203152000-12-19 Akim Demaille <akim@epita.fr>
20316
20317 * src/output.c (output_parser): Compute the `#line' lines when
20318 there are.
20319 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20320 Suggested by Hans Aberg.
20321
ff61dabd
AD
203222000-12-19 Akim Demaille <akim@epita.fr>
20323
20324 Let the handling of the skeleton files be local to the procedures
20325 that use it.
20326
20327 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20328 longer static.
20329 (fparser, open_extra_files): Remove.
20330 (open_files, output_files): Don't take care of fparser.
20331 * src/files.h: Adjust.
20332 * src/output.c (output_parser): Open and close the file to the
20333 skeleton.
20334 * src/reader.c (read_declarations): When %semantic_parser, open
20335 fguard.
20336
55b96341
AD
203372000-12-19 Akim Demaille <akim@epita.fr>
20338
20339 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20340 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20341
358c15b7
AD
203422000-12-19 Akim Demaille <akim@epita.fr>
20343
20344 * src/files.c (open_files): Yipee! We no longer need all the code
20345 looking for `/tmp' since we have no tmp file.
20346
7de3329e
AD
203472000-12-19 Akim Demaille <akim@epita.fr>
20348
20349 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20350 New macros.
20351 * src/files.c (open_files): Less dependency on MSDOS etc.
20352
3abcd459
AD
203532000-12-14 Akim Demaille <akim@epita.fr>
20354
20355 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20356 Provide a default definition.
20357 Use it when executing the default @ action.
20358 * src/reader.c (reader_output_yylsp): No longer include
20359 `timestamp' and `text' in the default YYLTYPE.
20360
2a91a95e
AD
203612000-12-12 Akim Demaille <akim@epita.fr>
20362
20363 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20364 (copy_guard): Quote the file names.
20365 Reported by Laurent Mascherpa.
20366
14d3eb9b
AD
203672000-12-12 Akim Demaille <akim@epita.fr>
20368
20369 * src/output.c (output_headers, output_program, output): Be sure
20370 to escape special characters when outputting filenames.
20371 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20372 (output_headers): Don't depend on them, Use ACTSTR.
20373
d7045ec6
AD
203742000-11-17 Akim Demaille <akim@epita.fr>
20375
20376 * lib/obstack.h: Formatting changes.
20377 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20378 prevents type checking.
20379 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20380 cast the value to (void *): assigning a `foo *' to a `void *'
20381 variable is valid.
20382 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20383 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20384 append characters.
20385
6fd54b73
AD
203862000-11-17 Akim Demaille <akim@epita.fr>
20387
20388 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20389 as...
20390 (suite.m4, regression.m4, calc.m4): these.
20391 * tests/atgeneral.m4: Update from CVS Autoconf.
20392
4c50eae6
AD
203932000-11-17 Akim Demaille <akim@epita.fr>
20394
20395 * tests/regression.m4 (%union and --defines): New test,
20396 demonstrating a current bug in the obstack implementation.
20397
a35f64ea
AD
203982000-11-17 Akim Demaille <akim@epita.fr>
20399
20400 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20401 macros.
20402 Use them to declare the variables which are global or local to
20403 `yyparse'.
20404
7de23534
AD
204052000-11-17 Akim Demaille <akim@epita.fr>
20406
20407 * acconfig.h: Remove, no longer used.
20408
aa7815f5
AD
204092000-11-07 Akim Demaille <akim@epita.fr>
20410
20411 * src: s/Copyright (C)/Copyright/g.
20412
5af1f549
AD
204132000-11-07 Akim Demaille <akim@epita.fr>
20414
20415 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20416 defining.
20417 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20418
553e2b22
AD
204192000-11-07 Akim Demaille <akim@epita.fr>
20420
20421 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20422 Merge in a single CPP if/else.
20423
8a4f41d6
AD
204242000-11-07 Akim Demaille <akim@epita.fr>
20425
20426 * src/output.c (output): Remove useless variables.
20427 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20428 argument `data' for consistency with the prototypes.
20429 Qualify it `const'.
20430 (obstack_copy, obstack_copy0): Rename the second argument as
20431 `address' for consistency. Qualify it `const'.
20432 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20433 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20434 `const' their input argument (`data' or `address').
20435 Adjust the corresponding macros to include `const' in casts.
20436
095a3fb5
AD
204372000-11-03 Akim Demaille <akim@epita.fr>
20438
20439 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20440 s/PFILE1/BISON_HAIRY/.
20441 Adjust dependencies.
20442
d1cdce7c
AD
204432000-11-03 Akim Demaille <akim@epita.fr>
20444
090c5ebf 20445 For some reason, this was not applied.
d1cdce7c
AD
20446
20447 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20448 `unlink': it's no longer used.
20449
9311529b
AD
204502000-11-03 Akim Demaille <akim@epita.fr>
20451
20452 * src/files.c (skeleton_find): New function, eved out of...
20453 (open_files, open_extra_files): here.
20454
d8880f69
AD
204552000-11-03 Akim Demaille <akim@epita.fr>
20456
20457 Don't use `atexit'.
20458
20459 * src/files.c (obstack_save): New function.
20460 (done): Rename as...
20461 (output_files): this.
20462 Use `obstack_save'.
20463 * src/main.c (main): Don't use `atexit' to register `done', since
20464 it no longer has to remove tmp files, just call `output_files'
20465 when there are no errors.
20466
0dbb648e
AD
204672000-11-02 Akim Demaille <akim@epita.fr>
20468
20469 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20470 `unlink': it's no longer used.
20471 * src/files.h: Formatting changes.
20472
896fe5c1
AD
204732000-11-02 Akim Demaille <akim@epita.fr>
20474
20475 Remove the last uses of mktemp and unlink/delete.
20476
20477 * src/files.c (fdefines, ftable): Removed.
20478 (defines_ostack, table_obstack): New.
20479 Adjust dependencies of the former into uses of the latter.
20480 * src/output.c (output_short_or_char_table, output_short_table):
20481 Convert to using obstacks.
20482 * src/reader.c (copy_comment2): Accept one FILE * and two
20483 obstacks.
20484 (output_token_defines, reader_output_yylsp): Use obstacks.
20485 * src/system.h (obstack_fgrow3): New.
1f65350a 20486 * po/POTFILES.in: Adjust.
896fe5c1 20487
dd60faec
AD
204882000-11-01 Akim Demaille <akim@epita.fr>
20489
20490 Change each use of `fattrs' into a use of `attrs_obstack'.
20491
20492 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20493 * src/files.c (fattrs): Remove.
20494 (attrs_obstack): New.
20495 Adjust all dependencies.
20496 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20497
8c7ebe49
AD
204982000-11-01 Akim Demaille <akim@epita.fr>
20499
20500 Introduce obstacks.
20501 Change each use of `faction' into a use of `action_obstack'.
20502
20503 * lib/obstack.h, lib/obstack.c: New files.
20504 * src/files.c (faction): Remove.
20505 (action_obstack): New.
20506 Adjust all dependencies.
20507
77aee789
AD
205082000-10-20 Akim Demaille <akim@epita.fr>
20509
20510 * lib/quote.h (PARAMS): New macro. Use it.
20511
43591cec
AD
205122000-10-16 Akim Demaille <akim@epita.fr>
20513
20514 * src/output.c (output_short_or_char_table): New function.
20515 (output_short_table, output_token_translations): Use it.
20516 (goto_actions): Use output_short_table.
20517
1e9798d5
AD
205182000-10-16 Akim Demaille <akim@epita.fr>
20519
20520 * src/symtab.c (bucket_new): New function.
20521 (getsym): Use it.
20522
20523 * src/output.c (output_short_table): New argument to display the
20524 comment associated with the table.
20525 Adjust dependencies.
20526 (output_gram): Use it.
20527 (output_rule_data): Nicer output layout for YYTNAME.
20528
f282676b
AD
205292000-10-16 Akim Demaille <akim@epita.fr>
20530
20531 * src/lex.c (read_typename): New function.
20532 (lex): Use it.
20533 * src/reader.c (copy_dollar): Likewise.
20534
550a72a3
AD
205352000-10-16 Akim Demaille <akim@epita.fr>
20536
20537 * src/reader.c (copy_comment2): Expect the input stream to be on
20538 the `/' which is suspected to open a comment, instead of being
20539 called after `//' or `/*' was read.
20540 (copy_comment, copy_definition, parse_union_decl, copy_action)
20541 (copy_guard): Adjust.
20542
131e2fef
AD
205432000-10-16 Akim Demaille <akim@epita.fr>
20544
20545 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20546 `read_signed_integer'.
20547
79282c5a
AD
205482000-10-16 Akim Demaille <akim@epita.fr>
20549
20550 * src/reader.c (copy_dollar): New function.
20551 (copy_guard, copy_action): Use it.
20552
ff4a34be
AD
205532000-10-16 Akim Demaille <akim@epita.fr>
20554
20555 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20556 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20557 New files, from Fileutils 4.0.27.
20558 * src/main.c (printable_version): Remove.
20559 * src/lex.c, src/reader.c: Use `quote'.
20560
205612000-10-04 Akim Demaille <akim@epita.fr>
20562
20563 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20564
14ded682
AD
205652000-10-04 Akim Demaille <akim@epita.fr>
20566
20567 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20568
8e03724b
AD
205692000-10-04 Akim Demaille <akim@epita.fr>
20570
20571 When a literal string is used to define two different tokens,
20572 `bison -v' segfaults.
20573 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20574
20575 * tests/regression.m4: New file.
20576 Include the core of the sample provided by Piotr Gackiewicz.
20577 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20578 properly.
20579
a9e64249
AD
205802000-10-04 Akim Demaille <akim@epita.fr>
20581
20582 * src/reader.c (parse_expect_decl): Keep `count' within the size
20583 of `buffer'.
20584 From Neil Booth.
20585
da9abf43
AD
205862000-10-02 Paul Eggert <eggert@twinsun.com>
20587
20588 * bison.s1 (yyparse): Assign the default value
20589 unconditionally, to avoid a GCC warning and make the parser a
20590 tad smaller.
20591
c33638bb
AD
205922000-10-02 Akim Demaille <akim@epita.fr>
20593
20594 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20595 options.
20596
444c570a
AD
205972000-10-02 Akim Demaille <akim@epita.fr>
20598
20599 * src/derives.c, src/print.c, src/reduce.c: To ease the
20600 translation, move some `\n' out of the translated strings.
20601
89cab50d
AD
206022000-10-02 Akim Demaille <akim@epita.fr>
20603
20604 The location tracking mechanism is precious for parse error
20605 messages. Nevertheless, it is enabled only when `@n' is used in
20606 the grammar, which is a different issue (you can use it in error
20607 message, but not in the grammar per se). Therefore, there should
20608 be another means to enable it.
20609
20610 * src/getargs.c (getargs): Support `--locations'.
20611 (usage): Report it.
20612 * src/getargs.h (locationsflag): Export it.
20613 * src/lex.c (percent_table): Support `%locations'.
20614 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20615 with `locationsflag'.
20616 * doc/bison.texinfo: Document `--locations' and `%locations'.
20617 Sort the options.
20618 * tests/calc.m4: Test it.
20619
20620 For regularity of the names, replace each
20621 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20622 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20623 In addition replace each `flag' with `_flag'.
20624
d6c2cba0
AD
206252000-10-02 Akim Demaille <akim@epita.fr>
20626
20627 Also test parse error messages, including with YYERROR_VERBOSE.
20628
20629 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20630 associative).
20631 Use it to check the computations.
20632 Use it to check `nonassoc' is honored.
20633 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20634 `--yyerror-verbose'.
20635 (_AT_CHECK_CALC): Adjust to this option.
20636 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20637
5a35a6cb
AD
206382000-10-02 Akim Demaille <akim@epita.fr>
20639
20640 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20641 the latter demonstrates a flaw in the handling of non debugging
20642 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20643 was used in order to simplify:
20644
20645 #if YYDEBUG
20646 if (yydebug)
20647 {
20648 ...
20649 }
20650 #endif
20651
20652 into
20653
20654 if (yydebug)
20655 {
20656 ...
20657 }
20658
20659 unfortunately this leads to a CPP conflict when
20660 `--name-prefix=foo' is used since it produces `#define yydebug
20661 foodebug'.
20662
20663 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20664 (YYDPRINTF): New macro.
20665 Spread its use.
20666 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20667 the bison options.
20668 Also test `--verbose', `--defines' and `--name-prefix'.
20669
71da9eea
AD
206702000-10-02 Akim Demaille <akim@epita.fr>
20671
20672 Improve the readability of the produced parsers.
20673
20674 * src/bison.s1: Formatting changes.
20675 Improve the comment related to the `$' mark.
20676 (yydefault): Don't fall through to `yyresume': `goto' there.
20677 * src/output.c (output_parser): When the `$' is met, skip the end
20678 of its line.
20679 New variable, `number_of_dollar_signs', to check there's exactly
20680 one `$' in the parser skeleton.
20681
95e36146
AD
206822000-10-02 Akim Demaille <akim@epita.fr>
20683
20684 * lib/xstrdup.c: New file, from the fileutils.
20685 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20686 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20687 instead of strlen + xmalloc + strcpy.
20688 * src/symtab.c (copys): Remove, use xstrdup instead.
20689
d7020c20
AD
206902000-10-02 Akim Demaille <akim@epita.fr>
20691
20692 * src/gram.h (associativity): New enum type which replaces the
20693 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20694 `right_assoc', `left_assoc' and `non_assoc'.
20695 Adjust all dependencies.
20696 * src/reader.c: Formatting changes.
20697 (LTYPESTR): Don't define it, use it as a literal in
20698 `reader_output_yylsp'.
20699 * src/symtab.h (symbol_class): New enum type which replaces the
20700 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20701 `sunknown', `stoken and `snterm'.
20702
1916f98e
AD
207032000-10-02 Akim Demaille <akim@epita.fr>
20704
20705 * src/getargs.c (fixed_outfiles): Rename as...
20706 (yaccflag): for consistency and accuracy.
20707 Adjust dependencies.
20708
d7913476
AD
207092000-10-02 Akim Demaille <akim@epita.fr>
20710
20711 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20712 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20713 difficult and introduced a lot of core dump. It turns out that
20714 Bison used an implementation of `xmalloc' based on `calloc', and
20715 at various places it does depend upon the initialization to 0. I
20716 have not tried to isolate the pertinent places, and all the former
20717 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20718 someone should address this issue.
20719
20720 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20721 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20722 files.
20723 Adjust dependencies.
20724 * src/warshall.h: New file.
20725 Propagate.
20726
340ef489
AD
207272000-10-02 Akim Demaille <akim@epita.fr>
20728
20729 Various anti-`extern in *.c' changes.
20730
20731 * src/system.h: Include `assert.h'.
20732
b2ca4022
AD
207332000-10-02 Akim Demaille <akim@epita.fr>
20734
20735 * src/state.h (nstates, final_state, first_state, first_shift)
20736 (first_reduction): Move their exportation from here...
20737 * src/LR0.h: to here.
20738 Adjust dependencies.
20739 * src/getargs.c (statisticsflag): New variable.
20740 Add support for `--statistics'.
20741 Adjust dependencies.
20742
20743 Remove a lot of now useless `extern' statements in most files.
20744
403b315b
AD
207452000-10-02 Akim Demaille <akim@epita.fr>
20746
20747 * src/LR0.h: New file.
20748 Propagate its use.
20749
07a58c13
AD
207502000-10-02 Akim Demaille <akim@epita.fr>
20751
20752 * src/print.h: New file.
20753 Propagate its use.
20754 * src/print.c: Formatting and ordering changes.
20755 (verbose, terse): Replace with...
20756 (print_results): this new function.
20757 Adjust dependencies.
20758
0619caf0
AD
207592000-10-02 Akim Demaille <akim@epita.fr>
20760
20761 * src/conflicts.c (conflict_report): New function.
20762 (conflict_log, verbose_conflict_log): Replace with...
20763 (print_conflicts): this function.
20764 Adjust dependencies.
20765 * src/conflicts.h: New file.
20766 Propagate its inclusion.
20767
3519ec76
AD
207682000-10-02 Akim Demaille <akim@epita.fr>
20769
20770 * src/nullable.h: New file.
20771 Propagate its inclusion.
20772 * src/nullable.c: Formatting changes.
20773
015acc48
AD
207742000-10-02 Akim Demaille <akim@epita.fr>
20775
20776 * src/reduce.h: New file.
20777 Propagate its inclusion.
20778 * src/reduce.c: Topological sort and other formatting changes.
20779 (bool, TRUE, FALSE): Move their definition to...
20780 * src/system.h: here.
20781
8963a27b
AD
207822000-10-02 Akim Demaille <akim@epita.fr>
20783
20784 * src/files.c: Formatting changes.
20785 (tryopen, tryclose, openfiles): Rename as...
20786 (xfopen, xfclose, open_files): this.
20787 (stringappend): static.
20788 * src/files.h: Complete the list of exported symbols.
20789 Propagate its use.
20790
a70083a3
AD
207912000-10-02 Akim Demaille <akim@epita.fr>
20792
20793 * src/reader.h: New file.
20794 Propagate its use instead of tedious list of `extern' and
20795 prototypes.
20796 * src/reader.c: Formatting changes, topological sort,
20797 s/register//.
20798
abadc117
AD
207992000-10-02 Akim Demaille <akim@epita.fr>
20800
20801 * src/lex.h: Prototype `lex.c' exported functions.
20802 * src/reader.c: Adjust.
20803 * src/lex.c: Formatting changes.
20804 (safegetc): Rename as...
20805 (xgetc): this.
20806
720d742f
AD
208072000-10-02 Akim Demaille <akim@epita.fr>
20808
20809 * src/lalr.h: New file.
20810 Propagate its inclusion instead of prototypes and `extern'.
20811 * src/lalr.c: Formatting changes, topological sorting etc.
20812
f2acea59
AD
208132000-10-02 Akim Demaille <akim@epita.fr>
20814
20815 * src/output.c (token_actions): Introduce a temporary array,
20816 YYDEFACT, that makes it possible for this function to use
20817 output_short_table.
20818
d019d655
AD
208192000-10-02 Akim Demaille <akim@epita.fr>
20820
20821 `user_toknums' is output as a `short[]' in `output.c', while it is
20822 defined as a `int[]' in `reader.c'. For consistency with the
20823 other output tables, `user_toknums' is now defined as a table of
20824 shorts.
20825
20826 * src/reader.c (user_toknums): Be a short table instead of an int
20827 table.
20828 Adjust dependencies.
20829
20830 Factor the short table outputs.
20831
20832 * src/output.c (output_short_table): New function.
20833 * src/output.c (output_gram, output_stos, output_rule_data)
20834 (output_base, output_table, output_check): Use it.
20835
6c89f1c1
AD
208362000-10-02 Akim Demaille <akim@epita.fr>
20837
20838 * src/output.c (output): Topological sort of the functions, in
20839 order to get rid of the `static' prototypes.
20840 No longer use `register'.
20841 * src/output.h: New file.
20842 Propagate its inclusion in files explicitly prototyping functions
20843 from output.c.
20844
d9efd181
AD
208452000-09-21 Akim Demaille <akim@epita.fr>
20846
20847 * src/atgeneral.m4: Update from Autoconf.
20848
c29240e7 208492000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
20850
20851 * src/closure.h: New file.
20852 * src/closure.c: Formatting changes, topological sort over the
20853 functions, use of closure.h.
20854 (initialize_closure, finalize_closure): Rename as...
20855 (new_closure, free_closure): these. Adjust dependencies.
20856 * src/LR0.c: Formatting changes, topological sort, use of
20857 cloture.h.
20858 (initialize_states): Rename as...
20859 (new_states): this.
20860 * src/Makefile.am (noinst_HEADERS): Adjust.
20861
499daa50
AD
208622000-09-20 Akim Demaille <akim@epita.fr>
20863
20864 * src/acconfig.h: Don't protect config.h against multiple
20865 inclusion.
20866 Don't define PARAMS.
20867 * src/system.h: Define PARAMS.
20868 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20869 purpose of config.h. system.h must not try to fix wrong
20870 definitions in config.h.
20871
cc84fd5d
AD
208722000-09-20 Akim Demaille <akim@epita.fr>
20873
20874 * src/derives.h: New file.
20875 * src/main.c, src/derives.h: Use it.
20876 Formatting changes.
20877 * src/Makefile.am (noinst_HEADERS): Adjust.
20878
db5b3a89
AD
208792000-09-20 Akim Demaille <akim@epita.fr>
20880
20881 * tests/atgeneral.m4: Update from Autoconf.
20882 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20883 (AT_CHECK_CALC): New macros.
20884 Use these macros to test bison with options `', `--raw',
20885 `--debug', `--yacc', `--yacc --debug'.
20886
ceed8467
AD
208872000-09-19 Akim Demaille <akim@epita.fr>
20888
20889 * src/output.c: Formatting changes.
20890 * src/machine.h: Remove, leaving its contents in...
20891 * src/system.h: here.
20892 Include stdio.h.
20893 Adjust all dependencies on stdio.h and machine.h.
20894 * src/getargs.h: New file.
20895 Let all `extern' declarations about getargs.c be replaced with
20896 inclusion of `getargs.h'.
20897 * src/Makefile.am (noinst_HEADERS): Adjust.
20898
20899 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20900 scope.
20901 (yyerror): Returns void, not int.
20902 * doc/bison.texinfo: Formatting changes.
20903
05a1d24b
AD
209042000-09-19 Akim Demaille <akim@epita.fr>
20905
20906 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20907 portable.
20908
cbd25751
AD
209092000-09-18 Akim Demaille <akim@epita.fr>
20910
20911 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20912 * src/Makefile.am (INCLUDES): Don't.
20913 Be ready to fetch headers in lib/.
20914
13863333
AD
209152000-09-18 Akim Demaille <akim@epita.fr>
20916
20917 * doc/bison.texinfo: Update the copyright.
20918 ANSIfy and GNUify the examples.
20919 Remove the old menu.
20920
0d533154
AD
209212000-09-18 Akim Demaille <akim@epita.fr>
20922
20923 First set of tests: use the `calc' example from the documentation.
20924
20925 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20926 is defined only when YYDEBUG is.
20927 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20928 * src/files.c (tryopen, tryclose): Formatting changes.
20929 Move to the top and be static.
20930 * src/reader.c (read_signed_integer): Likewise.
20931 * tests/calc.m4: New file.
20932 * Makefile.am, suite.m4: Adjust.
20933 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20934
e79137ac
AD
209352000-09-18 Akim Demaille <akim@epita.fr>
20936
20937 Add support for an Autotest test suite for Bison.
20938
20939 * m4/m4.m4, m4/atconfig.m4: New files.
20940 * m4/Makefile.am (EXTRA_DIST): Adjust.
20941 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
20942 files.
20943 * src/getargs.c: Display a more standard --version message.
20944 * src/reader.c (reader): Formatting changes.
20945 No longer depend upon VERSION_STRING.
20946 * configure.in: No longer use `dnl'.
20947 Set up the test suite and the new directory `tests/.
20948 (VERSION_STRING): Remove.
20949
27821bff
AD
209502000-04-14 Akim Demaille <akim@epita.fr>
20951
20952 * src/reader.c (copy_comment2): New function, same as former
20953 `copy_comment', but outputs into two FILE *.
20954 (copy_comment): Use it.
20955 (parse_union_decl): Use it.
20956 (get_type, parse_start_decl): Use the same `invalid' message.
20957 (parse_start_decl, parse_union_decl): Use the same `multiple'
20958 message.
20959 (parse_union_decl, copy_guard, copy_action): Use the same
20960 `unmatched' message.
20961 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
20962
cfe5fbc0
AD
209632000-03-31 Akim Demaille <akim@epita.fr>
20964
20965 * src/files.c (tryopen, tryclose): Move to the top.
20966 Be static.
20967
cb7db13e
AD
209682000-03-31 Akim Demaille <akim@epita.fr>
20969
20970 * src/main.c (main): Don't call `done', exit does it.
20971
a0f6b076
AD
209722000-03-31 Akim Demaille <akim@epita.fr>
20973
36281465
AD
20974 * allocate.c: s/return (foo)/return foo/.
20975 * lalr.c: Likewise.
20976 * LR0.c: Likewise.
20977 * output.c: Likewise.
20978 * reader.c: Likewise.
20979 * symtab.c: Likewise.
20980 * vmsgetargs.c: Likewise.
20981
209822000-03-31 Akim Demaille <akim@epita.fr>
20983
20984 Clean up the error reporting functions.
a0f6b076
AD
20985
20986 * src/report.c: New file.
20987 * src/report.h: Likewise.
20988 * src/Makefile.am: Adjust.
20989 * m4/error.m4: New file.
20990 * m4/Makefile.am: Adjust.
20991 * configure.in (jm_PREREQ_ERROR): Call it.
20992 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
20993 Remove.
20994 (fatal, fatals): Remove. All callers use complain.c::fatal.
20995 (warn, warni, warns, warnss, warnss): Remove. All callers use
20996 complain.c::complain.
20997 (toomany): Remove, use fatal instead.
20998 * src/files.c (done): No argument, use complain_message_count.
20999 * src/main.c (main): Register `done' to `atexit'.
21000
21001 * src/getargs.c (usage): More `fputs', less `fprintf'.
21002
18539825
AD
210032000-03-28 Akim Demaille <akim@epita.fr>
21004
21005 * lib/: New directory.
21006 * Makefile.am (SUBDIRS): Adjust.
21007 * configure.in: Adjust.
21008 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21009 useless.
21010 * src/alloca.c: Moved to lib/.
21011 * src/getopt.c: Likewise.
21012 * src/getopt1.c: Likewise.
21013 * src/getopt.h: Likewise.
21014 * src/ansi2knr.c: Likewise.
21015 * src/ansi2knr.1: Likewise.
21016 * src/Makefile.am: Adjust.
21017 * lib/Makefile.am: New file.
21018
9f306f2a
AD
210192000-03-28 Akim Demaille <akim@epita.fr>
21020
21021 * src/getargs.c (usage): Refresh the help message.
21022
0ba347b6
AD
210232000-03-17 Akim Demaille <akim@epita.fr>
21024
21025 * src/getopt1.c: Updated from textutils 2.0e
21026 * src/getopt.c: Likewise.
21027 * src/getopt.h: Likewise.
21028
dbe7f271
AD
210292000-03-17 Akim Demaille <akim@epita.fr>
21030
21031 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21032 the file name, not the whole `#line LINE FILE'.
21033
75bbe78d
AD
210342000-03-17 Akim Demaille <akim@epita.fr>
21035
21036 On syntax errors, report the token on which we choked.
21037
aa5fd0ee
AD
21038 * src/bison.s1 (yyparse): In the label yyerrlab, when
21039 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 21040
7b306f52
AD
210412000-03-17 Akim Demaille <akim@epita.fr>
21042
aa5fd0ee 21043 * src/reader.c (copy_at): New function.
7b306f52
AD
21044 (copy_guard): Use it.
21045 (copy_action): Use it.
21046
e87b5700
AD
210472000-03-17 Akim Demaille <akim@epita.fr>
21048
21049 Be kind to translators, save some useless translations.
21050
aa5fd0ee 21051 * src/main.c (banner): New function.
e87b5700
AD
21052 (fatal_banner): Use it.
21053 (warn_banner): Use it.
21054
ae3c3164
AD
210552000-03-17 Akim Demaille <akim@epita.fr>
21056
aa5fd0ee
AD
21057 * src/reader.c (copy_definition): Use copy_string and
21058 copy_comment. Removed now unused `match', `ended',
21059 `cplus_comment'.
ae3c3164
AD
21060 (copy_comment, copy_string): Moved, to be visible from
21061 copy_definition.
21062
4dc58e7c
AD
210632000-03-17 Akim Demaille <akim@epita.fr>
21064
aa5fd0ee
AD
21065 * src/reader.c (copy_string): Declare `static inline'. No
21066 problems with inline, since it is checked by configure.
4dc58e7c
AD
21067 (copy_comment): Likewise.
21068
0a6384c4
AD
210692000-03-17 Akim Demaille <akim@epita.fr>
21070
aa5fd0ee 21071 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 21072
3cef001a
AD
210732000-03-17 Akim Demaille <akim@epita.fr>
21074
aa5fd0ee 21075 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
21076 (copy_action): Use it. Removed now unused `match', `ended',
21077 `cplus_comment'.
21078 (copy_guard): Likewise.
21079
ca36d2ef
AD
210802000-03-17 Akim Demaille <akim@epita.fr>
21081
aa5fd0ee 21082 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
21083 (copy_action): Use it.
21084 (copy_guard): Likewise.
21085
6666f98f
AD
210862000-03-17 Akim Demaille <akim@epita.fr>
21087
21088 Change the handling of @s so that they behave exactly like $s.
21089 There is now a pseudo variable @$ (readble and writable), location
21090 of the lhs of the rule (by default ranging from the location of
21091 the first symbol of the rhs, to the location of the last symbol,
21092 or, if the rhs is empty, YYLLOC).
21093
21094 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21095 yyval.
21096 (yyparse): When providing a default semantic action, provide a
21097 default location action.
21098 (after the $): No longer change `*YYLSP', just stack YYLOC the
21099 same way you stack YYVAL.
21100 * src/reader.c (read_declarations): Use warns.
21101 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21102 (copy_action, case '@'): Likewise.
21103 Use a standard error message, to save useless work from
21104 translators.
21105
41aca2e0
AD
211062000-03-17 Akim Demaille <akim@epita.fr>
21107
aa5fd0ee
AD
21108 * src/bison.s1: Formatting and cosmetics changes.
21109 * src/reader.c: Likewise.
41aca2e0
AD
21110 Update the Copyright notice.
21111
dc08c1d5
AD
211122000-03-17 Akim Demaille <akim@epita.fr>
21113
aa5fd0ee
AD
21114 * src/bison.s1 (#line): All set to `#line' only, since the
21115 Makefile now handles them.
dc08c1d5 21116
9ee3c97b
AD
211172000-03-16 Akim Demaille <akim@epita.fr>
21118
21119 * src/output.c (output_rule_data): Output the documentation of
21120 some of the tables.
21121 (Copyright notice): Update.
21122 Formatting changes.
21123
0de741ca
AD
211242000-03-16 Akim Demaille <akim@epita.fr>
21125
21126 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21127 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21128 One `#if YYDEBUG' remains, since it uses variables which are
21129 defined only if `YYDEBUG != 0'.
21130
bb10be54
AD
211312000-03-16 Akim Demaille <akim@epita.fr>
21132
21133 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21134 and related variables so that the similarities are highlighted.
21135
b07b484a
AD
211362000-03-16 Akim Demaille <akim@epita.fr>
21137
21138 * src/bison.s1: Properly indent CPP directives.
21139
361f60b3
AD
211402000-03-16 Akim Demaille <akim@epita.fr>
21141
21142 * src/bison.s1: Properly indent the `alloca' CPP section.
21143
8c44d3ec
AD
211442000-03-16 Akim Demaille <akim@epita.fr>
21145
21146 Do not hard code values of directories in `configure.in'.
21147 Update the `configure' tool chain.
21148
21149 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21150 src/makefile.am.
21151 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21152 (AC_OUTPUT): Add m4/Makefile.
21153 Bump to bison 1.28a, 1.29 has never been released.
21154 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21155 handled via src/Makefile.am.
21156 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21157 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21158 autoheader.
21159 * Makefile.am (SUBDIRS): Add m4.
21160 (ACLOCAL_AM_FLAGS): New variable.
21161 (AUTOMAKE_OPTIONS): Add check-news.
21162 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21163 the proper line number and file name.
21164 (DEFS): Propagate the location of bison library files and of the
21165 locale files.
21166 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21167 builddir.
21168 * acinclude.m4: Remove, replaced by the directory m4.
21169 * m4/Makefile.am (EXTRA_DIST): New variable.
21170 * m4/gettext.m4: New file, from the fileutils.
21171 * m4/lcmessage.m4: Likewise
21172 * m4/progtest.m4: Likewise.
21173 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21174
f95997e7
AD
211752000-03-10 Akim Demaille <akim@epita.fr>
21176
21177 * src/closure.c:
21178 Formatting changes of various comments.
21179 Respect the GNU coding standards at various places.
21180 Don't use `_()' when no translation is needed.
21181
211821999-12-13 Jesse Thilo <jthilo@gnu.org>
21183
21184 * src/files.c:
21185 OS/2 honors TMPDIR environment variable.
21186
211871999-12-13 Jesse Thilo <jthilo@gnu.org>
21188
21189 * doc/bison.texinfo: Tweaked spelling and grammar.
21190 Updated ISBN.
21191 Removed reference to price of printed copy.
21192 Mention BISON_SIMPLE and BISON_HAIRY.
21193
211941999-12-13 Jesse Thilo <jthilo@gnu.org>
21195
21196 * configure.in, NEWS:
21197 Bison 1.29 released.
21198
211991999-10-27 Jesse Thilo <jthilo@gnu.org>
21200
21201 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21202 Added reference card.
21203
212041999-07-26 Jesse Thilo <jthilo@gnu.org>
21205
21206 * po/ru.po: Added Russian translation.
21207
212081999-07-26 Jesse Thilo <jthilo@gnu.org>
21209
21210 * configure.in: Added Russian translation.
21211
212121999-07-06 Jesse Thilo <jthilo@gnu.org>
21213
21214 * configure.in, NEWS, README:
21215 Released version 1.28.
21216
212171999-06-14 Jesse Thilo <jthilo@gnu.org>
21218
21219 * src/system.h:
21220 Squashed redefinition warning on some systems.
21221
21222 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21223 Have configure build version string instead of relying on ANSI string
21224 concatentation.
21225
212261999-06-14 Jesse Thilo <jthilo@gnu.org>
21227
21228 * po/POTFILES.in: Got rid of version.c.
21229
212301999-06-14 Jesse Thilo <jthilo@gnu.org>
21231
21232 * acconfig.h, configure.in:
21233 Have configure build version string instead of relying on ANSI string
21234 concatentation.
21235
212361999-06-08 Jesse Thilo <jthilo@gnu.org>
21237
21238 * doc/bison.1:
21239 Dropped mention of `+' for long-named options.
21240
212411999-05-30 Jesse Thilo <jthilo@gnu.org>
21242
21243 * src/files.c: Added <unistd.h> for unlink().
21244
21245 * src/Makefile.am, src/system.h:
21246 I18n fixes.
21247
212481999-05-30 Jesse Thilo <jthilo@gnu.org>
21249
21250 * README: Added a FAQ list.
21251
21252 * configure.in, acconfig.h:
21253 I18n fixes.
21254
212551999-05-30 Jesse Thilo <jthilo@gnu.org>
21256
21257 * doc/FAQ, doc/Makefile.am:
21258 Added a FAQ list.
21259
212601999-05-19 Jesse Thilo <jthilo@gnu.org>
21261
21262 * src/alloc.h, src/symtab.h, src/version.c:
21263 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21264
212651999-04-18 Jesse Thilo <jthilo@gnu.org>
21266
21267 * src/.cvsignore, src/Makefile.am:
21268 Reorganized: sources in `src', documentation in `doc'.
21269
21270 * src/lex.c (literalchar):
21271 fixed the code for escaping double quotes (thanks
21272 Jonathan Czisny.)
21273
212741999-04-18 Jesse Thilo <jthilo@gnu.org>
21275
21276 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21277 Adjusted paths to reflect directory reorganization.
21278
212791999-04-18 Jesse Thilo <jthilo@gnu.org>
21280
21281 * doc/.cvsignore, doc/Makefile.am:
21282 Reorganized: sources in `src', documentation in `doc'.
21283
212841999-04-18 Jesse Thilo <jthilo@gnu.org>
21285
21286 * configure.in:
21287 Updated AC_INIT file to reflect directory reorganization.
21288
21289 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21290 Reorganized: sources in `src', documentation in `doc'.
21291
212921999-04-13 Jesse Thilo <jthilo@gnu.org>
21293
21294 * src/allocate.c:
21295 Don't declare calloc() and realloc() if not necessary.
21296
212971999-04-13 Jesse Thilo <jthilo@gnu.org>
21298
21299 * configure.in, acconfig.h, acinclude.m4:
21300 Don't declare calloc() and realloc() if not necessary.
21301
213021999-03-23 Jesse Thilo <jthilo@gnu.org>
21303
21304 * po/.cvsignore: Added i18n support.
21305
213061999-03-23 Jesse Thilo <jthilo@gnu.org>
21307
21308 * acconfig.h, configure.in, Makefile.am:
21309 Added i18n support.
21310
213111999-03-22 Jesse Thilo <jthilo@gnu.org>
21312
21313 * src/bison.s1: Fixed #line numbers.
21314
213151999-03-15 Jesse Thilo <jthilo@gnu.org>
21316
21317 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21318 Added PO files from Translation Project.
21319
213201999-03-03 Jesse Thilo <jthilo@gnu.org>
21321
21322 * Makefile.am:
21323 Added support for non-ANSI compilers (ansi2knr).
21324
213251999-02-16 Jesse Thilo <jthilo@gnu.org>
21326
21327 * configure.in: Bumped version number to 1.27.
21328
21329 * Makefile.am:
21330 Added `bison.simple' to list of files removed by `make distclean'.
21331
213321999-02-12 Jesse Thilo <jthilo@gnu.org>
21333
21334 * src/files.c, src/files.h:
21335 Defined locations of parser files in config.h instead of Makefile.
21336
213371999-02-12 Jesse Thilo <jthilo@gnu.org>
21338
21339 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21340 Defined locations of parser files in config.h instead of Makefile.
21341
213421999-02-09 Jesse Thilo <jthilo@gnu.org>
21343
21344 * Makefile.am:
21345 Removed inappropriate use of $< macro.
21346
213471999-02-05 Jesse Thilo <jthilo@gnu.org>
21348
21349 * po/Makefile.in.in, po/POTFILES.in:
21350 Add `po' directory skeleton.
21351
213521999-01-27 Jesse Thilo <jthilo@gnu.org>
21353
21354 * README: Document help-bison list.
21355
21356 * configure.in: Add check for mkstemp().
21357
213581999-01-20 Jesse Thilo <jthilo@gnu.org>
21359
21360 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21361 Hush a few compiler warnings.
21362
21363 * src/files.c:
21364 Add tryclose(), which verifies that fclose was successful.
21365 Hush a couple of compiler warnings.
21366
213671999-01-20 Jesse Thilo <jthilo@gnu.org>
21368
21369 * Makefile.am, OChangeLog:
21370 ChangeLog is now automatically generated. Include the old version as
21371 OChangeLog.
21372
213731999-01-14 Jesse Thilo <jthilo@gnu.org>
21374
21375 * 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:
21376 Update FSF address.
21377
213781999-01-14 Jesse Thilo <jthilo@gnu.org>
21379
21380 * doc/bison.texinfo: Fix formatting glitch.
21381
21382 * doc/bison.texinfo: Update FSF address.
21383
213841999-01-14 Jesse Thilo <jthilo@gnu.org>
21385
21386 * acconfig.h: Update FSF address.
21387
213881999-01-08 Jesse Thilo <jthilo@gnu.org>
21389
21390 * src/system.h:
21391 Don't define PACKAGE here, since config.h defines it.
21392
213931998-12-30 Jesse Thilo <jthilo@gnu.org>
21394
21395 * src/reader.c: Update copyright date.
21396
21397 * src/main.c:
21398 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21399 favor of output directly to stderr (avoids buffer overruns).
21400
21401 * src/reader.c: Some checks for premature EOF.
21402
21403 * 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:
21404 Use prototypes if the compiler understands them.
21405
21406 * src/files.c: Honor TMPDIR on Unix hosts.
21407 Use prototypes if the compiler understands them.
21408
21409 * src/reader.c:
21410 Fix a couple of buffer overrun bugs.
21411 Use prototypes if the compiler understands them.
21412
21413 * src/system.h: Include unistd.h and ctype.h.
21414 Use #ifdef instead of #if for NLS symbols.
21415
214161998-12-30 Jesse Thilo <jthilo@gnu.org>
21417
21418 * doc/bison.texinfo:
21419 Delete comment "consider using @set for edition number, etc..." since
21420 we now are doing so.
21421
214221998-12-30 Jesse Thilo <jthilo@gnu.org>
21423
21424 * configure.in:
21425 Use prototypes if the compiler understands them.
21426
21427 * NEWS: Document 1.26 highlights.
21428
21429 * Makefile.am: Require Automake 1.3 or later.
21430
21431 * acconfig.h:
21432 Use prototypes if the compiler understands them.
21433
214341998-12-29 Jesse Thilo <jthilo@gnu.org>
21435
21436 * src/version.c:
21437 Use VERSION symbol from automake for version number.
21438
214391998-12-29 Jesse Thilo <jthilo@gnu.org>
21440
21441 * acconfig.h, configure.in, version.cin:
21442 Use VERSION symbol from automake for version number.
21443
214441998-11-28 Jesse Thilo <jthilo@gnu.org>
21445
21446 * Makefile.am:
21447 Distribute original version of simple parser (bison.s1), not built
21448 version (bison.simple).
21449
214501998-11-28 Jesse Thilo <jthilo@gnu.org>
21451
21452 * doc/bison.texinfo: Add info dir entry.
21453
21454 * doc/bison.texinfo:
21455 Let automake put version number into documentation.
21456
214571998-11-26 Jesse Thilo <jthilo@gnu.org>
21458
21459 * src/bison.cld, src/build.com, src/vmshlp.mar:
21460 Add non-RCS files from /gd/gnu/bison.
21461
214621998-11-26 Jesse Thilo <jthilo@gnu.org>
21463
21464 * doc/bison.1:
21465 Document the BISON_HAIRY and BISON_SIMPLE variables.
21466
214671998-11-25 Jesse Thilo <jthilo@gnu.org>
21468
21469 * src/version.c: Build version.c automatically.
21470
21471 * src/reader.c:
21472 Fix token numbering (used to start at 258, not 257).
21473
21474 * src/system.h: Include config.h.
21475
21476 * src/getargs.c: Update bug report address.
21477
21478 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21479 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21480
214811998-11-25 Jesse Thilo <jthilo@gnu.org>
21482
21483 * Makefile.am:
21484 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21485
21486 * configure.in, version.cin:
21487 Build version.c automatically.
21488
21489 * AUTHORS: Add AUTHORS file.
21490
21491 * README: Update bug report address.
21492
21493 * bison.simple:
21494 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21495
21496 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21497 Add automake stuff.
21498
214991998-11-25 Jesse Thilo <jthilo@gnu.org>
21500
21501 * doc/bison.texinfo: Clean up some formatting.
21502
215031998-05-05 Richard Stallman <rms@gnu.org>
21504
21505 * doc/bison.texinfo:
21506 Explain better why to make a pure parser.
21507
215081998-01-05 Richard Stallman <rms@gnu.org>
21509
21510 * src/files.c (openfiles):
21511 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21512 find a temporary directory, if possible. Do not unlink files while
21513 they are open.
21514
215151997-08-25 Richard Stallman <rms@gnu.org>
21516
21517 * src/reader.c (stack_offset;):
21518 Change some warni to warns.
21519
21520 * src/lex.c (literalchar): Use warns, not warni.
21521
215221997-06-28 Richard Stallman <rms@gnu.org>
21523
21524 * src/bison.s1: Add a Bison version comment.
21525
21526 * src/main.c (fatal, warn, berror):
21527 Use program_name.
21528
215291997-06-28 Richard Stallman <rms@gnu.org>
21530
21531 * Makefile.in (bison_version): New variable.
21532 (dist): Use that variable.
21533 (bison.s1): Substitute the Bison version into bison.simple.
21534
21535 * bison.simple: Add a Bison version comment.
21536
215371997-06-18 Richard Stallman <rms@gnu.org>
21538
21539 * src/main.c (fatal, warn, berror):
21540 Make error messages standard.
21541 (toomany): Improve error message text.
21542
21543 * 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:
21544 new.h renamed to alloc.h.
21545
215461997-06-18 Richard Stallman <rms@gnu.org>
21547
21548 * Makefile.in: new.h renamed to alloc.h.
21549
215501997-05-24 Richard Stallman <rms@gnu.org>
21551
21552 * src/lex.c (literalchar):
21553 Fix the code for escaping \, " and '.
21554
21555 (lex): Avoid trouble when there are many chars
21556 to discard in a char literal with just several chars in it.
21557
215581997-05-17 Richard Stallman <rms@gnu.org>
21559
21560 * src/bison.s1:
21561 Use malloc, if using alloca is troublesome.
21562 (YYSTACK_USE_ALLOCA): New flag macro.
21563 Define it for some systems and compilers.
21564 (YYSTACK_ALLOC): New macro.
21565 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21566 If it was malloc'd, free it.
21567
215681997-05-17 Richard Stallman <rms@gnu.org>
21569
21570 * bison.simple:
21571 Use malloc, if using alloca is troublesome.
21572 (YYSTACK_USE_ALLOCA): New flag macro.
21573 Define it for some systems and compilers.
21574 (YYSTACK_ALLOC): New macro.
21575 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21576 If it was malloc'd, free it.
21577
215781997-04-23 Richard Stallman <rms@gnu.org>
21579
21580 * src/bison.s1:
21581 (alloca) [__hpux]: Always define as __builtin_alloca.
21582
215831997-04-23 Richard Stallman <rms@gnu.org>
21584
21585 * bison.simple:
21586 (alloca) [__hpux]: Always define as __builtin_alloca.
21587
215881997-04-22 Richard Stallman <rms@gnu.org>
21589
21590 * src/bison.s1:
21591 [__hpux]: Include alloca.h (right for HPUX 10)
21592 instead of declaring alloca (right for HPUX 9).
21593
21594 * src/bison.s1 (__yy_memcpy):
21595 Declare arg `count' as unsigned int.
21596 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21597
215981997-04-22 Richard Stallman <rms@gnu.org>
21599
21600 * bison.simple:
21601 [__hpux]: Include alloca.h (right for HPUX 10)
21602 instead of declaring alloca (right for HPUX 9).
21603
21604 * bison.simple (__yy_memcpy):
21605 Declare arg `count' as unsigned int.
21606 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21607
216081997-01-03 Richard Stallman <rms@gnu.org>
21609
21610 * src/allocate.c: [__STDC__ or _MSC_VER]:
21611 Declare calloc and realloc to return void *.
21612
216131997-01-02 Richard Stallman <rms@gnu.org>
21614
21615 * src/system.h:
21616 [_MSC_VER]: Include stdlib.h and process.h.
21617 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21618
21619 * src/main.c (main): Return FAILURE as a value.
21620 (printable_version): Declare arg as int, not char.
21621
216221997-01-02 Richard Stallman <rms@gnu.org>
21623
21624 * Makefile.in (dist):
21625 Explicitly check for symlinks, and copy them.
21626
216271996-12-19 Richard Stallman <rms@gnu.org>
21628
21629 * src/files.c:
21630 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21631
216321996-12-18 Paul Eggert <eggert@gnu.org>
21633
21634 * src/bison.s1 (yyparse):
21635 If __GNUC__ and YYPARSE_PARAM are both defined,
21636 declare yyparse to have a void * argument.
21637
216381996-12-18 Paul Eggert <eggert@gnu.org>
21639
21640 * bison.simple (yyparse):
21641 If __GNUC__ and YYPARSE_PARAM are both defined,
21642 declare yyparse to have a void * argument.
21643
216441996-12-17 Richard Stallman <rms@gnu.org>
21645
21646 * src/reduce.c (nbits): Add some casts.
21647
216481996-08-12 Richard Stallman <rms@gnu.org>
21649
21650 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21651
216521996-08-12 Richard Stallman <rms@gnu.org>
21653
21654 * bison.simple: Test _MSDOS as well as _MSDOS_.
21655
216561996-07-31 Richard Stallman <rms@gnu.org>
21657
21658 * src/bison.s1:
21659 [__sun && __i386]: Include alloca.h.
21660
216611996-07-31 Richard Stallman <rms@gnu.org>
21662
21663 * bison.simple:
21664 [__sun && __i386]: Include alloca.h.
21665
216661996-07-30 Richard Stallman <rms@gnu.org>
21667
21668 * src/bison.s1: Comment change.
21669
21670 * src/bison.s1: Test _MSDOS_, not MSDOS.
21671
216721996-07-30 Richard Stallman <rms@gnu.org>
21673
21674 * bison.simple: Comment change.
21675
21676 * bison.simple: Test _MSDOS_, not MSDOS.
21677
216781996-06-01 Richard Stallman <rms@gnu.org>
21679
21680 * 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:
21681 Insert `_' macro around many string constants.
21682
21683 * src/main.c:
21684 Insert `_' macro around many string constants.
21685
21686 (main): Call setlocale, bindtextdomain and textdomain.
21687
21688 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21689 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21690 [ENABLE_NLS]: Include libintl.h.
21691 [ENABLE_NLS] (gettext): Define.
21692 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21693 (N_, PACKAGE, LOCALEDIR): New macros.
21694
216951996-06-01 Richard Stallman <rms@gnu.org>
21696
21697 * POTFILES.in: New file.
21698
21699 * Makefile.in (allocate.o):
21700 Define target explicitly.
21701
21702 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21703 (LDFLAGS): Set to @LDFLAGS@.
21704 (configure): Run autoconf only if preceding `cd' succeeds.
21705 (bison.s1): Redirect output to temporary file then move the
21706 temporary to the target, rather than redirecting directly to bison.s1.
21707 (clean): Remove config.status and config.log.
21708 (distclean): Don't remove config.status here.
21709
217101996-05-12 Richard Stallman <rms@gnu.org>
21711
21712 * src/bison.s1:
21713 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21714
217151996-05-12 Richard Stallman <rms@gnu.org>
21716
21717 * bison.simple:
21718 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21719
217201996-05-11 Richard Stallman <rms@gnu.org>
21721
21722 * src/bison.s1 (__yy_memcpy):
21723 Really reorder the args, as was supposedly done on Feb 14 1995.
21724 (yyparse): Calls changed accordingly.
21725
217261996-05-11 Richard Stallman <rms@gnu.org>
21727
21728 * Makefile.in (dist): Don't use $(srcdir).
21729
21730 * bison.simple (__yy_memcpy):
21731 Really reorder the args, as was supposedly done on Feb 14 1995.
21732 (yyparse): Calls changed accordingly.
21733
217341996-01-27 Richard Stallman <rms@gnu.org>
21735
21736 * src/output.c (output_rule_data):
21737 Test YYERROR_VERBOSE in the conditional
21738 around the definition of ttyname.
21739
217401995-12-29 Richard Stallman <rms@gnu.org>
21741
21742 * src/bison.s1:
21743 Fix line numbers in #line commands.
21744
217451995-12-29 Richard Stallman <rms@gnu.org>
21746
21747 * bison.simple:
21748 Fix line numbers in #line commands.
21749
217501995-12-27 Richard Stallman <rms@gnu.org>
21751
21752 * src/bison.s1 (YYPARSE_PARAM_DECL):
21753 In C++, make it always null.
21754 (YYPARSE_PARAM_ARG): New macro.
21755 (yyparse): Use YYPARSE_PARAM_ARG.
21756
217571995-12-27 Richard Stallman <rms@gnu.org>
21758
21759 * bison.simple (YYPARSE_PARAM_DECL):
21760 In C++, make it always null.
21761 (YYPARSE_PARAM_ARG): New macro.
21762 (yyparse): Use YYPARSE_PARAM_ARG.
21763
217641995-11-29 Richard Stallman <rms@gnu.org>
21765
21766 * doc/bison.texinfo:
21767 Describe literal string tokens, %raw, %no_lines, %token_table.
21768
217691995-11-29 Daniel Hagerty <hag@gnu.org>
21770
21771 * doc/bison.texinfo: Fixed update date
21772
217731995-10-16 Richard Stallman <rms@gnu.org>
21774
21775 * src/version.c: Version 1.25.
21776
217771995-10-16 Richard Stallman <rms@gnu.org>
21778
21779 * NEWS: *** empty log message ***
21780
217811995-10-16 Richard Stallman <rms@gnu.org>
21782
21783 * doc/bison.1, doc/bison.rnh:
21784 Add new options.
21785
217861995-10-15 Richard Stallman <rms@gnu.org>
21787
21788 * src/vmsgetargs.c, src/getargs.c:
21789 Added -n, -k, and -raw switches.
21790 (noparserflag, toknumflag, rawtoknumflag): New variables.
21791
21792 * src/symtab.h (SALIAS):
21793 New #define for adding aliases to %token.
21794 (struct bucket): Added `alias' field.
21795
21796 * src/reduce.c (reduce_grammar):
21797 Revise error message.
21798 (print_notices): Remove final `.' from error message.
21799
21800 * src/reader.c (reader_output_yylsp):
21801 New function.
21802 (readgram): Use `#if 0' around code that accepted %command
21803 inside grammar rules: The documentation doesn't allow it,
21804 and it will fail since the %command processors scan for the next %.
21805 (parse_token_decl): Extended the %token
21806 declaration to allow a multi-character symbol as an alias.
21807 (parse_thong_decl): New function.
21808 (read_declarations): Added %thong declarations.
21809 (read_declarations): Handle NOOP to deal with allowing
21810 % declarations as another means to specify the flags.
21811 (readgram): Allow %prec prior to semantics embedded in a rule.
21812 (skip_to_char, read_declarations, copy_definition)
21813 (parse_token_decl, parse_start_decl, parse_type_decl)
21814 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21815 (get_type_name, copy_guard, copy_action, readgram)
21816 (get_type, packsymbols): Revised most error messages.
21817 Changed `fatal' to `warnxxx' to avoid aborting for error.
21818 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21819 (read_declarations): Improve the error message for
21820 an invalid character. Do not abort.
21821 (read_declarations, copy_guard, copy_action): Use
21822 printable_version to avoid unprintable characters in printed output.
21823 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21824 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21825 Allow the type of a non-terminal can be given
21826 more than once, as long as all specifications give the same type.
21827
21828 * src/output.c:
21829 (output_headers, output_trailers, output, output_gram)
21830 (output_rule_data): Implement noparserflag variable.
21831 Implement toknumflag variable.
21832 (output): Call reader_output_yylsp to output LTYPESTR.
21833
21834 * src/main.c (main):
21835 If reader sees an error, don't process the grammar.
21836 (fatals): Updated to not use VARARGS1.
21837 (printable_version, int_to_string, warn, warni, warns, warnss)
21838 (warnsss): New error reporting functions. Avoid abort for error.
21839
21840 * src/lex.h:
21841 Added THONG and NOOP for alias processing.
21842 Added SETOPT for the new code that allows setting options with %flags.
21843
21844 * src/lex.c:
21845 Include getopt.h. Add some extern decls.
21846 (safegetc): New function to deal with EOF gracefully.
21847 (literalchar); new function to deal with reading \ escapes.
21848 (lex): Use literalchar.
21849 (lex): Implemented "..." tokens.
21850 (literalchar, lex, parse_percent_token): Made tokenbuffer
21851 always contain the token. This includes growing the token
21852 buffer while reading an integer.
21853 (parse_percent_token): Replaced if-else statement with percent_table.
21854 (parse_percent_token): Added % declarations as another
21855 way to specify the flags -n, -l, and -r. Also added hooks for
21856 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21857 major changes to files.c.
21858 (lex) Retain in the incoming stream a character following
21859 an incorrect '/'.
21860 (skip_white_space, lex): Revised most error messages
21861 and changed fatal to warn to avoid aborting.
21862 (percent_table): Added %thong declarations.
21863
21864 * src/gram.h: Comment changes.
21865
21866 * src/files.c (openfiles, open_extra_files, done):
21867 Add faction flag
21868 and actfile file. Handle noparserflag. Both for -n switch.
21869
21870 * src/conflicts.c (resolve_sr_conflict):
21871 Remove use of alloca.
21872
218731995-06-01 Jim Meyering <meyering@gnu.org>
21874
21875 * doc/bison.texinfo: *** empty log message ***
21876
218771995-05-06 Richard Stallman <rms@gnu.org>
21878
21879 * src/bison.s1: Comment change.
21880
218811995-05-06 Richard Stallman <rms@gnu.org>
21882
21883 * bison.simple: Comment change.
21884
218851995-05-03 Richard Stallman <rms@gnu.org>
21886
21887 * src/version.c: Version now 1.24.
21888
21889 * src/bison.s1: Change distribution terms.
21890
21891 * src/version.c: Version now 1.23.
21892
218931995-05-03 Richard Stallman <rms@gnu.org>
21894
21895 * doc/bison.texinfo:
21896 Rewrite "Conditions for Using Bison".
21897 Update version to 1.24.
21898
218991995-05-03 Richard Stallman <rms@gnu.org>
21900
21901 * bison.simple: Change distribution terms.
21902
219031995-02-23 Richard Stallman <rms@gnu.org>
21904
21905 * src/files.c: Test __VMS_POSIX as well as VMS.
21906
219071995-02-14 Jim Meyering <meyering@gnu.org>
21908
21909 * src/bison.s1 (__yy_memcpy):
21910 Renamed from __yy_bcopy to avoid
21911 confusion. Reverse FROM and TO arguments to be consistent with
21912 those of memcpy.
21913
219141995-02-14 Jim Meyering <meyering@gnu.org>
21915
21916 * bison.simple (__yy_memcpy):
21917 Renamed from __yy_bcopy to avoid
21918 confusion. Reverse FROM and TO arguments to be consistent with
21919 those of memcpy.
21920
219211994-11-10 David J. MacKenzie <djm@gnu.org>
21922
21923 * NEWS: reformat
21924
21925 * NEWS: New file.
21926
21927 * Makefile.in (DISTFILES): Include NEWS.
21928
21929 * Makefile.in (DISTFILES):
21930 Include install-sh, not install.sh.
21931
21932 * configure.in: Update to Autoconf v2 macro names.
21933
219341994-10-05 David J. MacKenzie <djm@gnu.org>
21935
21936 * Makefile.in: fix typo
21937
21938 * Makefile.in (prefix, exec_prefix):
21939 Let configure set them.
21940
219411994-09-28 David J. MacKenzie <djm@gnu.org>
21942
21943 * Makefile.in: Set datadir to $(prefix)/share.
21944
219451994-09-15 Richard Stallman <rms@gnu.org>
21946
21947 * src/bison.s1:
21948 Update copyright notice and GPL version.
21949
219501994-09-15 Richard Stallman <rms@gnu.org>
21951
21952 * bison.simple:
21953 Update copyright notice and GPL version.
21954
219551994-07-12 Richard Stallman <rms@gnu.org>
21956
21957 * src/reduce.c, src/reader.c:
21958 entered into RCS
21959
219601994-05-05 David J. MacKenzie <djm@gnu.org>
21961
21962 * Makefile.in: entered into RCS
21963
219641994-03-26 Richard Stallman <rms@gnu.org>
21965
21966 * src/bison.s1: entered into RCS
21967
219681994-03-26 Richard Stallman <rms@gnu.org>
21969
21970 * bison.simple: entered into RCS
21971
219721994-03-25 Richard Stallman <rms@gnu.org>
21973
21974 * src/main.c: entered into RCS
21975
219761994-03-24 Richard Stallman <rms@gnu.org>
21977
21978 * src/conflicts.c: entered into RCS
21979
219801994-01-02 Richard Stallman <rms@gnu.org>
21981
21982 * Makefile.in: *** empty log message ***
21983
219841993-11-21 Richard Stallman <rms@gnu.org>
21985
21986 * src/bison.s1: *** empty log message ***
21987
219881993-11-21 Richard Stallman <rms@gnu.org>
21989
21990 * doc/bison.texinfo: entered into RCS
21991
21992 * doc/bison.texinfo: *** empty log message ***
21993
219941993-11-21 Richard Stallman <rms@gnu.org>
21995
21996 * bison.simple: *** empty log message ***
21997
219981993-10-25 David J. MacKenzie <djm@gnu.org>
21999
22000 * doc/bison.texinfo: *** empty log message ***
22001
220021993-10-19 Richard Stallman <rms@gnu.org>
22003
22004 * src/bison.s1: *** empty log message ***
22005
220061993-10-19 Richard Stallman <rms@gnu.org>
22007
22008 * bison.simple: *** empty log message ***
22009
220101993-10-14 Richard Stallman <rms@gnu.org>
22011
22012 * src/bison.s1: *** empty log message ***
22013
220141993-10-14 Richard Stallman <rms@gnu.org>
22015
22016 * bison.simple: *** empty log message ***
22017
220181993-09-14 David J. MacKenzie <djm@gnu.org>
22019
22020 * doc/bison.texinfo: *** empty log message ***
22021
220221993-09-13 Noah Friedman <friedman@gnu.org>
22023
22024 * Makefile.in: *** empty log message ***
22025
220261993-09-10 Richard Stallman <rms@gnu.org>
22027
22028 * src/conflicts.c: *** empty log message ***
22029
22030 * src/system.h: entered into RCS
22031
220321993-09-10 Richard Stallman <rms@gnu.org>
22033
22034 * doc/bison.1: entered into RCS
22035
220361993-09-06 Noah Friedman <friedman@gnu.org>
22037
22038 * src/version.c: entered into RCS
22039
220401993-09-06 Noah Friedman <friedman@gnu.org>
22041
22042 * Makefile.in: *** empty log message ***
22043
220441993-07-30 David J. MacKenzie <djm@gnu.org>
22045
22046 * Makefile.in: *** empty log message ***
22047
220481993-07-24 Richard Stallman <rms@gnu.org>
22049
22050 * src/bison.s1: *** empty log message ***
22051
220521993-07-24 Richard Stallman <rms@gnu.org>
22053
22054 * bison.simple: *** empty log message ***
22055
220561993-07-08 David J. MacKenzie <djm@gnu.org>
22057
22058 * Makefile.in: *** empty log message ***
22059
220601993-07-04 Richard Stallman <rms@gnu.org>
22061
22062 * src/bison.s1: *** empty log message ***
22063
220641993-07-04 Richard Stallman <rms@gnu.org>
22065
22066 * bison.simple: *** empty log message ***
22067
220681993-06-26 David J. MacKenzie <djm@gnu.org>
22069
22070 * src/getargs.c: entered into RCS
22071
220721993-06-26 David J. MacKenzie <djm@gnu.org>
22073
22074 * doc/bison.texinfo: *** empty log message ***
22075
22076 * doc/bison.1: New file.
22077
220781993-06-25 Richard Stallman <rms@gnu.org>
22079
22080 * src/getargs.c: New file.
22081
220821993-06-16 Richard Stallman <rms@gnu.org>
22083
22084 * src/bison.s1: *** empty log message ***
22085
220861993-06-16 Richard Stallman <rms@gnu.org>
22087
22088 * bison.simple: *** empty log message ***
22089
220901993-06-03 Richard Stallman <rms@gnu.org>
22091
22092 * src/bison.s1: New file.
22093
220941993-06-03 Richard Stallman <rms@gnu.org>
22095
22096 * doc/bison.texinfo: *** empty log message ***
22097
220981993-06-03 Richard Stallman <rms@gnu.org>
22099
22100 * bison.simple: New file.
22101
221021993-05-19 Richard Stallman <rms@gnu.org>
22103
22104 * doc/bison.texinfo: New file.
22105
221061993-05-07 Noah Friedman <friedman@gnu.org>
22107
22108 * Makefile.in: *** empty log message ***
22109
221101993-04-28 Noah Friedman <friedman@gnu.org>
22111
22112 * src/reader.c: *** empty log message ***
22113
221141993-04-23 Noah Friedman <friedman@gnu.org>
22115
22116 * src/alloc.h: entered into RCS
22117
221181993-04-20 David J. MacKenzie <djm@gnu.org>
22119
22120 * src/version.c: *** empty log message ***
22121
22122 * src/files.c, src/allocate.c:
22123 entered into RCS
22124
22125 * src/reader.c: *** empty log message ***
22126
22127 * src/lex.c: entered into RCS
22128
22129 * src/conflicts.c: New file.
22130
22131 * src/symtab.c: entered into RCS
22132
22133 * src/alloc.h: New file.
22134
22135 * src/LR0.c: entered into RCS
22136
221371993-04-18 Noah Friedman <friedman@gnu.org>
22138
22139 * src/reader.c: New file.
22140
22141 * src/version.c: *** empty log message ***
22142
221431993-04-18 Noah Friedman <friedman@gnu.org>
22144
22145 * Makefile.in: *** empty log message ***
22146
221471993-04-17 Noah Friedman <friedman@gnu.org>
22148
22149 * Makefile.in: *** empty log message ***
22150
221511993-04-15 Richard Stallman <rms@gnu.org>
22152
22153 * src/main.c, src/files.c:
22154 New file.
22155
221561993-04-15 Noah Friedman <friedman@gnu.org>
22157
22158 * configure.in: entered into RCS
22159
22160 * configure.in: *** empty log message ***
22161
22162 * configure.in: New file.
22163
221641993-04-14 Richard Stallman <rms@gnu.org>
22165
22166 * Makefile.in: New file.
22167
221681993-04-13 Richard Stallman <rms@gnu.org>
22169
22170 * src/version.c: New file.
22171
221721993-03-25 Richard Stallman <rms@gnu.org>
22173
22174 * src/output.c: entered into RCS
22175
221761992-09-25 Richard Stallman <rms@gnu.org>
22177
22178 * configure.bat: entered into RCS
22179
221801992-06-22 Richard Stallman <rms@gnu.org>
22181
22182 * src/vmsgetargs.c: entered into RCS
22183
221841992-06-22 Richard Stallman <rms@gnu.org>
22185
22186 * doc/bison.rnh: entered into RCS
22187
221881992-04-20 David J. MacKenzie <djm@gnu.org>
22189
22190 * README: entered into RCS
22191
221921992-01-22 Richard Stallman <rms@gnu.org>
22193
22194 * src/machine.h: entered into RCS
22195
221961991-12-21 Richard Stallman <rms@gnu.org>
22197
22198 * src/lalr.c, src/closure.c:
22199 entered into RCS
22200
222011991-12-20 Richard Stallman <rms@gnu.org>
22202
22203 * src/state.h: entered into RCS
22204
222051991-12-18 Richard Stallman <rms@gnu.org>
22206
22207 * src/print.c, src/nullable.c, src/derives.c:
22208 entered into RCS
22209
222101991-11-03 David J. MacKenzie <djm@gnu.org>
22211
22212 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22213 entered into RCS
22214
222151988-09-09 Richard Stallman <rms@gnu.org>
22216
22217 * src/bison.hairy: entered into RCS
22218
222191987-12-16 Richard Stallman <rms@gnu.org>
22220
22221 * REFERENCES: entered into RCS
dc546b0f 22222
f294a2c2 22223
04098407 22224 -----
f294a2c2 22225
04098407 22226 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
f490771b
JD
22227 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
22228 2007, 2008, 2009 Free Software Foundation, Inc.
f294a2c2 22229
04098407
PE
22230 Copying and distribution of this file, with or without
22231 modification, are permitted provided the copyright notice and this
22232 notice are preserved.