]> git.saurik.com Git - bison.git/blame - ChangeLog
scan-gram: avoid portability trap with ctype usage.
[bison.git] / ChangeLog
CommitLineData
4bb975e1
EB
12009-08-27 Eric Blake <ebb9@byu.net>
2
3 scan-gram: avoid portability trap with ctype usage.
4 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
5 Avoid compiler warning.
6
74baf5c9
JD
72009-08-27 Joel E. Denny <jdenny@clemson.edu>
8
9 tests: use perl for printing special sequences to files.
10 And skip tests if perl is not available. This is better than
11 playing tricks with shell portability. Suggested by Akim
12 Demaille.
13 * tests/input.at (Bad character literals): Use it here for
14 omitting final newlines.
15 (Bad escapes in literals): Use it here for special characters.
16
d63e1279
JD
172009-08-26 Joel E. Denny <jdenny@clemson.edu>
18
19 tests: show a use of %define lr.default-reductions "consistent"
20 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
21 prevents the omission of expected tokens for %error-verbose.
22
833d1720
AD
232009-08-26 Akim Demaille <demaille@gostai.com>
24
25 tests: portability fix.
26 * tests/input.at (Bad escapes in literals): Don't expect "echo
27 '\0'" to output \ then 0.
28
e4bcae3c
JD
292009-08-26 Joel E. Denny <jdenny@clemson.edu>
30
31 Actually handle the yytable zero value correctly this time.
32 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Don't
33 mention zero values in the YYTABLE comments.
34 * data/glr.c (yytable_value_is_error): Don't check for zero
35 value.
36 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
37 * data/yacc.c (yytable_value_is_error): Likewise.
38 * data/lalr1.java (yy_table_value_is_error_): Likewise.
39 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
40 * src/tables.h: In header comments, explain why it's useless to
41 check for a zero value in yytable.
42
d5eb0826
JD
432009-08-25 Joel E. Denny <jdenny@clemson.edu>
44
45 More fixes related to last two patches.
46 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
47 defined.
48 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix
49 yytable comments: zero indicates syntax error not default
50 action.
51 * data/glr.c (yyis_pact_ninf): Rename to...
52 (yypact_value_is_default): ... this.
53 (yyisDefaultedState): Update for rename.
54 (yyis_table_ninf): Rename to...
55 (yytable_value_is_error): ... this, and check for value zero
56 besides just YYTABLE_NINF.
57 (yygetLRActions): Check for default value from yypact. It
58 appears that this check is always performed before this function
59 is invoked, and so adding the check here is probably redundant.
60 However, the code may evolve after this subtlety is forgotten.
61 Also, update for rename to yytable_value_is_error. Because that
62 macro now checks for zero, a different but equivalent branch of
63 the if-then-else here is evaluated.
64 (yyreportSyntaxError): Update for rename to
65 yytable_value_is_error. The zero condition was mishandled
66 before.
67 (yyrecoverSyntaxError): Update for renames. No behavioral
68 changes.
69 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
70 New function.
71 (yy_table_value_is_error_): New function.
72 (parse): Use new functions where possible. No behavioral
73 changes.
74 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
75 The zero condition was mishandled before.
76 * data/yacc.c (yyis_pact_ninf): Rename to...
77 (yypact_value_is_default): ... this.
78 (yyis_table_ninf): Rename to...
79 (yytable_value_is_error): ... this, and check for value zero
80 besides just YYTABLE_NINF.
81 (yysyntax_error): Update for rename to yytable_value_is_error.
82 The zero condition was mishandled before.
83 (yyparse): Update for renames. No behavioral changes.
84 * src/tables.h: Improve comments about yypact, yytable, etc.
85 more. Most importantly, say yytable value of zero means syntax
86 error not default action.
87
1fa30307
JD
882009-08-25 Joel E. Denny <jdenny@clemson.edu>
89
90 Fix %error-verbose for conflicts resolved by %nonassoc.
91 * NEWS (2.5): Document.
92 * data/glr.c (yyreportSyntaxError): Fix this by checking
93 yyis_table_ninf.
94 * data/yacc.c (yysyntax_error): Likewise.
95 * data/lalr1.cc (yysyntax_error_): Fix this by checking
96 yytable_ninf_.
97 * data/lalr1.java (yysyntax_error): Likewise.
98 * tests/conflicts.at (%nonassoc and eof): Update expected output
99 and remove FIXME.
100
77373efa
JD
1012009-08-25 Joel E. Denny <jdenny@clemson.edu>
102
103 Some code and documentation improvements.
104 * data/c.m4 (b4_table_value_equals): New macro to capture
105 some repeated code.
106 * data/glr.c (yyis_pact_ninf): Use it here.
107 (yyis_table_ninf): Likewise.
108 (yyreportSyntaxError): Improve internal comments.
109 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
110 Use it everywhere possible.
111 (yyis_table_ninf): Likewise.
112 (yysyntax_error): Improve internal comments.
113 * data/lalr1.cc (yysyntax_error_): Likewise.
114 * data/lalr1.java (yysyntax_error): Likewise.
115 * src/tables.h: Improve comments about yypact, yytable, etc.
116
890ab17c
JD
1172009-08-21 Joel E. Denny <jdenny@clemson.edu>
118
119 Use locale when quoting.
120 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
121 quote rather than implementing quoting here.
122
c5196098
EB
1232009-08-20 Eric Blake <ebb9@byu.net>
124
aa50ba7b
EB
125 Make previous patch more robust.
126 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
127 argmatch.h.
128 (output_skeleton): Use it.
129 Suggested by Akim Demaille.
130
c5196098
EB
131 Import latest m4/m4.m4.
132 * submodules/autoconf: Update to autoconf 2.64.
133 * configure.ac (M4_GNU_OPTION): New define.
134 * src/output.c (output_skeleton): Use it to resolve FIXME.
135 * NEWS: Mention this.
136
39fb7e62
JD
1372009-08-19 Joel E. Denny <jdenny@clemson.edu>
138
139 Fix complaints about escape sequences.
140 Discussed starting at
141 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
142 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
143 For a \0 and similar escape sequences meaning the null
144 character, report an invalid escape sequence instead of an
145 invalid null character because the latter does not actually
146 appear in the user's input.
147 In all escape sequence complaints, don't escape the initial
148 backslash, and don't quote when the sequence appears at the end
149 of the complaint line unless there's whitespace that quotearg
150 won't escape.
151 Consistently say "invalid" not "unrecognized".
152 Consistently prefer "empty character literal" over "extra
153 characters in character literal" warning for invalid escape
154 sequences; that is, consistently discard those sequences.
155 * tests/input.at (Bad escapes in literals): New.
156
c33bc800
AD
1572009-08-19 Akim Demaille <demaille@gostai.com>
158
159 doc: fixes.
160 * doc/bison.texinfo: Fix minor Texinfo errors.
161
8fbbeba2
AD
1622009-08-19 Akim Demaille <demaille@gostai.com>
163
164 doc: %initial-action to initialize yylloc.
165 Reported by Bill Allombert.
166 * doc/bison.texinfo: Set fill-column to 76.
167 (Location Type): Document the use of %initial-action to initialize
168 yylloc.
169
1874a474
JD
1702009-08-18 Joel E. Denny <jdenny@clemson.edu>
171
172 maint: update for gnulib's recent update-copyright changes
173 * gnulib: Update.
174 * .x-update-copyright (COPYING): Add as it's no longer implied
175 when .x-update-copyright is present.
176 * cfg.mk (update-copyright-local): Remove, now ignored.
177 (update-copyright): Declare update-b4-copyright as a dependency.
178
f4bfd5a9
AD
1792009-08-17 Akim Demaille <demaille@gostai.com>
180
181 build: require gettext 0.17.
182
183 Suggested by Bruno Haible.
184 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
185 * configure.ac: require gettext 0.17 to ensure compatibility with
186 gnulib.
187
2509eba6
AD
1882009-08-17 Akim Demaille <demaille@gostai.com>
189
190 build: lower gettext requirements.
191
192 Bison was uselessly requiring the formatstring macros from
193 gettext, which resulted in mo files not being installed on systems
194 that perfectly supported Bison mo files. Lower the requirement.
195 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
196
aa50ba7b
EB
197 * configure.ac: Require need-ngettext instead of
198 need-formatstring-macros.
199 Reported by Martin Jabocs.
200 Suggested by Bruno Haible.
201 * INSTALL: Restructure.
202 (Internationalization): New.
2509eba6 203
314542f9
JD
2042009-08-14 Joel E. Denny <jdenny@clemson.edu>
205
206 maint: fix use of copyright year intervals.
207 * gnulib: Update.
208 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
209 as now recommended in gnulib/NEWS.
210 * build-aux/update-b4-copyright: Fix.
211 * cfg.mk (update-copyright-env): Configure update-copyright.
212
24985964
JD
2132009-08-13 Joel E. Denny <jdenny@clemson.edu>
214
215 Make it easier to write deterministic tests.
216 Continues Akim's work from his 2009-06-10 commits.
217 * src/reader.c (check_and_convert_grammar): Don't add any
218 symbols after the first symbols_do invocation.
219 * src/symtab.c (symbols_sorted): New static global.
220 (user_token_number_redeclaration): Update comments.
221 (symbol_from_uniqstr): If a new symbol is being created, assert
222 that symbols_sorted hasn't been allocated yet.
223 (symbols_free): Free symbols_sorted.
224 (symbols_cmp, symbols_cmp_qsort): New functions.
225 (symbols_do): Sort symbol_table into symbols_sorted on first
226 invocation.
227 * tests/input.at (Numbered tokens): Recombine tests now that the
228 output should be deterministic across multiple numbers.
229
47076da5
AD
2302009-08-12 Akim Demaille <demaille@gostai.com>
231
232 distcheck: fix.
233
aa50ba7b 234 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
47076da5 235
36dfe466
JD
2362009-08-10 Joel E. Denny <jdenny@clemson.edu>
237
238 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
239
07c0db18
JD
2402009-08-10 Joel E. Denny <jdenny@clemson.edu>
241
242 Miscellaneous code readability improvements.
243
244 * src/reader.c (reader): Move %define front-end variable
245 defaults and checking into...
246 (prepare_percent_define_front_end_variables): ... this new
247 function.
248
249 * src/scan-gram.l (INITIAL): For consistency with string
250 literals, don't store open quote on character literal. It's
251 discarded before returning anyway.
252 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
253 Make length test more readable, and make the character stored
254 for an empty literal more obvious while consistent with the
255 previous behavior.
256
257 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
258 USER_NUMBER_HAS_STRING_ALIAS throughout.
259 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
260 that is repeated in symtab.h. Improve argument names to make it
261 clear which side of the symbol-string alias pair is which.
262 (symbol_check_alias_consistency): Improve local variable names
263 for the same purpose.
264 * src/symtab.h (struct symbol): Make comments about aliases
265 clearer.
266 (symbol_make_alias): Improve comments and argument name.
267 * src/output.c (token_definitions_output): Update for rename to
268 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
269
1a323c2f
AR
2702009-08-08 Alex Rozenman <rozenman@gmail.com>
271
272 Convert "misleading reference" messages to warnings.
273 * src/scan-code.l: New function 'show_sub_messages', more
274 factoring.
275 * tests/named-ref.at: Adjust tests.
276
38609c34
JD
2772009-08-06 Joel E. Denny <jdenny@clemson.edu>
278
279 maint: run "make update-copyright"
280
642f240e
JD
2812009-08-06 Joel E. Denny <jdenny@clemson.edu>
282
283 maint: make update-b4-copyright easier to use
284 * build-aux/update-b4-copyright: In warnings, report line
285 numbers rather than character positions.
286 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
287 that update-copyright runs it.
288 * gnulib: Update.
289
d0caad01
JD
2902009-08-05 Joel E. Denny <jdenny@clemson.edu>
291
292 maint: clean up update-b4-copyright code
293 * build-aux/update-b4-copyright: Do not accept 2-digit
294 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
295 Don't accept a `[' in a b4_copyright argument.
296 Format code more consistently.
297 Don't assume b4*copyright never occurs.
298
ac2def56
JD
2992009-08-04 Joel E. Denny <jdenny@clemson.edu>
300
301 maint: automate b4_copyright updates.
302 * Makefile.am (update-b4-copyright): New target rule.
303 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
304 * build-aux/update-b4-copyright: New.
305 * data/yacc.c: Remove stray characters around b4_copyright
306 invocations.
307
dbbb64f0
JD
3082009-08-04 Joel E. Denny <jdenny@clemson.edu>
309
310 maint: automate annual package-wide copyright-year update.
311 * .x-update-copyright: New.
312 * Makefile.am (EXTRA_DIST): Remove maint.mk.
313 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
314 update-copyright. Remove gnumakefile, which is implied by
315 maintainer-makefile.
316 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
317 * gnulib: Update.
318 * maint.mk: Remove, now copied from gnulib.
319 * examples/extexi: Add missing "(C)" in copyright statement so
320 update-copyright can recognize it.
321 * src/LR0.h: Likewise.
322 * src/print.h: Likewise.
323 * src/print_graph.h: Likewise.
324 * src/gram.c: Add missing comma in copyright statement.
325 * src/gram.h: Likewise.
326
bfa018d4
JD
3272009-08-04 Joel E. Denny <jdenny@clemson.edu>
328
329 Fix "make distcheck".
330 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
331 of just calc.stamp.
332
4521fcdf
JD
3332009-08-01 Joel E. Denny <jdenny@clemson.edu>
334
335 Pacify "gcc -Wunused" for the input function from Flex.
336 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
337 and later.
338 * src/scan-code.l: Add "%option noinput", which I cannot find in
339 the Flex manual, but which Flex has supported since at least as
340 far back as 2.5.4. However, if any of our developers still use
341 Flex 2.5.4, they'll need to stop configuring with
342 --enable-gcc-warnings because "%option noinput" didn't work
343 correctly until Flex 2.5.6.
344 * src/scan-gram.l: Likewise.
345 * src/scan-skel.l: Likewise.
346
992e874a
AR
3472009-07-31 Alex Rozenman <rozenman@gmail.com>
348
349 Fix --enable-gcc-warnings problems.
350 * src/reader.c: Adjust variable names.
351 * src/scan-code.l: Fix prototypes and adjust names.
352 * src/named-ref.c: Remove redundant "if".
353
a1ed2b71
JD
3542009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
355
356 Fix a --enable-gcc-warnings problem.
357 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
358 variable.
359
cbc6a70e 3602009-07-24 Alex Rozenman <rozenman@gmail.com>
1e20ad11
AR
361
362 Fix some memory leaks.
363 * src/named-ref.c: Add a pointer check (named_ref_free).
364 * src/scan-code.l: New function (variant_table_free). Called in
365 code_scanner_free.
366 * src/symlist.c: Call to named_ref_free (symbol_list_free).
367
ac9b0e95
JD
3682009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
369
370 Warn about character literals not of length one.
371 * NEWS (2.5): Document.
372 * src/scan-gram.l (INITIAL): Remove comment that we don't check
373 the length.
374 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
375 * tests/input.at (Bad character literals): New test group.
376
2de160e1
JD
3772009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
378
379 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
380
cba97506
JD
3812009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
382
383 Some M4 cleanup in the testsuite.
384 Suggested by Eric Blake at
385 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
386 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
387 complicate the code by distinguishing between a missing value
388 and an empty string value for an optional argument. This fix is
389 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
390 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
391 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
392 arguments are not needed because of the following changes.
393 Fix stale comments.
394 Bison developers should use GNU M4 and should not use
395 POSIXLY_CORRECT when building the test suite, so do not
396 complicate the code by avoiding $10 and above.
397 Do not quote an empty string value for an optional argument, and
398 do not distinguish between a missing value and an empty string
399 value.
400
62eb2d1b
JD
4012009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
402
403 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
404
620b2e36
JD
4052009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
406
407 Revert unnecessary column realignment in --help output.
408 Reported by Akim Demaille at
409 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
410 * src/getargs.c (usage): Here.
411
cbc6a70e 4122009-07-04 Alex Rozenman <rozenman@gmail.com>
dad6544d
AR
413
414 Alphabetical order in src/Makefile.am.
415 * src/Makefile.am: Adjust.
416
cbc6a70e 4172009-07-04 Alex Rozenman <rozenman@gmail.com>
d5e8574b
AR
418
419 Style changes and factoring.
420 * src/named-ref.h: Add comments.
421 * src/parse-gram.y: Readability and style changes.
422 * src/reader.c: Factoring: assign_named_ref function.
423 * src/scan-code.l: Factoring and style changes. Rename
424 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
425 Use "unsigned" type for variant index. Improve readablity.
426 * src/scan-gram.l: Change error messages and add comments.
427 * src/symlist.h: symbol_list_null: New function decl.
428 * src/symlist.c: symbol_list_null: Implement here.
429 * tests/named-refs.at: Adjust for new error messages.
430
ae09ec85
EB
4312009-06-29 Eric Blake <ebb9@byu.net>
432
433 scan-code: avoid compiler warnings
434 * src/scan-code.l (parse_named_ref): Use correct specifiers.
435
80d653fd
AD
4362009-06-29 Akim Demaille <demaille@gostai.com>
437
438 build: avoid concurrent extraction of calc++.
439 * examples/calc++/Makefile.am (calc.stamp): New.
440 Depend on it to create the sources of calc++ so that concurrent
441 builds don't launch several "extexi" in parallel.
442 Not only this is inefficient, this also builds incorrect sources
443 with several extractions mixed together.
444
7685e2f7
AR
4452009-06-27 Alex Rozenman <rozenman@gmail.com>
446
447 Implement support for named symbol references.
448 * src/parse-gram.y: Add new syntax (named_ref.opt).
449 * src/reader.c: Store named refs in symbol lists.
450 * src/reader.h: New argument for symbol_append and
451 action_append functions.
452 * src/scan-code.h: Add new field (named_ref) into
453 code_props data structure. Keeps named ref of midrule
454 actions.
455 * src/scan-code.l: Support for named refs in semantic
456 action code. New function 'parse_named_ref'.
457 * src/scan-gram.l: Support bracketed id.
458 * src/symlist.c: Store named refs in symbol lists.
459 * src/symlist.h: New field in symbol list: named_ref.
460 * src/named-ref.h: New file, a struct for named_ref.
461 * src/named-ref.cp: New file, named_ref_new function.
462 * src/local.mk: Add two new files.
463 * tests/testsuite.at: Include new test group:
464 * tests/named-refs.at: this new file.
465
67f8cf51
AD
4662009-06-25 Akim Demaille <demaille@gostai.com>
467
468 hash: check insertion for memory exhaustion.
469 * src/uniqstr.c (uniqstr_new): New.
470
83b66ddd
AD
4712009-06-11 Akim Demaille <demaille@gostai.com>
472
473 style changes.
474 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
475 * src/print-xml.c: Style changes.
476 * tests/conflicts.at: Comment changes.
477
517cb0ad
AD
4782009-06-11 Akim Demaille <demaille@gostai.com>
479
480 xml: beware of user strings used to give a %prec to rules.
481 * tests/conflicts.at (%prec with user strings): New.
482 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
483 XML output.
484
75c7a52a
AD
4852009-06-11 Akim Demaille <demaille@gostai.com>
486
487 hash: check insertion for memory exhaustion.
488 * src/muscle-tab.c (muscle_insert, muscle_grow)
489 * src/state.c (state_hash_insert): Check the return value of
490 hash_insert.
491
66ed9753
AD
4922009-06-10 Akim Demaille <demaille@gostai.com>
493
494 deterministic test suite.
495 Some consistency checks on symbols are performed after all the
496 symbols were read, by an iteration over the symbol table. This
497 traversal is nondeterministic, which can be a problem for test
498 cases.
499 Avoid this.
500 Addresses another form of nondeterminism reported by Joel E. Denny.
501 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
502
503 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
504 test in two.
505 Use different file names for the three tests to make the
506 maintenance easier.
507
ed15d907
AD
5082009-06-10 Akim Demaille <demaille@gostai.com>
509
95d176ff
AD
510 deterministic user-token-number redeclaration errors.
511 Address nondeterminism reported by Joel E. Denny.
512 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
513
514 * src/uniqstr.h: Comment changes.
515 * src/location.h (boundary_cmp, location_cmp): New.
516 * src/symtab.c (user_token_number_redeclaration): New.
517 (symbol_translation): Use it.
518 * tests/input.at (Numbered tokens): Adjust the expected output.
519
5202009-05-25 Akim Demaille <demaille@gostai.com>
521
ed15d907 522 gnulib: update.
aa50ba7b
EB
523 * gnulib: Update to latest.
524 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
525 * m4/.gitignore: Regen.
526 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
527 Call xalloc_die on hash_insert failures.
528 Requested by the new __warn_unused_result__ attribute of
529 hash_insert.
ed15d907 530
e3a33f7c
JD
5312009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
532
533 Convert multiple variable definition warnings to complaints.
534 * NEWS (2.5): Add a new entry for that change.
535 * doc/bison.texinfo (Decl Summary): Update %define entry.
536 (Bison Options): Update -D/--define/-F/--force-define entry.
537 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
538 * src/muscle_tab.h (muscle_percent_define_insert): Update
539 comments.
540 * tests/input.at (`%define errors'): Update.
541 (`%define, --define, --force-define'): Update.
542
34d41938
JD
5432009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
544
545 -F/--force-define and relative %define/-D/--define priorities.
546 * NEWS (2.5): Add documentation to -D/--define entry.
547 * build-aux/cross-options.pl: Hard-code association of
548 --force-define with %define.
549 * doc/bison.texinfo (Decl Summary): In %define entry,
550 cross-reference command-line options.
551 (Bison Options): Add documentation to -D/--define entry.
552 (Option Cross Key): Widen column for --force-define row.
553 * src/getargs.c (usage): Document -F/--force-define. Realign
554 options in output.
555 (short_options, long_options, getargs): Parse -F/--force-define,
556 and update muscle_percent_define_insert invocation.
557 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
558 (muscle_percent_define_insert): Add argument with that type.
559 * src/muscle_tab.c (muscle_percent_define_insert): Implement
560 -F/--force-define behavior and priorities.
561 * src/parse-gram.y (prologue_declaration): Update
562 muscle_percent_define_insert invocations.
563 * tests/input.at (`%define, --define'): Rename to...
564 (`%define, --define, --force-define'): ... this and extend.
565
246c4efa
JD
5662009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
567
568 Update some comments to make sense for -D.
569 * data/bison.m4 (b4_check_user_names): In header comments, say
570 "user occurrence" instead of "grammar occurrence".
571 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
572 (muscle_percent_code_grow): Likewise just for consistency.
573
531683e7
JD
5742009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
575
576 * data/c++.m4: Update copyright year.
577
e7bfa8b7
JD
5782009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
579
580 * data/c++.m4 (b4_namespace_close): Simplify slightly.
581
8c221795
JD
5822009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
583
584 Handle a trailing `:' in a user-supplied C++ namespace better.
585 * data/c++.m4 (b4_namespace_close): Don't let it be printed
586 among the closing braces here. This fix might make the
587 generated code easier to debug, but otherwise it should be
588 insignificant because a trailing `:' is a C++ error already.
589
c8bf65f0
AD
5902009-05-19 Akim Demaille <demaille@gostai.com>
591
592 remove useless variable.
593 * src/getargs.c (skeleton_arg): Remove now useless variable.
594 Should help the compiler see that this printf-like call is sane.
595
7ac45a46
AD
5962009-05-11 Akim Demaille <demaille@gostai.com>
597
598 doc: use C++ headers.
599 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
600 headers.
601
601bdfab
AD
6022009-05-05 Akim Demaille <demaille@gostai.com>
603
604 fix hexadecimal token number support.
605 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
606
d19123e6
AD
6072009-05-05 Akim Demaille <demaille@gostai.com>
608
609 tests: check token numbers.
610 * tests/input.at (Numbered tokens): New.
611
ecdfea9a
AD
6122009-05-04 Akim Demaille <demaille@gostai.com>
613
614 bison: catch bad symbol names.
615 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
616 * tests/input.at: Adjust.
617
43e6aea5
AD
6182009-05-04 Akim Demaille <demaille@gostai.com>
619
620 space changes.
621 * src/scan-gram.l: Untabify to be robust to zealous editors.
622
c046698e
AD
6232009-05-04 Akim Demaille <demaille@gostai.com>
624
625 identifiers: dashes are letters.
626 Dashes can now start identifiers (symbols and directives).
b10dd689 627
c046698e
AD
628 * src/scan-gram.l ({letter}): Add dash.
629 ({id}): Remove it.
630 * tests/input.at (Symbols): Adjust.
631 Remove stray comment.
632 * tests/regression.at (Invalid inputs): Adjust error message.
633 * doc/bison.texinfo (Symbols): Update.
634
966aba65
JD
6352009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
636
637 Declare %code to be a permanent feature.
638 * NEWS (2.4.2): Here.
639 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
640 experimental.
641 (Decl Summary): Likewise.
642
812775a0
JD
6432009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
644
645 Convert underscores to dashes in some %define variable names.
646 For now, just api.push-pull and lr.keep-unreachable-states.
647 Maintain old names for backward compatibility.
648 * NEWS (2.5): Document.
649 * data/c.m4 (b4_identification): Update comment.
650 * data/yacc.c: Update access.
651 * doc/bison.texinfo: Update.
652 * etc/bench.pl.in (bench_grammar): Update use.
653 * src/files.c (tr): Move to...
654 * src/getargs.c, src/getargs.h (tr): ... here because I can't
655 think of a better place to expose it. My logic is that, for all
656 uses of tr so far, command-line arguments can be involved, and
657 getargs.h is already included.
658 * src/main.c (main): Update access.
659 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
660 variable names to new variable names before assigning value.
661 * src/reader.c (reader): Update setting default.
662 * tests/calc.at: Update uses.
663 * tests/conflicts.at (Unreachable States After Conflict
664 Resolution): Update use.
665 * tests/input.at (%define enum variables): Update use.
666 (%define backward compatibility): New test group.
667 * tests/push.at: Update uses.
668 * tests/reduce.at: Update uses.
669 * tests/torture.at: Update uses.
670
1c4aa81d
JD
6712009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
672
673 Set all front-end %define defaults in one place.
674 * src/main.c (main): Move lr.keep_unreachable_states default...
675 * src/reader.c (reader): ... to here.
676
1d0f55cc
JD
6772009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
678
679 Rename lr.default_reductions to lr.default-reductions.
680 * NEWS (2.5): Here.
681 * doc/bison.texinfo: Here.
682 * src/lalr.c (initialize_LA): Here.
683 * src/print.c (print_reductions): Here.
684 * src/reader.c (reader): Here.
685 * src/tables.c (action_row): Here.
686 * tests/input.at (%define enum variables): Here.
687 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
688
0b593457
JD
6892009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
690
691 Pacify ./configure --enable-gcc-warnings.
692 * tests/input.at (Symbols): Prototype yyerror and yylex.
693
0939aa2d
AD
6942009-04-21 Akim Demaille <demaille@gostai.com>
695
696 tests: check the use of dashes and periods in symbols.
697 * tests/input.at (Symbol): New test group.
698
0b593457 6992009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
ae618dcc
JD
700
701 Document how `%define "var" "value"' is not M4-friendly.
702 * src/parse-gram.y (variable): In comments here.
703
0b593457 7042009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
6789b8bd
JD
705
706 Add copyright updates missed during previous cherry pick.
707 * src/output.c: Here.
708 * src/parse-gram.y: Here.
709 * src/scan-gram.l: Here.
710
663ce7bb
AD
7112009-04-20 Akim Demaille <demaille@gostai.com>
712
713 variables: accept dashes.
714 * src/scan-gram.l ({id}): Also accept dashes after the initial
715 letter.
716 ({directive}): Use {id}.
717 * src/parse-gram.y: Comment and formatting changes.
718 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
719 symbols.
720 * src/complain.h, src/complain.c (yacc_at): New.
721 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
722 symbol names.
723 * src/output.c (token_definitions_output): Do not #define token
724 names with dashes.
725
379261b3
JD
7262009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
727
728 Clean up recent patches a little.
729 Reported by Akim Demaille.
730 * doc/bison.texinfo (Understanding): Fix typos.
731 * src/print.c (print_reductions): Don't use negated variable.
732
25029e16
JD
7332009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
734
735 List accepted values for a %define enum variable with an invalid value.
736 Suggested by Akim Demaille at
737 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
738 * data/bison.m4 (_b4_percent_define_check_values): Implement.
739 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
740 * tests/input.at (%define lr.default_reductions invalid values): Merge
741 into...
742 (%define enum variables): ... here, and update output.
743
620b5727
JD
7442009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
745
746 Rename "default rule" to "default reduction".
747 This includes changing variable names in code, changing
748 comments, and renaming %define lr.default_rules to %define
749 lr.default_reductions.
750 * NEWS (2.5): Update IELR documentation.
751 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
752 Adjust YYDEFACT and yydefact_ documentation.
753 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
754 and lr.type documentation. Make some other wording
755 improvements.
756 (Glossary): Adjust cross-references and Default Reduction
757 definition.
758 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
759 Remove a confusing comment pointed out by Akim Demaille.
760 (initialize_LA): Adjust code.
761 * src/print-xml.c (print_reductions): Adjust code.
762 * src/print.c (print_reductions): Adjust code.
763 * src/reader.c (reader): Adjust code.
764 * src/tables.c (action_row): Adjust code.
765 (token_actions): Adjust code.
766 * src/tables.h: Adjust YYDEFACT documentation.
767 * tests/input.at (%define lr.default_rules invalid values):
768 Rename test group to...
769 (%define lr.default_reductions invalid values): ... this, and
770 update grammar file and expected output.
771 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
772 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
773
34a6c2d1
JD
7742009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
775
776 Document %define lr.type and lr.default_rules.
777 * NEWS (2.5): Add an entry.
778 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
779 besides just LALR(1) and GLR(1).
780 * doc/bison.texinfo (Introduction): Likewise.
781 (Language and Grammar): Bison is no longer limited to LALR(1)
782 restrictions.
783 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
784 when trying to distinguish from GLR. Talk about LR(1) grammars
785 rather than LALR(1) grammars.
786 (Decl Summary): In %define api.push_pull entry, say it applies
787 to deterministic parsers in C rather than LALR(1) parsers in C.
788 Add lr.default_rules entry.
789 Add lr.type entry.
790 (Mystery Conflicts): Bison is no longer limited to LALR(1)
791 restrictions.
792 (Generalized LR Parsing): Same changes as for the previous GLR
793 section.
794 (Memory Management): Say deterministic rather than LALR(1).
795 (Understanding): Correct some bison output.
796 Index discussion of "accepting state".
797 Say deterministic rather than LALR(1).
798 (Bison Options): In --yacc entry, say deterministic rather than
799 LALR(1).
800 In --report, --graph, and --xml entries, just don't mention
801 LALR(1).
802 (C++ Parsers): Say deterministic rather than LALR(1).
803 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
804 (Glossary): Add Accepting State, Consistent State, Default Rule,
805 and IELR(1) definitions.
806 In Generalized LR (GLR) definition, make same changes as in
807 previous GLR sections.
808 In LALR(1) definition, say Bison uses LALR(1) by default rather
809 than implying Bison is limited to LALR(1).
810 (LocalWords): Add IELR.
811
f805dfcb
JD
8122009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
813
814 Finish implementing %define lr.type.
815 Its value can be "LALR", "IELR", or "canonical LR".
816 * lib/timevar.def (TV_IELR_PHASE1): New var.
817 (TV_IELR_PHASE2): New var.
818 (TV_IELR_PHASE3): New var.
819 (TV_IELR_PHASE4): New var.
820 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
821 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
822 Sbitset.h, ielr.h, and ielr.c.
823 * src/getargs.h, src/getargs.c (enum trace, trace_args,
824 trace_types): Add trace_ielr.
825 * src/lalr.h, src/lalr.c (ngotos): Export it.
826 (F): Rename to...
827 (goto_follows): ... this, update all uses, and export it.
828 (set_goto_map): Export it.
829 (map_goto): Export it.
830 (compute_lookahead_tokens): Don't free goto_follows yet. Now
831 handled in ielr.
832 (initialize_LA): Export it. Move lookback allocation to...
833 (lalr): ... here because, for canonical LR, initialize_LA must
834 be invoked but lookback and much of the rest of LALR isn't
835 needed.
836 * main.c (main): Instead of lalr, invoke ielr, which invokes
837 lalr.
838 * src/reader.c (reader): Default lr.type to "LALR".
839 Default lr.default_rules to "accepting" if lr.type is "canonical
840 LR". Leave the default as "all" otherwise.
841 Check for a valid lr.type value.
842 * src/state.h, src/state.c (struct state_list): Add state_list
843 member.
844 (state_new): Initialize state_list member to NULL.
845 (state_new_isocore): New function, exported.
846 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
847 exercises all values of lr.type.
848 (GNU AWK Grammar): Rename test group to...
849 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
850 AT_TEST_EXISTING_GRAMMAR.
851 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
852 (GNU pic Grammar): Rename test group to...
853 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
854 AT_TEST_EXISTING_GRAMMAR.
855 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
856 all values of lr.type.
857 (Single State Split): New test groups using AT_TEST_LR_TYPE.
858 (Lane Split): Likewise.
859 (Complex Lane Split): Likewise.
860 (Split During Added Lookahead Propagation): Likewise.
861
166366b2
JD
8622009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
863
864 Add new files for IELR and canonical LR implementation.
865 * src/AnnotationList.c: New.
866 * src/AnnotationList.h: New.
867 * src/InadequacyList.c: New.
868 * src/InadequacyList.h: New.
869 * src/Sbitset.c: New.
870 * src/Sbitset.h: New.
871 * src/ielr.c: New.
872 * src/ielr.h: New.
873
03c07b03
JD
8742009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
875
876 Implement %define lr.default_rules.
877 Its value describes the states that are permitted to contain
878 default rules: "all", "consistent", or "accepting".
879 * src/reader.c (reader): Default lr.default_rules to "all".
880 Check for a valid lr.default_rules value.
881 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
882 is "accepting", then only mark the accepting state as
883 consistent.
884 (initialize_LA): Tell state_lookahead_tokens_count whether
885 lr.default_rules is "accepting".
886 * src/tables.c (action_row): If lr.default_rules is not "all",
887 then disable default rules in inconsistent states.
888 * src/print.c (print_reductions): Use this opportunity to
889 perform some assertions about whether lr.default_rules was
890 obeyed correctly.
891 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
892 helps with checking the parser tables for a grammar.
893 * tests/input.at (%define lr.default_rules invalid values): New
894 test group.
895 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
896 AT_TEST_TABLES_AND_PARSE.
897 (`no %define lr.default_rules'): New test group generated by
898 AT_TEST_LR_DEFAULT_RULES.
899 (`%define lr.default_rules "all"'): Likewise.
900 (`%define lr.default_rules "consistent"'): Likewise.
901 (`%define lr.default_rules "accepting"'): Likewise.
902
44c124a3
AD
9032009-04-20 Akim Demaille <demaille@gostai.com>
904
905 Consistently refer to Yacc, not YACC.
906 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
907
42660736
JD
9082009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
909
910 Pacify make maintainer-check-posix.
911 * tests/input.at (%define, --define): Move bison command-line
912 options before grammar file name.
913
a2d05674
JD
9142009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
915
916 Document semicolon warnings.
917 * NEWS (2.5): Here.
918
c4fae1ef
AD
9192008-12-08 Akim Demaille <demaille@gostai.com>
920
921 Fix portability issue in the test suite.
922 * tests/local.at (AT_MATCHES_CHECK): New.
923 Based on Perl instead of Sed. Sed has too many portability
924 pitfalls, not ever Sed is GNU Sed.
925 * tests/actions.at (Fix user actions without a trailing semicolon):
926 Use it.
927
42f4393a
DJ
9282008-12-07 Di-an Jan <dianj@freeshell.org>
929
930 Implement the FIXME that ends an user action with a semicolon
931 if it seems necessary.
932 * src/scan-code.l (flex rules section): Flag cpp directive from
933 any `#' to the first unescaped end-of-line. Semicolon is not
934 needed after `;', `{', '}', or cpp directives and is needed after
935 any other token (whitespaces and comments have no effect).
936 * tests/actions.at (Fix user actions without a trailing semicolon):
937 New test.
938 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
939 to make user actions complete statements.
940 Adjust column numbers in error messages.
941 * tests/regression.at (Fix user actions without a trailing semicolon):
942 Remove. Covered by new test.
943
bd5df716
AD
9442009-04-14 Akim Demaille <demaille@gostai.com>
945
946 doc: minor fixes.
947 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
948 (Table of Symbols): Remove duplicate entry for %debug.
949
7ba0d59d
EB
9502009-04-10 Eric Blake <ebb9@byu.net>
951
952 submodules: update to latest
953 * submodules/autoconf: Use latest upstream Autoconf.
954
b4d71a96
EB
9552009-04-06 Eric Blake <ebb9@byu.net>
956
957 Work around autoconf 2.63b bug in testsuite.
958 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
959 autoconf bug related to # in test.
960
4ecd3681
JD
9612009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
962
963 * NEWS (2.5): Describe new -D/--define feature.
964
c65e5292
AD
9652008-11-10 Akim Demaille <demaille@gostai.com>
966
967 --trace=muscles
968 * src/getargs.h, src/getargs.c (trace_muscle): New.
969 (trace_types, trace_args): Support it.
970 * src/output.c (output_skeleton): Use it.
971
96002de2
AD
9722008-11-10 Akim Demaille <demaille@gostai.com>
973
974 muscles_output.
975 * src/output.c (muscles_output): New, extracted from...
976 (output_skeleton): here.
977 Adjust.
978
fadb13b5
AD
9792008-11-21 Akim Demaille <demaille@gostai.com>
980
981 Display the changes in cross-options.texi.
982 * build-aux/cross-options.pl ($sep): New, to separate items.
983 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
984 the changes.
985
72183df4
DJ
9862008-11-20 Di-an Jan <dianj@freeshell.org>
987
988 Improves options in the manual.
989 * doc/bison.texinfo (-g, -x): Add space before argument.
990 (Option Cross Key): Implement FIXME: listing directives also.
991 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
992 (Short Option): Special case -d. Put arguments inside @option.
fadb13b5 993 (Bison Directive): Add column, automatically extracted from
72183df4
DJ
994 src/scan-gram.l (actual name passed as the first argument)
995 with special case for %define.
996 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
997 to build-aux/cross-options.pl.
998 * src/getargs.c (usage): Document limitations of cross-options.pl.
999 * src/scan-gram.l: Likewise.
1000
e80b068c
AD
10012009-02-25 Akim Demaille <demaille@gostai.com>
1002
1003 Copyright years.
1004 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1005
e3ee30b8
AD
10062008-12-08 Akim Demaille <demaille@gostai.com>
1007
1008 Install autoconf as a submodule to get m4sugar.
1009 * .gitmodules: Add submodules/autoconf.
1010 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1011 submodules/autoconf.
1012
c4eb1e84
JD
10132008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1014
1015 Simplify last patch slightly.
1016 * src/getargs.c (getargs): Here.
1017
10fa0146
JD
10182008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1019
1020 Fix last warning from --enable-gcc-warnings.
1021 * src/getargs.c (getargs): Don't assign const address to non-const
1022 pointer.
1023
6f5be1ab
DJ
10242008-11-17 Di-an Jan <dianj@freeshell.org>
1025
1026 Handle --enable-gcc-warnings.
1027 * src/getargs.c (command_line_location): Set parameters to void.
1028
11c4e57d
AD
10292008-11-11 Akim Demaille <demaille@gostai.com>
1030
1031 AT_FULL_COMPILE.
1032 * tests/actions.at, tests/regression.at: Use it.
1033
e186a284
AD
10342008-11-07 Akim Demaille <demaille@gostai.com>
1035
1036 Pass command line location to skeleton_arg and language_argmatch.
1037 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1038 The location argument is now mandatory.
1039 Adjust all dependencies.
1040 (getargs): Use command_line_location.
1041
e14c6831
AD
10422008-11-07 Akim Demaille <demaille@gostai.com>
1043
1044 -D, --define.
1045 * src/getargs.c (usage): Document -D.
1046 Fix help string for --locations.
1047 (command_line_location): New.
1048 (short_options, long_options, getargs): Support -D, --define.
1049 (getargs): Move -d support at the right place.
1050 * doc/bison.texinfo (Bison Options): Update.
1051 * tests/input.at (%define, --define): New.
1052
75c21b61
AD
10532008-11-07 Akim Demaille <demaille@gostai.com>
1054
1055 Initialize the muscle table before parsing the command line.
1056 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1057 (getargs): Define file_name.
1058 * src/main.c (main): Initialize muscle_tab before calling
1059 getargs.
1060 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1061 its value is not available yet.
1062
33d2a860
AD
10632008-11-09 Akim Demaille <demaille@gostai.com>
1064
1065 Require the generation of parse-gram.output.
1066 * src/Makefile.am (YACC): Pass --report=all.
1067
006faedf
JD
10682009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1069
1070 * NEWS (2.5): New stub.
1071
ecd1b61c
JD
10722009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1073
1074 Fix options documentation.
1075 * build-aux/cross-options.pl: As in --help output, write optional
1076 arguments as [=ARG] not =[ARG].
1077 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1078
f67c4037
AD
10792008-11-07 Akim Demaille <demaille@gostai.com>
1080
1081 Fix --help.
1082 * src/getargs.c (usage): Fix help string for -W.
1083
0213d651
AD
10842008-11-07 Akim Demaille <demaille@gostai.com>
1085
1086 Handle more general types of option arguments.
1087 * build-aux/cross-options.pl: The argument ends at the first
1088 space, not the first non-symbol character.
1089 Use @var for each word appearing the argument description.
1090
c19178bf
JD
10912009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1092
1093 Remove spurious initial empty lines.
1094 * data/location.cc: End the @output lines with an @.
1095
0d2b2ab0
AD
10962008-11-04 Akim Demaille <demaille@gostai.com>
1097
1098 Remove spurious initial empty lines.
1099 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1100 * data/yacc.c: End the @output lines with an @.
1101
8ba62e3e
JD
11022009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1103
1104 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1105 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1106 requirements for a correct m4 are stricter.
1107 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
1108 * configure.ac: Update to use AC_PROG_GNU_M4.
1109 Reported by Eric Blake.
1110
5bc993d9
JD
11112009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1112
1113 Help with updating web manual.
1114 * HACKING: Incorporate instructions from gnulib/doc/README.
1115 * bootstrap.conf (gnulib_modules): Add gendocs.
1116
580c075d
JD
11172009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1118
1119 Fix strange %define locations for default values.
1120 Reported by Akim Demaille at
1121 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1122 and discussed again starting at
1123 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1124 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1125 because location information is bogus.
1126 Use angle brackets to delimit fake file name because square brackets
1127 look like underexpanded m4. Choose a better fake file name.
1128 Use negative line numbers.
1129 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1130 * src/location.c (location_print): If line for a boundary is negative,
1131 only print that boundary's file name.
1132 * src/location.h: Document that.
1133 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1134 defaults): Update output.
1135
5d3a1ecb
AD
11362008-11-07 Akim Demaille <demaille@gostai.com>
1137
1138 Locations without columns for command line arguments.
1139 * src/location.c (location_print): Don't display negative columns.
1140 * src/location.h: Document this.
1141
015e86a7
JD
11422009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1143
1144 Add reminder about uploading public key to keys.gnupg.net.
1145 * HACKING (Release Procedure): Here.
1146
c1455bab
AD
11472009-03-31 Akim Demaille <demaille@gostai.com>
1148
1149 bootstrap: --help to stdout.
1150 * bootstrap (usage): Don't send --help to stderr.
1151 Use a here doc instead of a long string.
1152
2075a82a
AD
11532009-03-31 Akim Demaille <demaille@gostai.com>
1154
1155 bootstrap: README-hacking no longer exists
1156 * bootstrap (checkout_only_file): Set to HACKING.
1157
26fccd4d
AD
11582009-03-26 Akim Demaille <demaille@gostai.com>
1159
1160 doc: merge HACKING and README-hacking.
1161 Two files is confusing.
1162 Reported by Alexandre Duret-Lutz.
5bc993d9 1163
26fccd4d
AD
1164 * README-hacking: Merge into...
1165 * HACKING (Working from the repository): here.
1166
6469c4d7
AD
11672009-03-26 Akim Demaille <demaille@gostai.com>
1168
1169 doc: update README-hacking.
1170 * README-hacking: We now use git and git submodules.
1171 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1172
b328890a
AD
11732009-03-26 Akim Demaille <demaille@gostai.com>
1174
1175 lalr1.cc: avoid GCC 4.3 warnings.
1176 GCC 4.3 now warns about "a || b && c" and asks for explicit
1177 parentheses.
1178 Reported by Alexandre Duret-Lutz.
1179 * data/location.cc: Update copyright years.
1180 (Position::operator==): Use parens to make precedence explicit.
1181 Compare lines and columns first, as they are more likely to be
1182 different, and they are faster to compare.
1183
f3079439
AD
11842009-03-26 Akim Demaille <demaille@gostai.com>
1185
1186 gnulib: update.
1187 * gnulib: Update to latest.
1188 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
1189 use +=.
1190
8defe11b
AD
11912009-01-08 Akim Demaille <demaille@gostai.com>
1192
1193 Fix grep portability issues.
1194 Grep on Solaris does not support -q.
1195 Reported by Summum Bonum.
5bc993d9 1196
8defe11b
AD
1197 * NEWS: Add a stub for 2.4.2.
1198 * THANKS: Add Summum Bonum.
1199 * tests/atlocal.in (EGREP): New.
1200 (CC, CXX, XSLTPROC): Make it possible to override them via
1201 envvars.
1202 * tests/java.at: Use $EGREP instead of egrep.
1203 Use AT_CHECK's ignore instead of grep's -q.
1204
41930e7a
JD
12052008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1206
1207 Version 2.4.1.
1208 * NEWS: Set version and date.
1209 * lib/Makefile.am: Update copyright year.
1210 * tests/atlocal.in: Update copyright year.
1211
d07932ef
JD
12122008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1213
1214 Semicolon feature removal is not about future language support.
1215 * NEWS: The semicolon feature is no longer active for newer languages,
1216 so don't claim that it causes trouble for them.
1217
0364b334
JD
12182008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1219
1220 * gnulib: Update submodule to HEAD.
1221
876fd835
AD
12222008-12-09 Akim Demaille <demaille@gostai.com>
1223
1224 Update data/README.
1225 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1226
bee1df15
EB
12272008-12-05 Eric Blake <ebb9@byu.net>
1228
1229 Build testsuite with newer autoconf.
1230 * tests/output.at (m4_expand): Don't override in newer autoconf,
1231 where the underlying implementation changed.
1232 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1233 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1234 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1235 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1236 since some of them contain unbalanced ')'.
1237
7e6d1e22
JD
12382008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1239
1240 * NEWS: Clarify a little.
1241
a957d06c
JD
12422008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1243
1244 * NEWS: Update for recent changes.
1245
462503f8
JD
12462008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1247
1248 Fix unexpanded macros in GLR defines file.
1249 Reported by Csaba Raduly at
1250 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1251 * THANKS (Csaba Raduly): Add.
1252 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1253 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1254 lexer in a separate module that includes the defines file.
1255 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
1256 source.
1257 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1258 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1259 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1260 (AT_DATA_SOURCE_PROLOGUE): New.
1261 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1262 (AT_DATA_SOURCE): New.
1263 (AT_FULL_COMPILE): New, copied from master branch and extended to
1264 support an additional source file.
1265
bf151b75
JD
12662008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1267
1268 Don't let maintainer-*-check targets force a version update.
1269 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1270 handled.
1271
f56274a8
DJ
12722008-11-17 Di-an Jan <dianj@freeshell.org>
1273
1274 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1275 Align menus. Adjust word wrapping. Use node names for menu names.
1276 (Examples): Don't abbreviate node names.
1277 (LocalWords): Remove abbreviations.
1278 (Copying): Make description a sentence.
bf151b75 1279 (Java Action Features): Remove period to match the rest of menu.
f56274a8 1280
b5775a81
PB
12812008-11-11 Paolo Bonzini <bonzini@gnu.org>
1282
1283 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1284 * configure.ac: Adjust usage.
1285 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1286 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1287 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1288
7ed73f82
JD
12892008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1290
1291 Don't add a semicolon to actions for %skeleton or %language.
1292 It breaks Java test cases as reported by Akim Demaille.
1293 * src/scan-code.l: Implement.
1294
4b1ebc49
JD
12952008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1296
1297 Clean up %skeleton and %language priority implementation.
1298 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1299 remove static qualifier because others will soon need to see it.
1300 (language_prio): Likewise.
1301 (getargs): Use command_line_prio rather than 0.
1302 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1303 enum fields.
1304 (skeleton_prio): Extern it.
1305 (language_prio): Extern it.
1306 * src/parse-gram.y: Use grammar_prio rather than 1.
1307
738cde3e
AD
13082008-11-04 Akim Demaille <demaille@gostai.com>
1309
1310 * NEWS: Mention the trailing semicolon in action.
1311
d6fb461d
AD
13122008-11-04 Akim Demaille <demaille@gostai.com>
1313
1314 Reformat NEWS.
1315 * NEWS: Use more outline-mode markup.
1316 Suggested by Jim Meyering.
1317
14da0cdd
JD
13182008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1319
1320 Fix user actions without a trailing semicolon.
1321 Reported by Sergei Steshenko at
1322 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1323 * THANKS (Sergei Steshenko): Add.
1324 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1325 * tests/regression.at (Fix user actions without a trailing semicolon):
1326 New test case.
1327
c9ba9e59
JD
13282008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1329
1330 Initiate further development.
1331 * NEWS: Create an empty section for new entries.
1332 * gnulib: Update submodule to HEAD.
1333
bfb40910
JD
13342008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1335
1336 * NEWS: Version 2.4.
1337
241fda7a
JD
13382008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1339
1340 Prepare for next release.
1341 * NEWS: Briefly mention changes since 2.3b.
1342 * README: Say GNU m4 1.4.6, which we've been requiring in release
1343 announcements already, not 1.4.3, which breaks the build.
1344
ed4d67dc
JD
13452008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1346
1347 Say %language is experimental.
1348 We're thinking of extending it's effect on output file naming. See the
1349 thread at
1350 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1351 * NEWS: Say it's experimental.
1352 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1353 recommend it over %skeleton for now.
1354 (Bison Options): Likewise.
1355 (C++ Bison Interface): Use %skeleton not %language.
1356 (Calc++ Parser): Use %skeleton not %language.
1357 * src/getargs.c (usage): Say it's experimental.
1358
e254a580
DJ
13592008-11-01 Di-an Jan <dianj@freeshell.org>
1360 Paolo Bonzini <bonzini@gnu.org>
1361
1362 Support all Java parser class modifiers.
1363 * data/java.m4 (b4_percent_define_get3): New.
1364 (b4_final_if, b4_strictfp_if): New.
1365 * data/lalr1.java (final, strictfp, extends, implements): Support.
1366 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1367 documentation.
1368 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1369 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1370 (AT_CHECK_JAVA_GREP): New.
1371 (Java parser class modifiers): New test.
1372 (Java parser class extends and implements): New test.
1373
1374 Model exception propagation better with throws and lex_throws.
1375 * data/java.m4 (b4_list2): New.
1376 (throws): Change default.
1377 * data/lalr1.java (yyaction): Add throws.
1378 (parse): Add lex_throws in addition to throws.
1379 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1380 * tests/java.at (Java throws specifications): New test.
1381
1382 Improve documentation for Java parsers.
1383 * doc/bison.texinfo (Java Parsers): Add subsections.
1384 Don't quote first argument of %define.
1385 (Java Bison Interface): Document output files. Move documentation
1386 of parser class and merge into Java Parser Interface. Document
1387 features that error out. Document directives with no effect.
1388 Move note about Javadoc higher.
1389 (Java Semantic Values): Explicitly mention stype.
1390 Document that generic types cannot be used.
1391 (Java Location Values): Use @deftypeivar. Document constructors.
1392 Correct return value for toString.
1393 (Java Parser Interface): List undocumented constants/fields.
1394 Move documentation of fields added by %parse-param closer to list
1395 of members. Document that token names are added as fields.
1396 Document constructors accurately. Remove error method.
1397 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1398 Interface. Describe %code lexer and yylex accutately.
1399 Remove documentation that does not match the code.
1400 (Java Action Features): New.
1401 (Java Differences): Add reference. Add item on semantic values.
1402 Add note about @{ ... @}. Clarify %% epilogue placement.
1403 (Java Declarations Summary): New.
1404
1405 Fix Java skeleton.
1406 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1407 (b4_remove_comma): Quote test argument.
1408 (b4_identification): Remove "bison" field.
1409 * tests/java.at (Java parser class and package names): New test.
1410 (Java %parse-param and %lex-param): New test.
1411 (Java stype, position_class and location_class): New test.
1412
f259e4e6
PB
14132008-10-31 Di-an Jan <dianj@freeshell.org>
1414
1415 * data/lalr1.jave: Update copyright years.
1416 (YYParser): Correct name of "generated from" file in Javadoc:
1417 use b4_file_name instead of @ofile@.
1418 (Location constructor): Correct Javadoc parameter name.
1419 (yylloc): Add missing opening m4 quote after b4_location_if.
1420 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1421 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1422 (YYParser constructor): Correct Javadoc parameter name.
1423
cae5057f
JD
14242008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1425
1426 Always put auxiliary code files in the same dir as other output files.
1427 * src/files.c (compute_file_name_parts): When the user specifies
1428 --output but not --file-prefix, extract the directory prefix from the
1429 file prefix not from the grammar file name. This affects the location
1430 of files like location.hh generated by the C++ skeleton. The includes
1431 in the other output files require this fix.
1432 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1433 for expected output files.
1434 (Output files): Add a test for the above.
1435
4af432ba
JD
14362008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1437
1438 * gnulib: Update submodule to HEAD.
1439
e26d4e43
JD
14402008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1441
1442 Update copyright year.
1443 * src/files.c: Here.
1444
c0ee9e21
DJ
14452008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1446
1447 Don't overwrite the input file.
1448 * src/files.c (output_file_name_check): Fatal error if using input file
1449 for output.
1450 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1451 argument.
1452 (Conflicting output files): Add test.
1453
482dc52f
AD
14542008-10-28 Akim Demaille <demaille@gostai.com>
1455
1456 Space changes.
1457 * data/lalr1.cc: Formatting changes.
1458
52cbbe84
AD
14592008-10-28 Akim Demaille <demaille@gostai.com>
1460
1461 Don't define debugging functions when !YYDEBUG.
1462 * data/lalr1.cc (debug_stream, set_debug_stream)
1463 (debug_level_type, debug_level, set_debug_level): Don't
1464 declare them when YYDEBUG is not defined.
1465 The implementation are already YYDEBUG-aware.
1466
0925d5bf
AD
14672008-10-28 Akim Demaille <demaille@gostai.com>
1468
1469 Prefer "continue" for empty loop bodies.
1470 * etc/bench.pl.in: Use "continue" instead of {}.
1471
cf98343c
AD
14722008-10-28 Akim Demaille <demaille@gostai.com>
1473
1474 Space and comments changes.
1475 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1476 * data/c.m4, data/lalr1.cc: Space changes.
1477
9f467b7d
AD
14782008-10-28 Akim Demaille <demaille@gostai.com>
1479
1480 Make gnulib a submodule.
1481 * gnulib: New.
1482 * .gitmodules (gnulib): New.
1483
0f0e1ace
JD
14842008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1485
1486 Fix yyerror_range for user-defined location type in C++. Reported by
1487 Georg Sauthoff at
1488 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1489 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1490 * THANKS (Georg Sauthoff): Add.
1491
548e2104
JD
14922008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1493
1494 Update several administrative files mainly to facilitate releasing.
1495 * HACKING (Administrivia): Make the git-merge-changelog notes more
1496 helpful.
1497 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1498 (Release Procedure): Update for git and add numerous details that were
1499 previously missing.
1500 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1501 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1502 that announcements don't claim we bootstrapped with whatever bison
1503 happened to be in PATH. Add flex as a bootstrap tool.
1504 * Makefile.maint: Remove, previously replaced by maint.mk.
1505 * Makefile.cfg: Remove, and migrate settings to...
1506 * cfg.mk: ... here for the sake of `make announcement'.
1507 * bootstrap.conf (gnulib_modules): Add announce-gen.
1508 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1509 Berry.
1510
ddf17a6e
PB
15112008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1512
1513 Small but important bugfixes for the Java skeleton.
1514 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1515 (yy_symbol_print): Call toString on yyvaluep.
1516
e1145ad8
AD
15172008-08-29 Akim Demaille <demaille@gostai.com>
1518
1519 Clarify UPDATED use.
bee1df15 1520 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 1521 not to the release date of Bison.
bee1df15 1522 Reported by Joel E. Denny.
e1145ad8 1523
0df72d78
AD
15242008-08-29 Akim Demaille <demaille@gostai.com>
1525
1526 * README: Update FAQ pointer.
1527 Reported by Joel E. Denny.
1528
9a90b6bb
EB
15292008-08-27 Eric Blake <ebb9@byu.net>
1530
1531 Resync m4sugar from autoconf.
1532 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1533 (m4_init): Adjust to latest m4.git changes.
1534 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1535 effects.
1536 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1537 (_m4_list_cmp): Reduce side effects.
1538
65015668
AD
15392008-08-27 Akim Demaille <demaille@gostai.com>
1540
1541 Check yyerrok in calc.at.
bee1df15
EB
1542 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1543 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1544 expected.
65015668 1545
98e26a92
AD
15462008-08-27 Akim Demaille <demaille@gostai.com>
1547
1548 Support yyerrok in lalr1.cc.
1549 YYBACKUP is still to import back into lalr1.cc.
bee1df15 1550 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 1551
86c0e784
JD
15522008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1553
1554 For maintainer-check*, don't recompile for a $(VERSION) update.
1555 * cfg.mk: New file.
1556 (_is-dist-target): Override the one in GNUmakefile.
1557 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1558
88511166
JD
15592008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1560
1561 Update for recent change to gnulib.
1562 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1563 string.h now.
1564
6bbb2ed5
EB
15652008-08-15 Eric Blake <ebb9@byu.net>
1566
d67c52e8
EB
1567 Remaining m4sugar merge from autoconf.
1568 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1569 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1570 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1571 * src/output.c (output_skeleton): Tell m4 how to find it.
1572
6bbb2ed5
EB
1573 Partial m4sugar merge from autoconf: m4_map.
1574 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1575 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1576 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1577 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1578 for empty list.
1579 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1580 Likewise.
1581 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1582 declares it.
1583
8dce3875
JD
15842008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1585
1586 Keep .version and PACKAGE_VERSION in sync.
1587 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1588 dependency, and add comments justifying this in more detail. Discussed
1589 starting at
1590 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1591
882a1fbf
EB
15922008-08-06 Eric Blake <ebb9@byu.net>
1593
a3764451
EB
1594 Partial m4sugar merge from autoconf: m4_shiftn.
1595 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1596 (m4_shift2, m4_shift3): New macros.
1597 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1598 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1599 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1600 * data/java.m4 (b4_remove_comma): Likewise.
1601
882a1fbf
EB
1602 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1603 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1604 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1605 (m4_init): Consolidate wrapped text into single m4_wrap.
1606 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1607 in wrapped text.
1608
a30e920d
EB
16092008-08-05 Eric Blake <ebb9@byu.net>
1610
dfcc5959
EB
1611 Partial m4sugar merge from autoconf: builtins, version.m4.
1612 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1613 (m4_prepend): Remove, as it is unused and inherently quadratic,
1614 whereas m4_append is linear in newer m4.
1615 (m4_mkstemp): New builtin.
1616 (m4_symbols): Make rename conditional.
1617 (m4_version_prereq): Ensure fatal error if used in bison, which
1618 intentionally lacks version.m4.
1619
a30e920d
EB
1620 Fix comments in m4sugar.
1621 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1622
445b7470
JD
16232008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1624
1625 Update for recent .gitignore fix in Gnulib.
1626 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1627 anchored .gitignore entries.
1628
a1e50014
JD
16292008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1630
1631 Set gnu or gnits strictness.
1632 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1633 development and gnits strictness for releases. Based on Eric Blake's
1634 suggestion at
1635 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1636
d43f77e7
PB
16372008-07-31 Paolo Bonzini <bonzini@gnu.org>
1638
1639 * NEWS: Clarify documentation of %language.
1640
fee2ed87
PB
16412008-07-31 Paolo Bonzini <bonzini@gnu.org>
1642
1643 Support usage of git-merge-changelog.
1644 * .gitattributes: New.
1645 * HACKING: Document usage of git-merge-changelog.
1646 * bootstrap: Install git-merge-changelog entries in .git/config
1647 if appropriate.
1648
78029cd5
JD
16492008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1650
1651 Remove remaining dependence on CVS Id keyword.
1652 * ChangeLog: For the sake of people still using CVS, don't use dollars
1653 when mentioning Id.
1654 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1655 unusual anyway.
1656 * data/xslt/xml2dot.xsl: Likewise.
1657 * data/xslt/xml2text.xsl: Likewise.
1658 * data/xslt/xml2xhtml.xsl: Likewise.
1659 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1660 * doc/Makefile.am (neutralize): Remove, no longer needed.
1661 (.x.1): Don't use neutralize.
1662 (edit): Don't substitute for ID.
1663 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1664
c53d18b1
JD
16652008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1666
1667 Fix dependence on computed configure variables.
1668 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1669 $(top_srcdir)/configure.ac so that changes to computed variables, such
1670 as PACKAGE_VERSION, are seen.
1671 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1672
5523ac79
JD
16732008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1674
1675 Update copyright dates for recent changes.
1676 * Makefile.am: Here.
1677 * src/Makefile.am: Here.
1678 * src/reduce.c: Here.
1679 * tests/reduce.at: Here.
1680
8fa36911
JD
16812008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1682
1683 Use git-version-gen for version names between releases.
1684 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1685 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1686 * .prev-version: New.
1687 * .version.in: Remove.
78029cd5 1688 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
1689 revision.
1690 * GNUmakefile: Remove, now copied from Gnulib.
1691 * Makefile.am: Add code suggested by comments in
1692 build-aux/git-version-gen.
1693 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1694 .prev-version, and .version.
1695 * NEWS (2.3b+): Rename to...
1696 (?.?): ... this because we're dropping the "+" version naming scheme,
1697 but, in general, we still can't be sure of our next release name.
1698 * bootstrap: Add a quick hack to remove from .gitignore the
1699 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1700 entry. This should really be fixed in gnulib instead.
1701 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1702 * configure.ac (AC_INIT): Set version name by invoking
1703 build-aux/git-version-gen.
1704 (AC_CONFIG_FILES): Remove .version, now generated by
1705 build-aux/git-version-gen.
1706 * maint.mk: New, copied from coreutils.
1707 * doc/.cvsignore (bison.1): Add.
1708 * doc/.gitignore (/bison.1): Add.
1709 * doc/bison.1: Remove, generated.
1710 * src/.cvsignore (revision.c): Remove.
1711 * src/.gitignore (/revision.c): Remove.
1712 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1713 (BUILT_SOURCES): Remove revision.c.
1714 (revision.c): Remove.
1715 * src/getargs.c (version): Don't print revision after the VERSION.
1716 * src/revision.h: Remove.
1717
bcf07cb7
JD
17182008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1719
1720 Fix untranslatable composition of sentences. Reported by Goran
1721 Uddeborg at
1722 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1723 * THANKS (Goran Uddeborg): Add.
1724 * src/reduce.c (reduce_print): Report the number of nonterminals and
1725 rules useless in the grammar in separate sentences.
1726 * tests/reduce.at (Useless Rules): Update output.
1727 (Reduced Automaton): Likewise.
1728 (Underivable Rules): Likewise.
1729 (Empty Language): Likewise.
1730
9aacab9a
JD
17312008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1732
1733 Fix some .gitignore and .cvsignore problems.
1734 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1735 (insert_vc_ignore): ... this new function, which prepends `/' to all
1736 .gitignore entries before passing them to insert_sorted_if_absent.
1737 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1738 .cvsignore files are maintained even though Bison developers run
1739 bootstrap while using Git.
1740 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1741 unneeded by Bison.
1742 (gnulib): Add.
1743 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1744 unneeded. Reported by Eric Blake.
1745 * lib/.gitignore (/*~): Add.
1746 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1747 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1748 Blake.
1749 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1750
a9fc7990
JD
17512008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1752
1753 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1754 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1755 * bootstrap.conf (gnulib_modules): Add unsetenv.
1756 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1757 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1758 (/setenv.m4): Add.
1759 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1760 the first argument because it may become position-dependent, and unset
1761 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1762 Add comments explaining these issues in more detail.
1763
0f1d6f10
JD
17642008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1765
1766 Add .gitignore everywhere based on .cvsignore.
1767 * .gitignore: New.
1768 * build-aux/.gitignore: New.
1769 * data/.gitignore: New.
1770 * doc/.gitignore: New.
1771 * etc/.gitignore: New.
1772 * examples/.gitignore: New.
1773 * examples/calc++/.gitignore: New.
1774 * lib/.gitignore: New.
1775 * m4/.gitignore: New.
1776 * po/.gitignore: New.
1777 * runtime-po/.gitignore: New.
1778 * src/.gitignore: New.
1779 * tests/.gitignore: New.
1780
7bd1665a
JD
17812008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1782
1783 * NEWS (2.3b+): New section, empty for now.
1784 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1785
72c5b982
JD
17862008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1787
1788 * NEWS (2.3b): Update release date since there has been a delay in
1789 getting the announcements and tarballs out.
1790
bd02cd5d
JD
17912008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1792
1793 * NEWS: Version 2.3b.
1794 * configure.ac (AC_INIT): Likewise.
1795 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1796
9126263e
JD
17972008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1798
1799 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1800 been doing it for years.
1801 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1802 (Release Procedure): Add FIXME about make alpha being unmaintained.
1803
fa6aa7b3
JD
18042008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1805
1806 * data/yacc.c: Reformat m4 a little for readability.
1807 * src/lalr.c (build_relations): Correct comment.
1808
d30b312d
JMG
18092008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1810
1811 DJGPP specific issue.
1812 * djgpp/config.sed: Fixes required to run configure scripts generated
1813 by autoconf 2.62.
1814
138d4cd9
JD
18152008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1816
1817 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1818 coordinator@translationproject.org.
1819
8f7e2e1f
JD
18202008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1821
1822 * THANKS: Add Eric Blake.
1823
f55efa38
JD
18242008-04-23 Eric Blake <ebb9@byu.net>
1825
1826 Revert prior patch, by working around autoconf regression.
1827 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1828 ("Output file name: ("): Uncomment test.
1829 ("Output file name: )"): Likewise.
1830 Based on an idea from Noah Misch.
1831
096c9f9d
JD
18322008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1833
1834 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1835 2.61. Reported by Juan Manuel Guerrero at
1836 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1837 * tests/output.at ("Output file name: ("): Comment out test case for
1838 now.
1839 ("Output file name: )"): Likewise.
1840
0f664b89
JD
18412008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1842
1843 * GNUmakefile: Update git-version-gen invocation so make dist
1844 succeeds.
1845
1cfe6375
JD
18462008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1847
1848 Update to the current gnulib CVS repository, and fix trigraph handling
1849 in Bison.
1850 * bootstrap: Update gnulib CVS repository URL.
1851 (symlink_to_dir): Encapsulate the code that guarantees the destination
1852 directory exists into...
1853 (check_dst_dir): ... this new function, and...
1854 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1855 fail when copying files into lib/uniwidth/.
1856 * src/output.c (prepare_symbols): When writing yytname muscles, where
1857 symbol names will be encoded in C-string literals, tell quotearg to
1858 escape trigraphs. This used to be the default in gnulib.
1859 * tests/regression.at (Token definitions): Because of the change in
1860 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1861 escapes trigraphs in symbol names. Thus, yytname no longer has
1862 trigraphs unnecessarily doubly escaped. Update test case output.
1863 Extend test case to be sure Bison's own error messages will no longer
1864 have trigraphs in symbol names unnecessarily escaped once.
1865
74c52fc8
JD
18662008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1867
1868 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1869 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1870 * .cvsignore: Add .version.
1871 * .version.in: New.
1872 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1873 * configure.ac (AC_CONFIG_FILES): Add .version.
1874 * build-aux/.cvsignore: Add git-version-gen.
1875
8e55b3aa
JD
18762008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1877
1878 * NEWS (2.3a+): Mention that -g now takes an argument.
1879 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1880 consistency. Update the -g and -x entries now that they take
1881 arguments. Use brackets to indicate optional arguments.
1882 * src/getargs.c (usage): Explain the relationship between arguments of
1883 long and short options more completely. Document --defines and -d
1884 separately since the former takes an argument but, for POSIX Yacc, the
1885 latter does not.
1886 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 1887 (getargs): Sort cases.
8e55b3aa 1888
59c5ac72
AD
18892008-02-28 Akim Demaille <demaille@gostai.com>
1890
1891 * doc/bison.texinfo: Fix a few typos.
1892
118d4978
AD
18932008-02-28 Akim Demaille <akim@epita.fr>
1894
1895 * doc/bison.texinfo (Bison Options): Document -W.
1896 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1897
7020f1e9
AD
18982008-02-28 Akim Demaille <akim@epita.fr>
1899
1900 * src/getargs.c (short_options): Split and sort for readability.
1901 -g and -x take optional arguments, just like their long options.
1902 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1903 understand.
1904 Fix the handling of $opt which resulted in all the argument to be
1905 considered as optional.
1906
59da312b
JD
19072008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1908
1909 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1910 say its interface is experimental.
1911 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1912 Java.
1913 (Bison Options): In the -L and --language entry, mention Java.
1914 (Java Bison Interface): Say the interface is experimental.
1915 * src/getargs.c (usage): Mention -L and --language.
1916
1917 * NEWS (2.3a+): Say the push parsing interface is experimental.
1918 * doc/bison.texinfo (Push Decl): Likewise.
1919 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1920 (Push Parser Function): Likewise.
1921 (Pull Parser Function): Likewise.
1922 (Parser Create Function): Likewise.
1923 (Parser Delete Function): Likewise.
1924 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1925 yypull_parse, and yypush_parse entries.
1926
1927 * NEWS (2.3a+): Mention XML support, and say the schema is
1928 experimental.
1929 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1930 * src/getargs.c (usage): Say the XML schema is experimental.
1931
1932 * NEWS (2.3a+): Say option instead of flag.
1933
2bb3ebec
WP
19342008-02-21 Wojciech Polak <polak@gnu.org>
1935
1936 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1937 text.
1938
333e670c
JD
19392008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1940
1941 Fix impure push parser compile error reported by Bob Rossi at
1942 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1943 * data/yacc.c: Clean up whitespace in the output a little.
1944 (yypstate_allocated): Define for impure push parsers regardless of
1945 whether the pull interface is also requested.
1946 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1947 check impure push parsers without the pull interface.
1948
1949 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1950 yyerror takes arguments specified by %parse-param while yypstate_new
1951 does not.
1952 * doc/bison.texinfo (Parser Create Function): Document that
1953 yypstate_new returns 0 for multiple impure parser instances.
1954 * tests/push.at (Push Parsing: Multiple impure instances): Update
1955 expected stderr output.
1956
798096e1
JD
19572008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1958
1959 * runtime-po/POTFILES.in (push.c): Remove.
1960
9ca7f077
JD
19612008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1962
1963 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1964 * data/push.c: Rename to...
1965 * data/yacc.c: ... this, overwriting it.
1966 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1967 `%push-pull-parser' -> `%define api.push_pull "both"'.
1968 Remove old yacc.c tests, and update push.c tests to yacc.c.
1969
42ee26bb
JD
19702008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1971
1972 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1973 `"%code top" blocks' instead of `%code "top" blocks'.
1974 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1975 Clean up whitespace in the output a little.
1976
b1cc23c4
JD
19772008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1978
1979 Fix documentation problems reported by Tim Josling at
1980 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1981 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1982 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1983 integers. Explain the effect of literal string aliases on error
1984 messages. Copy token 0 documentation from the C++ skeleton
1985 documentation.
1986
ab7f29f8
JD
19872008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1988
1989 Accept a token number in a %left, %right, or %nonassoc for POSIX
1990 conformance. Reported by Tim Josling at
1991 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1992 * NEWS (2.3a+): Mention.
1993 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1994 and code numbers are treated by precedence declarations.
1995 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1996 of symbols.1.
1997 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1998 of symbol.
1999 (symbol.prec): New, just like symbol but allows INT.
2000 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
2001 longer holds.
2002 * tests/regression.at (Token number in precedence declaration): New
2003 test case.
2004
a924ef36
JMG
20052008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2006
2007 DJGPP specific issues.
2008 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
2009 be changed. Copyright timestamp adjusted.
2010 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
2011 be changed. Copyright timestamp adjusted.
2012 * djgpp/config.site: Copyright timestamp adjusted.
2013 * djgpp/config_h.sed: Copyright timestamp adjusted.
2014 * djgpp/djunpack.bat: Copyright timestamp adjusted.
2015 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
2016 filename translation list.
2017 * djgpp/subpipe.c (init_subpipe): Check the environment variables
2018 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
2019 files shall be created. Before trying to use the temp dir where the
2020 environment variable points to check that the dir really exists. If
2021 not default to the cwd as temp dir. Copyright timestamp adjusted.
2022 * djgpp/subpipe.h: Copyright timestamp adjusted.
2023 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2024
389c8cfd
PE
20252008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2026
2027 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2028
5d1cfef4
PE
20292008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2030
2031 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2032 Problem reported by Claudio Saavedra in
2033 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2034
e2dcf996
WP
20352008-01-05 Wojciech Polak <polak@gnu.org>
2036
2037 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2038 document's title with the input grammar file name.
2039
da730230
JD
20402007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2041
2042 Automate regression testing of the XML/XSLT implementation. Discussed
2043 starting at
2044 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2045 * configure.ac (XSLTPROC): New substitution.
2046 * Makefile.am (maintainer-xml-check): New phony target invoking...
2047 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2048 invoking make maintainer-check with BISON_TEST_XML=1.
2049 * tests/atlocal.in (XSLTPROC): New.
2050 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2051 not to report reachable memory when Bison is expected to have a
2052 non-zero exit status and (2) to compare XML/XSLT output with --graph
2053 and --report=all output for every working grammar when
2054 BISON_TEST_XML=1.
2055 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2056 (AT_BISON_CHECK_XML): New.
2057 (AT_QUELL_VALGRIND): New.
2058 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2059 (AT_CHECK): ... don't redefine this since this was the old way to
2060 quell Valgrind.
2061 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2062 AT_BISON_CHECK invocations.
2063 * tests/c++.at: Likewise.
2064 * tests/calc.at: Likewise.
2065 * tests/conflicts.at: Likewise.
2066 * tests/cxx-type.at: Likewise.
2067 * tests/existing.at: Likewise.
2068 * tests/glr-regression.at: Likewise.
2069 * tests/headers.at: Likewise.
2070 * tests/input.at: Likewise.
2071 * tests/java.at: Likewise.
2072 * tests/output.at: Likewise.
2073 * tests/push.at: Likewise.
2074 * tests/reduce.at: Likewise.
2075 * tests/regression.at: Likewise.
2076 * tests/sets.at: Likewise.
2077 * tests/skeletons.at: Likewise.
2078 * tests/synclines.at: Likewise.
2079 * tests/torture.at: Likewise.
2080 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2081 tends to hang xsltproc.
2082 (Big horizontal): Likewise.
2083
408476bc
JD
20842007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2085
2086 In XML output, remove redundant class attribute on symbol element.
2087 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2088 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2089 look up a symbol to determine whether it's a nonterminal or terminal.
2090 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2091 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2092
2093 Add prec/assoc information to XML output.
2094 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2095 %prec, add a percent_prec attribute.
2096 * src/print-xml.c (print_grammar): For each terminal that has a
2097 precedence or associativity, add a prec or assoc attribute.
2098 (xml_indent): New.
2099 (xml_puts): Use xml_indent.
2100 (xml_printf): Use xml_indent.
2101 * src/print-xml.h (xml_indent): Prototype.
2102
2103 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2104 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2105
d4a26c48
JD
21062007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2107
2108 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2109 (bison:ruleByNumber): ... this for clarity.
2110 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2111 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2112 (xsl:template match="reduction"): Update.
2113 (xsl:template match="item"): Update.
2114 (xsl:template match="reduction"): Update.
2115
2116 In the XML output, don't print the list of rules where symbols appear.
2117 Compute it in XSLT instead. Discussed at
2118 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2119 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2120 (bison:ruleByRhs): New.
2121 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2122 bison:ruleByRhs.
2123 (xsl:template match="terminal/rule"): Remove.
2124 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2125 bison:ruleByRhs.
2126 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2127 Remove.
2128 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2129 bison:ruleByRhs and mode="number-link" for rule template.
2130 (xsl:template match="terminal/rule"): Remove.
2131 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2132 bison:ruleByRhs and mode="number-link" for rule template.
2133 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2134 Rewrite as...
2135 (xsl:template match="rule" mode="number-link"): ... this.
2136 * src/print-xml.c (print_grammar): Don't print the list of rules.
2137
ef1b4273
JD
21382007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2139
2140 Don't let --report affect XML output; always print all information.
2141 Discussed at
2142 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2143 * src/conflicts.c (log_resolution): Implement.
2144 * src/print-xml.c (print_core): Implement.
2145 (print_state): Implement.
2146 (print_xml): Implement.
2147
2148 * NEWS (2.3a+): Fix quotes.
2149 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2150 don't let %verbose clear the list specified by --report.
2151
0f6cd9e3
AD
21522007-11-26 Akim Demaille <akim@epita.fr>
2153
2154 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2155
d80fb37a
JD
21562007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2157
2158 In the XML output, list useless and unused symbols and rules with the
2159 useful ones and add a "usefulness" attribute. Discussed starting at
2160 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2161 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2162 (grammar_rules_print_xml): Print all rules instead of just those
2163 useful in the grammar, and add a "usefulness" attribute.
2164 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2165 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2166 (print_grammar): Print all nonterminals instead of just useful ones,
2167 and add a "usefulness" attribute to nonterminals and terminals.
2168 (print_xml): Don't print a separate "reductions" or
2169 "rules-useless-in-parser" element.
2170 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2171 (reduce_xml): Remove.
2172 (reduce_token_unused_in_grammar): New.
2173 (reduce_nonterminal_useless_in_grammar): New.
2174 * src/reduce.h (reduce_xml): Remove prototype.
2175 (reduce_token_unused_in_grammar): Add prototype.
2176 (reduce_nonterminal_useless_in_grammar): Add prototype.
2177 * data/xslt/xml2text.xsl: Update for XML changes.
2178 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2179 * tests/reduce.at (Useless Terminals): Update output.
2180 (Useless Rules): Update output.
2181 (Reduced Automaton): Update output.
2182
2183 Say "Terminals unused in grammar" instead of "Unused terminals".
2184 * NEWS (2.3a+): Update.
2185 * doc/bison.texinfo (Understanding): Update example output.
2186 * src/reduce.c (reduce_output): Implement.
2187 * data/xslt/xml2text.xsl: Implement.
2188 * data/xslt/xml2xhtml.xsl: Implement.
2189
1bb2bd75
JD
21902007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2191
2192 Accept --report-file=FILE to override the default `.output' filename.
2193 * NEWS (2.3a+): Mention.
2194 * doc/bison.texinfo (Bison Options): Add an entry.
2195 * src/files.c (compute_output_file_names): Don't override
2196 spec_verbose_file if already set.
2197 * src/getargs.c (usage): Document --report-file.
2198 (REPORT_FILE_OPTION): New anonymous enum member.
2199 (long_options): Add entry for it.
2200 (getargs): Add case for it setting spec_verbose_file.
2201
2202 * build-aux/cross-options.pl: Don't record a short option just because
2203 there's an arg.
2204 * doc/.cvsignore: Add yacc.1.
2205
a005a9c4
AD
22062007-11-14 Akim Demaille <akim@epita.fr>
2207
2208 * doc/yacc.1.in: New.
2209 * configure.ac, doc/Makefile.am: Adjust.
2210 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2211 config.h symbol.
2212 Use AC_SUBST for assignments too.
2213 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2214
cff03fb2
JD
22152007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2216
2217 * src/gram.c: Remove comments that duplicate comments in gram.h.
2218
2219 When reporting useless rules and nonterminals, say "useless in grammar"
2220 instead of "useless", and say "useless in parser" instead of "never
2221 reduced". Discussed starting at
2222 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2223 * NEWS (2.3a+): Mention this change.
2224 * data/xslt/xml2text.xsl: Update output text and expected input XML
2225 element names to match changes below.
2226 * data/xslt/xml2xhtml.xsl: Likewise.
2227 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2228 Contents: "Rules useless in parser due to conflicts".
2229 * doc/bison.texinfo (Decl Summary): Reword a little.
2230 (Understanding): Update example output for changes below.
2231 * src/gram.c: (rule_useful_p): Rename to...
2232 (rule_useful_in_grammar_p): ... this.
2233 (rule_useless_p): Rename to...
2234 (rule_useless_in_grammar_p): ... this.
2235 (rule_never_reduced_p): Rename to...
2236 (rule_useless_in_parser_p): ... this.
2237 (grammar_rules_print): Update for renames.
2238 (grammar_rules_print_xml): Update for renames.
2239 (grammar_rules_never_reduced_report): Rename to...
2240 (grammar_rules_useless_report): ... this since it is used for either
2241 kind of useless rule.
2242 * src/gram.h: Reword comments and update function names in prototypes.
2243 * src/main.c (main): Say "rule useless in parser due to conflicts".
2244 * src/print-xml.c (print_rules_never_reduced): Rename to...
2245 (print_rules_useless_in_parser): ... this, and rename output XML
2246 element "rules-never-reduced" to "rules-useless-in-parser".
2247 (print_xml): Update for rename.
2248 * src/print.c (print_results): Say "Rules useless in parser due to
2249 conflicts".
2250 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2251 (nonterminals_reduce): Say "nonterminal useless in grammar".
2252 (reduce_output): Say "Nonterminals useless in grammar".
2253 Say "Rules useless in grammar".
2254 (reduce_xml): Rename output XML element "useless" to
2255 "useless-in-grammar".
2256 (reduce_print): Don't report the count of grammatically useless rules
2257 as "rules never reduced" just because %yacc is specified.
2258 In the correct report of this count, say nonterminal(s) and rule(s)
2259 "useless in grammar".
2260 * tests/conflicts.at (S/R in initial): Update expected output.
2261 (Defaulted Conflicted Reduction): Likewise.
2262 (Unreachable States After Conflict Resolution): Likewise.
2263 * tests/existing.at (GNU pic Grammar): Likewise.
2264 * tests/reduce.at (Useless Nonterminals): Likewise.
2265 (Useless Rules): Likewise.
2266 (Reduced Automaton): Likewise.
2267 (Underivable Rules): Likewise.
2268 (Empty Language): Likewise.
2269
66f0441d
JD
22702007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2271
2272 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2273 here document and before the EOF so that BSD's implementation of Bourne
2274 shell doesn't parse the delimiter as part of the here document.
2275 * doc/.cvsignore: Add cross-options.texi.
2276 * src/getargs.c (usage): Add a blank line after the warning categories.
2277
d0ee4105
PB
22782007-11-08 Paolo Bonzini <bonzini@gnu.org>
2279
2280 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2281
e8b1fb9b
AD
22822007-11-05 Akim Demaille <akim@epita.fr>
2283
2284 Remove Id: from bison.1.
2285 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2286 (perl -0777 -pi -e 's/\.PP\nId): New.
2287 (.x.1): Use it to ignore the version control revision.
2288
2f7a96b5
AD
22892007-11-05 Akim Demaille <demaille@gostai.com>
2290
2291 * build-aux/Makefile.am: Ship cross-options.pl.
2292 * doc/Makefile.am: Always refer to cross-options.texi with
2293 $(srcdir).
2294 (MAINTAINERCLEANFILES): Add it.
2295
f4101aa6
AD
22962007-11-04 Akim Demaille <demaille@gostai.com>
2297
2298 Generate the long/short option cross-table.
2299 * build-aux/cross-options.pl: New.
2300 * doc/Makefile.am (cross-options.texi): New.
2301 * doc/bison.texinfo: Use it.
2302
727a1401
AD
23032007-11-04 Akim Demaille <demaille@gostai.com>
2304
2305 Generate bison.1 using help2man.
2306 * doc/common.x, doc/bison.x: New.
2307 * doc/Makefile.am (bison.1, .x.1): New.
2308 The code is taken from autoconf-2.61/man/Makefile.am.
2309 * configure.ac: Look for help2man.
2310
6aeb9c57
AD
23112007-11-04 Akim Demaille <demaille@gostai.com>
2312
2313 Complete --help.
2314 * src/getargs.c (usage): Document -W, make it clear that -d,
2315 -g and -x have optional arguments.
2316
d7be4085
AD
23172007-11-04 Akim Demaille <demaille@gostai.com>
2318
2319 Find sha1sum when named gsha1sum.
2320 * bootstrap (find_tool): New.
2321 ($SHA1SUM): New.
2322
d9df47b6
JD
23232007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2324
2325 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2326 at
2327 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2328 * NEWS (2.3a+): Mention.
2329 * data/bison.m4 (b4_pure_if): Don't define it here.
2330 * data/c.m4 (b4_identification): Depend on individual skeletons to
2331 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2332 values of the %define variables api.pure or api.push_pull. Define
2333 YYPURE, YYPUSH, and YYPULL accordingly.
2334 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2335 glr.cc has already defined b4_pure_flag.
2336 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2337 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 2338 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
2339 * doc/bison.texinfo (Pure Decl): Update.
2340 (Push Decl): Update.
2341 (Decl Summary): Add api.pure to %define entry.
2342 In %pure-parser entry, say it's deprecated and reference %define.
2343 (Pure Calling): Update.
2344 (Error Reporting): Update.
2345 (C++ Scanner Interface): Update.
2346 (How Can I Reset the Parser): Update.
2347 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2348 reference %define.
2349 * src/getargs.c (pure_parser): Remove global variable.
2350 * src/getargs.h (pure_parser): Remove extern.
2351 * src/output.c (prepare): Don't define pure_flag muscle.
2352 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2353 wrapper around `%define api.pure'.
2354 * tests/calc.at (Simple LALR Calculator): Update.
2355 (Simple GLR Calculator): Update.
2356 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2357 Update.
2358 (GLR: Resolve ambiguity, pure, locations): Update.
2359 (GLR: Merge conflicting parses, pure, no locations): Update.
2360 (GLR: Merge conflicting parses, pure, locations): Update.
2361 * tests/glr-regression.at (Uninitialized location when reporting
2362 ambiguity): Update
2363 * tests/input.at (Unused %define api.pure): New test case.
2364 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2365 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2366 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2367
c373bf8b
JD
23682007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2369
2370 %define push_pull -> %define api.push_pull. Discussed starting at
2371 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2372 * data/push.c: Expect the new name.
2373 * data/yacc.c: Likewise.
2374 * doc/bison.texinfo (Push Decl): Update.
2375 (Decl Summary): Update %define entry.
2376 (Push Parser Function): Update.
2377 (Pull Parser Function): Update.
2378 (Parser Create Function): Update.
2379 (Parser Delete Function): Update.
2380 * tests/calc.at (Simple LALR Calculator): Update.
2381 * tests/input.at (%define enum variables): Update.
2382 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2383 (Push Parsing: Multiple impure instances): Update.
2384 (Push Parsing: Unsupported Skeletons): Update.
2385 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2386 (Exploding the Stack Size with Malloc): Update.
2387
2388 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2389 other entries some.
2390
32f19b6b
JD
23912007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2392
2393 For the XML output's terminal element, rename @number to @token-number,
2394 and add @symbol-number. In the nonterminal element, rename @number to
2395 @symbol-number. Discussed starting at
2396 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2397 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2398 renames.
2399 (xsl:template match="nonterminal"): Likewise.
2400 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2401 (xsl:template match="nonterminal"): Likewise.
2402 * src/print-xml.c (print_grammar): Implement.
2403
255a6b90
JD
24042007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2405
2406 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2407 2007-10-11 change, the child elements here are items not rules.
408476bc 2408 (xsl:template match="item"): New.
255a6b90
JD
2409 (xsl:template match="rule"): Update for new reduced itemset.
2410 (xsl:template match="point"): Remove.
2411 (xsl:template match="empty"): For consistency with --graph, don't
2412 output "/* empty */".
2413 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2414 line-wrap, don't pass a negative value as first-line-length since this
2415 won't work with the following changes.
2416 (xsl:template name="line-wrap"): Simplify slightly.
2417 (xsl:template name="ws-search"): Eliminate recursion.
2418 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2419 set next to an item whose dot is not at the end of the RHS even if it
2420 happens to be associated with the same rule.
2421
88c78747
JD
24222007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2423
31984206
JD
2424 Add %define lr.keep_unreachable_states.
2425 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2426 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2427 * src/main.c (main): Implement it.
2428 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2429 Extend to test it, and fix a typo.
2430
24312007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2432
2433 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
2434 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2435 the example .output text.
2436 * tests/regression.at (Extra lookahead sets in report): Improve wording
2437 of comments.
2438
b7a70162
WP
24392007-10-17 Wojciech Polak <polak@gnu.org>
2440
2441 * src/print-xml.c (print_grammar): Renamed
2442 <terminal> and <nonterminal> attributes:
2443 "type" to "number" and "symbol" to "name".
2444 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2445 Use new attribute names.
2446 (xsl:template match="nonterminal"): Likewise.
2447 * data/xslt/xml2xhtml.xsl: Likewise.
2448
a0de5091
JD
24492007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2450
2451 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2452 (Option Cross Key): Likewise.
2453
2454 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2455 next to an item whose dot is not at the end of the RHS even if it
2456 happens to be associated with the same rule.
2457 * src/print.c (print_core): Likewise.
2458 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2459 (Resolved SR Conflicts): Update output.
2460 * tests/regression.at (Extra lookahead sets in report): New test case.
2461
4c20d18d
WP
24622007-10-11 Wojciech Polak <polak@gnu.org>
2463
2464 * src/print-xml.c (print_core): Remove item set
2465 redundancy.
2466 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2467 Improve processing time. Suggested by Joel E. Denny.
2468 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2469 Write xsl:param "required" attribute as comment.
2470 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2471 (xsl:template match="rule"): Support new reduced itemset.
2472 (xsl:template match="point"): Remove.
2473 * data/xslt/xml2xhtml.xsl: Likewise.
2474
f506ad1c
JD
24752007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2476
2477 * src/getargs.c (version): Update copyright year.
2478
21f1b063
JD
24792007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2480
2481 Make xml2dot.xsl and --graph produce the same output.
2482 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2483 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2484 escaped later.
2485 (xsl:template name="output-node"): Use the new escape template instead
2486 of the string-replace template directly.
2487 (xsl:template name="output-edge"): Likewise.
2488 (xsl:template name="escape"): New, escapes backslashes and newlines in
2489 addition to quotation marks.
2490 * src/graphviz.c (start_graph, output_node, output_edge): Add
2491 whitespace to output for legibility.
2492
2493 Make xml2text.xsl and --report produce the same output, and remove the
2494 XML "conflicts" element since a conflict summary is easily extracted
2495 from the automaton.
2496 * data/xslt/bison.xsl: New.
2497 (xsl:template match="state" mode="bison:count-conflicts): New.
2498 * data/xslt/xml2text.xsl: Import bison.xsl.
2499 (xsl:template match="bison-xml-report"): Instead of styling the
2500 "conflicts" element, style the "automaton" element with mode
2501 "conflicts". Unlike the former, the latter lists S/R and R/R
2502 conflicts for a state on the same line.
2503 (xsl:template match="conflicts"): Remove.
2504 (xsl:template match="conflict"): Remove.
2505 (xsl:template match="terminal"): Line-wrap the list of rules in which
2506 the terminal is used.
2507 (xsl:template match="nonterminal"): Likewise for nonterminals.
2508 (xsl:template match="automaton" mode="conflicts"): New.
2509 (xsl:template match="state" mode="conflicts"): New.
2510 (xsl:template name="line-wrap"): New.
2511 (xsl:template name="ws-search"): New.
2512 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2513 (xsl:template match="bison-xml-report"): Instead of styling the
2514 "conflicts" element, style the "automaton" element with mode
2515 "conflicts."
2516 (xsl:template match="conflicts"): Remove.
2517 (xsl:template match="conflict"): Remove.
2518 (xsl:template match="automaton" mode="conflicts"): New.
2519 (xsl:template match="state" mode="conflicts): New.
2520 * src/conflicts.c (conflicts_output_xml): Remove.
2521 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2522 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2523 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2524 the corresponding XSLT is easier. Also, never wrap between a word and
2525 the comma that follows it.
2526
793fbca5
JD
25272007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2528
2529 Improve C++ namespace support. Discussed starting at
2530 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2531 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2532 b4_namespace_close): New macros that interpret the %define variable
2533 "namespace" so its value can contain "::" to indicate nested
2534 namespaces.
2535 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2536 the above macros.
2537 * data/lalr1.cc (b4_namespace): Likewise.
2538 * data/location.cc (b4_namespace): Likewise.
2539 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2540 inside a new table in the general %define entry. Document `%define
2541 namespace' there as well. Point the %name-prefix entry to it since it
2542 explains it more completely in the case of C++.
2543 (C++ Bison Interface): Mention `%define namespace' instead of
2544 %name-prefix.
2545 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2546 entry suffices.
2547 * tests/c++.at (Relative namespace references): New test case.
2548 (Absolute namespace references): New test case.
2549 (Syntactically invalid namespace references): New test case.
2550 * tests/input.at (C++ namespace reference errors): New test case.
2551
35b8730d
JD
25522007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2553
2554 Add syncline support and location accessor to internal %define
2555 interfaces.
2556 * data/bison.m4 (b4_percent_define_get_loc): New.
2557 (b4_percent_define_get_syncline): New.
2558 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2559 (b4_percent_define_default): Record defining location as line 1 rather
2560 than 0 for the sake of synchronizing #line's, and define
2561 b4_percent_define_syncline(VARIABLE).
2562 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2563 * src/muscle_tab.c (muscle_syncline_grow): New.
2564 (muscle_code_grow): Use muscle_syncline_grow.
2565 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2566 define b4_percent_define_syncline(VARIABLE).
2567 (muscle_percent_define_get_loc): New.
2568 (muscle_percent_define_get_syncline): New.
2569 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2570 remove some unused variables.
2571 (muscle_percent_define_default): Record defining location as line 1
2572 rather than 0 for the sake of synchronizing #line's, and define
2573 b4_percent_define_syncline(VARIABLE).
2574 (muscle_percent_define_check_values): Use
2575 muscle_percent_define_get_loc.
2576 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2577 (muscle_percent_define_get_syncline): Prototype.
2578 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2579 defaults): Update output for location change.
2580 (Complaining during macro argument expansion): Extend to test
2581 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2582
7dc4a694
JD
25832007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2584
2585 Fix some error-reporting macro bugs.
2586 * data/bison.m4 (b4_cat): New.
2587 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2588 to stdout so they don't become arguments to other macros. Update
2589 comments and add examples.
2590 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2591 add examples.
2592 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2593 after printing the error directive so that M4 doesn't report subsequent
2594 problems that are induced by this problem.
2595 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2596 instead of just in them. Recognize @\n in both places. Both expand to
2597 the empty string. Needed by b4_cat.
2598 * tests/skeletons.at (Complaining during macro argument expansion):
2599 New test case.
2600 (Fatal errors make M4 exit immediately): New test case.
2601
d4bd2295
JD
26022007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2603
2604 Implement --print-datadir.
2605 * src/getargs.c (usage): Mention.
2606 (PRINT_DATADIR_OPTION): New anonymous enum member.
2607 (long_options): Add entry for it.
2608 (getargs): Add case for it calling compute_pkgdatadir.
2609 * src/output.c (output_skeleton): Encapsulate data directory
2610 computation from here...
2611 (prepare): ... and from here...
2612 (compute_pkgdatadir): ... into this new function.
2613 * src/output.h (compute_pkgdatadir): Prototype.
2614
34cdeddf
JD
26152007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2616
2617 * src/print-xml.c (escape_bufs): New static global variable
2618 replacing...
2619 (xml_escape_n): ... the static local variable buf here.
2620 (print_xml): Free memory for escape_bufs.
2621 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2622
d782395d
JD
26232007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2624
2625 Replace `%push-parser' and `%push-pull-parser' with
2626 `%define push_pull "push"' and `%define push_pull "both"'.
2627 `%define push_pull "pull"' is the default.
2628 * doc/bison.texinfo (Push Decl, Push Parser Function,
2629 Pull Parser Function, Parser Create Function, Parser Delete Function):
2630 Update declarations.
2631 (Decl Summary, Table of Symbols): Replace %push-parser and
2632 %push-pull-parser entries with a %define push_pull entry.
2633 * data/bison.m4 (b4_percent_define_check_values): New macro.
2634 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2635 definitions...
2636 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2637 definitions...
2638 * data/push.c: ... to here and compute them from the value of the
2639 %define variable push_pull.
2640 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2641 parsing requests here...
2642 * data/yacc.c: ... hack this to switch to push.c any time
2643 b4_use_push_pull_flag or the %define variable push_pull is set. This
2644 will go away when we mv push.c yacc.c.
2645 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2646 push parsing is not supported since unused %define variables are
2647 reported anyway.
2648 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2649 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2650 comments for consistency with b4_percent_define_check_values.
2651 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2652 muscles.
2653 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2654 Remove.
2655 (prologue_declaration): Remove %push-parser and %push-pull-parser
2656 rules.
2657 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2658 * tests/calc.at: Update declarations.
2659 * tests/input.at (%define enum variables): New test case.
2660 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2661 declaration.
2662 (Push Parsing: Multiple impure instances): Update declaration.
2663 (Push Parsing: Unsupported Skeletons): New test case.
2664 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2665 declaration.
2666 (Exploding the Stack Size with Malloc): Update declaration.
2667
3f999f78
WP
26682007-09-24 Wojciech Polak <polak@gnu.org>
2669
2670 Add XSLT transformations.
2671
2672 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2673 * data/xslt/xml2text.xsl: Transform XML into plain text.
2674 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2675 * data/Makefile.am (xsltdir): New variable.
2676 (dist_xslt_DATA): Add xslt/*.xsl files.
2677
a4f75309
PE
26782007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2679
2680 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2681 Problem reported by Wojciech Polak.
2682 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2683 (xml_printf): Undo change I made on 21 September; that is,
2684 indent 2 spaces, not 1.
2685
ad5feac4
JD
26862007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2687
2688 Pacify ./configure --enable-gcc-warnings.
2689 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2690 `char const *' instead of `char *'.
2691 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2692 local variable `sep'.
2693
41d7a5f2
PE
26942007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2695
2696 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2697 elsewhere.
2698 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2699 (xml_printf): Indent just 1 space for level.
2700 (e_char, xlate_char): Remove.
2701 (xml_escape_string): Rewrite to avoid undefined behavior (used
2702 storage that was freed from the stack).
2703 (xml_escape_n): Don't bother checking for subscript error.
2704
3f999f78
WP
27052007-09-21 Wojciech Polak <polak@gnu.org>
2706
2707 Add Bison XML Automaton Report.
41d7a5f2
PE
2708
2709 Add support for an -x option to generate an XML report.
2710 It is not documented yet.
2711 * src/print-xml.c: New file.
2712 * src/print-xml.h: Likewise.
2713 * lib/timevar.def (TV_XML): New var.
2714 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2715 * src/conflicts.c: Include print-xml.h.
2716 (solved_conflicts_xml_obstack): New var.
2717 (log_resolution, conflicts_solve, conflicts_free):
2718 Add support for XML report.
2719 (conflicts_output_val): New function.
2720 * src/conflicts.h (conflicts_output_val): New decl.
2721 * src/files.c (spec_xml_file): New var.
2722 (compute_output_file_names, output_file_names_free): Add XML support.
2723 * src/files.h (spec_xml_file): New decl.
2724 * src/getargs.c (xml_flag): New var.
2725 (usage, short_options, long_options, getargs): Add XML support.
2726 * src/getargs.h (xml_flag): New decl.
2727 * src/gram.c: Include print-xml.h.
2728 (rule_lhs_print_xml, rule_rhs_print_xml):
2729 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2730 New functions.
2731 * src/gram.h: Declare external ones.
2732 * src/main.c: Include print-xml.h.
2733 (main): Add XML support.
2734 * src/reduce.c: Include print-xml.h.
2735 (reduce_xml): New function.
2736 * src/reduce.h: Declare it.
2737 * src/state.c: Include print-xml.h.
2738 (state_new): Add XML support.
2739 (state_rule_lookahead_tokens_print_xml): New function.
2740 * src/state.h: Declare it.
2741 (struct state): New member solved_conflicts_xml.
2742 * src/symtab.c (symbol_class_get_string): New function.
2743 * src/symtab.h: Declare it.
2744
6d8e724d
PE
27452007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2746
2747 * GNUmakefile: Switch to coreutils's version.
2748 * bootstrap: Likewise.
2749 * Makefile.cfg: Adjust to new GNUmakefile.
2750 * README-hacking: Likewise.
2751
2752 Import from gnulib:
2753
2754 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2755 Bruno Haible <bruno@clisp.org>
2756
2757 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2758 and is a script that invokes bison. Tighten the code. Add comments.
2759
922bdd7f
JD
27602007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2761
2762 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2763 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2764 * doc/bison.texinfo (Decl Summary): Fix.
2765 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2766 * tests/input.at (Boolean %define variables): Update output.
2767 * tests/skeletons.at (%define boolean variables: invalid skeleton
2768 defaults): Rename to...
2769 (%define Boolean variables: invalid skeleton defaults): ... this and
2770 update output.
2771
1b17b01d
JD
27722007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2773
2774 In impure push mode, don't allow more than one yypstate to be allocated
2775 since multiple impure parsers would corrupt yynerrs.
2776 * data/push.c (yypstate_allocated): New static global variable
2777 initialized to 0.
2778 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2779 exhaustion if yypstate_allocated is 1, but still return 2.
2780 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2781 already 1. Otherwise, set it to 1.
2782 (yypstate_delete): Set it to 0.
2783 * tests/push.at (Push Parsing: Multiple impure instances): New test
2784 case.
2785
9987d1b3
JD
27862007-08-17 Bob Rossi <bob@brasko.net>
2787
2788 * doc/bison.texinfo (Push Decl): Document the push parser.
2789 (Table of Symbols): Ditto.
2790 (Pure Decl): Ditto.
2791 (Decl Summary): Ditto.
2792 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2793 Parser Create Function, Parser Delete Function):
2794 Add new push parser symbols.
2795 (Table of Symbols): Document push-parser, push-pull-parser,
2796 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2797
f16b0819
PE
27982007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2799
2800 Update to GPLv3.
2801 * doc/gpl-3.0.texi: New file.
2802 * doc/gpl.texi: Remove.
2803 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2804 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2805 * README-hacking, TODO, bootstrap, bootstrap.conf:
2806 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2807 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2808 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2809 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2810 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2811 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2812 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2813 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2814 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2815 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2816 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2817 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2818 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2819 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2820 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2821 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2822 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2823 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2824 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2825 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2826 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2827 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2828 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2829 * src/complain.c, src/complain.h, src/conflicts.c:
2830 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2831 * src/files.h, src/flex-scanner.h, src/getargs.c:
2832 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2833 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2834 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2835 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2836 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2837 * src/print.c, src/print.h, src/print_graph.c:
2838 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2839 * src/reduce.h, src/relation.c, src/relation.h:
2840 * src/revision.h, src/scan-code.h, src/scan-code.l:
2841 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2842 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2843 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2844 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2845 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2846 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2847 * tests/existing.at, tests/glr-regression.at:
2848 * tests/headers.at, tests/input.at, tests/java.at:
2849 * tests/local.at, tests/output.at, tests/push.at:
2850 * tests/reduce.at, tests/regression.at, tests/sets.at:
2851 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2852 * tests/torture.at:
2853 Update to GPLv3.
2854
728c4be2
JD
28552007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2856
2857 Get rid of broken %no-parser, -n, and --no-parser implementation and
2858 documentation.
2859 * TODO: Don't mention them.
2860 * doc/bison.1: Likewise.
2861 * doc/bison.texinfo (Decl Summary): Likewise.
2862 (Bison Options): Likewise.
2863 (Option Cross Key): Likewise.
2864 * src/getargs.c (no_parser_flag): Remove global variable.
2865 (usage): Don't print description of -n and --no-parser.
2866 (long_options): Remove --no-parser entry here.
2867 (getargs): Remove -n case in the switch here.
2868 * src/getargs.h (no_parser_flag): Remove extern.
2869 * tests/regression.at (Web2c Actions): Remove comment that mentions
2870 --no-parser.
2871
5d31a216
JD
28722007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2873
2874 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2875 name user variables starting with `yy'. Just pass NULL instead of a
2876 dummy local &yylval to yypush_parse.
2877 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2878 starting with `yy'.
2879
a2ea208d
JD
28802007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2881
2882 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2883 true since it's then always used regardless of whether yyoverflow is
2884 defined. Reported by Christian Burger at
2885 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2886 * THANKS: Add Christian Burger.
2887
91661ebb
JD
2888 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2889 node names: say "Decl Summary" not "Bison Declaration Summary".
2890
cbd50549
JD
28912007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2892
2893 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2894 determine whether this function has already complained about an invalid
2895 value for a %define boolean variable, don't check whether Bison has
2896 ever examined the value. As written, the check was a tautology.
2897 Instead, record and check for this complaint using a separate muscle.
2898
eb1b0740
JD
28992007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2900
2901 Fix push parsing memory leak reported by Brandon Lucia at
2902 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2903 * THANKS: Add Brandon Lucia.
2904 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2905 but the parse never completed and thus freed it.
2906 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2907 * tests/testsuite.at: Include push.at.
2908 * test/push.at: New.
2909 (Push Parsing: Memory Leak for Early Deletion): New test case.
2910
9d774aff
JD
29112007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2912
2913 Improve handling of multiple S/R conflicts in the same state and of S/R
2914 conflicts involving multiple reductions.
2915 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2916 set for a state here or Bison will abort if it is reassigned on a
2917 later conflicted reduction in the same state.
2918 Similarly, don't finalize and assign the solved conflicts report here
2919 or it will be lost if it is reassigned on a later conflicted reduction
2920 in the same state.
2921 (set_conflicts): Instead, assign them both here after all S/R conflicts
2922 in the state have been fully examined.
2923 * src/print.c (shift_set): Rename to...
2924 (no_reduce_set): ... this.
2925 (print_reductions): Update for rename, and add %nonassoc error action
2926 tokens to no_reduce_set so that, when printing the first remaining
2927 reduction on an error action token, the reduction is enclosed in
2928 brackets.
2929 (print_results): Update for rename.
2930 * tests/conflicts.at (Solved conflicts report for multiple reductions
2931 in a state): New test case.
2932 (%nonassoc error actions for multiple reductions in a state): New test
2933 case.
2934
2935 * src/main.c (main): Don't depend on C99 features.
2936
10159d2a
JD
29372007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2938
2939 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
2940 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2941 uniwidth.
10159d2a 2942
953b3935
JD
29432007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2944
2945 * bootstrap (slurp): Create target directories that don't exist.
2946 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2947
6ce2d93a
JD
29482007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2949
2950 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2951 than item number.
2952 * closure.c (closure): Likewise.
2953 * state.h (reductions): Comment sorting of rules.
2954 (state): Comment sorting of items.
2955
ce3448d5
JD
29562007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2957
2958 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2959 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2960 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2961 definition in order to avoid Gnulib headers since we don't use config.h
2962 here.
2963 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2964 rather than AT_DATA so that config.h is included.
2965
8a86eef0
JD
29662007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2967
2968 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2969 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2970 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2971 and so that YYFPRINTF is guaranteed to be defined here.
2972
b1a81613
JD
29732007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2974
2975 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2976 with...
2977 (muscle_percent_define_check_values): ... this more helpful function.
2978 Again, it's not used yet, but it will be.
2979 * src/muscle_tab.h: Likewise.
2980
71b61d4d
JD
2981 Improve some comments in parser table construction.
2982 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2983 (generate_states): Don't mention ruleset, which is internal to closure.
2984 * src/closure.c (closure): Explain sorting of core and itemset, which
2985 is required for this function to behave correctly.
2986 * src/closure.h (closure): Mention sorting.
2987
2a6b783d
JD
29882007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2989
2990 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2991 move the check for disabled transitions to an aver since conflict
2992 resolution hasn't happened yet.
2993
2994 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2995 labels a state as inconsistent just because it has error transitions.
2996 The original form of this check appeared in revision 1.1 of lalr.c,
2997 which was committed on 1991-12-21. Now (at least), changing the
2998 consistency label on such a state appears to have no useful effect in
2999 any of the places it is examined, which I enumerate below. The key
3000 point to understanding each item in this enumeration is that a state
3001 with an error transition is labelled consistent in the first place only
3002 if it has no rules, so the check cannot matter for states that have
3003 rules. (1) Labelling a state as inconsistent will cause set_conflicts
3004 to try to identify its conflicts, and a state must have *rules* to have
3005 conflicts. (2) Labelling a state as inconsistent will affect how
3006 action_row sets the default *rule* for the state. (3) Labelling a
3007 state as inconsistent will cause build_relations to add lookback edges
3008 to *rules* in that state.
3009 * src/state.h (struct state): Word the comment for member consistent
3010 more carefully.
3011
14462c2b
JD
30122007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3013
3014 Don't depend on C99 features.
3015 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
3016 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
3017 * src/reader.c (check_and_convert_grammar): Fix for-loop.
3018 * src/state.c (state_mark_reachable_states): Fix for-loop.
3019 (state_remove_unreachable_states): Fix for-loop.
3020
3021 Don't widen struct state with member reachable just to temporarily
3022 record reachability. Instead, use a local bitset.
3023 * src/state.h (struct state): Remove member.
3024 * src/state.c (state_new): Don't initialize it.
3025 (state_mark_reachable_states): Rename to...
3026 (state_record_reachable_states): ... this, and use bitset.
3027 (state_remove_unreachable_states): Use bitset.
3028
5a43d418
JD
30292007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3030
3031 * src/Makefile.am (yacc): Quote target action commands properly so
3032 that the yacc script isn't corrupt. Reported by Hans Aberg at
3033 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3034
0c650a20
JD
3035 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3036 the case of pure parsers. Reported by Frans Englich at
3037 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3038 * THANKS: Add Frans Englich.
3039
61fee93e
JD
3040 * NEWS (2.3a+): In the %code entry, reference section `Bison
3041 Declaration Summary' from the manual now since the %code summary has
3042 moved there.
3043 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3044 in the rules section must be terminated by semicolons.
3045
f124d423
JD
30462007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3047
3048 Extend the front-end API for %define variables to more completely
3049 mirror the back-end. This will be useful in the future.
3050 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3051 Update comments to mention the new front-end counterparts of these
3052 macros.
3053 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3054 for muscle_string_decode and muscle_location_decode.
3055 (muscle_string_decode): New static function.
3056 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3057 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3058 functions.
3059 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3060 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3061 implementation more closely.
3062 (muscle_percent_define_invalid_value): New function.
3063 * src/muscle_tab.h (muscle_percent_define_get,
3064 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3065 Prototype.
3066
75ad86ee
JD
30672007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3068
3069 * NEWS (2.3a+): Mention yesterday's state-removal change.
3070 (2.3a): Remove the %language entry, which was added after 2.3a.
3071 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3072 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3073 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3074 tests/existing.at: Update copyright date.
3075
5967f0cf
JD
30762007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3077
3078 If conflict resolution makes states unreachable, remove those states,
3079 report rules that are then unused, and don't report conflicts in those
3080 states.
3081 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3082 New global function.
3083 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3084 function.
3085 * src/main.c (main): After conflict resolution, remove the unreachable
3086 states and update all data structures that reference states by number.
3087 * src/state.c (state_new): Initialize each state's reachable member to
3088 false.
3089 (state_mark_reachable_states): New static function.
3090 (state_remove_unreachable_states): New global function.
3091 * src/state.h (struct state): Add member bool reachable.
3092 (state_remove_unreachable_states): Prototype.
3093 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3094 New test case.
3095 * tests/existing.at (GNU pic Grammar): Update test case output now that
3096 an unused rule is discovered.
3097
b09f4f48
JD
30982007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3099
3100 Minor code cleanup in parser table construction.
3101 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3102 (new_itemsets, save_reductions): Update for rename to nitemset.
3103 * src/closure.c (nritemset): Rename to...
3104 (nitemset): ... this since the "r" appears to meaningless and isn't
3105 used in the comments.
3106 (closure): Update for rename.
3107 * src/closure.h (nritemset): Update extern to...
3108 (nitemset): ... this.
3109 * src/lalr.c (LA): Fix a typo in comments.
3110 * src/print.c (print_core): Update for rename to nitemset.
3111 * src/print_graph.c (print_graph): Likewise.
3112 * src/state.h: Fix some typos in header comments.
3113
bbb44d83
PE
31142007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3115
9b33de72
PE
3116 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3117 still sticks to ASCII. Sorry!
3118
bbb44d83
PE
3119 * README-hacking: New file, taken mostly from coreutils, with changes
3120 for Bison. Contains much of the contents of:
3121 * README-cvs: Remove.
3122 * bootstrap: Sync from gnulib.
3123 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3124 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3125
29553547
JD
31262007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3127
3128 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3129 Setzer.
3130 (Java Differences): Fix some typos.
3131 * THANKS: Add Sebastian Setzer.
3132
01b477c6
PB
31332007-03-07 Paolo Bonzini <bonzini@gnu.org>
3134
730739e4
AD
3135 * data/java.m4 (b4_single_class_if): Remove.
3136 (b4_abstract_if): Look at "%define abstract".
3137 (b4_lexer_if): New.
3138 (b4_union_name): Rename...
3139 (b4_yystype): ... to this. Map to "%define stype".
3140 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3141 b4_maybe_throws): Fix quoting.
3142 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3143 * data/lalr1.java (Lexer interface): Always define.
3144 (Lexer interface within parser class): Remove.
3145 (YYLexer class): New, used when "%code lexer" is present.
3146 (constructor): When "%code lexer" is used, pass %lex-param
3147 to the lexer constructor.
3148 (yylex, yyparse): Remove %lex-param from method invocations
3149 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3150
3151 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3152 abstract". Rename "%define union_name" to "%define stype".
3153 Rename method names according to previous patch.
3154 (Java Scanner Interface): Describe "%code lexer" instead of
3155 "%pure-parser" and "%define single_class".
3156 (Java Differences): Mention "%code lexer".
3157
3158 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3159 Include scanner here, using macros from tests/local.at.
3160 (AT_DATA_CALC_Y): Remove final argument.
3161 (_AT_CHECK_JAVA_CALC): Likewise.
3162 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3163 of %locations and %error-verbose.
3164 (main): Test with and without %lex-param.
3165 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3166 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 3167
122bea3a
JMG
31682007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3169
3170 DJGPP spefic issue. Inhibit the use of disallowed characters for
3171 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3172 and concern testsuite case 46.
3173 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3174 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3175 * djgpp/config.bat: Inhibit the use of disallowed characters.
3176
9611cfa2
JD
31772007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3178
3179 Miscellaneous %define and %code cleanup.
3180 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3181 values are interpreted.
3182 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3183 documentation a little more.
3184 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3185 muscle_percent_define_insert, muscle_percent_code_grow): New
3186 functions/macros.
3187 * src/muscle_tab.h (muscle_percent_define_insert,
3188 muscle_percent_code_grow): Prototype.
3189 * src/parse-gram.y (prologue_declaration): Use
3190 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3191 %define and %code directives.
3192
3193 Make it easy to share %define boolean variables between the front-end
3194 and back-end. Though not used yet, this will be useful in the future.
3195 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3196 Bison uses of names rather than just skeleton uses of names.
3197 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3198 b4_percent_define_skeleton_variables(VARIABLE) to
3199 b4_percent_define_bison_variables(VARIABLE).
3200 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3201 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3202 b4_percent_code_bison_qualifiers(QUALIFIER).
3203 (b4_check_user_names_wrap): Update for renames.
3204 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3205 muscle_percent_define_default): New functions mimicking
3206 b4_percent_define_flag_if and b4_percent_define_default.
3207
3208 For %define variables, report locations for invalid values and
bbb44d83 3209 redefinitions.
9611cfa2
JD
3210 * data/bison.m4 (b4_percent_define_flag_if): Read
3211 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3212 value for VARIABLE.
3213 (b4_percent_define_default): Save a special location in
3214 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3215 must later be reported as invalid.
3216 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3217 functions.
3218 (muscle_percent_define_insert): Record the location of VARIABLE in
3219 muscle percent_define_loc(VARIABLE), and use it to report the previous
3220 location for a redefinition.
3221 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3222 (muscle_percent_define_default): Update like b4_percent_define_default.
3223 (muscle_grow_user_name_list): Rename to...
3224 (muscle_user_name_list_grow): ... this for consistency and use
3225 muscle_location_grow.
3226 * src/muscle_tab.h (muscle_location_grow): Prototype.
3227 * tests/input.at (%define errors): Update expected output.
3228 * tests/skeletons.at (%define boolean variables: invalid skeleton
3229 defaults): New test case.
3230
0bf92491
JD
32312007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3232
3233 * src/print.c (lookahead_set, state_default_rule): Remove.
3234 (print_reductions): Replace state_default_rule invocation with
3235 equivalent use of yydefact, which was computed in token_actions in
3236 tables.c.
3237 (print_results): Don't allocate lookahead_set.
3238
d3b12988
PB
32392007-02-27 Paolo Bonzini <bonzini@gnu.org>
3240
3241 * data/lalr1.java: Prefix all private members with yy.
3242
f57a7536
JD
32432007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3244
3245 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 3246 Sebastien Fricker at
f57a7536 3247 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 3248 * THANKS: Add Sebastien Fricker.
f57a7536
JD
3249 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3250 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3251 accept a variable number of arguments.
3252
6404a5bf
JD
32532007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3254
3255 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3256
e4e09639
JMG
32572007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3258
3259 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3260 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3261 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3262
d7e0a1a7
PE
32632007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3264
3265 Undo my 2007-02-07 change, switching back to the c-strcase module
3266 introduced in the 2007-02-03 change. Bruno Haible reported that
3267 the 2007-02-07 change would be dangerous in Turkish if we add a
3268 language whose name contains "i", since "i" is not lowercase "I"
3269 in Turkish.
3270 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3271 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3272 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3273 * m4/.cvsignore: Remove strcase.m4.
3274 * src/getargs.c: Revert 2007-02-07 change, as follows.
3275 Include c-strcase.h.
3276 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3277
deee93a1
JD
32782007-02-11 Bruno Haible <bruno@clisp.org>
3279
3280 Enable the Java related testsuite tests when the only Java compiler
3281 found is a gcj < 4.3. Discussed at
3282 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3283 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3284
574add85
JD
32852007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3286
3287 * data/Makefile.am: Update copyright date.
3288 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3289 yypstate_new returns NULL.
3290 (yypstate_new): Return NULL if malloc does.
3291 * src/reader.c (packgram): Move translation of rule actions from the
3292 beginning of packgram to...
3293 (check_and_convert_grammar): ... here right before packgram is invoked
3294 so it's easier to write more complete comments, and remove redundant
3295 code.
3296
e785ccf7
JD
32972007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3298
3299 As in semantic actions, make @$ in %initial-action, %destructor, and
3300 %printer imply %locations.
3301 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3302 scanning @$.
3303 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3304 (@$ in %initial-action implies %locations,
3305 @$ in %destructor implies %locations,
3306 @$ in %printer implies %locations): ... these new test cases.
3307
1cfe1ed7
PE
33082007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3309
3310 Undo most of the 2007-02-03 change, switching to the strcase module
3311 now that gnulib strcase has been fixed.
3312 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3313 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3314 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3315 * m4/.cvsignore: Add strcase.m4.
3316 * src/getargs.c: Revert 2007-02-03 change, as follows.
3317 Don't include c-strcase.h.
3318 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3319 strcasecmp has "unspecified behavior" outside the POSIX locale,
3320 but it works fine in practice if at least one argument is ASCII,
3321 as is the case in Bison.
3322
0049ec86
PB
33232007-02-07 Paolo Bonzini <bonzini@gnu.org>
3324
3325 * tests/java.at: Skip tests if only one of javac/java is present.
3326 Reported by Joel E. Denny.
3327 * tests/atlocal.in: Adjust copyright years.
3328
33292007-02-05 Paolo Bonzini <bonzini@gnu.org>
3330
3331 * data/lalr1.java (Stack): Work around old verifiers that disallow
3332 access to the private fields of an inner class, from the outer class.
3333 We can make Stack's fields public because user code doesn't have access
3334 to the instance of Stack used by parse(). Reported by Paul Eggert.
3335
2c2b7220
PE
33362007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3337
3338 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3339 the right spot for these files?
3340 * bootstrap.conf (gnulib_modules): Add c-strcase.
3341 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3342 c-strncasecmp.c.
3343 * src/getargs.c: Include c-strcase.h.
3344 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3345 to avoid unspecified behavior.
3346
b2b81dae
JD
33472007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3348
3349 * doc/bison.texinfo (Decl Summary): Correct typo.
3350
c1d19e10
PB
33512007-01-30 Paolo Bonzini <bonzini@gnu.org>
3352
3353 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3354 Complain if the value does not match empty, "true" or "false".
3355 * data/c++.m4: Adjust default definitions of %define variables.
3356 * data/java.m4: Adjust default definitions of %define variables.
3357 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3358 to above behavior.
3359 * tests/input.at (Boolean %define variables): Test new behavior.
3360
8405b70c
PB
33612007-01-29 Paolo Bonzini <bonzini@gnu.org>
3362
3363 * NEWS: Mention java.
3364 * TODO: Remove things that are done.
3365 * bootstrap.conf: Add javacomp-script and javaexec-script.
3366 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3367
3368 * data/Makefile.am: Add new files.
3369 * data/java-skel.m4: New.
3370 * data/java.m4: New.
3371 * data/lalr1.java: New.
3372
3373 * doc/bison.texinfo: Put "A Complete C++ Example" under
3374 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3375 under Other Languages.
3376
3377 * src/getargs.c (valid_languages): Add Java.
3378 * src/getargs.h (struct bison_language): Update size of string fields.
3379
3380 * tests/Makefile.am: Add java.at.
3381 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3382 * tests/java.at: New.
3383 * tests/testsuite.at: Include it.
3384
3eb82471
JD
33852007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3386
3387 Clean up.
3388 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3389 at_directive_argv arguments so these no longer have to be global
3390 variables. Also, update the implementation for the following changes.
3391 (fail_for_at_directive_too_many_args,
3392 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3393 (at_directive_name): Remove as at_directive_argv[0] will be used for
3394 this now.
3395 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3396 for the directive name.
3397 (at_directive_argc, at_directive_argv): Make these local within
3398 skel_lex instead of global.
3399 (INITIAL): Update directive start action for above changes.
3400 (SC_AT_DIRECTIVE_ARG): Rename to...
3401 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3402 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3403 (scan_skel): Move yylex_destroy to...
3404 (skel_scanner_free): ... here.
3405 * tests/skeletons.at (installed skeleton file name): Rename to...
3406 (installed skeleton file names): ... this.
3407
148d66d8
JD
34082007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3409
3410 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3411 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3412 Summary" not "Directives".
3413 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3414 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3415 since the former is now the more complete one.
3416 (Prologue Alternatives): Likewise and do the same for %defines.
3417 (Table of Symbols): Add summary of %code, add summary of %define, and
3418 move full %code documentation to...
3419 (Decl Summary): ... here for consistency with other entries in these
3420 sections.
3421 Move %define entry in order to keep this list alphabetized.
3422 Reword %define entry a little to put less emphasis on the skeleton
3423 concept, which most users shouldn't have to think about.
3424
665f0c24
PE
34252007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3426
3427 Adjust to recent gnulib changes.
3428 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3429 Add string.h, string_.h, unistd_.h, wchar_.h.
3430 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3431 * src/system.h: Don't include <stpcpy.h>; this is now done by
3432 <string.h>.
3433
592d0b1e
PB
34342007-01-23 Paolo Bonzini <bonzini@gnu.org>
3435
3436 Simplify implementation of unqualified %code, implement macros for
3437 uniform treatment of boolean %define flags. Document %define.
3438 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3439 b4_percent_code_ifdef): New.
3440 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3441 * data/c++.m4: Define default value for global_tokens_and_yystype.
3442 * data/glr.cc: Likewise.
3443 * data/location.cc: Use b4_percent_define_flag_if.
3444
148d66d8 3445 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
3446
3447 * src/parse-gram.y (Unqualified %code): Change muscle name to
3448 b4_percent_code().
3449 (content.opt): Default to empty.
3450
a7867f53
JD
34512007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3452
3453 Implement support for relative and absolute skeleton file names.
3454 Discussed starting at
3455 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3456 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3457 (Bison Options): Document in --skeleton entry.
3458 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3459 full_skeleton can't necessarily hold all of pkgdatadir.
3460 If the specified skeleton file name contains a `/', don't prepend
3461 pkgdatadir.
3462 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3463 file name contains a `/', prepend the grammar file directory.
3464 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3465 * skeletons.at: New file.
3466 (relative skeleton file names): New test case.
3467 (installed skeleton file names): New test case.
3468 * tests/testsuite.at: Include skeletons.at.
3469
3470 * bootstrap: Update copyright to 2007.
3471
830c9b18
PB
34722007-01-17 Paolo Bonzini <bonzini@gnu.org>
3473
3474 * bootstrap: Remove occurrences of .#bootmp from the files.
3475
a8c2e813
AD
34762007-01-17 Akim Demaille <akim@epita.fr>
3477
3478 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3479 nonterminals.
3480 Use per-type %printer.
3481
279cabb6
JD
34822007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3483
3484 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3485 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3486 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3487 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3488 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3489 tests/glr-regression.at, tests/input.at, tests/local.at,
3490 tests/output.at, tests/torture.at: Update copyright to 2007.
3491
bb32f4f2
AD
34922007-01-16 Akim Demaille <akim@epita.fr>
3493
3494 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3495 error code.
3496 (Calc++ Scanner): Exit with failure if we can't open the input
3497 file.
3498 Accept "-" standing for stdin.
3499 (Calc++ Top Level): Print the result only if the parsing was
3500 successful.
3501
7cff04b5
AD
35022007-01-16 Akim Demaille <akim@epita.fr>
3503
3504 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3505
a4e25e1d
JD
35062007-01-15 Paolo Bonzini <bonzini@gnu.org>
3507 and Joel E. Denny <jdenny@ces.clemson.edu>
3508
3509 Clean up %define and %code implementation in M4 some. Most
3510 importantly, rename all related macros to be in the b4_percent_define
3511 and b4_percent_code namespaces. Also, complete support for `.' in
3512 %define variable names and %code qualifiers.
3513 * data/bison.m4 (b4_check_user_names): Check for special
3514 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3515 m4_foreach loops.
3516 (b4_get_percent_define, b4_get_percent_code): Rename to...
3517 (b4_percent_define_get, b4_percent_code_get): ... these.
3518 Extend documentation with examples.
3519 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3520 b4_percent_define_skeleton_variables and
3521 b4_percent_code_skeleton_qualifiers.
3522 Expect any value for the %define variable `foo' to be stored in the
3523 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3524 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3525 expect any unqualified %code blocks to be stored in a macro named
3526 `b4_percent_code_unqualified'.
3527 Use m4_indir so that %define variable names and %code qualifiers can
3528 contain `.', which is allowed by the grammar parser.
3529 (b4_percent_define_default): New macro to set a default value for a
3530 %define variable.
3531 (m4_wrap): Update wrapped code, and fix some underquoting.
3532 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3533 Expect grammar uses of %define variables and %code qualifiers to be
3534 defined in b4_percent_define_user_variables and
3535 b4_percent_code_user_qualifiers.
3536 * data/c++.m4: Use b4_percent_define_default rather than
3537 m4_define_default. Fix some underquoting. Skeleton usage of %define
3538 variable define_location_comparison now implies skeleton usage of
3539 %define variable filename_type.
3540 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3541 data/push.c, data/yacc.c: Update macro names.
3542 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3543 muscle names.
3544
e37c665c
JMG
35452007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3546
3547 DJGPP specific issues.
3548
3549 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3550 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3551
7d2d521f
JD
35522007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3553
3554 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3555 run parsers in all tests so that Valgrind is invoked during
3556 maintainer-check-valgrind.
3557 (Duplicate representation of merged trees): Free all semantic values.
3558 (Duplicated user destructor for lookahead): Likewise.
3559
e0ac9b4b
JD
35602007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3561
3562 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3563 command-line prefix.
3564 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3565 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3566 miss Valgrind messages.
3567 (Exploding the Stack Size with Malloc): Likewise.
3568
78143faa
JD
35692007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3570
3571 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3572 locals. Reported by Juan Manuel Guerrero at
3573 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3574 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3575 Fix some indentation also.
3576 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3577 explaining this issue.
3578
7ecec4dd
JD
35792007-01-09 Paolo Bonzini <bonzini@gnu.org>
3580 and Joel E. Denny <jdenny@ces.clemson.edu>
3581
3582 Simplify union and prologue handling, and escape union and lex/parse
3583 params with digraphs.
3584 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3585 values to the empty string since these are no longer guaranteed
3586 initialized by the front-end.
3587 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3588 braces around b4_user_stype since this is no longer done by the
3589 front-end.
3590 * src/files.c, src/files.h (pre_prologue_obstack,
3591 post_prologue_obstack): Remove.
3592 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3593 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3594 with digraphs. This fixes lex params and parse params.
3595 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3596 * src/output.c (prepare): Remove muscle insertion of the prologues.
3597 (output): Remove freeing of pre_prologue_obstack and
3598 post_prologue_obstack.
3599 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3600 than prologue_augment for prologue parsing so you don't need prologue
3601 obstacks.
5c80250c
JD
3602 (grammar_declaration): For %union RHS, use `braceless' instead of
3603 "{...}" so that braces are already stripped and code is escaped with
3604 digraphs.
7ecec4dd
JD
3605 * src/reader.c (prologue_augment): Remove.
3606 (reader): Remove initialization of pre_prologue_obstack and
3607 post_prologue_obstack.
3608 * src/reader.h (prologue_augment): Remove.
3609
3610 * data/c.m4: Remove stray parenthesis.
3611
16dc6a9e
JD
36122007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3613
3614 Remove quotes from variables names in %define directives and from
3615 qualifiers in %code directives, and restrict the characters that are
3616 allowed in them to M4-friendly ones. For %define, continue to support
3617 the quoted form as a deprecated feature. Discussed starting at
3618 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3619 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3620 %code.
3621 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
3622 (Decl Summary): In %defines entry, update mention of `%code requires'
3623 and `%code provides'.
16dc6a9e
JD
3624 (C++ Location Values): Update %define uses.
3625 (Calc++ Parser Interface): Likewise.
3626 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 3627 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
3628 * src/parse-gram.y (prologue_declaration): For %define variables, use
3629 `variable' instead of `STRING'.
3630 (grammar_declaration): For %code qualifiers, use `ID' instead of
3631 `STRING'.
3632 (variable): New nonterminal that takes an `ID' or a `STRING'.
3633 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3634 and %define uses.
3635 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3636 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3637 (%define errors): Update %define uses.
3638
e9813cd4
JD
36392007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3640
3641 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3642 instead of muscle_insert for %define values so that M4-special
3643 characters are replaced with digraphs.
3644 * tests/input.at (%define errors): Extend to check weird values.
3645
6afc30cc
JD
36462007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3647
3648 Instead of having skeletons declare all valid %define variables and
3649 %code qualifiers, provide macros that retrieve the associated values
3650 and build these lists automatically. Thus Bison will now warn when a
3651 variable or qualifier is not used by the skeleton in the current
3652 invocation regardless of whether it might sometimes be used by that
3653 skeleton in other invocations. Also, move all %define value macros to
3654 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3655 form, which is replaced by %code.
3656 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3657 (b4_check_user_names): ... this, and change the series of valid name
3658 arguments to a single list argument for names used in the skeleton
3659 similar to the existing list argument for names used in the grammar.
3660 Warn instead of complaining.
3661 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3662 values and %code code, to format %code code properly, and to build
3663 lists of all %define variables and %code qualifiers used in the
3664 skeleton: b4_skeleton_percent_define_variables and
3665 b4_skeleton_percent_code_qualifiers.
3666 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3667 Remove, and...
3668 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3669 the skeleton names lists can finish building first. In place of
3670 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3671 expect the lists b4_user_percent_define_variables and
3672 b4_user_percent_code_qualifiers.
3673 * data/c++.m4: Where setting default values for b4_parser_class_name,
3674 b4_location_type, b4_filename_type, b4_namespace, and
3675 b4_define_location_comparison, update their names to the
3676 b4_percent_define_ namespace.
3677 * data/glr.c: Don't use b4_check_percent_define_variables and
3678 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3679 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3680 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 3681 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
3682 * data/location.cc: Use b4_get_percent_define.
3683 * data/push.c: Don't use b4_check_percent_define_variables and
3684 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3685 * data/yacc.c: Likewise, and don't call m4_exit in
3686 b4_use_push_for_pull_if or m4_wrap code will never execute.
3687 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3688 Rename to...
3689 (muscle_grow_user_name_list): ... this for consistency with the
3690 terminology used in bison.m4.
3691 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3692 %define variable names, and rename muscle used_percent_define_variables
3693 to user_percent_define_variables.
3694 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3695 user_percent_code_qualifiers.
3696 (content): Remove.
3697 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3698 {CODE} form is no longer accepted.
3699 * tests/input.at (Reject bad %code qualifiers): Rename to...
3700 (Reject unused %code qualifiers): ... this, and update test output.
3701 (%define error): Update test output.
3702
7eb8a0bc
JD
37032007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3704
3705 Check for unrecognized %define variables similar to checking for
3706 unrecognized %code qualifiers. Check for redefined %define variables.
3707 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3708 generalizes...
3709 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3710 (b4_check_percent_define_variables): New, also wraps it.
3711 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3712 variables using b4_check_percent_define_variables.
3713 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3714 all those exercised in the test suite and all those listed in the
3715 `Default values' section of c++.m4. Are there others?
3716 * data/push.c, data/yacc.c: Declare no valid %define variables.
3717 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3718 similar to muscle_find, but it works even when the muscle stores a
3719 const value.
3720 (muscle_grow_used_name_list): New function for constructing the used
3721 name list muscles that b4_check_for_unrecognized_names requires.
3722 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3723 %define'd more than once. Define the b4_used_percent_define_variables
3724 muscle with muscle_grow_used_name_list.
3725 (grammar_declaration): Abbreviate %code code with
3726 muscle_grow_used_name_list.
3727 * tests/input.at (%define errors): New.
3728
3fc65ead
JD
37292007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3730
3731 Provide warn_at, complain_at, and fatal_at function callbacks to the
3732 skeletons, and use this for %code qualifier complaints.
3733 * data/bison.m4 (b4_error_at): New, invoked by...
3734 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3735 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3736 @fatal_at(...@) directives.
3737 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3738 qualifiers in b4_used_percent_code_qualifiers and to use
3739 b4_complain_at.
3740 * src/location.c, src/location.h (boundary_set_from_string): New global
3741 function.
3742 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3743 function.
3744 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3745 to b4_used_percent_code_qualifiers.
3746 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3747 function.
3748 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3749 (lineno): Rename to...
3750 (out_lineno): ... this so I don't misunderstand it again.
3751 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3752 here; these newlines are in the input but not the output file.
3753 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3754 (at_directive_perform): ... this new static function, and add handling
3755 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3756 directives.
3757 * tests/input.at (Reject bad %code qualifiers): Update test output with
3758 locations and extend.
3759
3760 * tests/output.at (Output file name: [, Output file name: ]): Remove
3761 bogus comment about these tests failing.
3762
1c7b7e1d
JD
37632007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3764
3765 Clean up b4_check_percent_code_qualifiers a little.
3766 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3767 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3768 documentation and add examples.
3769 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3770 qualifiers here.
3771
08af01c2
JD
37722007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3773
3774 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3775 unreliable -- especially when they're hidden inside another macro.
3776 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3777 data/c.m4: Remove m4_divert(-1).
3778 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3779 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3780 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 3781 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
3782 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3783 pushed and popped by m4sugar, should be first on the stack.
3784
3785 Provide warn, complain, and fatal function callbacks to the skeletons.
3786 This provides more flexibility than m4_fatal, improves the error
3787 message format, and captures messages for translation. Discussed
3788 starting at
3789 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3790 * data/bison.m4 (b4_error): New, invoked by...
3791 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3792 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3793 directives. Because these M4 macros might be called when the current
3794 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3795 the previous removal of uses of m4_divert, which caused trouble.
3796 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3797 m4_fatal to report unrecognized %code qualifiers.
3798 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3799 push parser requests.
3800 * data/glr.c: Use b4_complain instead of m4_fatal to report
3801 non-deterministic push parser requests.
3802 Update @output usage to @output(...@) form.
3803 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3804 report missing %defines. Update @output usage to @output(...@) form.
3805 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3806 @output(...@) form.
3807 * src/main.c (main): Invoke skel_scanner_free.
3808 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3809 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3810 obstack_for_string from flex-scanner.h.
3811 (YY_DECL): Use to declare skel_lex static.
3812 (decode_at_digraphs): Remove; now handled in the new
3813 SC_AT_DIRECTIVE_ARG start condition.
3814 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3815 functions.
3816 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3817 at_directive_argv): New static globals.
3818 (INITIAL): Use fail_for_invalid_at.
3819 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3820 recognize the start of a generalized `@directive(...@)' form and
3821 start...
3822 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3823 directive args (using the new obstack_for_string), to decode the
3824 contained @ diagraphs, and to perform the directive. It recognizes
3825 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3826 @output(...@).
3827 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3828 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3829 `@,'.
3830 (scan_skel): Initialize obstack_for_string on the first call.
3831 (skel_scanner_free): New function to free obstack_for_string.
3832 * tests/input.at (Reject bad %code qualifiers): Update test output.
3833
8e0a5e9e
JD
38342007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3835
3836 Consolidate the 4 prologue alternative directives (%code, %requires,
3837 %provides, and %code-top) into a single %code directive with an
3838 optional qualifier field. Discussed at
3839 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3840 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3841 alternatives.
3842 * doc/bison.texinfo (Prologue Alternatives): Update.
3843 (Decl Summary): Update to %code "requires" and %code "provides".
3844 (Calc++ Parser): Update to %code "requires".
148d66d8 3845 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
3846 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3847 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3848 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3849 which are skeleton-specific.
3850 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3851 declare what %code qualifiers it supports and to complain if any other
3852 qualifiers were used in the grammar.
3853 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3854 and b4_user_code([b4_percent_code_provides]) in place of
3855 b4_user_requires and b4_user_provides.
3856 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3857 Add b4_user_code([b4_percent_code_top]) and
3858 b4_user_code([b4_percent_code]).
3859 Invoke b4_check_percent_code_qualifiers.
3860 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3861 PERCENT_REQUIRES): Remove.
3862 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3863 %requires. Rewrite the %code RHS as the unqualified form defining the
3864 muscle b4_percent_code. Add another RHS for the qualified %code form,
3865 which defines muscles of the form b4_percent_code_QUALIFIER and the
3866 b4_used_percent_code_qualifiers muscle.
3867 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3868 PERCENT_REQUIRES): Remove.
3869 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3870 %code "requires" and %code "provides".
3871 * tests/input.at (Reject bad %code qualifiers): New.
3872
95021767
JD
38732007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3874
3875 Use the new code_props interface for destructors and printers.
3876 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3877 printer_location members, and change the type of the destructor and
3878 printer members to code_props.
3879 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3880 symbol_printer_get, semantic_type_destructor_set,
3881 semantic_type_printer_set, default_tagged_destructor_set,
3882 default_tagless_destructor_set, default_tagged_printer_set,
3883 default_tagless_printer_set): Use code_props in arguments and return
3884 types in place of char const * and location.
3885 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3886 since the locations are now contained in the return of
3887 symbol_destructor_get and symbol_printer_get.
3888 * src/output.c (symbol_destructors_output, symbol_printers_output):
3889 Replace with...
3890 (symbol_code_props_output): ... this to eliminate duplicate code.
3891 (output_skeleton): Update to use symbol_code_props_output.
3892 * src/reader.c (symbol_should_be_used): Update use of
3893 symbol_destructor_get.
3894 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3895 Update uses of the various _destructor_set and _printer_set functions.
3896 * src/symtab.c: (default_tagged_destructor_location,
3897 default_tagless_destructor_location, default_tagged_printer_location,
3898 default_tagless_printer_location): Remove since we...
3899 (default_tagged_destructor, default_tagless_destructor,
3900 default_tagged_printer, default_tagless_printer): ... change the type
3901 of these to code_props.
3902 (symbol_new, semantic_type_new, symbol_destructor_set,
3903 semantic_type_destructor_set, symbol_destructor_get,
3904 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3905 symbol_check_alias_consistency, default_tagged_destructor_set,
3906 default_tagless_destructor_set, default_tagged_printer_set,
3907 default_tagless_printer_set): Update.
3908 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3909 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3910 code_props members.
3911 (symbol_print): Use SYMBOL_CODE_PRINT.
3912
f6857bbf
JD
39132007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3914
3915 Use the new code_props interface for rule actions.
3916 * src/symlist.h (symbol_list): Replace action, action_location, and
3917 used members with a code_props action_props member.
3918 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3919 grammar_midrule_action, grammar_current_rule_merge_set,
3920 grammar_current_rule_symbol_append, packgram): Update.
3921 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3922 * src/scan-code.l (handle_action_dollar): Update.
3923 (translate_rule_action): Remove, no longer used.
3924 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3925
7c0c6181
JD
39262007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3927
3928 Use the new code_props interface in parse-gram.y.
3929 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3930 Update all uses of translate_* functions to use the new code_props
3931 interface and to use gram_scanner_last_string_free and
3932 code_scanner_last_string_free where possible.
3933 (grammar_declaration): symbol_list_destructor_set and
3934 symbol_list_printer_set now perform the translation, so don't do it
3935 here. Use gram_scanner_last_string_free where possible.
3936 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3937 translate_code): Remove, no longer used.
3938 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3939 symbol_list_printer_set): Perform code translation here rather than
3940 depending on the caller to do so.
3941
3942 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3943 * src/scan-gram.h (gram_last_string): Remove declaration.
3944 * src/scan-gram.l (last_string): Declare it static.
3945
28e52c0d
JD
39462007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3947
3948 Encapsulate code properties and related functionality for the various
3949 destructors, printers, and actions into a code_props structure and
3950 interface. This patch merely implements code_props in scan-code.h and
3951 scan-code.l. Future patches will rewrite other modules to use it.
3952 Discussed starting at
3953 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3954 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3955 consistently initialize const structs that have an empty location
3956 field.
3957 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3958 to ensure consistency.
3959 * src/scan-code.h (code_props): New structure.
3960 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3961 function, macro, and const global variable for initializing a
3962 code_props with no code.
3963 (code_props_plain_init, code_props_symbol_action_init,
3964 code_props_rule_action_init, code_props_translate_code): The rest of
3965 the new code_props functional interface. Among other things, the init
3966 functions set the code_props kind field so that
3967 code_props_translate_code will know whether to behave like
3968 translate_symbol_action, translate_rule_action, or translate_code.
3969 These old translate functions must remain until all other modules are
3970 updated to use the new code_props interface.
3971 (code_scanner_last_string_free): New function similar to
3972 gram_scanner_last_string_free.
3973 (code_scanner_free): Add documentation.
3974 * src/scan-code.l: Implement the new interface.
3975 (code_lex): Make it static, add a code_props* argument, and remove the
3976 rule argument.
3977 (last_string): New static global similar to the one in scan-gram.l.
3978 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3979 instead of rule.
3980 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3981 code_props since Bison may one day use this information for destructors
3982 and printers.
3983 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3984 (handle_action_dollar): Use symbol_list_n_get and set used flag
3985 directly since symbol_list_n_used_set is removed.
3986 (translate_action): Add a code_props* argument and remove the rule,
3987 action, and location arguments. Pass the code_props* on to code_lex.
3988 (translate_rule_action, translate_symbol_action, translate_code):
3989 Rewrite as wrappers around the new code_props interface.
3990 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3991 it would eventually need to break the encapsulation of code_props.
3992
96034983
JD
39932007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3994
3995 * etc/.cvsignore: New.
3996
945e396c
JD
39972007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3998
3999 Add maintainer-push-check to run maintainer-check using push parsing in
4000 place of pull parsing where available.
4001 * Makefile.am (maintainer-push-check): New.
4002 * data/bison.m4 (b4_use_push_for_pull_if): New.
4003 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
4004 appropriately based on their existing values.
4005 (yypush_parse): Don't print push-parser-specific diagnostics if push
4006 parsing is being used in place of pull parsing.
4007 * data/yacc.c: If push parsing should replace pull parsing, redirect to
4008 push.c.
4009 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
4010 variable, and insert b4_use_push_for_pull_flag into muscles.
4011 * tests/Makefile.am (maintainer-push-check): New.
4012
7d596384
JD
40132006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4014
4015 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
4016 (whether successful or failed) so that yypush_parse can be invoked
4017 again to start a new parse using the same yypstate.
4018 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
4019 check multiple yypull_parse invocations on the same yypstate. For pull
4020 mode, extend to check multiple yyparse invocations.
4021 (Exploding the Stack Size with Alloca): Extend to try with
4022 %push-pull-parser.
4023 (Exploding the Stack Size with Malloc): Likewise.
4024
4025 * tests/calc.at (Simple LALR Calculator): Don't specify
4026 %skeleton "push.c" since %push-pull-parser implies that now.
4027 * tests/headers.at (export YYLTYPE): Don't check for the push
4028 declarations. Otherwise, this test case can't be used to see if push
4029 mode can truly emulate pull mode.
4030 * tests/input.at (Torturing the Scanner): Likewise.
4031 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4032 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4033 AT_YACC_IF, which now includes the case of push mode since %skeleton
4034 need not be used for push mode. This will be more intuitive once
4035 push.c is renamed to yacc.c.
4036
7172e23e
JD
40372006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4038
4039 For push mode, convert yyparse from a macro to a function, invoke yylex
4040 instead of passing a yylexp argument to yypull_parse, and don't
4041 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4042 Discussed starting at
4043 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4044 * data/bison.m4 (b4_pull_if): New.
4045 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4046 * data/push.c: Improve M4 quoting a little.
4047 (b4_generate_macro_args, b4_parenthesize): Remove.
4048 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4049 any time a pull parser is requested.
4050 Don't #define this as a wrapper around yypull_parse. Instead, when
4051 both push and pull are requested, make it a function that does that
4052 same thing.
4053 (yypull_parse): If there's a b4_prefix, #define this to
4054 b4_prefix[pull_parse] when both push and pull are requested.
4055 Don't define this as a function unless both push and pull are
4056 requested.
4057 Remove the yylexp argument and hard-code yylex invocation instead.
4058 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4059 %push-parser.
4060 * src/getargs.c (pull_parser): New global initialized to true.
4061 * getargs.h (pull_parser): extern it.
4062 * src/output.c (prepare): Insert pull_flag muscle.
4063 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4064 (prologue_declaration): Set both push_parser and pull_parser = true for
4065 %push-pull-parser. Set push_parser = true and pull_parser = false for
4066 %push-parser.
4067 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4068 %push-parser since there's no backward-compatibility concern here.
4069 Scan %push-pull-parser.
4070 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4071 instead of %push-parser.
4072 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4073 prototype it in the module that calls yyparse.
4074 * tests/input.at (Torturing the Scanner): Likewise.
4075 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4076
2e7944cb
JD
40772006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4078
4079 Update etc/bench.pl. Optimize push mode a little (the yyn change
4080 deserves most of the credit).
4081 * Makefile.am (SUBDIRS): Add etc subdirectory.
4082 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4083 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4084 yytoken, yyval, and yyloc declarations to...
4085 (yyparse or yypush_parse): ... here to improve performance. For
4086 yypush_parse invocations after the first, be sure to assign yyn its old
4087 value again.
4088 (yypstate_new): Don't bother initializing the yyresult field since the
4089 initial value isn't used.
4090 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4091 remove the #define that, in push mode, set it to yyps->NAME.
4092 * etc/Makefile.am: New.
4093 * etc/bench.pl: Remove and build it instead from...
4094 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4095 "tests/bison" from the build directory by default rather than just
4096 invoking "bison" from $PATH.
4097 (calc_grammar): Update push parser code: don't declare yylval globally,
4098 don't define yyparse_wrapper, and don't #define yyparse.
4099 (bench_grammar): Update to check all working combinations of yacc.c,
4100 push.c, impure, pure, pull, and push.
4101
c3d50342
JD
41022006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4103
4104 For push mode, add pull wrappers around yypush_parse.
4105 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4106 (yypull_parse): New function wrapping yypush_parse.
4107 (yyparse): New #define wrapping yypull_parse.
4108 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4109 is declared.
4110 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4111 prototype yylex in the module that calls yyparse, and don't prototype
4112 yyparse there. Otherwise, the yyparse expansion won't compile.
4113 * tests/input.at (Torturing the Scanner): Likewise.
4114
94ebeba5
JD
41152006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4116
4117 Enable push parsers to operate in impure mode. Thus, %push-parser no
4118 longer implies %pure-parser. The point of this change is to move
4119 towards being able to test the push parser code by running the entire
4120 test suite as if %push-parser had been declared.
4121 * data/push.c (yypush_parse): For impure mode, remove the
4122 yypushed_char, yypushed_val, and yypushed_loc arguments.
4123 Instead, declare these as local variables initialized to the global
4124 yychar, yylval, and yylloc.
4125 For the first yypush_parse invocation only, restore the initial values
4126 of these global variables when it's time to read a token since they
4127 have been overwritten.
4128 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4129 %push-parser.
4130 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4131 %pure-parser along with %push-parser since this test case was designed
4132 for pure push parsers.
4133 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4134 (AT_YACC_OR_PUSH_IF): New.
4135 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4136 add a note that it's still wrong for some cases (as it has been for a
4137 while).
4138 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4139 %push-parser no longer implies %pure-parser.
4140
a0633178
JD
41412006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4142
4143 Remove some unnecessary differences between the pull parser code and
4144 the push parser code. This patch enables yynerrs in push mode.
4145 * data/push.c: Reformat M4 a little.
4146 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4147 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4148 because push mode is on. Instead, if pure mode is on, move yynerrs
4149 to...
4150 (b4_declare_parser_state_variables): ... here.
4151 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4152 to yyps->NAME so it can be used in yypush_parse.
4153 (yypush_parse): Don't omit uses of yynerrs in push mode.
4154
8646b6a3
JD
41552006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4156
4157 Fix bug such that the first pushed token's value and location are
4158 sometimes overwritten (sometimes by %initial-action) before being used.
4159 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4160 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4161 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4162 more closely mimic the pull parser logic.
4163 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4164 time to read a token, which is after any initialization of yylval and
4165 yylloc.
4166 (gottoken): Rename label to...
4167 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4168 user namespace.
4169
9baf4d74
JD
41702006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4171
4172 Rearrange initialization of the parser state variables so that the
4173 skeleton doesn't have to have a copy for pull mode and another for push
4174 mode. This patch also fixes at least a bug such that yylloc was not
4175 initialized (with b4_location_initial_line and
4176 b4_location_initial_column) upon calling yypush_parse. However, that
4177 initialization now overwrites the first token's location;
4178 %initial-action assigning @$ already did the same thing, and both bugs
4179 will be fixed in a later patch.
4180 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4181 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4182 yyss, yyvs, yyls, and yystacksize.
4183 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4184 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4185 yylsp.
4186 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4187 yyps->NAME so it can be used in yypush_parse.
4188 (yyparse or yypush_parse): For yypush_parse, don't print the
4189 "Starting parse" diagnostic for invocations after the first.
4190 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4191 yypush_parse, only do it for the first invocation.
4192 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4193 initialization to occur in yypush_parse but only on the first
4194 invocation.
4195
23522164
JD
41962006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4197
4198 * data/push.c: Add CPP guards around push parser declarations in both
4199 the header and the code file.
4200 In the code file, move the push parser declarations to the same place
4201 they appear in the header file.
4202 Clean up the M4 some, especially the inconsistent underquoting in
4203 some b4_c_function_def and b4_c_function_decl uses.
4204
bb010fe5
JD
42052006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4206
4207 Encapsulate the push parser state variables into an M4 macro so the
4208 push skeleton doesn't have to list them again for pull mode's yyparse.
4209 For push mode, remove yypush_parse's local equivalents of these
4210 variables to eliminate unnecessary copying between the two sets at
4211 run-time. This patch also fixes at least a bug related to multiple
4212 %initial-action invocations in push mode.
4213 * data/push.c (b4_declare_parser_variables): Rename to...
4214 (b4_declare_scanner_communication_variables): ... this for clarity and
4215 update both uses.
4216 (b4_declare_yyparse_variables): Remove and move its contents to the one
4217 spot where it was invoked.
4218 (b4_declare_parser_state_variables): New macro containing the parser
4219 state variables required by push mode.
4220 (struct yypstate): Replace all fields but yynew with
4221 b4_declare_parser_state_variables.
4222 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4223 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4224 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4225 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4226 parser state variable declarations with
4227 b4_declare_parser_state_variables.
4228 Don't initialize parser state variables when calling yypush_parse since
4229 yypstate_new already does that.
4230 Invoke the user's initial action only upon the first yypush_parse
4231 invocation.
4232 Remove all code that copies between the local parser state variables
4233 and the yypstate.
4234
2d212f8c
JD
42352006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4236
4237 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4238 prevent a name collision in a future patch where these names will
4239 sometimes be #define'd.
4240 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4241 since it no longer has the same name as the existing argument.
4242 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4243
e6e704dc
JD
42442006-12-19 Paolo Bonzini <bonzini@gnu.org>
4245 and Joel E. Denny <jdenny@ces.clemson.edu>
4246
4247 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4248 that the argument is case-insensitive, and there's no `=' here.
4249 For the %skeleton entry, mention that %language is better.
4250 (Bison Options): Likewise for --language and --skeleton. Move the
4251 --skeleton entry so that the `Tuning the parser' section is sorted
4252 alphabetically on long options.
4253 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4254 %language directive in detail here; cross-reference the %language
4255 documentation instead.
4256 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4257 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 4258 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
4259 * examples/extexi (normalize): Instead of replacing every %require
4260 argument with the current Bison version, just substitute for
4261 `@value{VERSION}'. This guarantees that we're testing what actually
4262 appears in the documentation.
4263 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4264 rather than `@VERSION@'.
4265
0e021770
PE
42662006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4267
fd575f05
PE
4268 * NEWS: Reword the %language news a bit, and put it earlier.
4269
0e021770
PE
4270 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4271 Rewrite to simplify the logic.
4272 (language_argmatch): Likewise.
fd575f05
PE
4273 (program_name): We now own this var.
4274 * src/getargs.h (struct bison_language): Use char[] rather than
4275 const char *.
0e021770
PE
4276
4277 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4278 Java is supported.
4279 * src/complain.c (program_name): Remove decl; no longer needed.
4280 * src/main.c (program_name): Remove; now belongs to getargs.
4281
42822006-12-18 Paolo Bonzini <bonzini@gnu.org>
4283
4284 * NEWS: Document %language.
4285
4286 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4287
4288 * data/c-skel.m4, data/c++-skel.m4: New files.
4289 * data/glr.c: Complain on push parsers.
4290
4291 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4292 over %skeleton.
148d66d8 4293 (Decl Summary): Document %language and %skeleton.
0e021770
PE
4294 (Command line): Document -L.
4295
4296 * examples/extexi: Rewrite %require directive.
4297 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4298
4299 * src/files.c (compute_exts_from_gc): Look in language structure
4300 for .y extension.
4301 (compute_file_name_parts): Check whether .tab should be added.
4302 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4303 (language, skeleton_arg, language_argmatch): New.
4304 (long_options): Add --language.
4305 (getargs): Use skeleton_arg, add -L/--language.
4306 * src/getargs.h: Include location.h.
4307 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4308 * src/output.c (prepare): Pick default skeleton from struct language.
4309 Don't dispatch C skeletons here.
4310 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4311 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4312 * src/scan-gram.l ("%language"): New rule.
4313
4314 * tests/calc.at: Test %skeleton and %language.
4315 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4316 (AT_GLR_IF): Look for %skeleton "glr.cc".
4317 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4318 (AT_YACC_IF): Reject %language.
4319
5691bf57
PE
43202006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4321
db06f0ce
PE
4322 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4323 since it wasn't used; only the typedef name 'semantic_type' is needed.
4324 Also, omit trailing white space.
4325
5691bf57
PE
4326 * bootstrap: Sync from coreutils.
4327 (gnulib_extra_files): Add build-aux/announce.gen.
4328 (slurp): Adjust .gitignore files like .cvsignore files.
4329 * build-aux/announce-gen: Remove from CVS, since bootstrap
4330 now creates this.
4331
791934e4
JD
43322006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4333
4334 Make %push-parser imply %pure-parser. This fixes several bugs; see
4335 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4336 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4337 pure_parser = true.
4338 * data/push.c: Don't bother testing b4_push_if when deciding whether
4339 to expand b4_declare_parser_variables globally.
4340 (yypush_parse): Likewise in here.
4341
4342 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4343 (yy_reduce_print): Reformat M4 for readability.
4344
ee5abb37
JD
43452006-12-15 Bob Rossi <bob@brasko.net>
4346 and Joel Denny <jdenny@ces.clemson.edu>
4347
4348 * data/push.c (yypstate): Add typedef, and update all uses of
4349 struct yypstate to just yypstate.
4350 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4351
16ca01f9
JD
43522006-12-14 Bob Rossi <bob@brasko.net>
4353
4354 * data/push.c (yypush_parse): Declare prototype regardless of
4355 %locations option.
4356
ab8e7e1a
JD
43572006-12-14 Bob Rossi <bob@brasko.net>
4358
4359 * data/push.c (yyparse): Remove the prototype and the #define when in
4360 push-parser mode.
4361
9bf32be3
JD
43622006-12-13 Bob Rossi <bob@brasko.net>
4363
4364 * data/push.c (yypstate_init): Rename to...
4365 (yypstate_new): ... this and use b4_c_function_def.
4366 (yypstate_delete): New.
4367 (yypush_parse): Change parameters yynval and yynlloc to be const.
4368 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4369 yypstate_delete functions.
4370
f02e2948
JD
43712006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4372
4373 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4374 strange test case titles. Reported by Bob Rossi.
4375
38eb7751
PE
43762006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4377
4378 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4379 of potential ambiguities in GLR grammers.
4380
bd9d212b
JD
43812006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4382
4383 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4384 `bison ', use m4_index instead of m4_substr since chopping up a string
4385 containing M4-special characters causes problems here.
4386
4387 Fix a couple of bugs related to special characters in user-specified
4388 file names, and make it easier for skeletons to compute output file
4389 names with the same file name prefix as Bison-computed output file
4390 names.
4391 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4392 b4_parser_file_name and b4_spec_defines_file instead of
4393 @output_parser_name@ and @output_header_name@, which are now redundant.
4394 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4395 b4_parser_file_name, b4_spec_defines_file, and the new
4396 @basename(FILENAME@) instead of @output_parser_name@ and
4397 @output_header_name@, which inappropriately escaped the file names as
4398 C string literals.
4399 * src/files.c (all_but_ext): Remove static qualifier.
4400 (compute_output_file_names): Move `free (all_but_ext)' to...
4401 (output_file_names_free): ... here since all_but_ext is needed later.
4402 * src/files.h (all_but_ext): Extern.
4403 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4404 exactly what MUSCLE_INSERT_STRING used to do.
4405 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4406 characters are escaped properly.
4407 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4408 all_but_ext.
4409 For pkgdatadir muscle, maintain previous functionality by using
4410 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4411 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4412 digraphs would never be expanded. Hopefully no one has M4-special
4413 characters in his Bison installation path.
4414 * src/scan-skel.l: Don't parse @output_header_name@ and
4415 @output_parser_name@ anymore since they're now redundant.
4416 In @output, use decode_at_digraphs.
4417 Parse a new @basename command that invokes last_component.
4418 (decode_at_digraphs): New.
4419 (BASE_QPUTS): Remove unused.
4420 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4421 (Output file name): New tests.
4422
3f7ca628
JD
44232006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4424
4425 Warn about output files that are generated by the skeletons and that
4426 conflict with other output files.
4427 * data/glr.c: Don't generate the header file here when glr.cc does.
4428 * src/files.c (file_names, file_names_count): New static globals.
4429 (compute_output_file_names): Invoke output_file_name_check for files
4430 not generated by the skeletons and remove existing checks.
4431 (output_file_name_check): New function that warns about conflicting
4432 output file names.
4433 (output_file_names_free): Free file_names.
4434 * src/files.h (output_file_name_check): Declare.
4435 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4436 the skeletons.
4437 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4438 (Conflicting output files): New tests.
4439
178e123e
PE
44402006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4441
4442 * doc/bison.texinfo: Fix a couple of typos.
4443
44442006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
4445
4446 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4447 Rename to...
4448 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4449 update all uses.
4450 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4451 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4452 local pv.
4453 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4454 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4455
ea17f233
JD
44562006-12-07 Bob Rossi <bob@brasko.net>
4457 and Joel Denny <jdenny@ces.clemson.edu>
4458
4459 * data/push.c (yypvarsinit): Change return type from void* to struct
4460 yypvars*. No longer cast to void* on return.
4461 (struct yypvars): Remove yylen since it need not be remembered between
4462 yypushparse invocations.
4463 (yypushparse): Don't copy between yylen and pv->yylen.
4464
55a30bda
JD
44652006-12-05 Bob Rossi <bob@brasko.net>
4466
4467 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4468 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4469 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4470 (struct yypvars): Remove b4_declare_parser_variables.
4471 (yypvarsinit): Remove init code for removed variables.
4472 (global scope): Do not declare b4_declare_parser_variables if
4473 push or pure mode.
4474 (yypushparse): Add b4_declare_parser_variables.
4475 Init new local variables, and remove init code for removed
4476 yypvars variables.
4477 (yyparse): Delete.
4478 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4479 and yyparse for other modes.
4480 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4481 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4482 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4483 (AT_PURE_LEX_IF): True if pure or push parser.
4484
85894313
JD
44852006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4486
4487 Document Yacc prologue alternatives and default %destructor's and
4488 %printer's as experimental. Don't mention Java yet. Discussed at
4489 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4490 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4491 (2.3a): Annotate this entry to say the old forms of these features were
4492 also experimental.
4493 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 4494 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
4495 of Java (we'll want this back eventually).
4496
02975b9a
JD
44972006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4498
4499 Support a file name argument to %defines. Deprecate `=' in
4500 %file-prefix, %name-prefix, and %output. Discussed at
4501 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4502 * NEWS (2.3a+): Mention.
148d66d8 4503 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
4504 form of %defines, and remove `=' from entries for %file-prefix,
4505 %name-prefix, and %output.
4506 * src/parse-gram.y (prologue_declaration): Implement.
4507 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4508 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4509 all but one occurrence of %name-prefix.
4510 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4511 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4512 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4513 occurrence of each of %file-prefix and %output. Add check for %defines
4514 with argument.
4515 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4516 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4517 Remove the `=' from %output.
4518
287b314e
JD
45192006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4520
4521 Don't escape $ in test case titles since Autoconf 2.61 now does that
4522 correctly.
4523 * tests/actions.at (Default %printer and %destructor are not for error
4524 or $undefined): Here.
4525 (Default %printer and %destructor are not for $accept): Here.
4526 * tests/input.at (Invalid $n and @n): Here.
4527
3ebecc24
JD
45282006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4529
4530 Rename <!> to <>. Discussed starting at
4531 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4532 * NEWS (2.3a+): Update.
148d66d8 4533 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
4534 Update.
4535 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4536 * src/scan-gram.l (INITIAL): Implement.
4537 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4538 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4539 comment.
4540 * tests/actions.at (Default tagless %printer and %destructor,
4541 Default tagged and per-type %printer and %destructor,
4542 Default %printer and %destructor are not for error or $undefined,
4543 Default %printer and %destructor are not for $accept,
4544 Default %printer and %destructor for mid-rule values): Update.
4545 * tests/input.at (Default %printer and %destructor redeclared,
4546 Unused values with default %destructor): Update.
4547
26b8a438
JD
45482006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4549
4550 Don't let %prec take a nonterminal.
4551 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4552 token.
4553 * tests/input.at (%prec takes a token): New test checking that %prec
4554 won't take a nonterminal.
4555
07c39ae9
JD
45562006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4557
405d53b7
JD
4558 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4559 it was double-quoted.
07c39ae9
JD
4560 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4561 grammar is maintained with Bison's highest standards.
4562 * src/getargs.c: Fix some typos in Doxygen comments.
4563
580b8926
JD
45642006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4565
4566 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4567 later. Reported by Paul Eggert in
4568 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4569 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4570 * src/scan-code.l (translate_action): Don't bother invoking
4571 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4572 (code_scanner_free): Instead of invoking
4573 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4574 which frees more.
4575 * src/scan-gram.l (gram_scanner_free): Likewise.
4576 * src/scan-skel.l (scan_skel): Likewise.
4577
4502eadc
JD
45782006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4579
4580 * src/files.c (tr): Change return type to void.
4581 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4582 has been called previously for the same key.
4583 (muscle_find): Return storage instead of value so that
4584 --enable-gcc-warnings doesn't produce warnings that the return discards
4585 const. aver that the value and storage are the same since storage
4586 could potentially be NULL when value is not.
4587 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4588 same as 0.
4589
7746c8f6
PE
45902006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4591
4592 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4593 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4594 us a slightly cleaner distribution, and also works.
4595 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4596 gnulib changes.
4597
eb095650
PE
45982006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4599 and Paul Eggert <eggert@cs.ucla.edu>
4600
4601 Don't let Bison leak memory except when it complains.
4602 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4603 (spec_defines_file, dir_prefix): Now char *, not const char *,
4604 since they are freed.
4605 * src/files.c: Likewise.
4606 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4607 Likewise.
4608 (tr): Now operates in-place. All uses changed.
4609 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4610 values.
4611 (compute_file_name_parts, compute_output_file_names): Don't store
4612 read-only data in variables that will be freed.
4613 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4614 src_extension, and header_extension.
4615 (output_file_names_free): New public function to free
4616 spec_verbose_file, spec_graph_file, spec_defines_file,
4617 parser_file_name, and dir_prefix.
4618 * src/getargs.c (getargs): Don't store read-only data in variables that
4619 will be freed.
4620 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4621 (which previously existed but was unused), and quotearg_free.
4622 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4623 * src/muscle_tab.c: Likewise.
4624 (muscle_entry): Make the value char const *,
4625 and add a new storage member that is char * and can be freed.
4626 (muscle_entry_free): New private function.
4627 (muscle_init): Use it instead of free.
4628 (muscle_insert, muscle_grow): Update and use new storage member.
4629 (muscle_code_grow): Free the string passed to muscle_grow
4630 since it's not needed anymore.
4631 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4632 add a new `char *code' member.
4633 ("{...}"): Declare semantic type as code.
4634 * src/scan-code.h (translate_rule_action):
4635 (translate_symbol_action, translate_code, translate_action): Return
4636 `char const *' rather than `char *' since external code should not free
4637 these strings.
4638 * src/scan-code.l: Likewise.
4639 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4640 which is "{...}" in the parser.
4641 * tests/Makefile.am (maintainer-check-valgrind): Set
4642 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4643 Valgrind.
4644 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4645 complain.
4646 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4647 expecting a non-zero exit status sets --leak-check=summary and
4648 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4649 this case, and we don't want to hear about it.
4650
ac564be4
PE
46512006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4652
4653 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4654 instead of from the template, to simplify configuration a bit.
4655 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4656 and m4/wint_t.m4, as they are needed with the latest gnulib.
4657
17bd8a73
JD
46582006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4659
4660 Disable unset/unused mid-rule value warnings by default, and recognize
4661 --warnings=midrule-values to enable them. Discussed starting at
4662 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4663 * NEWS (2.3a+): Mention.
4664 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4665 warnings): Add entry for midrule-values subargument.
4666 * src/reader.c (symbol_should_be_used): Don't return true just because
4667 the value is a set/used mid-rule value unless
4668 --warnings=midrule-values was specified.
4669 * tests/input.at (Unused values, Unused values before symbol
4670 declarations): Run tests with and without --warnings=midrule-values.
4671
4672 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4673 than LIST_FREE directly.
4674
89eb3c76
JD
46752006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4676
4677 Finish implementing --warnings=error, which should not be implied by
4678 --warnings=all (or by its synonyms -W and --warnings without
4679 subarguments).
4680 * src/complain.c (set_warning_issued): New function to report that
4681 warnings are being treated as errors and to record an error if so.
4682 Invoke...
4683 (warn_at, warn): ... here.
4684 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4685 "error - warnings are errors" does not appear above "all - all of the
4686 above".
4687 (getargs): For -W and --warnings without subarguments, don't let
4688 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4689 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4690
ba7560e2
JD
46912006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4692
4693 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4694 empty subargument list. For example: `bison --warnings= parser.y'.
4695
31283fc3
JD
46962006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4697
4698 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4699 the parser header file so that gcc doesn't warn.
4700
12e35840
JD
47012006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4702
4703 Split the default %destructor/%printer into two kinds: <*> and <!>.
4704 Discussed starting at
4705 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4706 * NEWS (2.3a+): Mention.
4707 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4708 previous change today related to mid-rules.
148d66d8 4709 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 4710 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
4711 (TYPE_TAG_ANY): Add as <*>.
4712 (TYPE_TAG_NONE): Add as <!>.
4713 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4714 for <*> and <!>.
4715 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4716 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4717 * src/symlist.c (symbol_list_default_new): Split into tagged and
4718 tagless versions.
4719 (symbol_list_destructor_set, symbol_list_printer_set): Split
4720 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4721 SYMLIST_DEFAULT_TAGLESS.
4722 * src/symlist.h: Update symbol_list_default*_new prototypes.
4723 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4724 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4725 * src/symtab.c (default_destructor, default_destructor_location,
4726 default_printer, default_printer_location): Split each into tagged and
4727 tagless versions.
4728 (symbol_destructor_get, symbol_destructor_location_get,
4729 symbol_printer_get, symbol_printer_location_get): Implement tagged
4730 default and tagless default cases.
4731 (default_destructor_set, default_printer_set): Split each into tagged
4732 and tagless versions.
4733 * src/symtab.h: Update prototypes.
4734 * tests/actions.at (Default %printer and %destructor): Rename to...
4735 (Default tagless %printer and %destructor): ... this, and extend.
4736 (Per-type %printer and %destructor): Rename to...
4737 (Default tagged and per-type %printer and %destructor): ... this, and
4738 extend.
4739 (Default %printer and %destructor for user-defined end token): Extend.
4740 (Default %printer and %destructor are not for error or $undefined):
4741 Update.
4742 (Default %printer and %destructor are not for $accept): Update.
4743 (Default %printer and %destructor for mid-rule values): Extend.
4744 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4745 (Unused values with default %destructor): Extend.
4746
f91b1629
JD
47472006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4748
4749 Don't apply the default %destructor/%printer to an unreferenced midrule
4750 value. Mentioned at
4751 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4752 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4753 like $@n instead of just @n so that the default %destructor/%printer
4754 logic doesn't see them as user-defined symbols.
4755 (symbol_is_dummy): Check for both forms of the name.
4756 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4757 name for which the midrule value is referenced in any action.
4758 * tests/actions.at (Default %printer and %destructor for mid-rule
4759 values): New test.
4760 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4761 for change to dummy symbol names.
4762
519d0004
JD
47632006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4764
4765 Warn about unset midrule $$ if the corresponding $n is used.
4766 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4767 $n usage.
4768 (packgram): Before invoking grammar_rule_check on any rule, make sure
4769 all actions have already been scanned in order to set `used' flags.
4770 Otherwise, checking that a midrule's $$ is set will not always work
4771 properly because the midrule check must forward-reference the midrule's
4772 parent rule.
4773 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4774 warning.
4775
a501eca9
JD
47762006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4777
4778 More improvements to the documentation of the prologue alternatives:
4779 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4780 Bison manual.
4781 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4782 some text to clarify the relative importance of the new directives and
4783 to show how these directives may be viewed as code labels.
4784
2cbe6b7f
JD
47852006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4786
4787 Similar to the recently removed %before-header, add %code-top as the
4788 alternative to the pre-prologue. Mentioned at
4789 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4790 Also, let the prologue alternatives appear in the grammar section.
4791 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4792 (prologue_declaration): Move the existing prologue alternatives to...
4793 (grammar_declaration): ... here and add %code-top.
4794 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4795
4796 Clean up and extend documentation for the prologue alternatives.
4797 * NEWS (2.3a+): Describe prologue alternatives.
4798 * doc/bison.texinfo (Prologue): Move discussion of prologue
4799 alternatives to...
4800 (Prologue Alternatives): ... this new section, and extend it to discuss
4801 all 4 directives in detail.
148d66d8
JD
4802 (Table of Symbols): Clean up discussion of prologue alternatives and
4803 add %code-top.
2cbe6b7f 4804
e557d3ea
JMG
48052006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4806
4807 DJGPP specific issues.
4808
4809 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4810 config.bat accordingly.
4811 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4812 * djgpp/config.site: Likewise.
4813
136a0f76
PB
48142006-10-16 Paolo Bonzini <bonzini@gnu.org>
4815
27bd5d67
PB
4816 Replace %*-header with %provides, %requires, %code. See discussion at
4817 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4818
136a0f76
PB
4819 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4820 (b4_user_start_header): Remove.
4821 * data/glr.c: Use new macros instead of b4_*start_header
4822 and b4_*end_header.
4823 * data/glr.cc: Likewise.
4824 * data/lalr1.cc: Likewise.
4825 * data/push.c: Likewise.
4826 * data/yacc.c: Likewise.
4827
4828 * doc/bison.texinfo: Remove %before-header, rename
4829 %{start,end,after}-header to %requires, %provides, %code.
4830
4831 * src/parse-gram.y: Likewise (also rename token names accordingly).
4832 * src/scan-gram.l: Likewise.
4833 * tests/actions.at: Likewise.
4834
10f429ef
PE
48352006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4836
4837 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4838 Problem reported by Joel E. Denny.
4839
48402006-10-14 Jim Meyering <jim@meyering.net>
4841
4842 (Sync from coreutils.)
4843 Work also when the working directory (with e.g. coreutils sources)
4844 is version controlled with git, rather than CVS.
4845 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4846 rather than CVS.
4847 In messages and comments, say e.g., "checked-out sources",
4848 rather than "CVS sources".
4849 (version_controlled_file): New function. Work for git as well as
4850 for CVS. Don't use grep's -q option.
4851 (slurp): Call it here, in place of CVS-specific code.
4852
c4bd5bf7
JD
48532006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4854
4855 Fix testsuite for ./configure --enable-gcc-warnings:
4856 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4857 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4858 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4859 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4860 * test/regression.at (Diagnostic that expects two alternatives):
4861 Likewise.
4862
46356ea4
PE
48632006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4864
231ed89a
PE
4865 * bootstrap.conf (gnulib_modules): Add config-h.
4866 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4867 worry about HAVE_CONFIG_H.
4868 * lib/abitset.c: Likewise.
4869 * lib/bitset.c: Likewise.
4870 * lib/bitset_stats.c: Likewise.
4871 * lib/bitsetv-print.c: Likewise.
4872 * lib/bitsetv.c: Likewise.
4873 * lib/ebitset.c: Likewise.
4874 * lib/get-errno.c: Likewise.
4875 * lib/lbitset.c: Likewise.
4876 * lib/subpipe.c: Likewise.
4877 * lib/timevar.c: Likewise.
4878 * lib/vbitset.c: Likewise.
4879 * lib/bitset.c: Include "bitset.h" first, to test interface.
4880 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4881 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4882 * lib/bitsetv.c: Include "bitsetv.h" first.
4883 * lib/get-errno.c: Include "get-errno.h" first.
4884 * m4/.cvsignore: Add config-h.m4.
4885 * tests/actions.at (Default %printer and %destructor for ...):
4886 Adjust expected line numbers in output to reflect removal of #if
4887 HAVE_CONFIG_H lines.
4888 * tests/glr-regression.at (Missed %merge type warnings when ...):
4889 Likewise.
4890 * tests/regression.at (Braced code in declaration in rules section):
4891 Likewise.
4892 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4893 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4894 Include <config.h> unconditionally.
4895
46356ea4
PE
4896 * bootstrap: Sync from coreutils, as follows:
4897
4898 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4899
4900 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4901 variable was sometimes used without being initialized. This
4902 messed up the installation of the INSTALL file in some cases.
4903
4904 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4905
4906 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4907 --copy. Inspired by a suggestion from Bruno Haible.
4908
4909 2006-10-03 Jim Meyering <jim@meyering.net>
4910
4911 * bootstrap: Undo last change to this file, since now gnulib-tool
4912 sticks with the automake default in generating dependencies.
4913
dd4bf078
PE
49142006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4915
cf2a5f7c
PE
4916 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4917 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4918
4919 * doc/bison.1: Add copyright notice.
4920
4921 * data/glr.c: Don't include <stdarg.h>; not used.
4922
35fe0834
PE
4923 * NEWS: The -g and --graph options now output graphs in Graphviz
4924 DOT format, not VCG format.
4925 * doc/bison.1: Likewise.
4926 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
4927 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4928 of this change in
4929 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
4930 * TODO: Remove Graphviz entry.
4931 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4932 remove vcg.c, vcg.h, vcg_defaults.h.
4933 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4934 * src/graphviz.c, src/graphviz.h: New files.
4935 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4936 * src/files.h: Make comment more generic.
4937 * src/main.c (main): Likewise.
4938 * src/print_graph.h: Likewise.
4939 * src/getargs.c (usage): Make usage description more generic.
4940 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4941 (static_graph, fgraph): Remove. All uses changed to pass
4942 arguments instead of sharing a static var.
4943 (print_core, print_actions, print_state, print_graph):
4944 Output graphviz format rather than VCG format.
4945 * tests/.cvsignore: Remove *.vcg; add *.dot.
4946 * tests/output.at: Expect *.dot files, not *.vcg files.
4947
dd4bf078
PE
4948 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4949 accommodates the 2006-10-08 change.
4950
efdd7421
PE
49512006-10-11 Bob Rossi <bob@brasko.net>
4952
4953 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4954 (b4_yyssa, b4_yyerror_range): New macros.
4955 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4956 (yypvarsinit): Remove init of removed fields.
4957 (yypushparse): Remove use of removed fields; use new macros instead.
4958
96a1981a
PE
49592006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4960
4961 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4962 in a push parser. Reindent slightly to match yacc.c better.
4963
49642006-10-11 Bob Rossi <bob@brasko.net>
4965
46356ea4
PE
4966 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4967 yymsg_alloc fields.
4968 (yypvarsinit, yypushparse): Remove init of removed fields.
4969 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 4970
c1630a8b
PE
49712006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4972
4973 * THANKS: Add Paolo Bonzini and Bob Rossi.
4974
90b9908d
PB
49752006-10-08 Paolo Bonzini <bonzini@gnu.org>
4976
4977 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4978 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4979 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4980 b4_define_user_cde and uses): Remove.
4981 (b4_comment, b4_prefix, b4_sync_start): New.
4982 * data/bison.m4: New file, with most of the content removed from c.m4.
4983 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4984 * src/output.c (output_skeleton): Pass bison.m4.
4985 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4986 only if specified.
4987
cf806753
PE
49882006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4989
4990 Fix test failure reported by Tom Lane in
4991 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4992 and try to make such failures easier to catch in the future.
4993 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4994 that's now the caller's responsibility.
4995 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4996 Set yychar = YYEOF if it's negative.
4997 * tests/actions.at (yylex): Abort if asked to read past EOF.
4998 * tests/conflicts.at (yylex): Likewise.
4999 * tests/cxx-type.at (yylex): Likewise.
5000 * tests/glr-regression.at (yylex): Likewise.
5001 * tests/input.at (yylex): Likewise.
5002 * tests/regression.at (yylex): Likewise.
5003 * tests/torture.at (yylex): Likewise.
5004
0e2f006a
PE
50052006-10-01 Paul Eggert <eggert@cs.ucla.edu>
5006
5007 Fix problems with translating English-language diagnostics.
5008 * bootstrap: Fix bug introduced in recent bootstrap changes, with
5009 respect to bison-runtime pot generation. The YY_ stuff
5010 wasn't being captured.
5011 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
5012 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
5013 * runtime-po/POTFILES.in: Add data/push.c.
5014
e3ddc1e3
PE
50152006-09-29 Paul Eggert <eggert@cs.ucla.edu>
5016
5017 Merge bootstrap changes from coreutils.
5018
5019 2006-09-28 Jim Meyering <jim@meyering.net>
5020
5021 Automatically generated dependencies are important even
5022 when all of the sources in a directory come from gnulib.
5023 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5024 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5025
5026 2006-09-23 Jim Meyering <jim@meyering.net>
5027
5028 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5029
5030 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5031
5032 * bootstrap: Add support for --force.
5033 (usage): New function. Describe usage less tersely.
5034 (CVS_only_file): New var.
5035
01e972b3
PE
50362006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5037
5038 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5039 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5040 Adjust white space and comments to match GNU style better.
5041
c63d3e90
PE
50422006-09-20 Bob Rossi <bob@brasko.net>
5043
5044 * data/push.c (yyresult_get): Remove function.
5045 (YYPUSH_MORE): Add #define.
5046 (yypushparse): Modify return value.
5047
e70f46d1
PE
50482006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5049
5050 * stamp-h.in: Remove; no longer needed.
5051 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5052 Remove config.h, config.hin, intl (no longer created).
5053 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5054 stamp-h1.
5055
5056 Sync bootstrap from coreutils, as follows:
5057
5058 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5059
5060 * bootstrap (symlink_to_gnulib): New function.
5061 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5062 to copies-of-gnulib.
5063 (cp_mark_as_generated, slurp, gnulib_files):
5064 Avoid making a copy if it's the same as the old version.
5065 (gnulib_files): Add support for this variable (used by Bison).
5066
a92be413
PE
50672006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5068
5069 * src/getargs.c (usage): Rework to use conventions similar to
5070 coreutils, to make translation a bit easier and the code a bit
5071 smaller. Problem reported by Tim Van Holder.
5072
4f82b42a
PE
50732006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5074
3b2942e6
PE
5075 Use some of gnulib's new modules, taken from coreutils.
5076
5077 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5078 * bootstrap.conf: New file.
5079 (gnulib_modules): Add configmake, inttypes, unistd.
5080 (XGETTEXT_OPTIONS): Add complain, complain_at,
5081 fatal, fatal_at, warn, warn_at, unexpected_end.
5082 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5083 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5084 (gl_EARLY): Add.
5085 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5086 (gl_INIT): Add
5087 (GNULIB_AUTOCONF_SNIPPET): Remove.
5088 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5089 the pickiest.
5090 * lib/.cvsignore: Add inttypes_.h.
5091 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5092 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5093 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5094 no-longer-necessary initializations.
5095 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5096 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5097 use the unistd module.
5098 * src/system.h: Likewise.
5099 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5100 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5101 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5102 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5103 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5104 * src/system.h: Include inttypes.h unconditionally, now that we
5105 use the inttypes module. Don't bother to include stdint.h, since
5106 inttypes.h now does that for us.
5107 (LOCALEDIR): Remove, now that we use the configmake module.
5108 * src/getargs.c: Include configmake.h.
5109 * src/main.c: Likewise.
5110 * src/output.c: Likewise.
5111 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5112 not from $abs_top_builddir, since config.h moved.
5113
5114
4f82b42a
PE
5115 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5116 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5117
5118 * src/parse-gram.y (symbol_declaration): Don't put statements
5119 before declarations; it's not portable to C89.
5120 * src/scan-code.l (handle_action_at): Likewise.
5121
5122 * src/scan-code.l: Always initialize braces_level; the old code
5123 left it uninitialized and therefore had undefined behavior.
5124
5125 Don't attempt to redefine 'assert', since it runs afoul of
5126 systems where standard headers (mistakenly) include <assert.h>.
5127 Instead, define and use our own alternative, called 'aver'.
5128 * src/reader.c: Don't include assert.h, since we no longer
5129 use assert.
5130 * src/scan-code.l: Likewise.
5131 * src/system.h (assert): Remove, replacing with....
5132 (aver): New function, taking a bool arg. All uses changed.
5133 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5134 not merely an integer.
5135
31c10e38
PE
51362006-09-15 Bob Rossi <bob@brasko.net>
5137
5138 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5139 * data/c.m4 (YYPUSH): New.
5140 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5141 * src/getargs.c (push_parser): New var.
5142 * src/getargs.h (push_parser): New declaration.
5143 * src/output.c (prepare): Add macro insertion of `push_flag'.
5144 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5145 (prologue_declaration): Parse %push-parser.
5146 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5147 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5148 list of removed lines from the traces observed.
5149 (AT_CHECK_CALC_LALR): Added push parser tests.
5150
fa7b79c0
PE
51512006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5152
21fe08ca
PE
5153 * NEWS: Version 2.3a.
5154 * configure.ac (AC_INIT): Likewise.
5155
e8ec4d9b
PE
5156 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5157 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5158 due to header ordering dependencies. I don't know why the #define
5159 was there.
5160
fa7b79c0
PE
5161 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5162 runtime cost when YYDEBUG is not defined, and so that some tests
5163 that used to fail now work. Problem and initial suggestion by
5164 Paolo Bonzini.
5165 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5166 * data/glr.cc (b4_parser_class_name):
5167 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5168 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5169 (yydebug_) [YYDEBUG]: New member.
5170 (yycdebug_): Now defined only if YYDEBUG.
5171 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5172 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5173 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5174 if YYYDEBUG.
5175 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5176 Define only if YYDEBUG.
5177 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5178 set_debug_level.
5179 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5180 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5181 AT_CHECK_CALC_GLR_CC that are working now.
5182
4ec13d60
PE
51832006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5184
5185 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5186 We don't need them in glr.cc, and glr.c defines them.
5187 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5188 assumes that defining it to anything is the same as defining
5189 it to 1. Problem reported by Paolo Bonzini.
5190
8e1687ae
PE
51912006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5192
5193 * data/c.m4 (b4_null, b4_case): Define.
5194 * src/output.c (prepare_symbols): Use b4_null.
5195 (user_actions_output): Use b4_case.
5196
3dc5e96b
PE
51972006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5198
aef3da86
PE
5199 * data/glr.c (b4_shared_declarations): Put start-header first,
5200 before any #includes that we generate, so that feature-test
5201 macros work. Problem reported by Michael Deutschmann in
5202 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5203 * data/lalr1.cc: Likewise.
5204 * doc/bison.texinfo (Prologue): Document that feature-test macros
5205 should be defined before any Bison declarations.
5206 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5207 that depend on location.hh after, not before, Bison decls, since
5208 we now include location.hh after the first user prologue.
5209
3dc5e96b
PE
5210 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5211 Sander Brandenburg in
5212 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5213 Also, fix minor white space and comment issues.
aef3da86
PE
5214 (Prologue): Mention that it's better to define feature-test macros
5215 before Bison declarations. Problem reported by Michael Deutschmann.
5216
5217 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5218 by Jim Meyering.
5219 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5220 This adjusts to recent gnulib changes.
3dc5e96b 5221
b2a0b7ca
JD
52222006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5223
5224 Finish implementation of per-type %destructor/%printer. Discussed
5225 starting at
5226 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5227 and
5228 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5229 * NEWS (2.3+): Add a description of this feature to the default
5230 %destructor/%printer description.
5231 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5232 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5233 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5234 list node contains a semantic type.
5235 * src/symtab.c, src/symtab.h: Extend with a table that associates
5236 semantic types with their %destructor's and %printer's.
5237 (semantic_type_from_uniqstr, semantic_type_get,
5238 semantic_type_destructor_set, semantic_type_printer_set): New functions
5239 composing the public interface of that table.
5240 (symbol_destructor_get, symbol_destructor_location_get,
5241 symbol_printer_get, symbol_printer_location_get): If there's no
5242 per-symbol %destructor/%printer, look up the per-type before trying
5243 the default.
5244 * tests/actions.at (Per-type %printer and %destructor): New test case.
5245 * tests/input.at (Default %printer and %destructor redeclared):
5246 Extend to check that multiple occurrences of %symbol-default in a
5247 single %destructor/%printer declaration is an error.
5248 (Per-type %printer and %destructor redeclared, Unused values with
5249 per-type %destructor): New test cases.
5250
3be03b13
JD
52512006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5252
5253 Require default %destructor/%printer to be declared using
5254 %symbol-default instead of an empty symbol list, and start working on
5255 new per-type %destructor/%printer. Discussed at
5256 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5257 * NEWS (2.3+): Add %symbol-default to example.
5258 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 5259 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
5260 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5261 (generic_symlist, generic_symlist_item): New nonterminals for creating
5262 a list in which each item is a symbol, semantic type, or
5263 %symbol-default.
5264 (grammar_declaration): Use generic_symlist in %destructor and %printer
5265 declarations instead of symbols.1 or an empty list.
5266 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5267 for changes to symbol_list.
5268 * src/reader.c: Update for changes to symbol_list.
5269 * src/scan-code.l: Likewise.
5270 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5271 * src/symlist.c, src/symlist.h: Extend such that a list node may
5272 represent a semantic type or a %symbol-default in addition to just an
5273 ordinary symbol. Add switched functions for setting %destructor's and
5274 %printer's.
5275 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5276 %destructor/%printer declarations.
5277
3508ce36
JD
52782006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5279
5280 Whether the default %destructor/%printer applies to a particular symbol
5281 isn't a question of whether the user *declares* that symbol (in %token,
5282 for example). It's a question of whether the user by any means
5283 *defines* the symbol at all (by simply using a char token, for
5284 example). $end is defined by Bison whereas any other token with token
5285 number 0 is defined by the user. The error token is always defined by
5286 Bison regardless of whether the user declares it with %token, but we
5287 may one day let the user define error as a nonterminal instead.
5288 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5289 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5290 the meaning of "user-defined".
5291 * tests/actions.at (Default %printer and %destructor for user-declared
5292 end token): Rename to...
5293 (Default %printer and %destructor for user-defined end token): ...
5294 this.
5295
5296 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5297 computation of whether to apply the default, don't maintain a list of
5298 every Bison-defined symbol. Instead, just check for a first character
5299 of '$', which a user symbol cannot have, and check for the error token.
5300
9350499c
JD
53012006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5302
5303 Don't apply the default %destructor or %printer to the error token,
5304 $undefined, or $accept. This change fits the general rule that the
5305 default %destructor and %printer are only for user-declared symbols,
5306 and it solves several difficulties that are described in the new test
5307 cases listed below.
5308 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5309 * tests/actions.at (Default %printer and %destructor are not for error
5310 or $undefined, Default %printer and %destructor are not for $accept):
5311 New test cases.
5312
4d7370cb
JD
53132006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5314
5315 Allow %start after the first rule.
5316 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5317 when parsing the first rule.
5318 (check_and_convert_grammar): Search for it here after all grammar
5319 declarations have been parsed. Skip midrules, which have dummy LHS
5320 nonterminals.
5321 * src/symtab.c (symbol_is_dummy): New function.
5322 * src/symtab.h (symbol_is_dummy): Declare it.
5323 * tests/input.at (%start after first rule): New test.
5324
6d0ef4ec
JD
53252006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5326
5327 Redo some of the previous commit: add back the ability to use
5328 non-aliased/undeclared string literals since it might be useful to
5329 those declaring %token-table.
5330 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5331 commit: don't worry about complaints from symbols_pack.
5332 * src/symtab.c (symbol_new, symbol_class_set,
5333 symbol_check_alias_consistency): Undo changes in previous commit: count
5334 each string literal as a new symbol and token, assign it a symbol
5335 number, and don't complain about non-aliased string literals.
5336 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5337 and token counts but does still set aliased tokens to the same number,
5338 symbol_pack_processor now leaves empty slots in the symbols array.
5339 Remove those slots.
5340 * tests/regression.at (Undeclared string literal): Remove test case
5341 added in previous commit since non-aliased string literals are allowed
5342 again.
5343 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5344 remove unnecessary string literal declarations.
5345 * tests/sets.at (Firsts): Likewise.
5346
965537bc
JD
53472006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5348
5349 Don't allow an undeclared string literal, but allow a string literal to
5350 be used before its declaration.
5351 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5352 symbols_pack complained.
5353 * src/symtab.c (symbol_new): Don't count a string literal as a new
5354 symbol.
5355 (symbol_class_set): Don't count a string literal as a new token, and
5356 don't assign it a symbol number since symbol_make_alias does that.
5357 (symbol_make_alias): It's not necessary to decrement the symbol and
5358 token counts anymore. Don't assume that an alias declaration occurs
5359 before any uses of the identifier or string, and thus don't assert that
5360 one of them has the highest symbol number so far.
5361 (symbol_check_alias_consistency): Complain if there's a string literal
5362 that wasn't declared as an alias.
5363 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5364 symbol_pack asserts that every token has been assigned a symbol number
5365 although undeclared string literals have not.
5366 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 5367 string literal): New test cases.
965537bc
JD
5368 (Characters Escapes, Web2c Actions): Declare string literals as
5369 aliases.
5370 * tests/sets.at (Firsts): Likewise.
5371
47aee066
JD
53722006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5373
5374 In the grammar scanner, STRING_FINISH unclosed constructs and return
5375 them to the parser in order to improve error messages.
5376 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5377 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5378 * tests/input.at (Unclosed constructs): New test case.
5379 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5380 seen.
5381
5382 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5383 unused global.
5384
1f6b3679
JD
53852006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5386
5387 Handle string aliases for character tokens correctly.
5388 * src/symtab.c (symbol_user_token_number_set): If the token has an
5389 alias, check and set its alias's user token number instead of its own,
5390 which is set to indicate the alias. Previously, every occurrence of
5391 the character token in the grammar overwrote that alias indicator with
5392 the character code.
5393 * tests/input.at (String aliases for character tokens): New test.
5394
219741d8
JD
53952006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5396
5397 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5398
11daa4e7
PE
53992006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5400
5401 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5402 to prevent failures when building on older platforms.
5403 Check for autopoint failure.
5404 Set XGETTEXT_OPTIONS to values that check for C format strings,
5405 so that translators are warned about them (this also helps
5406 prevent core dumps).
5407
5408 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5409 function, since it simplifies our code a bit.
5410
5411 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5412 rather than -W, so we don't get bogus warnings about sign comparisons.
5413 Add -Wpointer-arith, since that warning is useful (it reports code
5414 that does not conform to C89 and that some compilers reject).
5415 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5416 since it's no longer needed.
5417
f9bfc42a
JD
54182006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5419
5420 Clean up scanners a bit.
5421 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5422 definitions so gcc won't warn when obstack_for_string is unused.
5423 * src/scan-code.l: config.h and system.h are already #include'd by
5424 scan-code-c.c, so get rid of them here.
5425 * src/scan-gram.l: Likewise.
5426 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5427 definitions rather than duplicating the rest of it.
5428 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5429
06e8700a
JD
54302006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5431
5432 Suppress signed/unsigned comparison warnings for yycheck.
5433 * data/c.m4 (b4_safest_int_type): New macro.
5434 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5435 a signed int type, cast it to b4_safest_int_type first.
5436 * data/yacc.c: Likewise.
5437 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5438 also overwritten.
5439
9c437126
PE
54402006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5441
5442 * doc/bison.texinfo: Fix some typos.
5443
284d8a13
PE
54442006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5445
5446 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5447 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5448
5449 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5450 the latest gnulib does this a different way.
5451 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5452 translation was patched, so stop omitting it.
5453
ec5479ce
JD
54542006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5455
5456 Enable declaration of default %printer/%destructor. Make the parser
5457 use these for all user-declared grammar symbols for which the user does
5458 not declare a specific %printer/%destructor. Thus, the parser uses it
5459 for token 0 if the user declares it but not if Bison generates it as
5460 $end. Discussed starting at
5461 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5462 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5463 and
5464 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5465 * NEWS (2.3+): Mention.
5466 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5467 declare a %destructor for a mid-rule's semantic value. It's just
5468 impossible to declare one specific to it.
5469 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5470 code. Describe default %destructor form.
5471 * src/parse-gram.y (grammar_declaration): Parse default
5472 %printer/%destructor declarations.
5473 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5474 and symbol_destructor_location_get rather than accessing the destructor
5475 and destructor_location members of struct symbol.
5476 (symbol_printers_output): Likewise but for %printer's.
5477 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5478 again.
5479 * src/symtab.c (default_destructor, default_destructor_location,
5480 default_printer, default_printer_location): New static global
5481 variables to record the default %destructor and %printer.
5482 (symbol_destructor_get, symbol_destructor_location_get,
5483 symbol_printer_get, symbol_printer_location_get): New functions to
5484 compute the appropriate %destructor and %printer for a symbol.
5485 (default_destructor_set, default_printer_set): New functions to set the
5486 default %destructor and %printer.
5487 * src/symtab.h: Prototype all those new functions.
5488 * tests/actions.at (Default %printer and %destructor): New test to
5489 check that the right %printer and %destructor are called, that they're
5490 not called for $end, and that $$ and @$ work correctly.
5491 (Default %printer and %destructor for user-declared end token): New
5492 test to check that the default %printer and %destructor are called for
5493 a user-declared end token.
5494 * tests/input.at (Default %printer and %destructor redeclared, Unused
5495 values with default %destructor): New tests to check related grammar
5496 warnings and errors.
5497
868d2d96
JD
54982006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5499
5500 Clean up handling of %destructor for the end token (token 0).
5501 Discussed starting at
5502 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5503 and
5504 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5505
5506 Make the skeletons consistent in how they pop the end token and invoke
5507 its %destructor.
5508 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5509 state, which has token number 0, since this would invoke the
5510 %destructor for the end token.
5511 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5512 until after shifting the end token, or else it won't be popped.
5513 * data/yacc.c (yyparse): Likewise.
5514
5515 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5516 it's the end token. Upon termination, destroy an unshifted lookahead
5517 even when it's the end token.
5518 * data/lalr1.cc (yy::parser::parse): Likewise.
5519 * data/yacc.c (yyparse): Likewise.
5520
5521 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5522 value warnings for the end token when the user gives the end token a
5523 %destructor.
5524
5525 * tests/actions.at (Printers and Destructors): Test all the above.
5526
62a9592d
PE
55272006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5528
5529 Update to latest gnulib and gettext versions.
5530 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5531 Add fopen-safer.
5532 (gnulib_files): Add m4/warning.m4. Don't worry about files
5533 overwritten by autopoint.
5534 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5535 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5536 rejects them.
5537 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5538 so that we can remove the intl files at a better time.
5539 (intl_files_to_remove): Remove aclocal.m4, since it gets
5540 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5541 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5542 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5543 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5544 Remove datarootdir hack; no longer needed.
5545 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5546 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5547 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5548 strdup.h.
5549 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5550 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5551
10d6970f
PE
55522006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5553
5554 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5555 it with --assume-autoconf='latest-stable'.
5556
50a33993
JD
55572006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5558
5559 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5560 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5561 YYSTYPE' and `{'.
5562 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5563 those from muscle_tab.c since the old ones are misleading.
5564
2ce4ed68
AD
55652006-07-13 Akim Demaille <akim@epita.fr>
5566
5567 Support %define "KEY" {VALUE}.
5568 * src/scan-code.h, src/scan-code.l (translate_action)
5569 (translate_rule_action, translate_symbol_action, translate_code):
5570 Return char *, not const char *.
5571 * src/parse-gram.y (declaration): Rename as...
5572 (prologue_declaration): this.
5573 (string_content): Remove this nonterminal, use STRING.
5574 (braceless, content, content.opt): New nonterminal.
5575 Use them.
5576 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5577 as value.
5578 * src/scan-gram.l (getargs.h): Don't include it.
5579
db7e5eb5
PE
55802006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5581
5582 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5583 rather than a for-loop that declares a local bool variable. This
5584 should work around a compatibility problem with a Cray x1e C++
5585 compiler reported by Hung Nguyen in
5586 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5587 The for-loop was introduced in the 2004-11-17 change but I don't
5588 know why it was needed.
5589
a5d80ba5
AD
55902006-07-12 Akim Demaille <akim@epita.fr>
5591
5592 * data/c.m4: Comment changes.
5593
23eb2a69
AD
55942006-07-10 Akim Demaille <akim@lrde.epita.fr>
5595
5596 * src/complain.c (error_message, ERROR_MESSAGE): New.
5597 To factor...
5598 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5599 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5600
ddc8ede1
PE
56012006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5602
5603 * NEWS: Instead of %union, you can define and use your own union type
5604 YYSTYPE if your grammar contains at least one <type> tag.
5605 Your YYSTYPE need not be a macro; it can be a typedef.
5606 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5607 (Union Decl, Decl Summary): Document this.
5608 * data/glr.c (YYSTYPE): Implement this.
5609 * data/glr.cc (YYSTYPE): Likewise.
5610 * data/lalr1.cc (YYSTYPE): Likewise.
5611 * data/yacc.c (YYSTYPE): Likewise.
5612 * src/output.c (prepare): Output tag_seen_flag.
5613 * src/parse-gram.y (declaration, grammar_declaration):
5614 Use 'union_seen' rather than 'typed' to determine whether
5615 %union has been seen, since grammars can now be typed without
5616 %union.
5617 (symbol_declaration, type.opt, symbol_def):
5618 Keep track of whether a tag has been seen.
5619 * src/reader.c (union_seen, tag_seen): New vars.
5620 (typed): remove.
5621 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5622 * src/scan-code.l (untyped_var_seen): New variable.
5623 (handle_action_dollar): Adjust to above changes.
5624 (handle_action_dollar, handle_action_at):
5625 Improve overflow checking for outlandish numbers.
5626 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5627 avoid new diagnostics generated by above changes.
5628 * tests/regression.at (YYSTYPE typedef): Add test to check
5629 for type tags without %union.
5630
5631 * src/symlist.c (symbol_list_length): Return int, not unsigned
5632 int, since callers expect int. This may need to get revisited
5633 once we have proper integer overflow checking.
5634
5635 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5636 object is now static.
5637
5638 * src/getargs.c (flags_argmatch): Return void, not int,
5639 to pacify ./configure --enable-gcc-warnings.
5640
5641 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5642 since last_string is already defined to FLEX_PREFIX (last_string).
5643
7b42569e
AD
56442006-07-09 Akim Demaille <akim@lrde.epita.fr>
5645
5646 Implement --warnings/-W.
5647 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5648 replaced by...
5649 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5650 Adjust callers.
5651 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5652 (warnings_args, warnings_types): New.
5653 (getargs, short_options, long_options): Accept -W/--warnings.
5654 Sort the options by alphabetical order, upper case letter right
5655 before its lower case.
5656
3b452f4e
JD
56572006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5658
5659 Change %merge result type clash warnings to errors. Discussed at
5660 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5661 * src/reader.c (record_merge_function_type): Use complain_at.
5662 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5663 declared later): Update test case results.
5664
b8a41559
AD
56652006-07-09 Akim Demaille <akim@lrde.epita.fr>
5666
5667 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5668 to be in alphabetical order.
5669 (trace_args): Spelling fixes.
5670
cd9e1ba2
PE
56712006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5672
5673 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5674 so they don't collide with user-defined macros.
5675 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5676 this was never guaranteed, and now that we're using gnulib stdint,
5677 which defines int_fast16_t to long int, the problem is exposed.
5678
cb48f191
PE
56792006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5680
b8445a15
PE
5681 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5682 need the full POSIX semantics (and weren't implementing them
5683 anyway).
5684
cb48f191
PE
5685 Adjust to Autoconf 2.60 and today's gnulib.
5686 * bootstrap (gnulib_modules): Add stdint.
5687 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5688 no longer copies it.
5689 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5690 since stdint needs the former and wcwidth (which is now required
5691 by mbswidth) needs the latter.
5692 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5693 work around a compatibility glitch between gettext 0.14.6 and
5694 Autoconf 2.60.
5695 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5696 Do not check for uintptr_t, since new stdint module does the right
5697 thing.
5698 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5699 Add stdint.h, stdint_.h, wcwidth.h.
5700 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5701 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5702 stdint.m4, wchar_t.m4, wcwidth.m4.
5703 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5704 usual order for ../lib/*.h files.
5705 (file_name_split): Use last_component, not base_name, to adjust
5706 to gnulib changes.
5707 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5708 for ../lib/*.h files.
5709 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5710 Define unconditionally, since we now assume the stdint module.
5711 * src/scan-skel.l: Include <dirname.h>.
5712 (BASE_QPUTS): Use last_component, not base_name.
5713 * src/system.h: Include <unlocked-io.h> in the usual order
5714 for ../lib/*.h files. Include <stdint.h> unconditionally,
5715 since we now use the stdint module.
5716 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5717 HAVE_UINTPTR_T, since we now use the stdint module.
5718 (base_name): Remove decl, since files now include <dirname.h>
5719 to get the decl.
5720
cd48d21d
AD
57212006-07-08 Akim Demaille <akim@lrde.epita.fr>
5722
5723 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5724 New, default to 1.
5725 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5726 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5727 default.
5728 * tests/calc.at: Adjust.
5729
8ec0a172
AD
57302006-07-08 Akim Demaille <akim@lrde.epita.fr>
5731
b8445a15 5732 * data/c.m4 (b4_basename): New.
8ec0a172
AD
5733 (b4_syncline): Also output the location of its invocation (from
5734 the skeleton).
5735 (b4_user_action, b4_define_user_action, b4_user_actions)
5736 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5737 (b4_user_stype): New.
5738 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5739
4a678af8
JD
57402006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5741
5742 In the grammar file, the first column is 1 not 0 on the first line as
5743 on every other line.
5744 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5745 * tests/input.at (Torturing the Scanner): Update output.
5746
5747 * src/scan-gram.l (scanner_cursor): Declare it static.
5748
dd60572a
JD
57492006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5750
5751 In warnings, say "previous declaration" rather than "first
5752 declaration".
5753 * src/symtab.c (redeclaration): Do that here.
5754 * src/reader.c (record_merge_function_type): In the case of a result
5755 type clash, report the previous declaration rather than the very first
5756 one in the grammar file.
5757 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5758 declared later): Add a third declaration to check this behavior.
5759 * tests/input.at (Incompatible Aliases): Update output.
5760
2073e1b6
AD
57612006-06-27 Akim Demaille <akim@epita.fr>
5762
5763 * doc/Doxyfile.in: New.
5764 * doc/Makefile.am: Use it.
5765 * src/lalr.h, src/symtab.h: Initial doxygenation.
5766
8ee5b538
JD
57672006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5768
5769 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
5770 declared after the %merge. This continues the effort of the previous
5771 patch.
8ee5b538
JD
5772 * src/reader.c (get_merge_function): Don't set the merger type yet.
5773 (record_merge_function_type): New function for setting the merger type
5774 and checking for clashes.
5775 (grammar_current_rule_merge_set): Set the location of the %merge for
5776 the current rule.
5777 (packgram): Invoke record_merge_function_type for each rule now that
5778 all symbol type declarations have been parsed.
5779 * src/reader.h (merger_list.type_declaration_location): New member
5780 storing the location of the first %merge from which the type for this
5781 merging function was derived.
5782 * src/symlist.h (symbol_list.merger_declaration_location): New member
5783 storing the location of a rule's %merge, if any.
5784 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5785 declared later): New test to catch the error fixed by the above patch.
5786
ffa4ba3a
JD
57872006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5788
5789 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
5790 declarations appear after the rules. Discussed at
5791 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5792 and
5793 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5794 Don't mistake the type of $$ in a midrule to be that of its parent
5795 rule's $$.
ffa4ba3a
JD
5796 * src/reader.c (grammar_current_rule_end): Don't invoke
5797 grammar_rule_check yet since not all symbol declarations may have been
5798 parsed yet.
5799 (grammar_midrule_action): Likewise.
5800 Don't record whether the midrule's $$ has been used yet since actions
5801 haven't been translated yet.
5802 Record the midrule's parent rule and its RHS index within the parent
5803 rule.
5804 (grammar_current_rule_action_append): Don't translate the action yet
5805 since not all symbol declarations may have been parsed yet and, thus,
5806 warnings about types for $$, $n, @$, and @n can't be reported yet.
5807 (packgram): Translate the action and invoke grammar_rule_check now that
5808 all symbol declarations have been parsed.
5809 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5810 after parsing the entire grammar file, the symbol list here in the case
5811 of a midrule is actually the midrule's empty RHS, so reference its
5812 parent rule's RHS where necessary.
5813 On the other hand, now that you can already know it's a midrule, you
5814 aren't forced to think $$ has the same type as its parent rule's $$.
5815 (handle_action_at): In the case of a midrule, reference the parent rule
5816 where necessary.
5817 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5818 members.
5819 (symbol_list_length): Now that this is invoked after all rules have
5820 been parsed, a NULL symbol (rather than a NULL symbol list node)
5821 terminates a rule. symbol_list_print already does this correctly.
5822 * src/symlist.h (symbol_list.midrule_parent_rule,
5823 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5824 remember their relationships with their parents.
5825 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5826 fixed by the above patch.
5827 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5828 implementing...
5829 (Unused values): ... this old test case and...
5830 (Unused values before symbol declarations): ... this new test case.
5831 This one is the same as `Unused values' except that all symbol
5832 declarations appear after the rules in order to catch the rest of the
5833 errors fixed by the above patch.
5834
e256e17f
JD
58352006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5836
300a1930
JD
5837 More cleanup.
5838 * src/reader.c (current_rule): Declare it static since it's no longer
5839 used outside this file.
5840 (grammar_current_rule_action_append): Remove redundant arguments from
5841 translate_rule_action invocation.
5842 * src/reader.h (current_rule): Remove this unused extern.
5843 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5844 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 5845
381ecb06
JD
58462006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5847
5848 Clean up yesterday's patch.
5849 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5850 to...
5851 * src/reader.c (grammar_current_rule_action_append): ... here for
5852 consistency with grammar_current_rule_symbol_append.
5853 * tests/regression.at (Braced code in declaration in rules section):
5854 Make yyerror and yylex static as usual.
5855
4210cd0b
JD
58562006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5857
5858 Fix bug that mistakes braced code in a declaration in the rules section
5859 to be a rule action. Mentioned at
5860 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5861 * src/scan-gram.l: Move midrule action detection from the start of the
5862 scanning of any braced code to...
5863 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5864 action. For readability, use $2 and @2 rather than the equivalent
5865 global variables.
5866 * tests/regression.at (Braced code in declaration in rules section):
5867 New test to catch the error fixed by the above patch.
5868
5869 Work on code readability some.
5870 * src/scan-code.l (current_rule): Get rid of this misleading and
5871 redundant declaration: it's actually extern'ed in reader.h.
5872 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5873 translate_action): Add a rule argument and use it instead of the global
5874 current_rule.
5875 (translate_rule_action): This already receives current_rule through an
5876 argument, so pass it on to translate_action instead of assigning
5877 current_rule to current_rule.
5878 (translate_symbol_action, translate_code): Pass rule = NULL to
5879 translate_action.
5880
34f98f46
JD
58812006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5882
5883 Rename %before-definitions to %start-header and %after-definitions to
5884 %end-header. Don't use these declarations to separate pre-prologue
5885 blocks from post-prologue blocks. Add new order-independent
5886 declarations %before-header and %after-header as alternatives to the
5887 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5888 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5889 * NEWS (2.3+): Update for these changes.
5890 * data/glr.c (b4_before_definitions): Update to...
5891 (b4_start_header): ... this.
5892 (b4_after_definitions): Update to...
5893 (b4_end_header): ... this.
5894 * data/glr.cc: Likewise.
5895 * data/lalr1.cc: Likewise.
5896 * data/yacc.c: Likewise.
5897 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5898 prologue blocks with %*-header declarations.
5899 (Calc++ Parser): Likewise.
91661ebb 5900 (Decl Summary): Update names.
148d66d8 5901 (Table of Symbols): Update description.
34f98f46
JD
5902 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5903 (PERCENT_END_HEADER): ... this.
5904 (PERCENT_BEFORE_DEFINITIONS): Update to...
5905 (PERCENT_START_HEADER): ... this.
5906 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5907 (declaration): Update token names and m4 macro names.
5908 When parsing %end-header and %start-header, invoke translate_code
5909 before muscle_code_grow, and no longer set global booleans to remember
5910 whether these declarations have been seen.
5911 Parse new %after-header and %before-header.
5912 * src/reader.c (before_definitions, after_definitions): Remove.
5913 (prologue_augment): Accept a new bool argument to specify whether to
5914 augment the pre-prologue or post-prologue.
5915 * src/reader.h (before_definitions, after_definitions): Remove these
5916 extern's.
5917 (prologue_augment): Add new bool argument.
5918 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5919 (PERCENT_END_HEADER): ... this.
5920 (PERCENT_BEFORE_DEFINITIONS): Update to...
5921 (PERCENT_START_HEADER): ... this.
5922 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5923 * tests/actions.at (Printers and Destructors): Update names.
5924
31b2b07e
JD
59252006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5926
5927 Add comparison operators for C++ location classes. Discussed at
5928 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5929 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5930 declaration indicating whether filename_type has an operator==. If
5931 filename_type is `std::string', it defaults to `1', `0' otherwise.
5932 * data/location.cc: Iff b4_define_location_comparison is `1', add
5933 operator== and operator!= for class position and for class location.
5934
5935 Some minor fixes.
5936 * src/scan-action.l: Remove unused file.
5937 * src/symtab.c (symbol_printer_set): Use printer_location not
5938 destructor_location.
5939 * src/symtab.h (struct symbol): Replace incorrect source comment for
5940 printer members.
5941 * tests/input.at (Incompatible Aliases): Update output with correct
5942 printer location.
5943
9bc0dd67
JD
59442006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5945
5946 Don't put the pre-prologue in the header file. For the yacc.c code
5947 file and the glr.c header and code files, move the pre-prologue before
5948 the token definitions. Add new %before-definitions and
5949 %after-definitions to declare code that will go in both the header file
5950 and code file. Discussed at
5951 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5952 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5953 and
5954 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5955 * NEWS (2.3+): Describe these changes.
5956 * data/glr.c (b4_pre_prologue): Move from within to before...
5957 (b4_shared_declarations): ... this.
5958 Add new b4_before_definitions before b4_token_enums.
5959 Add new b4_after_definitions at the end.
5960 * data/glr.cc (b4_pre_prologue): Replace with...
5961 (b4_before_definitions): ... this in the header file.
5962 (b4_after_definitions): New near the end of the header file.
5963 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5964 code file right before including the header file.
5965 (b4_before_definitions): New in the previous position of
5966 b4_pre_prologue in the header file.
5967 (b4_after_definitions): New near the end of the header file.
5968 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5969 (b4_token_enums_defines): In the code file, move to right before
5970 YYSTYPE for consistency with the header file.
5971 (b4_before_definitions): New right before b4_token_enums_defines in
5972 both the header and code file.
5973 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5974 header and code file.
5975 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5976 of prologues for %union dependencies.
91661ebb
JD
5977 (Decl Summary): In %defines description, mention the effect of
5978 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
5979 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5980 than in the pre-prologue so that make check succeeds.
148d66d8 5981 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
5982 %after-definitions.
5983 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5984 %before-definitions.
5985 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5986 (declaration): Parse those declarations and append to
5987 b4_before_definitions and b4_after_definitions, respectively.
5988 * src/reader.c (before_definitions, after_definitions): New bools to
5989 track whether those declarations have been seen.
5990 (prologue_augment): Add to the post-prologue if %union,
5991 %before-definitions, or %after-definitions has been seen.
5992 * src/reader.h (before_definitions, after_definitions): New extern's.
5993 * src/scan-gram.l: Scan the new declarations.
5994 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5995 prologue block in a %before-definitions or a %after-definitions based
5996 on whether the %union is declared.
5997 * tests/regression.at (Early token definitions with --yacc, Early token
5998 definitions without --yacc): Move tests for token definitions into the
5999 post-prologue since token names are no longer defined in the
6000 pre-prologue.
6001
203b9274
AD
60022006-06-20 Akim Demaille <akim@epita.fr>
6003
6004 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
6005 (symbol_get): Use it.
6006 * src/parse-gram.y: Use it.
6007
a7ee59cf
JD
60082006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
6009
6010 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
6011 build succeeds when configured with --enable-gcc-warnings.
6012
5a2baae7
PE
60132006-06-19 Paul Eggert <eggert@cs.ucla.edu>
6014
33ad1a9c
PE
6015 * src/parse-gram.y (char_name): New function.
6016 (CHAR, STRING, string_content): For %printer, properly escape.
6017 (ID): Prefer fputs to fprintf.
6018 (id): Reindent to be consistent with other rules.
6019 Properly quote char.
6020
5a2baae7
PE
6021 The Translation Project changed its way of publishing translations
6022 to maintainers. I haven't received any responses to my request
6023 for supporting the old way, or for documenting the new way. I
6024 have modified 'bootstrap' to use screen scraping
6025 (in this case, HTML scraping). This is unreliable and inelegant,
6026 but I don't see any better way. Yuck.
6027 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6028 (get_translations): New function, which uses HTML scraping to
6029 deduce locations of latest translations.
6030 Use this function to grab both bison and bison-runtime .po files.
6031 Don't bother priming the pump for the runtime-po domain any more,
6032 as it's now translated better than bison is.
6033
58d7a1a1
AD
60342006-06-19 Akim Demaille <akim@epita.fr>
6035
6036 * src/scan-gram.l: No longer "parse" things after `%union' until
6037 `{'. Rather, return a single "%union" token.
6038 No longer make symbols: return strings, and leave the conversion
6039 to symbols to the parser.
6040 (SC_PRE_CODE, token_type): Remove.
6041 * src/parse-gram.y (%union): New field `character'.
6042 Sort tokens.
6043 (CHAR): New token.
6044 (ID, ID_COLON): Now that the scanner no longer makes them
6045 identifiers, adjust all uses to invoke symbol_get.
6046 (id_colon): New, wraps the conversion from string to symbol.
6047 (%union): Accept a possible union_name.
6048 (symbol): Now can be a char.
6049 * data/c.m4 (b4_union_name): Leave a default value.
6050 * data/glr.c, data/yacc.c: Use it.
6051
b931235e
JD
60522006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6053
6054 For associating token numbers with token names for "yacc.c", don't use
6055 #define statements unless `--yacc' is specified; always use enum
6056 yytokentype. Most important discussions start at:
6057 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6058 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6059 and
6060 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6061 * NEWS (2.3+): Mention.
6062 * data/c.m4 (b4_yacc_if): New.
6063 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6064 token #define's.
6065 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6066 on token name definitions.
6067 * src/getargs.c (usage): Capitalize `Yacc' in English.
6068 * src/output.c (prepare): Define b4_yacc_flag.
6069 * tests/regression.at (Early token definitions): Test that tokens names
6070 are defined before the pre-prologue not just before the post-prologue.
6071 Remove this test case and copy to...
6072 (Early token definitions with --yacc): ... this to test #define's.
6073 (Early token definitions without --yacc): ... and this to test enums.
6074
9e6e7ed2
PE
60752006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6076
6077 * NEWS: Reword the post-2.3 change to not be so optimistic about
6078 removing the old "look-ahead" spelling.
6079 Update previous look-ahead/lookahead change reports.
6080 * REFERENCES: look-ahead -> lookahead (since that's
6081 what he actually wrote).
6082 * doc/refcard.tex: look ahead -> lookahead,
6083 look-ahead -> lookahead
6084
742e4900
JD
60852006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6086
6087 For consistency, use `lookahead' instead of `look-ahead' or
6088 `look_ahead'. Discussed starting at
6089 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6090 and then at
6091 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6092 * NEWS: For the next release, note the change to `--report'.
6093 * TODO, doc/bison.1: Update English.
6094 * doc/bison.texinfo: Update English.
6095 (Understanding Your Parser, Bison Options): Document as
6096 `--report=lookahead' rather than `--report=look-ahead'.
6097 * src/conflicts.c: Update English in comments.
6098 (lookahead_set): Rename from look_ahead_set.
6099 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6100 (resolve_sr_conflict): Rename local look_ahead_tokens to
6101 lookahead_tokens, and update other uses.
6102 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6103 count_rr_conflicts, conflicts_free): Update uses.
6104 * src/getargs.c (report_args): Move "lookahead" before alternate
6105 spellings.
6106 (report_types): Update uses.
6107 (usage): For `--report' usage description, state `lookahead' spelling
6108 rather than `look-ahead'.
6109 * src/getargs.h (report.report_lookahead_tokens): Rename from
6110 report_look_ahead_tokens.
6111 * src/lalr.c: Update English in comments.
6112 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6113 (state_lookahead_tokens_count): Rename from
6114 state_look_ahead_tokens_count.
6115 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6116 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6117 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6118 Update other uses.
6119 Update English in output.
6120 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6121 * src/print.c: Update English in comments.
6122 (lookahead_set): Rename from look_ahead_set.
6123 (print_reduction): Rename argument lookahead_token from
6124 look_ahead_token.
6125 (print_core, state_default_rule, print_reductions, print_results):
6126 Update uses.
6127 * src/print_graph.c: Update English in comments.
6128 (print_core): Update uses.
6129 * src/state.c: Update English in comments.
6130 (reductions_new): Update uses.
6131 (state_rule_lookahead_tokens_print): Rename from
6132 state_rule_look_ahead_tokens_print, and update other uses.
6133 * src/state.h: Update English in comments.
6134 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6135 (state_rule_lookahead_tokens_print): Rename from
6136 state_rule_look_ahead_tokens_print.
6137 * src/tables.c: Update English in comments.
6138 (conflict_row, action_row): Update uses.
6139 * tests/glr-regression.at
6140 (Incorrect lookahead during deterministic GLR,
6141 Incorrect lookahead during nondeterministic GLR): Rename
6142 print_look_ahead to print_lookahead.
6143 * tests/torture.at: Update English in comments.
6144 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6145 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6146 (Many lookahead tokens): Update uses.
6147 * data/glr.c: Update English in comments.
6148 * lalr1.cc: Likewise.
6149 * yacc.c: Likewise.
6150 * src/conflicts.h: Likewise.
6151 * src/lalr.h: Likewise.
6152 * src/main.c: Likewise.
6153 * src/output.c: Likewise.
6154 * src/parse-gram.c: Likewise.
6155 * src/tables.h: Likewise.
6156 * tests/calc.at: Likewise.
6157
3c40d0b5
JD
61582006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6159
6160 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6161
5d278082
PE
61622006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6163
6164 * TODO: Add request from Nelson H. F. Beebe to be able to install
6165 Bison without installing the yacc script.
6166
9e668899
JD
61672006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6168
6169 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6170 and yytext if they're already #define'd.
6171 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6172 * src/scan-code-c.c: ... here.
6173 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6174 <config.h>.
6175
0c8e079f
JD
61762006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6177
6178 Get Bison to build again when configured with --enable-gcc-warnings.
6179 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6180 missing #include's.
6181 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6182 loc argument as it shadows a global.
6183 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6184 invocation.
6185
6186 * src/.cvsignore: Add scan-code.c.
6187
2346344a
AD
61882006-06-07 Akim Demaille <akim@epita.fr>
6189
6190 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6191 to...
6192 * src/scan-code.l: here.
6193 * tests/input.at (Torturing the Scanner): Fix another location
6194 error.
6195
4862bdfd
AD
61962006-06-07 Akim Demaille <akim@epita.fr>
6197
6198 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6199
e9071366
AD
62002006-06-06 Akim Demaille <akim@epita.fr>
6201
6202 Extract the parsing of user actions from the grammar scanner.
6203 As a consequence, the relation between the grammar scanner and
6204 parser is much simpler. We can also split "composite tokens" back
6205 into simple tokens.
6206 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6207 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6208 rename as...
6209 * src/location.h, src/location.c (add_column_width)
6210 (location_compute): these.
6211 Fix the column count: the initial column is 0.
6212 (location_print): Be robust to ending column being 0.
6213 * src/location.h (boundary_set): New.
6214 * src/main.c: Adjust to scanner_free being renamed as
6215 gram_scanner_free.
6216 * src/output.c: Include scan-code.h.
6217 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6218 Use boundary_set.
6219 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6220 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6221 which is now, again, a separate token.
6222 Adjust all dependencies.
6223 Whereever actions with $ and @ are used, use translate_code.
6224 (action): Remove this nonterminal which is now useless.
6225 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6226 (grammar_current_rule_action_append): Use translate_code.
6227 (packgram): Bound check ruleno, itemno, and rule_length.
6228 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6229 (last_string, last_braced_code_loc, max_left_semantic_context)
6230 (scanner_initialize, scanner_free, scanner_last_string_free)
6231 (gram_out, gram_lineno, YY_DECL_): Move to...
6232 * src/scan-gram.h: this new file.
6233 (YY_DECL): Rename as...
6234 (GRAM_DECL): this.
6235 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6236 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6237 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6238 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6239 Move these declarations, and...
6240 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6241 these to...
6242 * src/flex-scanner.h: this new file.
6243 * src/scan-gram.l (rule_length, rule_length_overflow)
6244 (increment_rule_length): Remove.
6245 (last_braced_code_loc): Rename as...
6246 (gram_last_braced_code_loc): this.
6247 Adjust to the changes of the parser.
6248 Move all the handling of $ and @ into...
6249 * src/scan-code.l: here.
6250 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6251 (handle_action_dollar, handle_action_at): Move to...
6252 * src/scan-code.l: here.
6253 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6254 scan-code.h, scan-code-c.c, scan-gram.h.
6255 (EXTRA_bison_SOURCES): Add scan-code.l.
6256 (BUILT_SOURCES): Add scan-code.c.
6257 (yacc): Be robust to white spaces.
6258
6259 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6260 * tests/regression.at: Adjust the column numbers.
6261 * tests/regression.at: Adjust the error message.
7891a7c4 6262
184e42f0
JD
62632006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6264
6265 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6266 Use Akim's wording from
6267 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6268
7891a7c4
JD
62692006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6270
6271 Between Bison releases, manually append `+' to the previous Bison
6272 release number, and use that as a signal to automatically print the
6273 ChangeLog's CVS Id keyword from --version. Discussed starting at
6274 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6275 * ChangeLog: Add Id header.
6276 * configure.ac (AC_INIT): Append `+' to `2.3'.
6277 * src/.cvsignore: Add revision.c.
6278 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6279 (BUILT_SOURCES): Add revision.c.
6280 (revision.c): New target rule. This file defines a new global variable
6281 named revision. It initializes it with either the Id from ChangeLog
6282 or, if VERSION doesn't contain `+', with the empty string.
6283 * src/getargs.c (version): Print the value of revision.
6284 * src/revision.h: Extern revision.
6285
4ad3ed84
PE
62862006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6287
6288 * NEWS: Version 2.3.
6289 * configure.ac (AC_INIT): Likewise.
6290
02103984
PE
62912006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6292
6293 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6294 with no arguments, not as an object-like macro. This is for
6295 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6296 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6297 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6298 Document this.
6299
2c08afa5
JD
63002006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6301
6302 * src/getargs.c (usage): Back out yesterday's modification of the
6303 --help output so that we don't have to wait for translation before
6304 releasing 2.3.
6305
6077da58
PE
63062006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6307
6308 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6309 Problem reported by Akim Demaille.
6310
2a26b6c2
JD
63112006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6312
6313 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6314
aefef0d6
PE
63152006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6316
6317 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6318 generated source code. Problem reported by Frans Englich in
6319 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6320
fcd8e201
PE
63212006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6322
6323 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6324 shell, not within 'make', so that 'make' by an ordinary builder
6325 (using GNU make) does not worry about configuring gzip. This also
6326 works around a bug reported independently by Keith Thompson and by
6327 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6328 stderr rather than stdout, messing up the build logs.
6329
7b5cdcbd
JD
63302006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6331
6332 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6333 to make sure that YYID will never be unused. This fixes a 'make
6334 maintainer-check' failure caused by the recent changes to the 'Trivial
6335 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6336 not used.
6337 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6338
5ad0a449
JD
63392006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6340
6341 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6342 state before an empty RHS is always resolved here. Only the location
6343 of that state is guaranteed to be resolved, and that's enough. This
6344 fixes the remaining bug reported by Derek M. Jones in
6345 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6346 * tests/glr-regression.at (Uninitialized location when reporting
6347 ambiguity): Test the above case.
6348 Also, the embedded comments in this test case claim it checks the case
6349 of an empty RHS that has inherited the initial location. However, the
6350 corresponding LHS was already resolved, so yyresolveLocations didn't
6351 actually have reason to modify it. Fix this by forcing
6352 nondeterministic operation at the beginning of the parse.
6353
50cce58e
PE
63542006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6355
6356 * data/c.m4 (b4_yy_symbol_print_generate):
6357 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6358 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6359 of the bugs reported today by Derek M Jones in
6360 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6361 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6362 defined to be a type name without parens or brackets.
6363 (Location Type): Similarly for YYLTYPE.
6364 * tests/regression.at (Trivial grammars): Put in a test for this
6365 bug that will be caught by 'make maintainer-check' (though not,
6366 alas, by 'make check' unless your compiler is picky).
6367
ab8d9dc5
PE
63682006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6369
0d2c8934 6370 * NEWS: Version 2.2.
ab8d9dc5
PE
6371 * configure.ac (AC_INIT): Likewise.
6372
9138c575
JD
63732006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6374
6375 * data/glr.c (yyreportTree): Make room in yystates for the state
6376 preceding the RHS. This fixes the segmentation fault reported by Derek
6377 M. Jones in
6378 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6379 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6380 to the user. Reported for yyreportTree by Derek M. Jones later in the
6381 same thread.
6382 * THANKS: Add Derek M. Jones.
6383 Update my email address.
6384 Fix typo in Steve Murphy's name.
6385
276f48df
PE
63862006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6387
d6645148
PE
6388 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6389 checking against YYLAST that caused the parser to miss a potential
6390 alternative in its diagnostic.
6391 Problem reported by Maria Jose Moron Fernandez in
6392 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6393 * data/lalr1.cc (yysyntax_error_): Likewise.
6394 * data/yacc.c (yysyntax_error): Likewise.
6395 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6396 tokens, in case we run into an older C compiler.
6397 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6398 Use them to check for the off-by-one error fixed above.
6399
276f48df
PE
6400 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6401 YYSIZE_T, not size_t.
6402 * tests/regression.at (Trivial grammars): New test, to catch
6403 the error fixed by the above patch.
6404
cd8b5791
AD
64052006-05-14 Akim Demaille <akim@lrde.epita.fr>
6406
6407 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6408 scheme.
6409 Reported by Steve Murphy.
6410
34376418
AD
64112006-05-14 Akim Demaille <akim@lrde.epita.fr>
6412
6413 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6414 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6415
327afc7c
AD
64162006-05-14 Akim Demaille <akim@lrde.epita.fr>
6417
6418 Implement --trace=m4.
6419 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6420 * src/output.c (output_skeleton): When set, pass -dV to m4.
6421
6422 Factor the handling of flags in m4.
6423 * src/output.c (prepare): Rename the muscle names debug, defines,
6424 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6425 * data/c.m4: Adjust.
6426 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6427 Use b4_define_flag_if to define other b4_FLAG_if macros.
6428 (b4_location_if): As a consequence, rename as...
6429 (b4_locations_if): this, for consistency.
6430 Adjust all the skeletons.
6431
ba9ecd19
AD
64322006-05-14 Akim Demaille <akim@lrde.epita.fr>
6433
6434 * etc/bench.pm: Shorten bench names.
6435
4e83ea15
AD
64362006-05-14 Akim Demaille <akim@lrde.epita.fr>
6437
6438 * src/output.h, src/output.c (error_verbose): Move to...
6439 * src/getargs.h, src/getargs.c: here.
6440 Sort the flags.
6441 Adjust dependencies.
6442
6e93d810
PE
64432006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6444
6445 * data/c.m4 (b4_copyright): Put the special exception for Bison
6446 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
6447 uses changed. Suggested by Akim Demaille. Also, wrap the
6448 copyright notice, in case it is longer than 80 columns. Replace
6449 comma by newline after title.
6e93d810 6450
eaea13f5
PE
64512006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6452
6453 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6454 incompatibility, not a bug. Mention that it wasn't fixed as of
6455 flex 2.5.33.
6456
3cf084ec
AD
64572006-05-11 Akim Demaille <akim@lrde.epita.fr>
6458
6459 * examples/extexi: Enforce the precedence of concatenation over
6460 >>.
0a9f1c7d 6461 Reported by Tommy Nordgren.
3cf084ec 6462
32c96bd7
AD
64632006-05-11 Akim Demaille <akim@lrde.epita.fr>
6464
6465 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6466 with the member "token".
f94705b2 6467 Reported by Martin Nylin.
32c96bd7 6468
eaea13f5
PE
64692006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6470
6471 * data/glr.c: Switch to Bison 2.2 special-exception language in
6472 the copyright notice. Use more-regular format for titles and
6473 copyright notices.
6474 * data/glr.cc: Likewise.
6475 * data/location.cc: Likewise.
6476 * data/yacc.cc: Likewise.
6477 * doc/bison.texinfo (Conditions): Document this.
6478 * NEWS: likewise. Upgrade version to 2.2.
6479
6e2d1146
AD
64802006-04-27 Akim Demaille <akim@lrde.epita.fr>
6481
6482 * data/glr.cc: Remove dead code.
6483
47671055
PE
64842006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6485
6486 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6487 that variable and the line breaks the bootstrap. Problem reported
6488 by Juan M. Guerrero.
6489
ed2e6384
AD
64902006-04-24 Akim Demaille <akim@lrde.epita.fr>
6491
6492 * doc/bison.texinfo (Multiple start-symbols): New.
6493
3cedc2dc
AD
64942006-04-24 Akim Demaille <akim@lrde.epita.fr>
6495
6496 * etc/README, etc/bench.pl: New.
6497
b2ddc3f3
AD
64982006-04-03 Akim Demaille <akim@lrde.epita.fr>
6499
6500 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6501 rule.
6502 Reported by Mickael Labau.
6503 * tests/input.at (Torturing the Scanner): Test it.
6504
91e3ac9a
PE
65052006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6506
6507 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6508 Problem reported by Bob Rossi.
6509
65102006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6511
6512 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6513 and didn't really work.
6514 For the index, use @ifnotinfo, not @iftex.
6515 Minor cleanups of spacing and terminology.
6516
5cf61e93
AD
65172006-03-12 Akim Demaille <akim@lrde.epita.fr>
6518
6519 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6520 of AT_NAME_PREFIX when %name-prefix is not used.
6521
aa08666d
AD
65222006-03-12 Akim Demaille <akim@lrde.epita.fr>
6523
6524 Apply --prefix to C++ skeletons too: they change the namespace.
6525 The test suite already exercize these cases.
6526 * data/c++.m4 (b4_namespace): New.
6527 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6528 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6529 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6530 * doc/bison.texinfo: Document it.
6531 (Option Cross Key): Use @multitable in all formats. It looks
6532 nicer, even in TeX outputs.
6533 (Rules): Use the same code whatever the output type is.
6534 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6535 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6536 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 6537
45567173
AD
65382006-03-10 Akim Demaille <akim@lrde.epita.fr>
6539
6540 * TODO: Remove dead items.
6541
e9d8f881 65422006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
6543
6544 * doc/FAQ: Remove, merged into...
6545 * doc/bison.texinfo (FAQ): this.
6546 * doc/Makefile.am (EXTRA_DIST): Adjust.
6547
c095d689
AD
65482006-03-10 Akim Demaille <akim@lrde.epita.fr>
6549
6550 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6551 even if empty.
6552 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6553 * doc/bison.texinfo (Calc++ Scanner): Use it.
6554
6e0f8287
PE
65552006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6556
6557 Fix two nits reported by twlevo, plus one more that I discovered.
6558
6559 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6560 this is the usual Bison style.
6561 * src/location.h (location_print): Likewise.
6562
6563 * src/reader.h (token_name): Likewise.
6564
d6b771c3
PE
65652006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6566
6567 Fix some nits reported by twlevo.
6568 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6569 and "POSIX". Use more-modern syntax for URLs. Mention C++
6570 and ask for Java. Don't hardwire OS version numbers. Add
6571 copyright notice.
6572 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6573 * src/conflicts.c (solved_conflicts_obstack): Now static.
6574
1e137b71
JD
65752006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6576
6577 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6578 page. Say "you can use it" not "you may use it" as on the web page;
6579 we're describing capabilities not granting permission.
6580
73f2e47e
PE
65812006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6582
6d05403d
PE
6583 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6584 shadowing warnings. Use usual patter for iterating through RHS.
6585 * tests/glr-regression.at
6586 (Uninitialized location when reporting ambiguity):
6587 Modify yylex so that it uses its argument, rather than trying
6588 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6589 const char -> char const.
6590
73f2e47e
PE
6591 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6592 Don't use tabs inside commands; it messes up 'ps'.
6593 Problem reported by twlevo.
6594
8710fc41
JD
65952006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6596
6597 * tests/glr-regression.at (Uninitialized location when reporting
6598 ambiguity): New test case.
6599 * data/glr.c (yyresolveLocations): New function, which uses
6600 YYLLOC_DEFAULT.
6601 (yyresolveValue): Invoke yyresolveLocations before reporting an
6602 ambiguity.
6603 * doc/bison.texinfo (Default Action for Locations): Note
6604 YYLLOC_DEFAULT's usage for ambiguity locations.
6605 (GLR Semantic Actions): Cross-reference those notes.
6606
ae952af2
JD
66072006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6608
6609 * tests/glr-regression.at (Leaked semantic values when reporting
6610 ambiguity): Remove unnecessary union and type declarations.
6611 (Leaked lookahead after nondeterministic parse syntax error): New test
6612 case.
6613 * data/glr.c (yyparse): Check for zero stacks remaining before
6614 attempting to shift the lookahead so that you don't lose it.
6615
35ee866a
JD
66162006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6617
6618 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6619 * tests/glr-regression.at (Leaked semantic values when reporting
6620 ambiguity): New test case.
6621 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6622 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6623 now unnecessary yystackp parameter.
6624 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6625 destructors can be called.
6626
6627 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6628 in existing testcases.
6629
520181ab
JD
66302006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6631
6632 Don't leak semantic values for parent RHS when a user action cuts the
6633 parser, and clean up related code a bit.
6634 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
6635 cuts parse): Rename to...
6636 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
6637 for leaked parent RHS values.
6638 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6639 between an unresolved state (non-empty chain of semantic options) and
6640 an incomplete one (signaled by an empty chain).
ae952af2 6641 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
6642 successfully or unsuccessfully resolved yyGLRState to...
6643 (yyresolveValue): ... here so that yyresolveValue always leaves a
6644 yyGLRState with consistent data and thus is easier to understand.
6645 Remove the yyvalp and yylocp parameters since they are always just
6646 taken from the yys parameter. When reporting a discarded merged value
6647 in debugging output, note that it is incompletely merged. Document the
6648 interface.
6649 (yyresolveAction): If resolving any of the RHS states fails, destroy
6650 them all rather than leaking them. Thus, as long as user actions are
6651 written to clean up the RHS correctly, yyresolveAction always cleans up
6652 the RHS of a semantic option. Document the interface.
6653
18d9185c
PE
66542006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6655
6656 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6657 led to a segmentation fault in GNU Pascal. Problem reported
6658 by Waldek Hebisch.
6659
841a7737
JD
66602006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6661
6662 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6663 mid-rule action inside a nonterminal symbol in order to declare a
6664 destructor for its semantic value.
6665
fc3f467f
PE
66662006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6667
6668 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6669 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6670 __cplusplus && ! defined _STDLIB_H && !
6671 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6672 defined free))]: Include <stdlib.h> rather than rolling our own
6673 declarations of malloc and free, to avoid problems with
6674 incompatible declarations (using 'throw') C++'s stdlib.h. This
6675 should fix Debian bug 340012
6676 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6677 reported by Guillaume Melquiond.
6678
a3af26dd
PE
66792006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6680
4d7bc38c
PE
6681 * NEWS: Clarify symbols versus types in unused-value warnings.
6682
a3af26dd
PE
6683 * configure.ac (AC_INIT): Bump version number.
6684
4e26c69e
PE
66852006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6686
6687 * NEWS: Version 2.1a.
6688 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6689 since C99 requires this.
6690
498e897c
PE
66912006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6692
6693 * m4/c-working.m4: New file.
6694 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6695
57bb17ca
PE
66962006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6697
6698 * Makefile.maint: Merge from coreutils.
6699
0be105dc
PE
67002006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6701
6702 More portability fixes for problems summarized by Nelson H. F. Beebe.
6703
6704 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6705 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6706 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6707 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6708 messes up because C++ code is compiled in 32-bit mode but linked
6709 in 64-bit mode.
6710
6fc0c024
PE
67112006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6712
6713 More portability fixes for problems summarized by Nelson H. F. Beebe.
6714
7870f699
PE
6715 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6716 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6717
6fc0c024
PE
6718 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6719 nodist_PROGRAMS, since we don't need to actually compile the
6720 example if we're just doing a plain 'make'. This avoids bothering
6721 the installer unnecessarily about problems due to weird C++
6722 compilers.
6723
fe6c2fde
PE
67242006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6725
6726 More portability fixes for problems summarized by Nelson H. F. Beebe.
6727
6728 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6729 than #include "...", and compile with -I'.'. The old method was
6730 not portable, according to Posix and the C standard, and it does
6731 not work with Sun C 5.7, where previous #line directives affect
6732 the working directory used in later #include "..." directives.
6733
927b425b
JMG
67342006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6735
6736 Various DJGGP specific issues in /djgpp
6737
d9735e9e
PE
67382006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6739
6740 More portability fixes for problems summarized by Nelson H. F. Beebe.
6741
6742 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6743 '#include <map>' works and that you can apply ++ to iterators.
6744
5a6755af
PE
67452006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6746
67a0dc4f
PE
6747 Work around portability problems summarized by Nelson H. F. Beebe in
6748 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6749
8c86f0ef
PE
6750 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6751 that '#include <string>' works.
6752
de35dd59
PE
6753 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6754 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6755 "warning: sorry: semantics of inline function static data `const
6756 unsigned char translate_table[262]' are wrong (you'll wind up with
6757 multiple copies)".
6758
67a0dc4f
PE
6759 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6760 or, xor to not_, and_, or_, and xor_, respectively. This works
6761 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6762 random system header somewhere that includes the equivalent of
6763 <iso646.h>.
6764
5a6755af
PE
6765 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6766 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 6767 Suite Version 2.0.
5a6755af 6768
3f001415
JD
67692006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6770
6771 During deterministic GLR operation, user actions should be able to
6772 influence the parse by changing yychar. To make this easier to fix and
6773 to make glr.c easier to evolve in general, don't maintain yytoken in
6774 parallel with yychar; just compute yytoken when needed.
6775 * tests/glr-regression.at (Incorrect lookahead during deterministic
6776 GLR): Check that setting yychar in a user action has the intended
6777 effect.
6778 * data/glr.c (yyGLRStack): Remove yytokenp member.
6779 (yyclearin): Don't set *yytokenp.
6780 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6781 yychar rather than *yytokenp to determine the current lookahead.
6782 Compute yytoken locally when needed.
6783 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6784 point to.
6785
6786 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6787 after `--report' documentation.
6788
e2a8c0f5
PE
67892006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6790
6791 * src/parse-gram.y (grammar_declaration): Location of printer
6792 symbol is @1, not list->location. Bug reported by twlevo.
6793 * tests/input.at (Incompatible Aliases): Adjust to above change.
6794
6b702268
PE
67952006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6796
27622431
PE
6797 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6798 all the test at once. This makes the output easier to read in the
6799 normal case.
6800
6b702268
PE
6801 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6802 got from <http://bro-ids.org/download.html>. The bug is that
6803 when two actions appeared in succession, the second one was
6804 scanned before the first one was added to the grammar rule
6805 as a midrule action. Bison then output the incorrect warning
6806 "parse.y:905.17-906.36: warning: unused value: $3".
6807 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6808 associated with a value.
6809 (rhs): Don't invoke grammar_current_rule_action_append.
6810 (action): Invoke it here instead.
6811 * src/reader.c (grammar_midrule_action): Now extern.
6812 (grammar_current_rule_action_append): Don't invoke
6813 grammar_midrule_action; that is now the scanner's job.
6814 * src/reader.h (last_string, last_braced_code_loc):
6815 (grammar_midrule_action): New decls.
6816 * src/scan-gram.l (last_string): Now extern, sigh.
6817 (last_braced_code_loc): New extern variable.
6818 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6819 rule already has an action.
6820 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6821 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6822 Add some tests to check that the above changes fixed the bug.
6823
d40ba6c2
PE
68242006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6825
6826 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6827 All used changed. Check whether the symbol has a destructor,
6828 not whether it is typed.
6829 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6830 that the values are still reported as unused. All line numbers
6831 adjusted.
6832
401aace6
PE
68332006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6834
6835 Work around a bug in bro 0.8, which underparenthesizes its
6836 definition of YYLLOC_DEFAULT.
6837 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6838 their arguments.
6839 * data/lalr1.cc: Likewise.
6840 * data/yacc.cc: Likewise.
6841
06f01bc4
PE
68422006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6843
401aace6
PE
6844 Work around a bug in Pike 7.0, and give the Pike folks a
6845 better way to override the usual int widths.
6846 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6847 user can override the types.
6848 (short): #undef, to work around a bug in Pike 7.0.
6849 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6850 (union yyalloc.yyss): Use yytype_int16 rather than short.
6851 All uses changed.
6852 (yysigned_char): Remove.
6853 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6854 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6855 * tests/regression.at (Web2c Actions): Adjust to above changes.
6856
6857 * src/reader.c (check_and_convert_grammar): New function.
6858 (reader): Close the input file even if something went wrong during
6859 parsing. Minor file descriptor leak reported by twlevo.
6860
06f01bc4
PE
6861 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6862 to pacify gcc -Wswitch-default.
6863 * src/scan-gram.l (adjust_location): Use a default: break; case
6864 to pacify gcc -Wswitch-default.
6865 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6866 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6867 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6868 Move these decls to scan-skel.l, since they don't need to be
6869 visible elsewhere.
6870 * src/scan-skel.l: Accept the above decls.
6871 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6872 is used.
6873
02650b7f
PE
68742006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6875
6876 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6877 since we don't want to insist on a version number at the start
6878 of the changelog every time.
6879 * Makefile.maint: Sync from coreutils a bit better.
6880 (sc_trailing_blank): Renamed from sc_trailing_space.
6881 All uses changed.
6882 (sc_no_if_have_config_h, sc_require_config_h):
6883 (sc_prohibit_assert_without_use): New rules.
6884 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6885 (sc_dd_max_sym_length): Fix leading spaces in rule.
6886 (sc_system_h_headers): Prefix with @.
6887 (sc_useless_cpp_parens, m4-check): Output line numbers.
6888 (changelog-check): Allow version only in head.
6889 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6890 satisfy new Makefile.maint rule.
6891 * data/glr.c: Likewise.
6892 * data/glr.cc: Likewise.
6893 * data/lalr1.cc: Likewise.
6894 * data/yacc.c: Likewise.
6895 * lib/ebitsetv.c: Likewise.
6896 * lib/lbitset.c: Likewise.
6897 * lib/subpipe.c: Likewise.
6898 * lib/timevar.c: Likewise.
6899 * src/system.h: Likewise.
6900 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6901 * djgpp/Makefile.maint: Add copyright notice.
6902 * djgpp/README.in: Likewise.
6903 * djgpp/config.bat: Likewise.
6904 * djgpp/config.site: Likewise.
6905 * djgpp/config_h.sed: Likewise.
6906 * djgpp/djunpack.bat: Likewise.
6907 * djgpp/config.sed: Fix copyright notice to match standard format.
6908 * djgpp/subpipe.h: Likewise.
6909 * lib/bitsetv-print.c: Likewise.
6910 * lib/bitsetv.c: Likewise.
6911 * lib/subpipe.h: Likewise.
6912 * lib/timevar.c: Likewise.
6913 * lib/timevar.h: Likewise.
6914 * djgpp/subpipe.c: Use standard recipe for config.h.
6915 * lib/abitset.c: Likewise.
6916 * lib/bitset.c: Likewise.
6917 * lib/bitset_stats.c: Likewise.
6918 * lib/bitsetv-print.c: Likewise.
6919 * lib/bitsetv.c: Likewise.
6920 * lib/ebitsetv.c: Likewise.
6921 * lib/get-errno.c: Likewise.
6922 * lib/lbitset.c: Likewise.
6923 * lib/subpipe.c: Likewise.
6924 * lib/timevar.c: Likewise.
6925 * lib/vbitset.c: Likewise.
6926 * tests/local.at: Likewise.
6927 * src/scan-gram.l: Don't include verify.h, since system.h does
6928 that for us.
6929 * .x-sc_require_config_h: New file.
6930 * .x-sc_unmarked_diagnostics: New file.
6931
287c78f6
PE
69322006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6933
287c78f6
PE
6934 Be a bit more systematic about using 'abort'.
6935 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6936 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6937 Put 'default: abort ();' before some other case, to satisfy older
6938 pedantic compilers.
6939 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6940 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6941 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6942 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
6943 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6944 (get_decision_str, get_orientation_str, get_node_alignment_str):
6945 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6946 (get_linestyle_str, get_arrowstyle_str): Likewise.
6947 * src/conflicts.c (resolve_sr_conflict):
6948 Use a default case rather than one for the one remaining enum
6949 value, to catch invalid enum values as well.
6950 * src/lalr.c (set_goto_map, map_goto):
6951 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6952 * src/nullable.c (nullable_compute, token_definitions_output):
6953 Likewise.
6954 * src/reader.c (packgram, reader): Likewise.
6955 * src/state.c (transitions_to, state_new, state_reduction_find):
6956 Likewise.
6957 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6958 (symbol_pack): Likewise.
6959 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
6960 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6961 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
6962 * src/system.h: Don't include <assert.h>.
6963 (assert): New macro.
6964
6965 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6966 (Destructor Decl, Parser Function, Pure Calling):
6967 Describe rules for braces inside C code more carefully.
287c78f6 6968
c66dfadd
PE
69692006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6970
c21493b8
PE
6971 Fix some porting glitches found by Nelson H. F. Beebe.
6972 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6973 compilers that don't understand that abort () does not return.
6974 * src/state.c (transitions_to): Likewise.
6975 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6976 that '#include <cstdlib>' works.
6977 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6978 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6979 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6980 for the benefit of some pre-C99 compilers.
6981
b6e3facf
PE
6982 * bootstrap: Undo changes to gnulib files that autoreconf made.
6983
c66dfadd
PE
6984 Minor fixups to get 'make maintainer-check' to work.
6985 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6986 with the new verify.h implementation.
6987 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6988 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6989 * data/yacc.c (YYUSE): Likewise.
6990 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6991 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6992 * src/parse-gram.y (declaration): Don't pass a string constant
6993 to a function that expects char *, since GCC might complain
6994 about the constant value.
6995 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6996 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6997 before #defining them.
6998 * tests/glr-regression.at
6999 (Incorrectly initialized location for empty right-hand side in GLR):
7000 In yyerror, use the msg arg.
7001 (Corrupted semantic options if user action cuts parse):
7002 (Incorrect lookahead during deterministic GLR):
7003 (Incorrect lookahead during nondeterministic GLR):
7004 Don't name a local var 'index'; it shadows string.h's 'index'.
7005
ed94ef2a
AD
70062006-01-19 Akim Demaille <akim@epita.fr>
7007
7008 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
7009 location, not just parts of it.
7010
e9ad4aec
PE
70112006-01-18 Paul Eggert <eggert@cs.ucla.edu>
7012
d6ca7905
PE
7013 * NEWS: Document the fact that multiple %unions are now allowed.
7014 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
7015 * TODO: This feature is now implemented, so remove it from
7016 the wishlist.
d6ca7905 7017
ef1b70e0
PE
7018 * Makefile.maint: Merge with coreutils Makefile.maint.
7019 (CVS_LIST): Use build-aux version if available.
7020 (VERSION_REGEXP): New macro.
7021 (syntax-check-rules): Add sc_no_if_have_config_h,
7022 sc_prohibit_assert_without_use, sc_require_config_h,
7023 sc_useless_cpp_parens.
7024 (sc_obsolete_symbols): Check for O_NDELAY.
7025 (sc_dd_max_sym_length): Track coreutils.
7026 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7027 (sc_useless_cpp_parens): New rule.
7028 (news-date-check): Look for version or today's date.
7029 (changelog-check): Don't require version number near head.
7030 (copyright-check): Use current year instead of hardwiring 2005.
7031 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7032 (announcement): Add --gpg-key-ID.
7033
7034 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7035 with "file system".
7036
2073ce56 7037 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
7038 array. Problem reported by twlevo.
7039 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7040 * src/lalr.c (build_relations): Rely on new sentinel.
7041 * src/gram.c (gram_free): Adjust to new sentinel.
7042
b7691f15
JD
70432006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7044
7045 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7046 yylookaheadNeeds. All uses updated.
7047 (yysplitStack): Rename local yynewLookaheadStatuses to
7048 yynewLookaheadNeeds.
7049 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7050 GLR): In comments, change `lookahead status' to `lookahead need'.
7051
ddee1b06
PH
70522006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7053
7054 * data/glr.c (yysplitStack): A little stylistic rewrite.
7055
12f4614d
PH
70562006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7057
7058 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7059
32c29292
JD
70602006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7061
7062 * doc/bison.texinfo: Fix some typos.
7063 (GLR Semantic Actions): New subsection discussing special
7064 considerations because GLR semantic actions might be deferred.
7065 (Actions): Mention look-ahead usage of yylval.
7066 (Actions and Locations): Mention look-ahead usage of yylloc.
7067 (Special Features for Use in Actions): Add YYEOF entry and mention it
7068 in the yychar entry.
7069 In the yychar entry, remove mention of the local yychar case (pure
7070 parser) since this is irrelevant information when writing semantic
148d66d8 7071 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
7072 yychar is otherwise described as an external variable.
7073 In the yychar entry, don't call it the `current' look-ahead since it
7074 isn't when semantic actions are deferred.
7075 In the yychar and yyclearin entries, add note about deferred semantic
7076 actions.
7077 Add yylloc and yylval entries discussing look-ahead usage.
7078 (Look-Ahead Tokens): When discussing yychar, don't call it the
7079 `current' look-ahead, and do mention yylval and yylloc.
7080 (Error Recovery): Cross-reference `Action Features' when mentioning
7081 yyclearin.
148d66d8 7082 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
7083 look-ahead.
7084 In the yylloc and yylval entries, mention look-ahead usage.
7085
de366a2f 70862006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
7087
7088 * tests/glr-regression.at: Update copyright year to 2006.
7089
bf70fa87
JD
70902006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7091
7092 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7093 use during nondeterministic operation to track which stacks have
7094 actually needed the current lookahead.
7095 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7096 Allocate, deallocate, resize, and otherwise shuffle space for
7097 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7098 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7099 appropriately during nondeterministic operation.
7100 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7101 members to store the current lookahead to be used by the deferred
7102 user action.
7103 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7104 from which the RHS is taken. Set the lookahead members of the new
7105 yySemanticOption according to the lookahead status for stack yyk.
7106 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7107 yyaddDeferredAction.
7108 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7109 members of yySemanticOption before invoking yyuserAction, and then set
7110 them back to their current values afterward.
7111 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7112 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7113 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7114 titles for consistency.
7115 (Leaked merged semantic value if user action cuts parse): In order to
7116 suppress lint warnings, use arguments in merge function, and assign
7117 char value < 128 in main.
7118 (Incorrect lookahead during deterministic GLR): New test case.
7119 (Incorrect lookahead during nondeterministic GLR): New test case.
7120
05449a2c
JD
71212006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7122
de366a2f 7123 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
7124 !yyvaluep as signal that no semantic value is available to print.
7125 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7126 to print a semantic value.
7127
4158e0a1 71282006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 7129
4158e0a1
JD
7130 * tests/glr-regression.at: For consistency with my newer test cases,
7131 don't thank myself.
7132
d659304d
JD
71332006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7134
7135 * data/glr.c (yyresolveValue): When merging semantic options, if at
7136 least one user action succeeds but a later one cuts the parse, then
7137 destroy the semantic value before returning rather than leaking it.
7138 (yyresolveStates): If a user action cuts the parse and thus
7139 yyresolveValue fails, ignore the (unset) semantic value rather than
7140 corrupting the yyGLRState, and empty the semantic options list since
7141 the user actions should have called all necessary destructors.
7142 Simplify code with YYCHK.
7143 * tests/glr-regression.at (Corrupted semantic options if user action
7144 cuts parse): New test case.
7145 (Undesirable destructors if user action cuts parse): New test case.
7146 Before applying any of this patch, this test case never actually failed
7147 for me... but only because the corrupted semantic options usually
7148 masked this bug.
7149 (Leaked merged semantic value if user action cuts parse): New test
7150 case.
7151
6ec2c0f2
AD
71522006-01-05 Akim Demaille <akim@epita.fr>
7153
7154 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7155
1b9c21fb
PE
71562006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7157
7158 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7159 _MSC_VER. Problem reported by Cenzato Marco.
7160 (b4_c_function_def): Use it.
7161 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7162 b4_c_modern.
7163 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7164 than rolling our own.
7165
84866159
AD
71662006-01-04 Akim Demaille <akim@epita.fr>
7167
7168 Also warn about non-used mid-rule values.
7169 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7170 member.
7171 (symbol_list_new): Adjust.
7172 * src/reader.c (symbol_typed_p): New.
7173 (grammar_rule_check): Use it.
7174 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7175 Check its rule.
7176 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7177 Use it.
7178 * tests/actions.at (Exotic Dollars): Adjust.
7179
378f4bd8
AD
71802006-01-04 Akim Demaille <akim@epita.fr>
7181
7182 * src/reader.c (grammar_midrule_action): If $$ is set in a
7183 mid-rule, move the `used' bit to its lhs.
7184 * tests/input.at (Unused values): New.
7185 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7186
e2a21b6f
PE
71872006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7188
54662697
PE
7189 * doc/bison.texinfo (Bison Options): Say more accurately what
7190 --yacc does.
7191 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7192 about declarations in the grammar when in Yacc mode, as POSIX does
7193 not require a diagnostic when the grammar uses extensions.
7194
7195 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7196
073f9288
PE
7197 Warn about dubious constructions like "%token T T".
7198 Reported by twlevo.
7199 * src/symtab.h (struct symbol.declared): New member.
7200 * src/symtab.c (symbol_new): Initialize it to false.
7201 (symbol_class_set): New arg DECLARING, specifying whether
7202 this is a declaration that we want to warn about, if there
7203 is more than one of them. All uses changed.
7204
1221b78a
PE
7205 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7206 Allow multiple %union directives, whose contents concatenate.
7207 * src/parse-gram.y (grammar_declaration): Likewise.
7208 Use muscle_code_grow, so that we don't need stype_line any more.
7209 All uses changed.
7210
7211 * src/muscle_tab.c (muscle_grow): Fix comment.
7212
e2a21b6f
PE
7213 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7214 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7215 Update copyright year to 2006.
7216
8f7e3cf9
AD
72172006-01-03 Akim Demaille <akim@epita.fr>
7218
7219 Have glr.cc pass (some of) the calc.at tests.
7220 * data/glr.cc (b4_parse_param_orig): New.
7221 (b4_parse_param): Improve its definition, and bound it more
7222 clearly in the skeleton.
7223 (b4_epilogue): Append, instead of prepending, in order to keep
7224 #line consistency.
7225 Simplify the generation of auxiliary functions: locations and
7226 purity are mandated.
7227 (b4_global_tokens_and_yystype): Honor it.
7228 * data/location.cc (c++.m4): Don't include it.
7229 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7230 and AT_SKEL_CC_IF.
7231 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7232 AT_LALR1_CC_IF.
7233 Be sure to initialize the first position's filename.
7234 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7235 mandated anyway.
7236 (AT_CHECK_CALC_GLR_CC): New.
7237 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7238
3953ed88
AD
72392006-01-02 Akim Demaille <akim@epita.fr>
7240
7241 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7242 c.m4.
0a96ba81 7243 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
7244 * data/glr.cc: Do not include stack.hh.
7245
9ecafbbf
AD
72462006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7247
7248 * data/glr.c: Reformat whitespace with tabs.
7249 (b4_lpure_formals): Remove this unused m4 macro.
7250 * tests/cxx-type.at: Reformat whitespace with tabs.
7251 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7252 since it's a member. Rename type to isNterm for clarity.
7253
c4d497a0
AD
72542005-12-29 Akim <akim@sulaco.local>
7255
7256 Let glr.cc catch up with symbol_value_print.
7257 * data/glr.cc (b4_yysymprint_generate): Replace by...
7258 (b4_yy_symbol_print_generate): this.
7259 (yy_symbol_print, yy_symbol_value_print): Declare them.
7260
4517da37
PE
72612005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7262
7263 * src/location.h (boundary): Note that a line or column equal
7264 to INT_MAX indicates an overflow.
7265 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7266 (rule_length_overflow, increment_rule_length, add_column_width):
7267 New functions.
7268 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7269 (<SC_BRACED_CODE>"}"):
7270 Use increment_rule_length rather than incrementing it by hand.
7271 (adjust_location, handle_syncline): Diagnose overflow.
7272 (handle_action_dollar, handle_action_at):
7273 Fix bug with monstrosities like $-2147483648.
7274 Remove now-unnecessary checks.
7275 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7276 (convert_ucn_to_byte): Verify assumptions.
7277 (handle_syncline): New arg LOC. All callers changed.
7278 Don't store through a value derived from char const * pointer.
7279
7280 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7281 GCC warnings.
7282
e3233bf6
PE
72832005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7284
7285 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7286 Remove unnecessary forward static decls.
7287
8f3596a6
AD
72882005-12-27 Akim Demaille <akim@epita.fr>
7289
7290 * src/reader.c (grammar_current_rule_check): Also check that $$
7291 is used.
7292 Take the rule to check as argument, hence rename as...
7293 (grammar_rule_check): this.
7294 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7295 Rename as...
7296 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7297 (grammar_midrule_action, grammar_symbol_append): Now static.
7298 * tests/torture.at (input): Don't rely on the default action
7299 being always performed.
7300 * tests/calc.at: "Set" $$ even when the action is "cut" with
7301 YYERROR or other.
7302 * tests/actions.at (Exotic Dollars): Instead of using unused
7303 values, check that the warning is issued.
7304
721be13c
PE
73052005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7306
7307 * NEWS: Improve wording for unused-value warnings.
7308
a0af42fc
AD
73092005-12-22 Akim Demaille <akim@epita.fr>
7310
7311 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7312 (b4_yysymprint_generate): Rename as...
7313 (b4_yy_symbol_print_generate): this.
7314 Generate yy_symbol_print instead of yysymprint.
7315 Generate also yy_symbol_value_print, and use it.
7316
affac613
AD
73172005-12-22 Akim Demaille <akim@epita.fr>
7318
721be13c 7319 * NEWS: Warn about unused values.
affac613
AD
7320 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7321 a `used' member.
7322 (symbol_list_n_get, symbol_list_n_used_set): New.
7323 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7324 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7325 * src/reader.c (grammar_current_rule_check): Check that values are
7326 used.
7327 * src/symtab.c (symbol_print): Accept 0.
7328 * tests/existing.at: Remove the type information.
7329 Empty the actions.
7330 Remove useless actions (beware of mid-rule actions: perl -000
7331 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7332 * tests/actions.at (Exotic Dollars): Use unused values.
7333 * tests/calc.at: Likewise.
7334 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7335 Likewise.
7336
7337 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7338 rule_useful_p.
7339
9d9b8b70
PE
73402005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7341
8bb4c753
PE
7342 Undo 2005-12-01 tentative license wording change. The wording is
7343 still being reviewed by the lawyers, and we don't want to wait for
7344 them before publishing a test release. For now, revert to the
7345 previous wording.
7346 * NEWS: Undo 2005-12-01 change.
7347 * data/glr.c: Revert to previous license wording.
7348 * data/glr.cc: Likewise.
7349 * data/lalr1.cc: Likewise.
7350 * data/location.cc: Likewise.
7351 * data/yacc.c: Likewise.
7352
9d9b8b70
PE
7353 * NEWS: Reword %destructor vs YYABORT etc.
7354 * data/glr.c: Use American spacing, for consistency.
7355 * data/glr.cc: Likewise.
7356 * data/lalr1.cc: Likewise.
7357 * data/yacc.c: Likewise.
7358 * data/yacc.c: Reformat comments slightly.
7359 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7360 for consistency. Fix some spelling errors and reword recently-included
7361 text slightly.
7362 * tests/cxx-type.at: Cast results of malloc, for C++.
7363
2c3b392a
AD
73642005-12-21 Joel E. Denny <address@hidden>
7365
7366 * tests/cxx-type.at: Construct a tree, count the parents of shared
7367 nodes, and free each node once and only once. Previously, the memory
7368 for semantic values was leaked instead.
7369
d6cff4dc
AD
73702005-12-21 Joel E. Denny <address@hidden>
7371
7372 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7373 (yylval, yylloc): If pure, #define to yystackp->yyval and
7374 yystackp->yyloc similar to yychar and yynerrs.
7375 (yyparse): If pure, remove local yylval and yylloc. Add local
7376 yystackp to accommodate pure definitions of yylval and yylloc.
7377 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7378 yylvalp and yyllocp to &yylval and &yylloc.
7379 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7380 namespace. Previously, nerrs and char were missing, but lval and lloc
7381 weren't necessary.
7382 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7383 yylvalp and yyllocp parameters since, if pure, these are now always
7384 accessible through yystackp. If not pure, they are still accessible
7385 globally.
7386 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7387 `if (YYID (N))' to pacify lint.
7388
a85284cf
AD
73892005-12-21 Akim Demaille <akim@epita.fr>
7390
7391 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7392 destroy the RHS symbols of a rule.
7393 * data/yacc.c (yylen): Initialize to 0.
7394 Keep its value to the number of items to possibly shift.
7395 In particular, a regular successful parse that ends on YYFINAL by
7396 a (internal) YYACCEPT must not have yylen != 0.
7397 (yyerrorlab, yyreturn): Pop the RHS.
7398 Reorder a bit to emphasize the `shifting' bits of code.
7399 (YYPOPSTACK): Now accept a number of items to pop.
7400 * data/lalr1.cc: Likewise.
7401 * data/glr.c: Formatting changes.
7402 Use goto instead of fall through.
7403 * doc/bison.texinfo (Destructor Decl): Complete.
7404
d508c281
JMG
74052005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7406
7407 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7408 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7409 * djgpp/config.bat: Replace every occurence of the file name
7410 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7411 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7412 * djgpp/config.sed: Replace every occurence of the file name
7413 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7414 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7415 * djgpp/djunpack.bat: DJGPP specific file.
7416 * djgpp/fnchange.lst: DJGPP specific file.
7417 * djgpp/README.in: Add new information about how to unpack the bison
7418 source on MSDOS and other systems which have 8.3 file name restrictions
7419 using djunpack.bat and fnchange.lst.
7420
3e7a2cd9
PE
74212005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7422
7423 * bootstrap (build_cvs_prefix): Remove; unused.
7424 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7425 when getting gnulib.
7426
74272005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7428
7429 * data/glr.c: Reorder typedef declarations for structs to match order
7430 of struct declarations.
7431 Rename yystack everywhere to yystackp except in yyparse where it's not
7432 a pointer.
7433 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7434 consistency.
7435 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7436 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7437 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7438 lint.
7439
877519f8
PE
74402005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7441
0eca5a39
PE
7442 * tests/sets.at (Accept): Fix typos in regular expression used to
7443 sed out the final state number.
7444
2cec9080
PE
7445 Work around portability problem on Solaris 10: flex-generated
7446 files include <stdio.h> before <config.h>, which messes up
7447 because the latter defines __EXTENSIONS__. Address the problem
7448 by creating two new little files that include <config.h> first,
7449 then include the flex-generated files. Rewrite everyone else
7450 to include <config.h> first, as well.
7451 * lib/timevar.c: Always include "config.h".
7452 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7453 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7454 (EXTRA_bison_SOURCES): New macro.
7455 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7456 * src/system.h: Don't include config.h.
7457 * src/LR0.c: Include <config.h> first.
7458 * src/assoc.c: Likewise.
7459 * src/closure.c: Likewise.
7460 * src/complain.c: Likewise.
7461 * src/conflicts.c: Likewise.
7462 * src/derives.c: Likewise.
7463 * src/files.c: Likewise.
7464 * src/getargs.c: Likewise.
7465 * src/gram.c: Likewise.
7466 * src/lalr.c: Likewise.
7467 * src/location.c: Likewise.
7468 * src/main.c: Likewise.
7469 * src/muscle_tab.c: Likewise.
7470 * src/nullable.c: Likewise.
7471 * src/output.c: Likewise.
7472 * src/parse-gram.y: Likewise.
7473 * src/print.c: Likewise.
7474 * src/print_graph.c: Likewise.
7475 * src/reader.c: Likewise.
7476 * src/reduce.c: Likewise.
7477 * src/relation.c: Likewise.
7478 * src/state.c: Likewise.
7479 * src/symlist.c: Likewise.
7480 * src/symtab.c: Likewise.
7481 * src/tables.c: Likewise.
7482 * src/uniqstr.c: Likewise.
7483 * src/vcg.c: Likewise.
7484
877519f8
PE
7485 * src/parse-gram.y: Fix minor problems uncovered by lint.
7486 (current_lhs, current_lhs_location): Now static.
7487 (current_assoc): Remove unused variable.
7488
7489 Cleanups so that Bison-generated parsers have less lint.
7490 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7491 Prepend /*ARGSUSED*/, for lint's sake.
7492 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7493 definition if 'lint' is defined.
7494 (YYID): New macro (or function, if lint).
7495 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7496 * data/yacc.c: Likewise.
7497 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7498 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7499 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7500 is C++ only.
7501 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7502 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7503 Use YYID(0) rather than 0, for lint.
7504 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7505 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7506
f5228370
PE
75072005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7508
7509 * tests/glr-regression.at
7510 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7511 Close memory leak reported by twlevo.
7512
69ce078b
PE
75132005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7514
6ff99711
PE
7515 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7516 all stacks.
7517 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
7518 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7519 New test case.
7520 (Duplicated user destructor for lookahead): This test now is expected
7521 to succeed.
7522
af3412cd
PE
75232005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7524
32b5b719 7525 * NEWS: Document the following change.
af3412cd
PE
7526 * data/yacc.c: Say "parser skeleton" rather than "file", since
7527 it's no longer just a file.
7528 * data/glr.c: Grant a special exception for C GLR parsers, that
7529 reads like the already-existing exception for C LALR(1) parsers.
7530 * data/glr.cc: Likewise.
7531 * data/lalr1.cc: Likewise.
7532 * data/location.cc: Likewise.
7533 * data/yacc.c: Reword the "written by" statement to clarify that
7534 it was the parser skeleton, not the entire output file.
7535 * data/glr.c: Written by Paul Hilfinger.
7536 * data/glr.cc: Written by Akim Demaille.
7537 * data/lalr1.cc: Likewise.
7538
035aa4a0
PE
75392005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7540
d9963c85
PE
7541 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7542 Fix typos in previous change that broke 'make check'.
7543 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7544 supported in C.
7545 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7546 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7547 We can revert this once things settle down.
7548
035aa4a0
PE
7549 * src/conflicts.c (conflicts_print): Don't print file name twice
7550 when %expect fails because there were no conflicts.
7551 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7552 change.
7553 * tests/conflicts.at (%expect not enough, %expect too much):
7554 (%expect with reduce conflicts): Adjust to new behavior.
7555
75562005-11-18 Akim Demaille <akim@epita.fr>
7557
7558 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7559 errors.
7560 * NEWS: Document this.
7561 * doc/bison.texinfo (Expect Decl): Likewise.
7562
d1ff7a7c
AD
75632005-11-16 Akim Demaille <akim@epita.fr>
7564
7565 Generalize the display of semantic values and locations in traces.
7566 * data/glr.c (yy_reduce_print): Fix indices (again).
7567 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7568 literal integers.
7569 * data/lalr1.cc (yyreduce_print): Rename as...
7570 (yy_reduce_print): this.
7571 Display values and locations.
7572 * data/yacc.c (yy_reduce_print): Likewise.
7573 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7574 (yysymprint): Move higher to be visible from yy_reduce_print).
7575 (yyparse): Adjust.
7576 * tests/calc.at: Adjust the expected length of the traces.
7577
6de5398d
AD
75782005-11-14 Akim Demaille <akim@epita.fr>
7579
7580 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7581 from 1 to N, while values and location start at 0.
7582 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7583
a1373f55
AD
75842005-11-14 Akim Demaille <akim@epita.fr>
7585
7586 * data/glr.c (yy_reduce_print): Fix the $ number.
7587
613d8952
AD
75882005-11-14 Akim Demaille <akim@epita.fr>
7589
7590 "Use" parse parameters.
7591 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7592 * data/glr.c, data/glr.cc: Use them.
7593 * data/glr.c (YYUSE): Have a C++ definition that supports
7594 non-pointer types.
7595
b2741627
AD
75962005-11-14 Akim Demaille <akim@epita.fr>
7597
7598 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7599
5059b5c8
AD
76002005-11-14 Akim Demaille <akim@epita.fr>
7601
42249483
AD
7602 * data/glr.cc: New.
7603 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 7604
4626a15d
AD
76052005-11-12 Akim Demaille <akim@epita.fr>
7606
7607 Let position and location be PODs.
7608 * data/location.cc (position::initialize, location::initialize): New.
7609 (position::position, location::location): Define only if
7610 b4_location_constructors is defined.
7611 * data/lalr1.cc (b4_location_constructors): Define it for backward
7612 compatibility.
7613 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7614
76152005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
7616
7617 * data/lalr1.cc: Move the body of the ctor and dtor into the
7618 parser file (instead of the header).
7619 Wrap the implementations in a "namespace yy".
7620
76212005-11-12 Akim Demaille <akim@epita.fr>
7622
7623 Have glr.c include its header file when created.
7624 * data/glr.c (b4_shared_declarations): New.
7625 Output them verbatim in the parser if !%defines, otherwise
7626 output then in the header file, and include it instead.
7627
1989d947
AD
76282005-11-11 Akim Demaille <akim@epita.fr>
7629
7630 * data/glr.c: Comment changes.
7631
76322005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
7633
7634 When yydebug, report semantic and location values for reductions.
7635 * data/glr.c (yy_reduce_print): Report the semantic values and the
7636 locations.
7637 (YY_REDUCE_PRINT): Adjust.
7638 (yyglrReduce): Use them.
7639 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7640 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7641 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7642 traces.
7643
02998094
AD
76442005-11-10 Akim Demaille <akim@epita.fr>
7645
7646 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7647 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7648 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7649
5210672f
PE
76502005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7651
7652 * m4/cxx.m4, examples/Makefile.am: Don't build
7653 examples/calc++ if no C++ compiler is available. (trivial change)
7654
a8991a1d
AD
76552005-11-09 Akim Demaille <akim@epita.fr>
7656
7657 * src/scan-skel.l: Use a couple of asserts.
7658
36b5e963
AD
76592005-11-03 Akim Demaille <akim@epita.fr>
7660
7661 In some (weird) cases, the final state number is incorrect.
7662 Reported by Alexandre Duret-Lutz.
7663 * src/LR0.c (state_list_append): Remove the computation of
7664 final_state.
7665 (save_reductions): Do it here.
7666 (get_state): Alpha conversion.
7667 (generate_states): Use a for loop.
7668 * src/gram.h (item_number_is_rule_number)
7669 (item_number_is_symbol_number): New.
7670 * src/state.c: Use assert.
7671 * src/system.h: Include assert.h.
7672 * tests/sets.at (Accept): New.
7673
44e7ead1
PH
76742005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7675
7676 * data/glr.c (yyfill): Adjust comment.
36b5e963 7677 (yyresolveAction): Initialize default location properly
44e7ead1
PH
7678 for empty right-hand sides.
7679 (yydoAction): Ditto.
7680 Add comment explaining apparently dead code.
36b5e963
AD
7681 * tests/glr-regression.at
7682 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 7683 New test.
36b5e963 7684
e10a80ee
PE
76852005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7686
7687 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7688 gnulib when interrupted. This fixes some race conditions and
7689 works around some portability problems (one noted by Paul
7690 Hilfinger).
7691
067b32ee
AD
76922005-10-22 Akim <akim@epita.fr>
7693
7694 * Makefile.cfg: Adjust to config -> build-aux.
7695 Reported by twledo.
7696
4b367315
AD
76972005-10-21 Akim Demaille <akim@epita.fr>
7698
7699 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7700 the %parse-params.
7701 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7702 * data/yacc.c (b4_Pure_if): Rename as...
7703 (b4_yacc_pure_if): this.
7704 (YY_SYMBOL_PRINT, yyparse): Adjust.
7705 * doc/bison.texinfo: Formatting changes.
7706
24cc23d9
AD
77072005-10-21 Akim Demaille <akim@epita.fr>
7708
7709 Finish the transition config -> build-aux.
7710 * configure.ac, Makefile.am: Use build-aux.
7711 * config/prev-version, config/announce-gen, config/Makefile.am:
7712 Move to...
7713 * build-aux/prev-version, build-aux/announce-gen,
7714 * build-aux/Makefile.am: here.
7715
d4476375
AD
77162005-10-14 Akim Demaille <akim@epita.fr>
7717
7718 * examples/calc++/test: Use set -x only when VERBOSE.
7719
302c0aee
PE
77202005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7721
7722 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7723 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7724
7625ec2c
AD
77252005-10-13 Akim Demaille <akim@epita.fr>
7726
7727 * src/scan-skel.l: Output the base name parts of the parser and
7728 header file names.
302c0aee 7729 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
7730 additional checks.
7731 Use this to exercise C++ outputs in subdirs.
7732 Reported by Oleg Smolsky.
7733
ba0fe3c7
PE
77342005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7735
7736 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7737 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7738 Problem reported by John P. Hartmann.
7739 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7740 already defined it.
7741
9b8a5ce0
AD
77422005-10-12 Akim Demaille <akim@epita.fr>
7743
7744 * src/parse-gram.y (version_check): Exit 63 to please missing
7745 (stands for "version mismatch).
7746 * tests/input.at, doc/bison.texinfo: Adjust.
7747
4f6e011e
PE
77482005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7749
7750 Work around portability problems with Visual Age C compiler
7751 (xlc and xlC_r) reported by John P. Hartmann.
7752 * data/location.cc (initial_column, initial_line): Remove.
7753 All uses replaced by 0 and 1.
7754 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7755 that xlc complains about.
7756 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 7757 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 7758 as __STDC__.
4d7aa45e
PE
7759 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7760 __STDC_VERSION__. Use it everywhere instead of looking at
7761 __STDC__ and __cplusplus.
4f6e011e 7762
a1b3bf8c
AD
77632005-10-10 Akim Demaille <akim@epita.fr>
7764
7765 * examples/calc++/test: Be quiet unless VERBOSE.
7766
412e44aa
PE
77672005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7768
2a4647a3
PE
7769 * data/c.m4 (yydestruct, yysymprint):
7770 Use YYUSE instead of casting to void.
7771 * data/glr.c (YYUSE): New macro.
7772 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7773 Use it instead of rolling our own.
7774 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7775 (YYCHK1):
7776 Use /*CONSTCOND*/ to suppress lint warnings.
7777 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7778 (YY_STACK_PRINT): Use 'false' not '0'.
7779 (YYUSE): New macro.
7780 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7781 * data/yacc.c (YYUSE): New macro.
7782 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7783 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7784 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7785
7786
412e44aa
PE
7787 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7788 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7789
88c6637f
PE
77902005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7791
2f4f028d
PE
7792 Undo the parts of the unlocked-I/O change that substituted
7793 putc or puts for printf. This might hurt performance a bit,
7794 but some people prefer the printf style.
7795 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7796 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7797 All uses replaced by YYFPRINTF and YYDPRINTF.
7798 * data/yacc.c: Likewise.
7799 * lib/bitset.c (bitset_print): Likewise.
7800 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7801 putc and puts.
7802 * lib/lbitset.c (debug_lbitset): Likewise.
7803 * src/closure.c (print_firsts, print_fderives): Likewise.
7804 * src/gram.c (grammar_dump): Likewise.
7805 * src/lalr.c (look_ahead_tokens_print): Likewise.
7806 * src/output.c (escaped_output): Likewise.
7807 (user_actions_output): Break apart two printfs.
7808 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7809 * src/reduce.c (reduce_print): Likewise.
7810 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7811 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7812
88c6637f
PE
7813 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7814 Use assignments rather than casts-to-void to suppress
7815 unused-variable warnings. This pacifies 'lint'.
7816 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7817 unused-variable warnings.
7818
fb32e373
JMG
78192005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7820
7821 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7822
edb8f44f
PE
78232005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7824
fb9c0b33
PE
7825 Use unlocked I/O for a minor performance improvement on hosts like
7826 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7827 is to use the gnlib unlocked-io module, and to prefer putc and
7828 puts to printf when either will work (since the latter doesn't
7829 come in an unlocked flavor).
7830 * bootstrap (gnulib_modules): Add unlocked-io.
7831 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7832 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7833 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7834 and similarly for puts and putc and printf.
7835 * data/yacc.c: Likewise.
7836 * lib/bitset.c (bitset_print): Likewise.
7837 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7838 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7839 to printf.
7840 * lib/lbitset.c (debug_lbitset): Likewise.
7841 * src/closure.c (print_firsts, print_fderives): Likewise.
7842 * src/gram.c (grammar_dump): Likewise.
7843 * src/lalr.c (look_ahead_tokens_print): Likewise.
7844 * src/output.c (escaped_output): Likewise.
7845 (user_actions_output): Coalesce two printfs.
2f4f028d 7846 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
7847 * src/reduce.c (reduce_print): Likewise.
7848 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 7849 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 7850
edb8f44f
PE
7851 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7852 this confuses xgettext.
7853
b50d2359
AD
78542005-10-02 Akim Demaille <akim@epita.fr>
7855
7856 * bootstrap (gnulib_modules): Add strverscmp.
7857 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7858 * m4/.cvsignore: Add strverscmp.m4.
7859 * src/parse-gram.y (%require): New token, new rule.
7860 (version_check): New.
7861 * src/scan-gram.l (%require): Adjust.
7862 * tests/input.at (AT_REQUIRE): New.
7863 Use it.
7864 * doc/bison.texinfo (Require Decl): New.
7865 (Calc++ Parser): Use %require.
7866
21667f64
AD
78672005-10-02 Akim Demaille <akim@epita.fr>
7868
7869 * data/location.cc: New.
7870
2b81e969
AD
78712005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7872 Akim Demaille <akim@epita.fr>
7873
7874 Make sure -odir/foo.cc creates dir/location.hh etc.
7875 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7876 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7877 (spec_defines_file): Now const.
7878 (dir_prefix): New.
7879 (short_base_name): Remove.
7880 * src/files.c: Adjust.
7881 (dirname.h): Include.
7882 (base_name): Don't prototype it.
7883 (finput): Remove, duplicates gram_in.
7884 (full_base_name, short_base_name): Replace by...
7885 (all_but_ext, all_but_tab_ext): these.
7886 (compute_base_names): Rename as...
7887 (compute_file_name_parts): this.
7888 Update to compute the new variables, including dir_prefix.
7889 Adjust dependencies.
7890 * src/output.c (prepare): Output them.
7891 * src/reader.c: Adjust to use gram_in, not finput.
7892 * src/scan-skel.l (@dir_prefix@): New.
7893
ad6a9b97
JMG
78942005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7895
7896 * lib/subpipe.c: New function end_of_output_subpipe() added
7897 to allow support for non-posix systems. This is a no-op function
7898 for posix systems.
7899
7900 * lib/subpipe.h: New function end_of_output_subpipe() added
7901 to allow support for non-posix systems. This is a no-op function
7902 for posix systems.
7903
7904 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7905 handle the lack of pipe/fork functionality on non-posix systems.
7906
7907 * djgpp/Makefile.maint: DJGPP specific file.
7908
7909 * djgpp/README.in: DJGPP specific file.
7910
7911 * djgpp/config.bat: DJGPP specific configuration file.
7912
7913 * djgpp/config.sed: DJGPP specific configuration file.
7914
7915 * djgpp/config.site: DJGPP specific configuration file.
7916
7917 * djgpp/config_h.sed: DJGPP specific configuration file.
7918
7919 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7920
7921 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7922
fc695704
AD
79232005-10-02 Akim Demaille <akim@epita.fr>
7924
7925 * data/location.cc: New, extract from...
7926 * data/lalr1.cc: here.
7927 (location.hh): Include it after the user prologue, in case the
7928 filename type is defined by the user.
7929 Forward declation location and position before the pre-prologue.
7930 (yyresult_): Rename as...
7931 (yyresult): this, it's a local variable, not an attribute.
7932 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7933
79342005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
7935
7936 * examples/extexi: Restore the #line generation.
7937
fb9712a9
AD
79382005-09-30 Akim Demaille <akim@epita.fr>,
7939 Alexandre Duret-Lutz <adl@gnu.org>
7940
7941 Move the token type and YYSTYPE in the parser class.
7942 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7943 (parser::token): New, from the moved free definition of tokens.
7944 (parser::semantic_value): Now a full definition instead of an
7945 indirection to YYSTYPE.
7946 (b4_post_prologue): No longer included in the header file, but
7947 in the implementation file.
7948 * doc/bison.texi (C+ Language Interface): Update.
7949 * src/parse-gram.y: Support unary %define.
7950 * tests/actions.at: Define global_tokens_and_yystype for backward
7951 compatibility until we update the tests.
7952 * tests/calc.at: Idem.
7953 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7954 to simplify the code.
7955
55f0c7b1
PE
79562005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7957
7958 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7959 Ah, the good old days! Problem reported by Peter Klein.
7960 * bootstrap (gnulib_modules): Add strerror, strtoul.
7961 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7962 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7963
fb9712a9 79642005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
7965
7966 * data/c.m4 (b4_error_verbose_if): New.
7967 * data/lalr1.cc: Use it.
7968 (YYERROR_VERBOSE_IF): Remove.
7969 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7970 parser members, replaced by...
7971 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7972 local variables.
7973 (yysyntax_error_): Takes the state number as argument.
7974 (yyreduce_print_): Use the argument yyrule, not the former
7975 attribute yyn_.
7976
8a6f72f3
PE
79772005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 * bootstrap (gnulib_modules): Add verify.
7980 * lib/.cvsignore: Add verify.h.
7981 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7982 * src/system.h (verify): Remove.
7983 Include verify.h instead.
7984 * src/tables.c (tables_generate): Use new API for 'verify'.
7985
0d50976f
PE
79862005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7987
ebc3737e
PE
7988 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7989 local variables whose names begin with 'yy'.
7990 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7991 Trivial changes from Joel E. Denny.
7992
0d50976f
PE
7993 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7994 it itself.
7995 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7996 don't use alloca any more.
7997
7998 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7999 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 8000 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
8001 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
8002 to match yacc.c, to test more hosts.
8003
a05b79df
PE
80042005-09-20 Paul Eggert <eggert@cs.ucla.edu>
8005
55289366
PE
8006 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
8007 doesn't affect behavior.
8008 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
8009 Solaris, AIX, MSC.
8010 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
8011 This works a bit better with glibc, if user code has already included
8012 stdlib.h.
8013 * doc/bison.texinfo (Bison Parser): Document that users can't
8014 arbitrarily use malloc and free for other purposes. Document
8015 that <alloca.h> and <malloc.h> might be included.
8016 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
8017 user must declare alloca.
8018
a05b79df
PE
8019 * HACKING (release): Forwarn the Translation Project about
8020 stable releses.
8021
3ab2ca22
AD
80222005-09-20 Akim Demaille <akim@epita.fr>
8023
8024 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8025
a9739e7c
PE
80262005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8027
a702593e
PE
8028 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8029 (YYSTACK_ALLOC_MAXIMUM): Use it.
8030 (yysyntax_error): New function.
8031 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8032 multiple syntax errors are reported, and alloca is being used.
8033 Instead, reallocate buffers twice as big each time, so that
8034 we waste at most half the allocated memory. Start with a small
8035 (128-byte) buffer that will suffice in most cases anyway.
8036 Use yysyntax_error to do most of the work.
8037
8038 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8039 yynerrs is the number of errors reported, not the number of
8040 errors encountered.
8041
a9739e7c
PE
8042 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8043 Mark it as expected to fail.
8044 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8045 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8046 Don't start user-code symbols with "yy", to avoid name space problems.
8047
f479c6c6
AD
80482005-09-19 Akim Demaille <akim@epita.fr>
8049
8050 Remove the traits, failed experiment.
8051 It never proved useful, and anyway because of the current
8052 definition, it was not possible to have several specialization of
8053 this traits, making it useless.
8054 * data/lalr1.cc (yy:traits): Remove.
8055 Inline its definitions in the parser class.
8056
e2586f82
AD
80572005-09-19 Akim Demaille <akim@epita.fr>
8058
8059 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8060 least Mac OSX with a /usr/local install of gettext.
8061
2e8cf949
AD
80622005-09-19 Akim Demaille <akim@epita.fr>
8063
8064 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8065 and yytoken for similarity with the other skeletons.
8066
c7fb0b90
AD
80672005-09-19 Akim Demaille <akim@epita.fr>
8068
4e26c69e 8069 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 8070
1bd0deda
PE
80712005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8072
8073 * NEWS: Version 2.1.
8074
8075 * NEWS: Remove notice of yytname change, since it was never in an
8076 official release.
8077 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8078 diagnostic.
8079 * src/output.c (prepare): Likewise.
8080 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8081 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8082 is not defined. This is an awful hack, but it's enough for now.
8083 All callers changed.
8084 * tests/glr-regression-at (make_value): Args are const pointers now,
8085 to avoid GCC warning.
8086 (Duplicated user destructor for lookahead): New test. Currently
8087 skipped. It fails on my host but I'm not sure it'll always fail.
8088
80892005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
8090
8091 * src/symtab.h (struct symbol): Declare the printer and destructor
8092 as const, to avoid accidental calls to free.
8093 (symbol_destructor_set, symbol_printer_set): Adjust.
8094 * src/symtab.c: Adjust.
8095
1bd0deda 80962005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
8097
8098 * data/c.m4 (b4_token_enums): New.
8099 (b4_token_defines): Rename as...
8100 (b4_token_enums_defines): this.
8101 (b4_token_defines): New, output only the #defines.
8102 * data/yacc.c, data/glr.c: Adjust.
8103 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8104 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8105 as default values.
8106
dbcdae2d
AD
81072005-09-16 Akim Demaille <akim@epita.fr>
8108
8109 * data/lalr1.cc (yylex_): Remove, inline its code.
8110 (yyreport_syntax_error_): Remove, replaced by...
8111 (yysyntax_error_): this which returns a string and leaves to the
8112 caller the call to the users' error function.
8113 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8114 Move from members of the parser object...
8115 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8116 to local variables of the parse function.
8117
70d8f291
AD
81182005-09-16 Akim Demaille <akim@epita.fr>
8119
8120 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8121 since it's in Bison's name space.
8122
b47dbebe
PE
81232005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8124
ae199bf1
PE
8125 * data/glr.c (yyresolveValue): Add default case to pacify
8126 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8127
b47dbebe
PE
8128 * NEWS: Document when yyparse started to return 2.
8129 * doc/bison.texinfo (Parser Function): Document when yyparse
8130 returns 2.
8131
8132 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8133 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8134 changed.
8135 (class position): file_name -> filename (reverting). All uses changed.
8136
81372005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8138
8139 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8140 do anything if $@ exists. This reverts part of the 2005-07-07
8141 patch.
8142
00292f66
PE
81432005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8144
8145 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8146 contains obsolete information and isn't worth distributing as a
8147 separate file anyway.
8148 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8149 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8150 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8151 (yyparse): Abort if user code uses longjmp to throw an unexpected
8152 value.
8153
a420f962
PE
81542005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8155
00292f66
PE
8156 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8157 Suggested by twlevo@xs4all.nl.
8158
127287e9
PE
8159 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8160 This avoids a diagnostic from gcc -Wswitch-enum.
8161 Problem reported by twlevo@xs4all.nl.
8162
a420f962
PE
8163 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8164 standards. Use "file name" or "file" or "name", depending on
8165 the context.
8166 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8167 not to hack/foo.tab.c.
8168 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
8169 * data/glr.c: b4_filename -> b4_file_name.
8170 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8171 All uses changed.
8172 (class position): filename -> file_name. All uses changed.
8173 * data/yacc.c: b4_filename -> b4_file_name.
8174 * lib/bitset.h: filename -> file_name in local vars.
8175 * lib/bitset_stats.c: Likewise.
8176 * src/files.c: Likewise.
8177 * src/scan-skel.l ("@output ".*\n): Likewise.
8178 * src/files.c (file_name_split): Renamed from filename_split.
8179 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
8180
81812005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8182
8183 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8184 to accommodate latest gnulib.
8185
8186 * tests/glr-regression.at (Duplicate representation of merged trees):
8187 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8188
8189 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8190 needed.
8191
42a6501d
PE
81922005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8193
8194 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8195 All uses changed. Invoke user destructor after an error during a
8196 split parse (trivial change from Joel E. Denny).
8197
8198 * tests/glr-regression.at
8199 (User destructor after an error during a split parse): New test case.
8200 Problem reported by Joel E. Denny in:
8201 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8202
ef9a1faf
PE
82032005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8204
5b4aaf78
PE
8205 * README-cvs: Give URLs for recommended tools.
8206 Mention Gzip version problem, and bootstrapping issues.
8207 Remove troubleshooting section, as it's somewhat obsolete.
8208
b5240ba5
PE
8209 * bootstrap (no_cache): New var, to accommodate different wget
8210 variants. Use it instead of '-C off'. Problem reported by
8211 twlevo@xs4all.nl.
8212
ef9a1faf
PE
8213 * data/glr.c (yydestroyStackItem): New function.
8214 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8215 debugging information. Problem reported by Joel E. Denny.
8216
e6efa9da
AD
82172005-08-25 Akim Demaille <akim@epita.fr>
8218
8219 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8220
adc90f13
PE
82212005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8222
8223 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8224 Don't invoke destructor on unresolved entries.
8225 * tests/glr-regression.at
8226 (User destructor for unresolved GLR semantic value): New test case.
8227 Problem reported by Joel E. Denny in:
8228 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8229
f9315de5
PE
82302005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8231
15d29c1f
PE
8232 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8233 Add strnlen.c.
8234 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8235 lib-prefix.m4, po.m4.
8236
dd5f2af2
PE
8237 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8238 in yydestruct diagnostic, since it might not be an error.
8239 Problem reported by Joel Denny near end of
8240 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 8241 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
8242 * data/yacc.c (yyreturn): Likewise.
8243 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8244
8245 * src/files.c: Remove obsolete FIXME comment.
8246
8247 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8248 with the other templates, and to fix bogus run-on messages such
8249 as the one reported at the end of
8250 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8251 All callers changed to avoid the newline.
8252 (yyprocessOneStack): Output two lines rather than one, to accommodate
8253 the above change. This changes the debug output format slightly.
8254
f9315de5
PE
8255 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8256 reported by Joel E. Denny in
8257 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8258 (trivial change).
8259 * tests/glr-regression.at (Duplicate representation of merged trees):
8260 New test, from Joel E. Denny in:
8261 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8262 * THANKS: Add Joel E. Denny.
8263
8264 * configure.ac (AC_INIT): Bump to 2.0c.
8265
04098407
PE
82662005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8267
8268 * NEWS: Version 2.0b.
8269
ca5d2013
PE
8270 * Makefile.am (SUBDIRS): Put examples before tests, so that
8271 "make check" doesn't finish with "All 1 tests passed".
8272
3d54b576
PE
8273 * tests/regression.at (Token definitions): Don't rely on
8274 AT_PARSER_CHECK for data that contains backslashes. It currently
8275 uses 'echo', and 'echo' isn't portable if its argument contains
8276 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8277 that the byte '\0xff' is not printable in the C locale; it is,
8278 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8279 not printable, so use '\0x81' to test.
8280
d53ae497
PE
8281 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8282 version of GCC, since the macro is used with non-GCC compilers.
8283
fc01665e
PE
8284 Fix core dump reported by Pablo De Napoli in
8285 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8286 * tests/regression.at (Invalid inputs with {}): New test.
8287 * src/parse-gram.y (token_name): Translate type before using
8288 it as an index.
8289
04098407
PE
8290 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8291 the user's name space. All uses changed to __attribute__
8292 ((__unused__)).
8293 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8294 Add __attribute__ ((__noreturn__)).
8295
8296 * etc/clcommit: Remove. We weren't using it, and it failed
8297 "make maintainer-distcheck".
8298 * Makefile.maint: Merge from coreutils.
8299 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8300 (syntax-check-rules): Change list of rules as described below.
8301 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8302 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8303 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8304 (sc_trailing_space): New rules.
8305 (sc_xalloc_h_in_src): Remove.
8306 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8307 (sc_space_tab, sc_error_exit_success, sc_changelog):
8308 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8309 (makefile-check, po-check, author_mark_check):
8310 (makefile_path_separator_check, copyright-check):
8311 Use grep -n, to make it easier to find violations.
8312 Use CVS_LIST and CVS_LIST_EXCEPT.
8313 (header_regexp, h_re): Remove.
8314 (dd_c): New macro.
8315 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8316 (my-distcheck): Use more-modern GCC flags.
8317 (signatures, %.asc): Remove.
8318 (rel-files, announcement): Remove signatures.
8319 Restore old updating code, even though we don't use it, so
8320 that we're the same as coreutils.
8321 (alpha, beta, major): Depend on news-date-check.
8322 Make the upload commands.
8323
8324 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8325 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8326 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8327 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8328 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8329 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8330 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8331 * tests/sets.at: Likewise.
8332
8333 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8334 we comment out the Autoconf version number.
8335 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8336 it's error-prone and "make maintainer-distcheck" rejects it.
8337
8338 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8339 Indent calls to "error" to pacify "make maintainer-distcheck",
8340 when the calls are not intended to be translated.
8341 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8342
8343 * src/Makefile.am (DEFS): Use +=, to pacify
8344 "make maintainer-distcheck".
8345 (bison_SOURCES): Add scan-skel.h.
8346 (sc_tight_scope): New rule, from coreutils.
8347
8348 * src/files.c (src_extension, header_extension):
8349 Now static, not extern.
8350 * src/getargs.c (short_options): Likewise.
8351 * src/muscle_tab.c (muscle_table): Likewise.
8352 * src/parse-gram.y (current_class, current_type, current_prec):
8353 Likewise.
8354 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8355 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8356 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8357 void, to avoid warning when NLS is disabled.
8358 * src/output.c: Include scan-skel.h.
8359 (scan_skel): Remove decl, since scan-skel.h does this.
8360 (output_skeleton):
8361 Indent calls to "error" to pacify "make maintainer-distcheck".
8362 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8363 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8364 "make maintainer-distcheck".
8365 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8366 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8367 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8368 (skel_lex_destroy, scan_skel): Move these decls to...
8369 * src/scan-skel.h: New file.
8370 * src/uniqstr.c (uniqstr_assert):
8371 Indent calls to "error" to pacify "make maintainer-distcheck".
8372
8373 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8374 not @VAR@.
8375
8376 * tests/torture.at: Revamp to avoid misuse of atoi that
8377 "make maintainer-distcheck" complained about.
8378
8379 * examples/extexi (message): Don't print a message more than once,
8380 and omit line-number decoration that makes Emacs compile think
8381 that informative messages are worth worrying about.
8382
83832005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8384
8385 * configure.ac: Update version number.
8386
8387 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8388 accidentally.
8389 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8390 autogenerated by the maintainer.
8391 * examples/calc++/.cvsignore: Add *.yy.
8392
8393 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8394 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8395 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8396
8397 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8398
8399 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8400 from maintainer-distcheck about casting the argument of 'free'.
8401
8402 * NEWS: Mention recent yytname changes.
8403 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8404
8405 * bootstrap: For translations that have not yet been upgraded to
8406 the new runtime-po domain, prime the pump by extracting the
8407 relevant strings from the obsolete translations. This code can be
8408 removed once the bison-runtime domain has been translated by each
8409 team.
8410
8411 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8412 now that token names are already quoted.
8413
8414 Fix problem reported by Anthony Heading.
8415 * data/glr.c (YYTOKEN_TABLE): New macro.
8416 (yytname): Define if YYTOKEN_TABLE.
8417 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8418 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8419 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8420 * src/output.c (prepare_symbols): Output token_table_flag.
8421
0ffda363
PE
84222005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8423
8424 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8425 again if the first call fails.
8426
8427 * data/glr.c (yytnamerr): New function.
8428 (yyreportSyntaxError): Use it to dequote most string literals.
8429 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8430 with other skeletons. All uses changed.
8431 (yytnameerr_): New function.
8432 (yyreport_syntax_error): Use it to dequote most string literals.
8433 * data/yacc.c (yytnamerr): New function.
8434 (yyerrlab): Use it to decode most string literals.
8435 * doc/bison.texinfo (Decl Summary, Calling Convention):
8436 Clarify quoting convention of yytname.
8437 * src/output.c (prepare_symbols): Quote all names. This undoes
8438 the 2005-04-17 change, which is now accomplished (mostly) via
8439 changes in the parsers as described above.
8440 * tests/regression.at (Token definitions, Web2c Actions):
8441 Undo most 2005-04-17 change here, too.
8442
84432005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8444
8445 Fix more problems reported by twlevo@xs4all.nl.
8446 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8447 remove trailing spaces. This loses the exit status of ./types,
8448 and isn't needed since ./types shouldn't be emitting trailing
8449 spaces.
8450 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8451 as the stack isn't valid in that case.
8452
8453 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8454 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8455 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8456 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8457 is used.
8458 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8459 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8460 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8461 Likewise.
8462
8463 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8464 overly-picky compilers that reject 'char *foo = "bar";'.
8465
8466 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8467 to FILE * parameter, not to stderr. This fixes a typo introduced
8468 in the 2005-07-12 change.
8469
8470 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8471 warnings from GCC 4.
8472
8473 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8474 (yyglrShiftDefer, yysplitStack):
8475 Remove unused parameters b4_pure_formals. All uses changed.
8476 (yyglrShift): Remove unused parameters b4_user_formals.
8477 All uses changed.
8478 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8479
6100a9aa
PE
84802005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8481
258b75ca
PE
8482 Destructor cleanups and regularization among the three skeletons.
8483 * NEWS: Document the behavior changes.
8484 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8485 stack before failing, as the cleanup code will do it for us now.
8486 * data/lalr1.cc (yyerrlab): Likewise.
8487 * data/glr.c (yyparse): Pop everything off the stack before
8488 freeing it, so that destructors get called properly.
8489 * data/lalr1.cc (yyreturn): Likewise.
8490 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8491 This is more consistent.
8492 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8493 why destructors might be called. 1.875 -> 2.1.
8494 (Destructor Decl, Decl Summary, Table of Symbols):
8495 Some English-language cleanups for %destructor.
8496 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8497 Add output line for destructor of start symbol.
8498 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8499 because of that same extra output line.
8500
1a059451
PE
8501 * NEWS: Document minor wording changes in diagnostics of
8502 Bison-generated parsers.
8503 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8504 Remove unused formals. All uses changed.
8505 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8506 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8507 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8508 Rename yyoverflowab to yyexhaustedlab.
8509 When memory exhaustion occurs during syntax-error reporting,
8510 report it separately rather than in a single diagnostic; this
8511 eases translation.
8512 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8513 (Memory Exhausted): Renamed from Parser Stack Overflow.
8514 Revamp wording slightly to prefer "memory exhaustion".
8515 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8516
97460c78
PE
8517 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8518
30757c8c
PE
8519 Add i18n support to the GLR skeleton. Partially fix the C++
8520 skeleton; a C++ expert needs to finish this. Remove debugging
8521 msgids; there's little point to having them translated, since they
8522 can be understood only by someone who can read the
8523 (English-language) source code.
8524
8525 Generate runtime-po/bison-runtime.pot automatically, so that we
8526 don't have to worry about garbage getting in that file. We'll
8527 make sure after the next official release that old msgids don't
8528 get lost. See
8529 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8530
8531 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8532 Now auto-generated.
8533 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8534 Fix typos in explanations of the runtime file.
8535 * bootstrap: Change gettext keyword from YYI18N to YY_.
8536 Use standard Makefile.in.in in runtime-po, since we'll arrange
8537 for backward-compatible bison-runtime.po files in a different way.
8538 * data/glr.c (YY_): New macro, from yacc.c.
8539 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8540 Translate messages intended for users.
8541 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8542 the wording in the other skeletons. We don't know that the memory
8543 is virtual.
8544 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8545 Use same method that yacc.c uses.
8546 Don't translate debugging messages.
8547 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8548 it doesn't work (yet), and requires C++ expertise to fix.
8549 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8550 Move defn to a more logical place, to be consistent with other
8551 skeletons.
8552 Don't translate debugging messages.
8553 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8554 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8555 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8556 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8557
ac8c5689
PE
8558 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8559 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8560 void, not int.
8561 * tests/glr-regression.at (Badly Collapsed GLR States):
8562 Likewise.
8563 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8564 yylex should return 0 at EOF rather than aborting.
8565
6100a9aa
PE
8566 Improve tests for stack overflow in GLR parser.
8567 Problem reported by twlevo@xs4all.nl.
8568 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8569 All uses removed.
8570 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8571 can handle the problem.
8572 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8573 (yyparse): New local variable yyresult to record the result.
8574 Use result of setjmp to set it, rather than storing itinto
8575 struct.
8576 (yyDone): Remove label.
8577 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8578 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8579 if YYABORT is used).
8580 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8581 yyparse status; put status > 1 into diagnostic.
8582 Check that status==2 works.
8583 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8584 Use exit status 3 for failure to open (which shouldn't happen).
8585
15f40952
PE
85862005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8587
67fd79c4
PE
8588 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8589 1 on syntax error; just let yyparse do its thing.
8590 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8591 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8592 (Exploding the Stack Size with Alloca):
8593 (Exploding the Stack Size with Malloc):
8594 Expect exit status 2, not 1, since the parser is supposed to blow
8595 its stack. Problem reported by twlevo@xs4all.nl.
8596
15f40952
PE
8597 * data/glr.c (yyparse): Don't assume that the initial calls
8598 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8599 Print a stack-overflow message and fail instead.
8600 Initialize the line-number information before creating the stack,
8601 so that the stack-overflow message can report line zero safely.
8602
f32c66b5
PE
86032005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8604
a22ff96f 8605 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
8606 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8607 (yyuserMerge): Provide a default case if b4_mergers is empty.
8608 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8609 * tests/glr-regression.at
8610 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 8611 Add casts to pacify C++ compilers.
1beb0b24
PE
8612 * tests/glr-regression.at (Improper merging of GLR delayed action
8613 sets): Declare yylex before using it.
f32c66b5 8614 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
8615 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8616 test for valgrind; valgrind is independent of g++.
8617 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8618 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8619 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8620 Use a destructor, so that we can expand the stack. Change
8621 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 8622
d741bd1b
PE
86232005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8624
8625 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8626 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8627
0410a6e0
PE
86282005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8629
8630 * PACKAGING: New file, suggested by Bruno Haible and taken from
8631 similar wording in gettext's PACKAGING file.
8632 * NEWS: Mention PACKAGING.
8633 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8634
f7ab6a50
PE
86352005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8636
baf785db 8637 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
8638 * bootstrap: Get runtime translations into runtime-po.
8639 Create runtime-po files automatically, if possible.
8640 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8641 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8642 does not infringe on the user's name space.
8643 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8644 * doc/bison.texinfo (Internationalization): Revamp the English
8645 and Texinfo syntax a bit, to try to make it clearer.
8646 (Bison Options, Option Cross Key): Mention --print-localedir.
8647 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8648 YYENABLE_NLS. Quote a bit more.
8649 * runtime-po/.cvsignore: New file.
8650 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8651 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8652 * runtime-po/quot.sed: Likewise.
8653 * runtime-po/boldquot.sed: Likewise.
8654 * runtime-po/en@quot.header: Likewise.
8655 * runtime-po/en@boldquot.header: Likewise.
8656 * runtime-po/insert-header.sin: Likewise.
8657 * runtime-po/remove-potcdate.sin: Likewise.
8658 * runtime-po/Makevars: Likewise.
8659 * runtime-po/LINGUAS: Likewise.
8660 * runtime-po/de.po: Likewise; we will rely on the translation project
8661 to maintain this, so "bootstrap" should get it.
0410a6e0 8662 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
8663 its value.
8664 * src/main.c (main): Bind the bison-runtime domain, too.
8665
86662005-07-12 Bruno Haible <bruno@clisp.org>
8667
8668 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8669 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8670 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8671 * runtime-po: New directory.
8672 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8673 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8674 * runtime-po/Rules-quot: New file, copied from po/.
8675 * runtime-po/quot.sed: Likewise.
8676 * runtime-po/boldquot.sed: Likewise.
8677 * runtime-po/en@quot.header: Likewise.
8678 * runtime-po/en@boldquot.header: Likewise.
8679 * runtime-po/insert-header.sin: Likewise.
8680 * runtime-po/remove-potcdate.sin: Likewise.
8681 * runtime-po/Makevars: New file.
8682 * runtime-po/POTFILES.in: New file.
8683 * runtime-po/LINGUAS: New file.
8684 * runtime-po/bison-runtime.pot: New file.
8685 * runtime-po/de.po: New file.
8686 * m4/bison.m4: New file.
8687 * Makefile.am (SUBDIRS): Add runtime-po.
8688 (aclocaldir, aclocal_DATA): New variables.
8689 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8690 Define aclocaldir.
8691 * src/getargs.c (usage): Document --print-localedir option.
8692 (PRINT_LOCALEDIR_OPTION): New enum item.
8693 (long_options): Add --print-localedir option.
8694 (getargs): Handle --print-localedir option.
8695 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8696 (Internationalization): New section.
8697
22dda0f0
AD
86982005-07-12 Akim Demaille <akim@epita.fr>
8699
8700 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8701 for consistency with the rest of the code.
8702 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8703 Add separators.
8704
82b248ad
AD
87052005-07-12 Akim Demaille <akim@epita.fr>
8706
8707 * src/parse-gram.y: Use %printer instead of YYPRINT.
8708
fa0e9314
AD
87092005-07-12 Akim Demaille <akim@epita.fr>
8710
867a3e00
AD
8711 * src/symtab.h, src/symtab.c (symbol_print): New.
8712 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8713 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8714
87152005-07-12 Akim Demaille <akim@epita.fr>
8716
8717 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
8718 b4_at_dollar and b4_dollar_dollar.
8719
e054b190
PE
87202005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8721
8722 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8723 and Pennello's paper.
8724
34160ec4
PE
87252005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8726
407d4a75
PE
8727 * data/yacc.c (yyparse): Undo previous patch. Instead,
8728 set yylsp[0] and yyvsp[0] only if the initial action
8729 sets yylloc and yylval, respectively.
8730
34160ec4
PE
8731 * data/yacc.c (yyparse): In the initial action, set
8732 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8733 This avoids the use of undefined variables if the initial
8734 action does not set yylloc and/or yylval.
8735
c3d5a4a7
PE
87362005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8737
b34d96c1
PE
8738 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8739 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8740 Remove from CVS. These files are automatically generated.
8741 * examples/extexi: Clarify that this file is now part of Bison,
8742 not GNU M4, and that it works with any POSIX-compatible Awk.
8743 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8744 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8745 so that we also get calc++-parser.yy. Geneate it.
8746 Use $(AWK), not gawk, since any conforming Awk will do.
8747 Put comment before action, since older 'make' can't handle comment
8748 in action.
8749 $(BUILT_SOURCES): List all built sources, not just some of them.
8750 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8751 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8752 $($(calc_sources_generated)): Remove unnecessary test for existence
8753 of target. (This had a shell syntax error anyway; a stray "x".)
8754 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8755 calc++-parser.yy.
8756 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8757
c3d5a4a7
PE
8758 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8759 implied by the other modules.
8760
828c373b
AD
87612005-07-06 Akim Demaille <akim@epita.fr>
8762
8763 Bind examples/calc++ to the package.
8764 * examples/calc++/Makefile: Remove, replaced by...
8765 * examples/calc++/Makefile.am: ... this new file.
8766 * examples/calc++/test: Remove input.
8767 * examples/calc++/compile: Remove.
8768 * examples/Makefile.am: New.
8769 * configure.ac, Makefile.am: Adjust.
8770 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8771
63cb01d6
PE
87722005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8773
fd2df2ed
PE
8774 * data/glr.c (yyFail): Drastically simplify; since the format argument
8775 never had any % directives, we can simply pass it to yyerror.
8776 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8777 be modified later, as that is the usual style in glr.c.
8778 Problems reported by Paul Hilfinger.
8779
63cb01d6
PE
8780 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8781 and size overflow errors.
8782 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8783 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8784 (YYSIZEMAX): New macro.
8785 (yystpcpy): New function, taken from yacc.c.
8786 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8787 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8788 so that we don't have to maintain their signatures.
8789 (yyFail): Check for buffer overflow, by using vsnprintf rather
8790 than vsprintf. Allocate a bigger buffer if possible.
8791 Report an error if buffer allocation fails.
8792 (yyStackOverflow): New function.
8793 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8794 the initialization was successful. It might fail if storage was
8795 exhausted.
8796 (yyexpandGLRStack): Add more checks for storage allocation failure.
8797 Use yyStackOverflow to report failures.
8798 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8799 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8800 Don't assume stack number fits in int.
8801 (yysplitStack): Check for storage allocation failure.
8802 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8803 can print diagnostics on storage allocation failure. All callers
8804 changed.
8805 (yyresolveValue): Use yybool for boolean.
8806 (yyreportSyntaxError): Check for size-calculation overflow.
8807 This code is taken from yacc.c.
8808 (yyparse): Check for storage allocation errors when allocating
8809 the initial stack.
8810
1c59e0a1
AD
88112005-07-05 Akim Demaille <akim@epita.fr>
8812
8813 Extract calc++ from the documentation.
8814 * doc/bison.texinfo (Calc++): Add the extraction marks.
8815 * examples/extexi: New, from the aborted GNU Programming 2E.
8816 Separate the different paragraph of a file with empty lines.
8817 * examples/Makefile: Use it to extract the whole calc++ example.
8818
8a0adb01
AD
88192005-06-24 Akim Demaille <akim@epita.fr>
8820
8821 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8822 class typedefs.
8823
12545799
AD
88242005-06-22 Akim Demaille <akim@epita.fr>
8825
8826 * doc/bison.texinfo (C++ Language Interface): First stab.
8827 (C++ Parsers): Remove.
8828
99be0235
AD
88292005-06-22 Akim Demaille <akim@epita.fr>
8830
8831 * data/lalr1.cc (yylex_): Honor %lex-param.
8832
0ffd4fd1
AD
88332005-06-22 Akim Demaille <akim@epita.fr>
8834
8835 Start a set of simple examples.
8836 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8837 * examples/calc++/calc++-driver.hh,
8838 * examples/calc++/calc++-parser.yy,
8839 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8840 * examples/calc++/compile, examples/calc++/test: New.
8841
0925ebb4
PE
88422005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8843
8844 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8845 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8846 which stems from the 2005-05-27 patch.
8847
43d3b664
PH
88482005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8849
8850 * data/glr.c: Modify treatment of unused parameters to permit use
8851 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8852
3062864d
PE
88532005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8854
8855 Fix infringement on user name space reported by Janos Zoltan Szabo.
8856 * data/yacc.c (yyparse): strlen -> yystrlen.
8857
989b5b8e
AD
88582005-05-30 Akim Demaille <akim@epita.fr>
8859
8860 * data/lalr1.cc (_): New.
8861 Translate the various messages.
8862
bedf57f5
PE
88632005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8864
8865 Fix infringement on user name space reported by Bruno Haible.
8866 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8867 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8868 the user's name space.
8869 (alloca): Include <stdlib.h> to get it, if it's not built in.
8870 (YYMALLOC, YYFREE): Define only if needed.
8871 (malloc, free): Declare, but only if needed, as this infringes on
8872 the user name space.
8873
4d1801f1
PE
88742005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8875
8876 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8877 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8878 with %d format.
8879 * lib/ebitset.c (min, max): Undef before defining.
8880 * lib/vbitset.c (min, max): Likewise.
8881 * lib/subpipe.c (create_subpipe): Save local variables in case
8882 vfork clobbers them.
8883
88842005-05-24 Bruno Haible <bruno@clisp.org>
8885
8886 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8887 error message syntax used by gcc-4.0.
8888
b94a9e1e
PE
88892005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8890
85ac3861
PE
8891 * README: Mention m4 1.4.3. Remove obsolete advice about
8892 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8893
b94a9e1e
PE
8894 * bootstrap: Remove workaround for problem I encountered with
8895 gettext 0.14.1; it seems to be fixed now.
8896
51c30d21
PE
88972005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8898
009ce67d
PE
8899 * NEWS: Version 2.0a.
8900
f2a97c62
PE
8901 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8902 the previous change.
8903
c8775f93
PE
8904 Various maintainer cleanups.
8905 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8906 conftest*, for benefit of CVS commands run at the same time as
8907 "configure". Add build-aux, since "bootstrap" now creates it and
8908 its subfiles.
8909 * Makefile.cfg (move_if_change): Remove.
8910 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8911 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8912 (po_repo, do-po-update, po-update, wget_files, get-targets):
8913 (config.guess-url_prefix, config.sub-url_prefix):
8914 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8915 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8916 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8917 Remove.
8918 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8919 this is now the recommended name.
8920 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8921 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8922 ylwrap. These files now go into build-aux.
8923 * config/move-if-change: Remove.
8924 * config/prev-version.txt: Bump from 1.75 to 2.0.
8925
3ea5f0ec
PE
8926 * bootstrap: Add stdio-safer, unistd-safer modules.
8927 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8928 we don't need it).
8929 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8930 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8931 * lib/subpipe.c: Include "unistd-safer.h".
8932 (create_subpipe): Make sure all the newly-created
8933 file descriptors are > 2, so that diagnostics don't
8934 get sent down them (which might cause Bison to hang, in theory).
8935 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8936 * src/files.c (xfopen): Use fopen_safer, not fopen.
8937
51c30d21
PE
8938 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8939 yesterday's yacc.c fix.
8940
cea1469d
PE
89412005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8942
3ea5f0ec
PE
8943 * data/glr.c, data/lalr1.cc: Update copyright date.
8944
cea1469d
PE
8945 Fix a destructor bug reported by Wolfgang Spraul in
8946 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8947 * data/yacc.c (yyabortlab): Don't call destructor, and
8948 don't set yychar to EMPTY.
8949 (yyoverflowlab): Don't call destructor.
8950 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8951 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8952 since we no longer output the message "discarding lookahead token
8953 end of input ()".
8954
5e6f62f2
PH
89552005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8956
8957 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8958 fix a small glitch in debugging output.
8959 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8960 after YY_SYMBOL_PRINT where needed.
8961
8962 (struct yyGLRState): Add some comments.
8963 (struct yySemanticOption): Add some comments.
8964 (union yyGLRStackItem): Add comment.
8965
8966 (yymergeOptionSets): Correct this to properly perform the union,
8967 avoiding infinite reported by Michael Rosien.
8968 Update comment.
8969
8970 * tests/glr-regression.at: Add test for GLR merging error reported
8971 by M. Rosien.
cea1469d 8972
0fb669f9
PE
89732005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8974
8975 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8976 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8977 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8978 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8979 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8980 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8981 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8982 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8983 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8984 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8985 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8986 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8987 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8988 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8989 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8990 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8991 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8992 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8993 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8994 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8995 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8996 src/output.h, src/parse-gram.c, src/parse-gram.h,
8997 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8998 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8999 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
9000 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
9001 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
9002 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
9003 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
9004 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
9005 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
9006 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
9007 tests/reduce.at, tests/regression.at, tests/sets.at,
9008 tests/synclines.at, tests/testsuite.at, tests/torture.at:
9009 Update FSF postal mail address.
9010
51f4735e
PE
90112005-05-11 Paul Eggert <eggert@cs.ucla.edu>
9012
9013 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
9014 Problem reported by Ralf Menzel.
9015
80ce3401
PE
90162005-05-01 Paul Eggert <eggert@cs.ucla.edu>
9017
9018 * tests/actions.at: Test that stack overflow invokes destructors.
9019 From Marcus Holland-Moritz.
9020 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9021 from here....
9022 (yyreturn): to here. That way, destructors are called properly
9023 even if the stack overflows, or the user calls YYACCEPT or
9024 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9025 (yyoverflowlab): Destroy the lookahead.
9026
90272005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9028
9029 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9030
72f000b0
PE
90312005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9032
9033 * NEWS: Bison-generated C parsers no longer quote literal strings
9034 associated with tokens.
9035 * src/output.c (prepare_symbols): Don't escape strings,
9036 since users don't want to see C escapes.
9037 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9038 in diagnostics.
c19683bb 9039 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
9040 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9041
1094323f
PE
90422005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9043
9044 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9045 the data size is known to be too small and we can't increase it.
9046 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9047
ca407bdf
PE
90482005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9049
9050 * src/parse-gram.y: Include quotearg.h.
9051 (string_as_id): Quote $1 before using it as a key, since the
9052 lexer no longer quotes it for us.
9053 (string_content): Don't strip quotes, since lexer no longer
9054 quotes it for us.
9055 * src/scan-gram.l: Include quotearg.h.
9056 ("\""): Omit quote.
9057 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9058 a key, since the rest of the lexer doesn't quote it.
9059 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9060 * tests/regression.at (Token definitions): Check for backslashes
9061 in token strings.
9062
9063 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9064 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9065 (yyparse): Revamp code to generate long syntax error message, to
9066 make it easier to translate, and to avoid problems with arithmetic
9067 overflow. Change "virtual memory" to "memory" in diagnostic, since
9068 we don't know whether the memory is virtual.
9069
1ce59070
PE
90702005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9071
9072 * NEWS: Bison-generated C parsers now use the _ macro to
9073 translate strings.
9074 * data/yacc.c (_) [!defined _]: New macro.
9075 All English strings wrapped inside this macro.
9076 * doc/bison.texinfo (Bison Parser): Document _.
9077 * po/POTFILES.in: Include src/parse-gram.c, since it now
9078 includes translateable strings that parse-gram.y doesn't.
9079
a749a695
PE
90802005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9083 reverting the 2004-10-11 change to this function.
9084 (symbol_check_alias_consistency): Don't call symbol_type_set
9085 if the type name is already correct.
9086 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9087
8fb1053b
PE
90882005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9089
9090 * tests/regression.at (Token definitions): Don't use a token named
9091 c, as that generates a "#define c ..." that runs afoul of buggy
9092 stdlib.h that uses the identifier c as a member of struct
9093 drand48_data. Problem reported by Horst Wente.
9094
ff498c4a
PE
90952005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9096
9097 * bootstrap: Change translation URL from
9098 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9099 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9100 redirection glitches. Problem reported by twlevo@xs4all.nl.
9101
65211d70
PE
91022005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9103
9104 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9105 after operands; POSIX says this isn't portable for the c99 command.
9106
9577fb1f
PE
91072005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9108
9109 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9110 immediately if a data overrun has occurred; this may help us track
9111 down what may be a spurious failure on MacOS.
9112
78b178f7
PE
91132005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9114
a2599d0f
PE
9115 Respond to problems reported by twlevo@xs4all.nl.
9116
9117 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9118
78b178f7
PE
9119 * src/vcg.h: Comment fix.
9120 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9121 (G_CMAX): Change to -1 instead of INT_MAX.
9122
9123 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 9124
7296e729
PE
91252005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9126
9127 * src/tables.c (state_number_to_vector_number): Put it inside an
9128 "#if 0", since it's not currently used. Problem reported by
9129 Roland McGrath.
9130
05ac60f3
PE
91312005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9132
9133 * src/output.c (escaped_output): Renamed from
9134 escaped_file_name_output, since we now use it for symbol tags as
9135 well. All uses changed.
9136 (symbol_destructors_output, symbol_printers_output):
9137 Escape symbol tags too.
9138 Problem reported by Matyas Forstner in
9139 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9140
9141 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9142 not needed.
9143 * src/output.c (user_actions_output, token_definitions_output,
9144 symbol_destructors_output, symbol_printers_output): Likewise.
9145 * src/reader.c (prologue_augment): Likewise.
9146 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9147
9148 * src/vcg.c (output_edge): Don't quote linestyle arg.
9149 Problem reported by twlevo@xs4all.nl.
9150
7eb453ac
PE
91512005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9152
9153 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9154 example, reported by Derek M Jones. Also, make the example even
9155 more outrageous, to better illustrate how bad the problem is.
9156
4c04c52a
PE
91572005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9158
9159 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9160 putsym. Typo reported by Sebastian Piping.
9161
a61e1620
PE
91622005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9163
9164 * doc/bison.texinfo (Language and Grammar): some -> same
9165 (Epilogue): int he -> in the
9166 Typos reported by Sebastian Piping via Justin Pence.
9167
9ec93868
PE
91682005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9169
9170 * tests/glr-regression.at (Improper handling of embedded actions
9171 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9172 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9173 with dollar signs in test names.
9174 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9175 for a similar reason.
9176
73ce7e7e
PE
91772005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9178
9179 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9180 wants to redefine G_VIEW.
9181
2e72b98e
PE
91822005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9183
9184 * src/vcg.c (get_view_str): Remove case for normal_view.
9185 Problem reported by twlevo@xs4all.nl.
9186
e0d634e5
PE
91872005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9188
ccf830a4
PE
9189 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9190 Problem reported by twlevo@xs4all.nl.
9191
e0d634e5
PE
9192 * doc/bison.texinfo: Change @dircategory from "GNU programming
9193 tools" to "Software development". Requested by Richard Stallman
9194 via Karl Berry.
9195
7bbc8cb0
PE
91962005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9197
9198 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9199 Problem reported by twlevo@xs4all.nl.
9200
08b770bc
PE
92012005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9202
9203 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9204 keyword; it's not needed with modern compilers, and it doesn't
9205 affect correctness with older compilers. Suggested by
9206 twlevo@xs4all.nl.
9207
95f22ad2
PE
92082005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9209
9210 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9211 gcc -Wswitch-default.
9212 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9213 * data/yacc.c (yyparse): Likewise.
9214
d229d15c
PE
92152005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9216
9217 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9218 already. Let config.h define any nonstandard values.
9219
ecadd90f
PE
92202005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9221
9222 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9223 for the benefit of slower hosts. Problem reported by
9224 Nelson H. F. Beebe.
9225
213744b5
PE
92262005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9227
9228 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9229 being defined and not used.
9230 * data/lalr1.cc (yyparse): Likewise.
9231 Use "if (false)" rather than "if (0)".
9232
249d3236
PE
92332005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9234
9235 * TODO: Mention that we should allow NUL bytes in tokens.
9236
987cc1fb
PE
92372005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9238
9239 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9240 Problem reported by Hans Aberg.
9241
08fe02d9
PE
92422005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9243
9244 * src/getargs.c (version): Happy new year; update overall
9245 program copyright date from 2004 to 2005.
9246
9247 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9248 Problem reported by Hans Aberg.
9249 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9250 (Output file names.): Add a test for the case when standard output
9251 is closed.
9252
010c0266
PE
92532004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9254
9255 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9256 to fix an oversight in the Bison 2.0 manual.
9257
da12206a
PE
92582004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9259
9260 * NEWS: Version 2.0. Reformat the existing news items since
9261 1.875, so that related items are grouped together.
3a4734aa 9262 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
9263 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9264
c935d934
PE
9265 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9266 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9267 otherwise, we're not testing alloca. Unfortunately there's no
9268 simple way to consult HAVE_ALLOCA here.
9269
da12206a
PE
9270 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9271 for yymsg, too.
9272
9273 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9274 hand. This avoids a warning about comparing int to size_t when
9275 GCC warnings are enabled.
9276
0a2c5137
PE
92772004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9278
d7e14fc0
PE
9279 * NEWS: Bison-generated parsers no longer default to using the
9280 alloca function (when available) to extend the parser stack, due
9281 to widespread problems in unchecked stack-overflow detection.
9282 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9283 responsibility to set it to a positive value. This lets the user
9284 specify a value that is not a preprocessor constant.
9285 * data/yacc.c (YYMAXDEPTH): Likewise.
9286 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9287 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9288 to be a compile-time constant. However, explain the constraints on it.
9289 Also, explain the constraints on YYINITDEPTH.
9290 (Table of Symbols): Explain that alloca is no longer the default.
9291 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9292 to 1.
9293
0a2c5137
PE
9294 * doc/bison.texinfo (Location Default Action): Mention that n must
9295 be zero when k is zero. Suggested by Frank Heckenbach.
9296
e019c247
AD
92972004-12-22 Akim Demaille <akim@epita.fr>
9298
9299 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9300 (parser::state_type, parser::semantic_type, parser::location_type):
9301 Private, not public.
9302 (parser::parse): Return ints, not bool.
9303 Returning a bool introduces a problem: 0 corresponds to false, and
9304 it seems weird to return false on success. Returning true changes
9305 the conventions for yyparse.
9306 Alternatively we could return void and send an exception.
9307 There is no clear consensus (yet?).
9308 (state_stack, semantic_stack, location_stack): Rename as...
9309 (state_stack_type, semantic_stack_type, location_stack_type): these.
9310 Private, not public.
9311 * tests/c++.at: New.
9312 * tests/testsuite.at, tests/Makefile.am: Adjust.
9313
72731bb7
AD
93142004-12-21 Akim Demaille <akim@epita.fr>
9315
9316 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9317
9a0d8bec
AD
93182004-12-21 Akim Demaille <akim@epita.fr>
9319
9320 Don't impose std::string for filenames.
9321
9322 * data/lalr1.cc (b4_filename_type): New.
9323 (position::filename): Use it.
9324 (parser.hh): Move the inclusion of stack.hh and location.hh below
9325 the user code, so that needed headers for the filename type can be
9326 included first.
72731bb7
AD
9327 Forward declare them before the user code.
9328 * tests/Makefile.am (check-local, installcheck-local): Pass
9329 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 9330
99880de5
AD
93312004-12-20 Akim Demaille <akim@epita.fr>
9332
9333 Use more STL like names: my_class instead of MyClass.
9334
9335 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9336 (SemanticStack, SemanticType, StateStack, StateType)
9337 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9338 (Parser::value): Rename as...
9339 (location_stack, location_type, rhs_number_type, semantic_stack)
9340 (semantic_type, state_stack, state_type, token_number_type, stack)
9341 (slice, traits, parser::yylloc, parser::yylval): these.
9342
9343 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9344
9bec482e
PE
93452004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9346
9347 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9348 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9349
f6fbd3da
PE
93502004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9351
9352 Remove uses of 'short int' and 'unsigned short int'. This raises
9353 some arbitrary limits. It uses more memory but nowadays that's
9354 not much of an issue.
9355
9356 This change does not affect the generated parsers; that's a different
9357 task, as some users will want to conserve memory there.
9358
9359 Ideally we should use size_t to represent all object counts, and
9360 something like ptrdiff_t to represent signed differences of object
9361 counts; but that will require more code-cleanup than I have the
9362 time to do right now.
9363
9364 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9365 Use size_t, not int or short int, to count objects.
9366 * src/closure.c (nritemset, closure): Likewise.
9367 * src/closure.h (nritemset, closure): Likewise.
9368 * src/nullable.c (nullable_compute): Likewise.
9369 * src/print.c (print_core): Likewise.
9370 * src/print_graph.c (print_core): Likewise.
9371 * src/state.c (state_compare, state_hash): Likewise.
9372 * src/state.h (struct state): Likewise.
9373 * src/tables.c (default_goto, goto_actions): Likewise.
9374
9375 * src/gram.h (rule_number, rule): Use int, not short int.
9376 * src/output.c (prepare_rules): Likewise.
9377 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9378 errs, reductions): Likewise.
9379 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9380 Likewise.
9381 * src/tables.c (vector_number, tally, action_number,
9382 ACTION_NUMBER_MINIMUM): Likewise.
9383 * src/output.c (muscle_insert_short_int_table): Remove.
9384
efeed023
AD
93852004-12-17 Akim Demaille <akim@epita.fr>
9386
9387 * data/lalr1.cc: Extensive Doxygenation.
9388 (error_): Rename as...
9389 (error): this, since it is visible to the user.
9390 Adjust callers.
9391 (Parser::message): Now an automatic variable from...
9392 (Parser::yyreport_syntax_error_): here.
9393 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9394 Parser::error.
9395 * tests/input.at: Escape $.
9396
bc82c5a5
PE
93972004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9398
9399 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9400 Parenthesize rhs to avoid obscure problems with mistakes like
9401 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9402 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9403 b4_rhs_location): Likewise.
9404 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9405 b4_rhs_location): Likewise.
9406
fd19f271
AD
94072004-12-16 Akim Demaille <akim@epita.fr>
9408
9409 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9410 yacc.c: be sure to stay within yycheck_.
9411 * tests/actions.at: Re-enable C++ tests.
9412
10454ea4
AD
94132004-12-16 Akim Demaille <akim@epita.fr>
9414
9415 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9416 real.
9417
c5b95ccf
AD
94182004-12-16 Akim Demaille <akim@epita.fr>
9419
9420 Use #define to handle the %name-prefix.
9421
9422 * data/glr.c, data/yacc.c: Comment changes.
9423 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9424 so that one can refer to yylex in the parser file, and have it
9425 renamed, as is the case with other skeletons.
9426
617a8f12
AD
94272004-12-16 Akim Demaille <akim@epita.fr>
9428
9429 Move lalr1.cc internals into yy*.
9430
9431 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9432 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9433 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9434 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9435 (empty_, final_, terror_, errcode_, ntokens_)
9436 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9437 (looka_, ilooka_, error_range_, nerrs_):
9438 Rename as...
9439 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9440 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9441 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9442 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9443 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9444 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9445 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9446 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9447 these.
9448
1e547e6e
PE
94492004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9450
9451 Fix some problems reported by twlevo at xs4all.
9452 * src/symtab.c (symbol_new): Report an error if the input grammar
9453 contains too many symbols. This is better than calling abort() later.
9454 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9455 (struct node, struct graph):
9456 Rename member expand to stretch. All uses changed.
9457 (struct graph): Remove member layoutalgorithm. All uses removed.
9458 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9459 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9460 All uses changed.
9461 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9462
735d6bd4
AD
94632004-12-15 Akim Demaille <akim@epita.fr>
9464
9465 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9466 Add more Doxygen comments.
9467 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9468 (report_syntax_error_, translate_): Rename as...
9469 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9470 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9471
2e1f5829
AD
94722004-12-15 Akim Demaille <akim@epita.fr>
9473
9474 * data/lalr1.cc (lex_): Rename as...
9475 (yylex_): this.
9476 Move the trace here.
9477 Take the %name-prefix into account.
9478 Reported by Alexandre Duret-Lutz.
9479
a3cb6248
AD
94802004-12-15 Akim Demaille <akim@epita.fr>
9481
9482 Simplify the C++ parser constructor.
9483
9484 * data/lalr1.cc (debug_): Rename as...
9485 (yydebug_): so that the parser's internals are always in the yy*
9486 pseudo namespace.
9487 Adjust uses.
9488 (b4_parse_param_decl): Remove the leading comma as it is now only
9489 called as unique argument list.
9490 (Parser::Parser): Remove the constructor accepting a location and
9491 an initial debugging level.
9492 Remove from the other ctor the argument for the debugging level.
9493 (debug_level_type, debug_level, set_debug_level): New.
9494
9495 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9496 constructor calls.
9497
07fed891
AD
94982004-12-15 Akim Demaille <akim@epita.fr>
9499
9500 Remove b4_root related material: failure experiment
a3cb6248 9501 (which goal was to allow to derive from a class).
07fed891
AD
9502
9503 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9504 definitions and uses.
9505
e603eaa5
PE
95062004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9507
9508 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9509 not 2, since it's not portable to subtract 1 from the start of an
9510 array. The new item 0 is never set or used. All uses changed.
9511
9512 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9513 the default definition of YYLLOC_DEFAULT. Problem reported
9514 by Frank Heckenbach.
9515
fafb007d
PE
95162004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9517
9518 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9519 the normal case and one for the error case. Just use the
9520 first one uniformly. Problem reported by Frank Heckenbach.
9521 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9522 use exactly the same macro in both places.
9523 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9524 so that the normal-case YYRHSLOC works for the error case too.
9525 All uses changed.
9526 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9527 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9528 * doc/bison.texinfo (Location Default Action): Don't claim that
9529 we have an array of locations. Use the same macro for both glr
9530 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9531 the index is 0.
9532
48814dcd
PE
95332004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9534
a4e1a53b
PE
9535 * HACKING: Update email addresses to send announcements to.
9536
48814dcd
PE
9537 * configure.ac (AC_INIT): Bump version to 1.875f.
9538
337116ba
PE
95392004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9540
9541 * NEWS: Version 1.875e.
9542 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9543
9544 * src/scan-skel.l: Include "complain.h", for "fatal".
9545
9546 * src/relation.h (relation_print, relation_digraph):
9547 Relation sizes are of type relation_node, not size_t (this is
9548 merely a doc fix, since the two types are equivalent).
9549 (relation_transpose): Relation sizes are of type relation_node,
9550 not int.
9551 * src/relation.c: Likewise.
9552 (top, infinity): Now of type relation_node, not int.
9553 (traverse, relation_transpose): Use relation_node, not int.
9554
9555 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9556 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9557 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9558
9559 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 9560 specifying whether the test should be skipped. Use it tp
337116ba 9561 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 9562 fail on some hosts, and should be skipped.
337116ba 9563
da2a7671
PE
95642004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9565
9566 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9567 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9568 unless otherwise specified below.
9569
9570 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9571 to allocate kernel_base, kernel_items, kernel_size, since
9572 they needn't be initialized to 0.
9573 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9574 * src/closure.c (new_closure): Likewise, for itemset.
9575 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9576 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9577 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9578 (build_relations): Likewise for edge, states1, includes.
9579 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9580 * src/reader.c (packgram): Likewise, for ritem, rules.
9581 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9582 * src/relation.c (relation_digraph): Likewise for VERTICES.
9583 (relation_transpose): Likewise for new_R, end_R.
9584 * src/symtab.c (symbols_token_translations_init): Likewise for
9585 token_translations.
9586 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9587 (token_actions): Likewise for yydefact, actrow, conflrow,
9588 conflict_list.
9589 (save_column): Likewise for froms[symno], tos[symno].
9590 (goto_actions): Likewise for state_count.
9591 (pack_table): Likewise for base, pos, check.
9592 (tables_generate): Likewise for width.
9593
9594 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9595 for initial core. Just have a separate core, so we needn't worry
9596 about whether kernel_size and kernel_base are initialized.
9597
9598 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9599 kernel_size, kernel_items): Remove unnecessary initialization.
9600 * src/conflicts.c (conflicts): Likewise.
9601 * src/derives.c (derives): Likewise.
9602 * src/muscle_tablc (muscle_insert): Likewise.
9603 * src/relation.c (relation_digraph): Likewise.
9604 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9605 conflrow, conflict_table, conflict_list, table, check):
9606 Likewise.
9607
9608 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9609 This is because all callers pass unsigned int.
9610 * src/closure.h (new_closure): Likewise.
9611
9612 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9613 (build_relations): Initialize includes[i] in all cases.
9614 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9615 and rules[ruleno].precsym. Initialize members in order.
9616 * src/relation.c (relation_transpose): Always initialize new_R[i]
9617 and end_R[i].
9618 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9619
9620 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9621 conflict_list[0] was always 0, but now it isn't initialized.
9622
9623 * src/table.c (table_grow): When conflict_table grew, the grown
9624 area wasn't cleared. Fix this.
9625
9626 * lib/.cvsignore: Add strdup.c, strdup.h.
9627 * m4/.cvsignore: Add strdup.m4.
9628
00baeeac
PE
96292004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9630
9631 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9632 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9633 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9634 ngotos + 1 without checking for overflow.
9635 (build_relations): Use END_NODE, not -1, to denote end of edges.
9636 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9637 build_relations): Use goto_number, not int, for goto numbers.
9638 * src/tables.c (save_column, default_goto): Likewise.
9639
be3d9d42
AD
96402004-11-23 Akim Demaille <akim@epita.fr>
9641
9642 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9643 of #defining from yystype.
9644 Don't typedef yystype, C++ does not need it.
9645 This lets it possible to forward declare it as union.
9646
78e526d5
PE
96472004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9648
9649 * bootstrap (gnulib_modules): Add extensions.
9650 Problem reported by Jim Meyering.
9651
afbb696d
PE
96522004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9653
9654 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9655 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9656 src/system.h, src/tables.c: XFREE -> free, to accommodate
9657 recent change to gnulib xalloc.h.
78e526d5 9658 Problem reported by Jim Meyering.
afbb696d 9659
c1f8f16a
AD
96602004-11-17 Akim Demaille <akim@epita.fr>
9661
9662 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9663
db7e5eb5 96642004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
9665 Alexandre Duret-Lutz <adl@gnu.org>
9666
9667 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9668 changes.
9669 (YYCDEBUG): Adjust.
9670 Use it instead of cdebug_.
9671 (Parser::debug_stream, Parser::set_debug_stream): New.
9672 (Parser::symprint_): Define cdebug_ for temporary backward
9673 compatibility.
9674 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9675 debug_stream ().
9676
68e11668
AD
96772004-11-17 Akim Demaille <akim@epita.fr>
9678
9679 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9680 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9681 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9682 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9683
97cbc73e
PE
96842004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9685
9686 * data/glr.c (yyloc_default): Remove; not used.
9687 Problem reported by Frank Heckenbach.
9688
e342c3be
AD
96892004-10-25 Akim Demaille <akim@epita.fr>
9690
9691 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9692 Introduce another definition to address simple location arrays.
9693 (yyGLRStack): New member: yyerror_range.
9694 (yyrecoverSyntaxError, yyparse): Update it.
9695 (yyrecoverSyntaxError): Use it when shifting the error token to
9696 have an accurate range, equivalent to the one computed by both
9697 yacc.c and lalr1.cc.
9698 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9699 that column numbers start at column 0, as per GNU Coding
9700 Standards, the others tests, and the doc.
9701 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9702 Adjust to the above change (first column is 0).
9703 And adjust the location of the "<error>", now covering the whole
9704 line.
9705
93602feb 97062004-10-22 Akim Demaille <akim@epita.fr>
04098407 9707 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
9708
9709 Remove some arbitrary limits on goto numbers and relations.
9710 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9711 initial values, since they're never used.
9712 (set_goto_map): ngotos is now unsigned, so test for overflow
9713 by seeing whether it wraps around to zero.
9714 * src/lalr.h (goto_number): Now size_t, not short int.
9715 (GOTO_NUMBER_MAXIMUM): Remove.
9716 * src/relation.c (relation_print, traverse, relation_transpose):
9717 Check for END_NODE rather than looking at sign.
9718 * src/relation.h (END_NODE): New macro.
9719 (relation_node): Now size_t, not short int.
9720
dba08b04
PE
97212004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9722
9723 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9724 keyword, not an identifier. Problem reported by Baron Schwartz in
9725 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9726
df09ef2e
AD
97272004-10-11 Akim Demaille <akim@epita.fr>
9728
9729 * src/symtab.c (symbol_check_alias_consistency): Also check
9730 type names, destructors, and printers.
9731 Reported by Alexandre Duret-Lutz.
9732 Recode the handling of associativity and precedence in terms
9733 of symbol_precedence_set.
9734 Accept no redeclaration at all, not even equal to the previous
9735 value.
9736 (redeclaration): New.
9737 Use it to factor redeclaration complaints.
9738 (symbol_make_alias): Don't set the type of the alias, let
9739 symbol_check_alias_consistency do it as for other features.
9740 * src/symtab.h (symbol): Add new member prec_location, and
9741 type_location.
9742 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9743 * tests/input.at (Incompatible Aliases): New.
9744
146bc99d
PE
97452004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9746
9747 .cvsignore fixes to accommodate gnulib changes,
9748 and the practice of naming build directories "_build".
9749 * .cvsignore: Add "_*". Sort.
9750 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9751 * m4/.cvsignore: Add "*_gl.m4".
9752
e503aa60
AD
97532004-10-06 Akim Demaille <akim@epita.fr>
9754
9755 * src/parse-gram.y (add_param): Fix the truncation of trailing
9756 spaces.
9757
b4a20338
AD
97582004-10-05 Akim Demaille <akim@epita.fr>
9759
9760 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9761 whether the reducion was empty or not. This leaves room to
9762 improve the use of YYLLOC_DEFAULT in such a case.
9763 lalr1.cc is still experimental, so changing this is acceptable.
9764 And finally, there are probably not many users who changed the
9765 handling of locations in GLR, so changing is admissible too.
9766
9767 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9768 empty reduction, set @$ to an empty location ending the previously
9769 stacked symbol.
9770 Adjust uses to make sure the code is triggered on empty
9771 reductions.
9772 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9773 expected output: empty reductions have empty locations.
9774
f85a5e6f
AD
97752004-09-29 Akim Demaille <akim@epita.fr>
9776
9777 * data/lalr1.cc: Move towards a more standard C++ coding style
9778 for templates: Class < T > -> Class<T>.
9779
b203fc2c
AD
97802004-09-29 Akim Demaille <akim@epita.fr>
9781
9782 * data/lalr1.cc: Reinstall the former ctor, for sake of
9783 compatibility, but warn it will be removed.
9784 Move towards a more standard C++ coding style (i.e., type *var ->
9785 type* var).
9786
5b7e1e73
PE
97872004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9788
3fee967f
PE
9789 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9790 since it's less likely to work if NULs are involved in the future.
5b7e1e73 9791
0dcca5c2
AD
97922004-09-27 Akim Demaille <akim@epita.fr>
9793
9794 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9795
6dde1c82
AD
97962004-09-27 Akim Demaille <akim@epita.fr>
9797
9798 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 9799 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
9800 and argument names.
9801 (b4_cc_constructor_call): Likewise.
9802
b233d555
AD
98032004-09-24 Akim Demaille <akim@epita.fr>
9804
9805 * src/parse-gram.y (add_param): Strip the leading and trailing
9806 blanks from a formal argument declaration.
9807 (YY_LOCATION_PRINT): New.
9808
619404e3
AD
98092004-09-24 Akim Demaille <akim@epita.fr>
9810
9811 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9812 after the location.
9813
dd8d9022
AD
98142004-09-24 Akim Demaille <akim@epita.fr>
9815
9816 * doc/bison.texinfo (Table of Symbols): Sort.
9817
0092f063
AD
98182004-09-21 Akim Demaille <akim@epita.fr>
9819
9820 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9821 the useless parentheses.
9822 Suggested by Paul Eggert.
9823
451364ed
AD
98242004-09-20 Akim Demaille <akim@epita.fr>
9825
9826 Let the initial-action act on the look-ahead, and use it for the
9827 "initial push" (corresponding to an hypothetical beginning-of-file).
9828 And let lalr1.cc honor %initial-action.
9829
9830 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9831 example.
9832 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9833 (Parser::Parser): Remove the ctor that used to initialize it.
9834 (Parser::parse): Like in the other skeletons, issue the "starting
9835 parse" message before any action.
9836 Honor %initial-action.
9837 Initialize the stacks with the lookahead.
9838 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9839 look-ahead.
9840 Push them in the stacks.
9841 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9842
18d192f0
AD
98432004-09-20 Akim Demaille <akim@epita.fr>
9844
9845 * doc/bison.texinfo (Initial Action Decl): New.
9846
b8458aa5
AD
98472004-09-20 Akim Demaille <akim@epita.fr>
9848
9849 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9850 clearer criterion to define it.
9851 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9852 When reducing on an empty RHS, use the latest stacked location as
9853 location.
9854 yylloc is not always available.
9855 * data/glr.c: Likewise.
9856 Also, honor initial-actions.
9857
3fc16193
AD
98582004-09-20 Akim Demaille <akim@epita.fr>
9859
9860 * data/yacc.c (YY_LOCATION_PRINT): New.
9861 Define when we know YYLTYPE's structure, i.e., when the default
9862 YYLLOC_DEFAULT is used.
9863 * data/c.m4 (b4_yysymprint_generate): Use it.
9864 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9865 value of the result.
9866 (error_start_): Replace with...
9867 (error_range_): this location array.
9868 This allows to replace code relying on the implementation of
9869 locations by portable code.
9870 * data/yacc.c (yylerrsp): Replace with...
9871 (yyerror_range): this.
9872 Every time a token is popped, update yyerror_range[0], to have an
9873 accurate location for the error token.
9874 * data/glr.c (YY_LOCATION_PRINT): New.
9875 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9876 deference a pointer.
9877 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9878 report the location in %printers.
9879
9880 * src/scan-skel.l: Instead of abort, report error messages to ease
9881 understanding skeleton scanning failures.
9882
ecfe33e7
AD
98832004-09-16 Akim Demaille <akim@epita.fr>
9884
9885 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9886 (iterator, const_iterator): these, to be more in the C++ spirit.
9887 Also, return reverse iterators so that when displaying the stack
9888 we display its bottom first.
9889 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9890 from yacc.c.
9891 We should probably use vector here though.
9892
1576d44d
AD
98932004-09-16 Akim Demaille <akim@epita.fr>
9894
9895 Have more complete shift traces.
9896
9897 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9898 to report Shifts instead of ad hoc YYDPRINTF invocations,
9899 including for the error token.
9900 * data/lalr1.cc (symprint_): Output the location.
9901 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9902 output the location within the %printer.
9903 Activate GLR tests, at least to make sure they compile properly.
9904 They still don't pass though.
9905 * tests/calc.at: Adjust expect verbose output, since now "Entering
9906 state..." is on a different line than the "Shifting" message.
9907
9c66f418
AD
99082004-09-08 Akim Demaille <akim@epita.fr>
9909
9910 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9911 Bison directive from the Bison file to the invocation of this
9912 macro, so that these directives are passed to
9913 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9914 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9915 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9916 the extra Bison directives instead of the whole series.
9917 Change the grammar so that there are recoverable errors, and
9918 unrecoverable errors. Now we can have the parser give up before
9919 consuming the whole input. As a result we now can observe that
9920 the lookahead is freed when needed.
9921 Change the parser source to parse argv[1] instead of a hard coded
9922 string.
9923 Simplify yylex, and give a value and location to EOF.
9924 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9925 passed directives already coded in the file.
9926 Add some tests to check the location of "error".
9927 For some tests, the C++ parser is correct, and not yacc.c.
9928 For other tests, they provide different, but unsatisfying, values,
9929 so keep the C++ value so that at least one parser is "correct"
9930 according to the test suite.
9931 (Actions after errors): Remove, this is subsumed by the
9932 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9933
52d5733f
AD
99342004-09-06 Akim Demaille <akim@epita.fr>
9935
9936 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 9937 (Parser::pop): New.
52d5733f
AD
9938 Use it.
9939
a0e68930
AD
99402004-09-06 Akim Demaille <akim@epita.fr>
9941
9942 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9943 argument, an informative message.
9944 Call YY_SYMBOL_PRINT.
9945 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9946 * data/lalr1.cc (destruct_): Likewise.
9947 In addition, no longer depend on b4_yysymprint_generate and
9948 b4_yydestruct_generate to generate these functions, do it "by
9949 hand".
9950
e757bb10
AD
99512004-09-03 Akim Demaille <akim@epita.fr>
9952
9953 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9954 invoked, yydestruct the lookahead.
9955 * tests/calc.at (Calculator $1): Update the expected lengths of
9956 traces: there is an added line for the discarded lookahead.
9957 * doc/bison.texinfo (Destructor Decl): Some rewording.
9958 Define "discarded" symbols.
9959
0fe1f06d
AD
99602004-09-02 Akim Demaille <akim@epita.fr>
9961
9962 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9963
284acc8b
AD
99642004-09-02 Akim Demaille <akim@epita.fr>
9965
9966 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9967 (YYDSYMPRINTF): Rename as...
9968 (YY_SYMBOL_PRINT): this.
9969 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9970 two.
9971 Use it instead of direct symprint_ calls.
9972 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9973 one.
9974
a5eb1ed2
AD
99752004-09-02 Akim Demaille <akim@epita.fr>
9976
b7c72fe1
AD
9977 * data/lalr1.cc (b4_yysymprint_generate): New.
9978 (symprint_): New member function, defined when YYDEBUG.
9979 Use it consistently instead of token/nterm debugging output by
9980 hand.
a5eb1ed2
AD
9981 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9982 %printer calls to use cdebug_ when using lalr1.cc.
9983
417141dd
AD
99842004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9985
9986 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9987 with #ifdef YYDEBUG.
9988
2fa09258
AD
99892004-08-26 Akim Demaille <akim@epita.fr>
9990
9991 * doc/bison.texinfo (Implementing Loops): Rename as...
9992 (Implementing Gotos/Loops): this.
9993
9378b508
PE
99942004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9995
9996 Adjust to latest gnulib.
9997 * bootstrap (gnulib_modules): Add xalloc-die.
9998 Set LC_ALL=C so that file names sort consistently.
9999 Prefer the gnulib copies of gettext.m4, glibc21.m4,
10000 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
10001 uintmax_t.m4, ulonglong.m4.
10002 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
10003 po.m4 since we are now using _gl.m4 instead.
10004
87a8ad5c
PE
100052004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
10006
10007 * src/scan-action.l: Remove. Scanning of semantic actions is
10008 handled in scan-gram.l.
10009
dca81a78
PE
100102004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
10011
10012 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
10013
10014 * src/location.h (struct): The file member is a uniqstr.
10015 (equal_boundaries): Use UNIQSTR_EQ for comparison.
10016
c9cbf7c5
PE
100172004-07-22 Paul Eggert <eggert@cs.ucla.edu>
10018
10019 Fix bug with non-%union parsers that have printers or destructors,
10020 which led to a Bison core dump. Reported by Peter Fales in
10021 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 10022
c9cbf7c5
PE
10023 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10024 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10025 not to our own type.
10026 * src/output.c (symbol_destructors_output, symbol_printers_output):
10027 Don't assume %union.
10028 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10029 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10030 UNION-FLAG. All callers changed.
10031 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10032 Use type char, not unsigned int, when declaring an array of char;
10033 this lets us remove a cast.
10034 (Printers and Destructors): Add non-%union test cases.
10035
fa7e68c3
PE
100362004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10037
10038 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10039 GLR writeups. E.g., avoid frenchspacing and the future tense,
10040 change "lookahead" to "look-ahead", and change "wrt" to "with
10041 respect to".
2fa09258 10042
fa7e68c3
PE
100432004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10044
10045 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10046 New sections, split off from the GLR Parsers section. Put the new
10047 Simple GLR Parser near the start of the GLR section, for clarity.
10048 Rewrite connective text.
10049
99a9344e
PE
100502004-06-21 Frank Heckenbach <frank@g-n-u.de>
10051
10052 * doc/bison.texinfo (Simple GLR Parsers): New section.
10053
8dd162d3
PE
100542004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10055
10056 * NEWS, TODO, doc/bison.texinfo:
10057 Use "look-ahead" instead of "lookahead", to be consistent.
10058 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10059 while we're fixing "look-ahead".
10060 * src/conflicts.c (shift_set): Renamed from shiftset.
10061 (look_ahead_set): Renamed from lookaheadset.
10062 * src/print.c: Likewise.
10063 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10064 name for "lookahead".
10065 (report_types, usage): Likewise.
10066 * src/getargs.h (report_look_ahead_tokens): Renamed from
10067 report_lookaheads.
10068 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10069 compute_lookaheads.
10070 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10071 (look_ahead_tokens_print): Renamed from lookaheads_print.
10072 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10073 state_rule_lookaheads_print.
10074 * src/state.h: Likewise.
10075 (reductions.look_ahead_tokens): Renamed from lookaheads.
10076 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10077 AT_DATA_LOOKAHEADS_GRAMMAR.
10078
57a90331
PE
100792004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10080
10081 * README: Update location of patched M4 distribution.
10082
8ed3234a
PE
100832004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10084
10085 Don't assume the C++ compiler takes the same arguments as the C compiler
10086 (trivial change).
10087 * configure.ac (O0CXXFLAGS): New var.
10088 * tests/atlocal.in (CXXFLAGS): Use it.
10089
07971983
PE
100902004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10091
10092 Fix some "make check" problems with C++ reported by
10093 Albert Chin-A-Young for Tru64 C++ in this thread:
10094 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10095
10096 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10097 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10098 Output to a .cc file for C++, not to a .c file.
10099 * tests/calc.at (AT_CHECK_CALC): Likewise.
10100 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10101 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10102
29058652
PE
101032004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10104
10105 * tests/calc.at, tests/actions.at: Workaround for SGI
10106 C++ compiler. (trivial change)
10107
62cb8a99
PE
101082004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10109
fd418816
PE
10110 Spent a few hours checking out which prerequisite versions the
10111 current sources actually require. I went all the way back to
10112 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10113 a seemingly endless set of combinations of versions more recent
10114 than that. The bottom line is that the current sources require
10115 fairly recent versions of the build tools, and it'll be some work
10116 to change this.
10117 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10118 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10119 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10120 Add comments explaining why those particular versions are
10121 currently needed.
2fa09258 10122
62cb8a99
PE
10123 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10124 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 10125 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
10126
10127 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10128 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10129
caa52c10
PE
101302004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10131
10132 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10133 0.11.5. Suggested by Bruno Haible.
10134 * bootstrap: Remove gettext version checking.
10135
10136 * doc/bison.texinfo (Decl Summary): Also mention that %union
10137 can depend on prerequisite types. Problem reported by Tim
10138 Van Holder.
10139
4bfd5e4e
PE
101402004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10141
2cef3017
PE
10142 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10143 * README-alpha: Don't tell people not to package this.
10144
b9c85d5c
PE
10145 * bootstrap: Don't assume $(...) works; use `...` instead.
10146 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10147 gettext better.
10148
4bfd5e4e
PE
10149 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10150 put into the -d output file, and mention what to do if YYSTYPE is
10151 defined as a macro.
10152
6a36ff94
PE
101532004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10154
6712933e
PE
10155 Undo change made earlier today: it caused autopoint to not bring
10156 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10157 autopoint's.
10158
10159 * bootstrap: Check that gettext version matches what's in
10160 configure.ac. Warn users to ignore robots.txt ERROR 404.
10161 * bootstrap: Undo today's earlier change (logged below).
10162 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 10163
6a36ff94
PE
10164 The gettext version checking is causing more trouble than it's
10165 curing; remove it. Problem reported by Paul Hilfinger.
10166
10167 * bootstrap: Issue a warning that one can expect a message
10168 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10169 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10170
209ea708
PE
101712004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10172
10173 Ensure that the C++ compiler used for testing actually works on a
10174 simple test program; if not, skip the C++-related tests. Problem
10175 reported by Vin Shelton in:
161a71f3 10176 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
10177
10178 * m4/cxx.m4: New file.
10179 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10180 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10181 * tests/local.at (AT_COMPILE_CXX): Use it.
10182
41ca2549
PE
101832004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10184
383e69dc
PE
10185 * data/glr.c (yylloc): Output this macro even if locations are not
10186 being generated, as the GLR parser needs it even in that case.
10187 Problem reported by Troy A. Johnson
10188 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10189
41ca2549
PE
10190 * configure.ac (AC_INIT): Update to 1.875e.
10191
e476c87d
PE
101922004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10193
10194 * NEWS: Version 1.875d.
10195 * configure.ac (AC_INIT): Likewise.
10196 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10197
10198 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10199 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10200 lalr1.cc runs afoul of the first, and the last two are no longer
10201 supported by GCC 3.4.0.
10202 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10203 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10204
233a88ad
PE
102052004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10206
10207 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10208 unsigned int, for compatibility with latest gnulib hash module.
10209 * src/state.c (state_hash, state_hasher): Likewise.
10210 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10211 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 10212
12ffdd28
PE
102132004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10214
10215 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10216
10217 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10218 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10219 character and string literals.
10220 (unexpected_end): New function.
10221 (unexpected_eof): Use it.
10222 (unexpected_newline): New function.
10223 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10224 actions.
e476c87d 10225
12ffdd28
PE
10226 * NEWS: Document %expect-rr.
10227
10228 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10229 Fix typo by replacing $1 with $option.
10230 Remove more 'intl'-related files.
9668e2be 10231 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
10232
10233 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10234 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10235 strtoul.c.
10236 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10237 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10238 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10239 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10240 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10241 * src/.cvsignore: Add *.output.
10242
10243 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10244 gets copied to the output file.
e476c87d 10245
1f65350a
PE
102462004-04-28 Paul Eggert <eggert@twinsun.com>
10247
10248 Get files from the gnulib and po repositories, instead of relying
10249 on them being in our CVS. Upgrade to latest versions of gnulib
10250 and Automake.
10251
10252 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10253 * bootstrap: Bootstrap from gnulib and po repositories.
10254 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10255 * README-cvs: Document these changes. Remove version numbers from
10256 mentions of build tools, since they change so often. Mention Flex.
10257
10258 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10259 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
10260 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10261 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 10262 does this for us.
12ffdd28
PE
10263 (AC_ISC_POSIX): Remove; we no longer support this
10264 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
10265 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10266 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10267 Do not check for C89 headers, except for locale.h which is used
10268 by the Yacc library and must port to K&R hosts.
10269 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10270 Do not check for C89 functions, except for setlocale which is
10271 used by the Yacc library.
10272 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10273 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10274 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10275 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10276 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10277 AM_GNU_GETTEXT): Remove; now done by:
10278 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10279 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10280 for us.
10281
10282 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10283 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10284 Define to empty, as gnulib.mk will do the rest for us.
10285 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10286 for us.
10287 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10288 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10289
10290 * src/files.c: Include gnulib's xstrndup.h.
10291
10292 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10293 (REALLOC): Use xnrealloc, for likewise.
10294 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10295 (strnlen, memrchr): Remove decls; functions no longer used.
10296 Include <stpcpy.h>.
10297
10298 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10299 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10300 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10301 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10302 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10303 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10304 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10305 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10306 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10307 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10308 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10309 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10310 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10311 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10312 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10313 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10314 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10315 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10316 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10317 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10318 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10319 Remove, as these files are now generated automatically
10320 by bootstrap or automake.
10321
10322 * po/ChangeLog: Remove: all but one entry was a duplicate
10323 of this file, and I moved that 2000-11-02 entry here.
10324
10325 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10326 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10327 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10328 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10329 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10330 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10331 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10332 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10333 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10334 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10335 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10336 xstrndup.h.
10337 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10338 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10339 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10340 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10341 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10342 * src/.cvsignore: Remove *_.c.
10343
10344
10345 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10346 support it. (The latest stable gzip doesn't.)
10347
103482004-04-27 Paul Eggert <eggert@twinsun.com>
10349
10350 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10351 case, as stos_ is now used by destructors due to the 2004-02-09
10352 change.
10353
10354 Remove more K&R C support.
10355 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10356 * lib/subpipe.c (errno): Remove decl.
10357 Include <stdlib.h> unconditionally.
10358 (EXIT_FAILURE): Remove macro.
10359 * src/complain.c (vfprintf, strerror): Remove.
10360 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10361 unconditionally.
10362 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10363 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10364 (strchr, strspn, memchr): Remove decls.
10365 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10366 unconditionally. Do not declare perror.
10367 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10368 unconditionally.
10369
10370 * src/complain.c (_): Remove useless defn, as system.h defines this.
10371
10372 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10373 with latest obstack.h.
10374 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10375 to procedure types, as obstack.h now does that for us.
10376 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10377
10378 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10379 so that this include file can stand alone.
10380 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10381 does this now. Include subpipe.h first after config.h, to
10382 test whether it can stand alone.
10383
10384 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10385 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10386 unused declaration.
10387
10388 * tests/synclines.at (%union synch line): Put a dummy member in
10389 the union, because empty unions aren't allowed in C. Caught
10390 by GCC 3.4.0.
10391
4f16766c
PE
103922004-04-13 Jim Meyering <jim@meyering.net>
10393
10394 * src/conflicts.c (conflicts_print): Correct format string typo:
10395 use `%%' to produce literal `%'. (trivial change)
10396
779e7ceb
PE
103972004-03-30 Paul Eggert <eggert@twinsun.com>
10398
10399 * src/getargs.c (version): Update copyright year to 2004.
10400
10401 * data/c.m4 (b4_int_type): Use 'short int' rather than
10402 'short', and similarly for 'long', 'unsigned', etc.
10403 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10404 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10405 yy_yypstack, yydumpstack): Likewise.
10406 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10407 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10408 Likewise.
10409 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10410 yy_stack_print, yyparse): Likewise.
10411 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10412 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10413 * lib/bitset.c (bitset_print): Likewise.
10414 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10415 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10416 * lib/bitsetv.c (bitsetv_dump): Likewise.
10417 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10418 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10419 Likewise.
10420 * src/LR0.c (allocate_itemsets): Likewise.
10421 * src/gram.h (rule_number, rule): Likewise.
10422 * src/lalr.h (goto_number): Likewise.
10423 * src/nullable.c (nullable_compute): Likewise.
10424 * src/output.c (prepare_rules): Likewise.
10425 * src/relation.c (relation_print, relation_digraph): Likewise.
10426 * src/relation.h (relation_node): Likewise.
10427 * src/state.h (state_number, transitions, errs, reductions,
10428 struct state): Likewise.
10429 * src/symtab.h (symbol_number, struct symbol): Likewise.
10430 * src/tables.c (vector_number, tally, action_number,
10431 default_goto, goto_actions): Likewise.
10432 * tests/existing.at (GNU Cim Grammar): Likewise.
10433 * tests/regression.at (Web2c Actions): Likewise.
10434
10435 * src/output.c (muscle_insert_short_int_table): Renamed from
10436 muscle_insert_short_table. All uses changed.
10437
d6328241
PH
104382004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10439
10440 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10441 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10442 Add %expect-rr rule.
4f16766c 10443
d6328241
PH
10444 * src/scan-gram.l: Recognize %expect-rr.
10445
4f16766c 10446 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 10447 expected_conflicts.
4f16766c 10448 (expected_rr_conflicts): Declare.
d6328241
PH
10449
10450 * src/conflicts.c (expected_sr_conflicts): Rename from
10451 expected_conflicts.
10452 (expected_rr_conflicts): Define.
10453 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10454 for GLR parsers.
10455 Use expected_sr_conflicts in place of expected_conflicts.
10456 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 10457
d6328241 10458 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 10459
1452af69
PE
104602004-03-08 Paul Eggert <eggert@gnu.org>
10461
10462 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 10463 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
10464
10465 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10466 in lalr1.cc.
10467 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10468 * src/scan-gram.l (scan_integer): New function.
10469 ({int}): Use it.
10470 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10471 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10472 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10473 Say "long int", not "long", for uniformity with GNU style.
10474
006d217d
PE
104752004-02-25 Paul Eggert <eggert@twinsun.com>
10476
10477 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10478 compilers. This fixes a problem with Intel's C++ compiler being
10479 chatty, reported by Guido Trentalancia in
161a71f3 10480 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 10481
c2729758
ADL
104822004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10483
10484 Support %destructor and merge error locations in lalr1.cc.
10485
10486 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10487 (Parser::stos_): Define unconditionally.
10488 (Parser::destruct_): New method. Generate its body with
10489 b4_yydestruct_generate.
10490 (Parser::error_start_): New attribute.
10491 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10492 token which are discarded.
10493 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10494 error_start_ when erroneous token are discarded.
10495 (Parser::parse) <yyerrlab1>: Compute the location of the error
10496 token so that it covers all the discarded tokens.
10497 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10498 it can be called with `%skeleton "lalr1.cc"', and do that.
10499
dd0e0635
PE
105002004-02-02 Paul Eggert <eggert@twinsun.com>
10501
10502 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10503 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10504 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10505 There's no need to mention top_builddir since Automake does that
10506 for us.
10507 (INCLUDES): Remove, as Automake says it's obsolescent.
10508 Contents migrated into AM_CPPFLAGS as described above.
10509 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10510
105112004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10512
10513 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10514 (yyreportSyntaxError): Handle case where lookahead token is
10515 YYEMPTY.
10516
be16239b
PH
105172004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10518
10519 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10520 resulting parsers are compilable with C++.
10521
5fa90832
PE
105222003-12-23 Paul Eggert <eggert@twinsun.com>
10523
10524 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10525 * src/output.c (output_skeleton): Rename local var.
10526 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10527 Bison tokens, as this runs afoul of the 2003-10-07 change that
10528 disallowed NUL bytes in character constants or string literals.
10529
10530 * tests/local.at: Require Autoconf 2.59's Autotest.
10531 * tests/testsuite.at: Don't include local.at, since we now assume
10532 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10533 including it.
10534 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10535 multiple inclusion warnings.
dd0e0635 10536
b165c324
AD
105372003-12-02 Akim Demaille <akim@epita.fr>
10538
10539 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10540 conditions.
10541 From Bruno Haible.
10542
26e06a21
ADL
105432003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10544
10545 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10546
92ac3705
PE
105472003-10-07 Paul Eggert <eggert@twinsun.com>
10548
6a5ecb38
PE
10549 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10550 if testsuite doesn't exist.
10551
92ac3705
PE
10552 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10553 literals, unfortunately.
10554 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10555 Complain about NUL bytes in character constants or string literals.
10556
91d2c560
PE
105572003-10-05 Paul Eggert <eggert@twinsun.com>
10558
10559 * NEWS: Don't document %no-default-prec, as it's still
10560 too experimental.
10561 * doc/bison.texinfo: Document %no-default-prec only if
10562 the defaultprec flag is set. Normally it's not.
10563
0cc3da3a
PE
105642003-10-04 Paul Eggert <eggert@twinsun.com>
10565
10566 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10567 non-modifiable lvalue, instead of a modifiable one.
10568 * doc/bison.texinfo (Actions): Document that $$ can
10569 be assigned to. Do not claim that $$ and $N are
10570 array element references: user code should not rely on this.
10571
22fccf95
PE
105722003-10-01 Paul Eggert <eggert@twinsun.com>
10573
10574 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10575 (grammar_declaration): Use it.
10576 * src/scan-gram.l: New token %no-default-prec.
10577 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10578 * NEWS, doc/bison.texinfo: Document the above.
10579
fc8f2965
AD
105802003-10-01 Akim Demaille <akim@epita.fr>
10581
10582 VCG no longer supports long_straight_phase.
10583
10584 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10585 * src/print_graph.c (print_graph): Adjust.
10586
39a06c25
PE
105872003-09-30 Frank Heckenbach <frank@g-n-u.de>
10588 and Paul Eggert <eggert@twinsun.com>
10589
10590 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10591 Table of Symbols): Document %default-prec.
10592 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10593 (grammar_declaration): Set default_prec on %default-prec.
10594 * src/scan-gram.l (%default-prec): New token.
10595 * src/reader.h (default_prec): New flag.
10596 * src/reader.c: Likewise.
10597 (packgram): Handle it.
10598 * tests/conflicts.at (%default-prec without %prec,
10599 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 10600
39a06c25
PE
106012003-09-30 Paul Eggert <eggert@twinsun.com>
10602
10603 * tests/testsuite.at: Include local.at, not input.at, fixing
10604 a typo in the 2003-08-25 patch.
10605
62b6aef9
AD
106062003-08-27 Akim Demaille <akim@epita.fr>
10607
10608 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10609 GCC warnings.
10610
89e1cc61
AD
106112003-08-26 Akim Demaille <akim@epita.fr>
10612
10613 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10614 "<\#" to avoid magic from Gnus when posting parts of this script.
10615
a08460b0
AD
106162003-08-26 Akim Demaille <akim@epita.fr>
10617
10618 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10619 (Parser::parse): here.
10620 Adjust: nerrs and errstatus is now replaced by...
10621 (Parser::nerrs_, Parser::errstatus_): New.
10622
603f1cfd
AD
106232003-08-25 Akim Demaille <akim@epita.fr>
10624
10625 * config/announce-gen, Makefile.cfg: New.
10626 * Makefile.am: Adjust.
10627 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10628 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10629
cd3684cf
AD
106302003-08-25 Akim Demaille <akim@epita.fr>
10631
10632 When reducing initial empty rules, Bison parser read an initial
10633 location that is not defined. This results in garbage, and that
10634 affects Bison's own parser. Therefore we need (i) to extend Bison
10635 to support a means to initialize this location, and (ii) to use
10636 this CVS Bison to fix CVS Bison's parser.
10637
10638 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10639 with...
10640 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10641 * src/parse-gram.y: Adjust.
10642 (%initial-action): New.
10643 (%error-verbose): Since we require CVS Bison, there is no reason
10644 not to use it.
10645 * src/scan-gram.l: Adjust.
10646 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10647 * data/yacc.c (yyparse): Use b4_initial_action.
10648
4e03e201
AD
106492003-08-25 Akim Demaille <akim@epita.fr>
10650
10651 * doc/bison.texinfo: Don't promote stdout for error messages.
10652
8c182d05
AD
106532003-08-25 Akim Demaille <akim@epita.fr>
10654
10655 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10656 From Alexandre Duret-Lutz.
10657
6a60c4cf
PE
106582003-08-25 Akim Demaille <akim@epita.fr>
10659
10660 Version 1.875c.
10661
25f66e1a
AD
106622003-08-25 Akim Demaille <akim@epita.fr>
10663
10664 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10665 Use them.
10666
5348bfbe
AD
106672003-08-25 Akim Demaille <akim@epita.fr>
10668
10669 * data/lalr1.cc (Parser::reduce_print_): New.
10670 Use it.
10671
47301314
AD
106722003-08-25 Akim Demaille <akim@epita.fr>
10673
10674 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10675 error recovery loops. This patch is based on
161a71f3 10676 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
10677 Also, augment the similarity between lalr1.cc and yacc.c.
10678 Note: the locations of error recovery rules are not correct yet.
10679
10680 * data/lalr1.cc: Comment changes to augment the similarity between
10681 lalr1.cc and yacc.c.
10682 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10683 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10684 yyerrlab), when hitting EOF, pop the whole stack here instead of
10685 merely falling thru the default error handling mechanism.
10686 (yyerrorlab): New label, with the old contents of YYERROR,
10687 plus the following change: pop the stack of rhs corresponding
10688 to the production that invoked YYERROR. That is how Yacc
10689 behaves (required by POSIX).
10690 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10691 fail.
10692
1f7a61ff
AD
106932003-08-25 Akim Demaille <akim@epita.fr>
10694
10695 Tune local.at so that people can "autom4te -l autotest calc.at -o
10696 calc" for instance, to extract a sub test suite.
10697
10698 * tests/testsuite.at: Move the initialization, Autotest version
10699 requirement, and AT_TESTED invocation into...
10700 * tests/local.at: here.
10701 * tests/testsuite.at: Include it for compatibility with Autoconf
10702 2.57.
10703 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10704 be ignore.
10705
327b5b56
PE
107062003-08-04 Paul Eggert <eggert@twinsun.com>
10707
10708 Rework code slightly to avoid gcc -Wtraditional warnings.
10709 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10710 The returned value is now stored in *YY0. All callers changed.
10711 * src/output.c (merge_output): Adjust to the above change.
10712
0051e3ed
PE
107132003-07-26 Paul Eggert <eggert@twinsun.com>
10714
10715 * data/glr.c (YYASSERT): New macro.
10716 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10717 yyresolveStates, yyprocessOneStack):
10718 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10719 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 10720
137437c6
PE
107212003-07-25 Paul Eggert <eggert@twinsun.com>
10722
5b620e06
PE
10723 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10724 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 10725 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
10726 by Frank Heckenbach, though I have omitted the structure-initialization
10727 part of his glr-knr.diff patch since I recall that the Portable
10728 C Compiler didn't require that change.
10729
137437c6
PE
10730 Let the user specify how to allocate and free memory.
10731 Derived from a suggestion by Frank Heckenbach in
161a71f3 10732 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
10733 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10734 All uses of free, malloc, realloc changed to use these macros,
10735 and unnecessary casts removed.
10736 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10737
ddb85ca5
PE
107382003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10739
10740 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10741 use s.empty() rather than s == "" to test for empty string; see
161a71f3 10742 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
10743 (trivial change)
10744
39910e09
AD
107452003-06-25 Akim Demaille <akim@epita.fr>
10746
10747 * config/depcomp, config/install-sh: Update from masters.
10748
0ae99356
PE
107492003-06-20 Paul Eggert <eggert@twinsun.com>
10750
10751 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10752 and return properly parenthesized result.
10753 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10754 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10755 Remove unnecessary parentheses from uses.
10756 * doc/bison.texinfo (Location Default Action): Describe the
10757 conventions for parentheses.
10758
cd05d13c
PE
107592003-06-19 Paul Eggert <eggert@twinsun.com>
10760
81fd08ca
PE
10761 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10762 yyreportTree): Do not assume that size_t is the same width as int,
10763 when printing sizes. Print sizes using an unsigned format.
10764 Problem reported by Frank Heckenbach in
161a71f3 10765 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 10766
cd05d13c
PE
10767 Port to Forte Developer 7 C compiler.
10768 * data/glr.c (struct YYLTYPE): If locations are not being used,
10769 declare a single dummy member, as empty structs do not conform
10770 to the C standard.
10771 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10772 the Forte Developer 7 C compiler complains that end-of-loop
10773 code is not reached.
10774
4dcf140b
PE
107752003-06-17 Paul Eggert <eggert@twinsun.com>
10776
10777 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10778 avoid warnings from picky compilers about redefinition of PARAMS.
10779
8dd76bee
PE
107802003-06-17 Paul Eggert <eggert@twinsun.com>
10781
10782 Version 1.875b.
10783
10784 * NEWS: Document 1.875b.
10785
10786 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10787 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10788 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10789 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10790 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10791 per recent gettext manual's suggestion.
10792 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10793 Use prototypes, not old-style definitions.
10794 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10795 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10796 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10797 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10798 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10799 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10800 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10801 vbitset_or_and_cmp, vbitset_copy): Likewise.
10802
10803 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10804 Do not include <stdlib.h>.
10805 (PARAMS): Define unconditionally for C89.
10806 (ATTRIBUTE_NORETURN): Remove.
10807 (ATTRIBUTE_UNUSED): Define unconditionally.
10808
10809 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 10810 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
10811 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10812 * lib/vbitset.c, lib/vbitset.h: New files.
10813 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10814 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10815 from libbitset.
10816
10817 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10818 `How Can I Reset @code{yyparse}', since texinfo does not allow
10819 arbitrary @ in node names.
10820
10821 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10822 shouldn't be needed according to the gettext 0.12.1 documentation
10823 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 10824 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 10825 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 10826 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 10827
8dd76bee
PE
10828 * lib/.cvsignore: Add stdbool.h.
10829 * m4/.cvsignore: Add nls.m4, po.m4.
10830
10831 Upgrade to CVS gnulib.
10832 * stdbool_.h: File renamed from stdbool.h.in.
10833 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10834 AC_HEADER_STDBOOL.
10835 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10836 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10837 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10838 (MOSTLYCLEANFILES): New var.
10839 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10840 (stdbool.h): New rule.
10841 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10842 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10843 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10844 m4/quote.m4: Upgrade to today's gnulib.
10845
10846 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10847 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10848 the tests right now.
10849 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10850 yyerror are declared before use; C99 requires this.
10851
25005f6a
PH
108522003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10853
10854 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10855 first.
10856 (yyrecoverSyntaxError): Correct the logic for setting and testing
10857 yyerrState.
10858 Correct comment on handling EOF.
10859 Allow states with only a default reduction, rather than failing
8dd76bee 10860 (I can't quite reconstruct why these were not allowed before).
25005f6a 10861
137437c6 10862 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 10863 buffer overruns, corrupting state.
8dd76bee
PE
10864
10865 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
10866 definition.
10867 * src/reader.h (max_left_semantic_context): New variable declaration.
10868 * src/scan-gram.l (max_left_semantic_context): Define.
10869 (handle_action_dollar): Update max_left_semantic_context.
10870 * data/glr.c (YYMAXLEFT): New definition.
10871 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10872 (yyresolveAction): Ditto.
10873
10874 Fixes to problems with location handling in GLR parsers reported by
10875 Frank Heckenbach (2003/06/05).
10876
10877 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10878 (YYRHSLOC): Add parentheses, and define only if locations used.
10879 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10880 locations not used.
10881 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10882 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 10883
25005f6a
PH
10884 * tests/cxx-type.at: Exercise location information; update tests
10885 to differentiate output with and without locations.
8dd76bee 10886 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
10887 because default YYLTYPE not yet defined.
10888 Change semantic actions to compute strings, rather than printing
10889 them directly (to test proper passing of semantics values). Change
10890 output to prefix notation and update test data and expected results.
10891 (yylex): Track locations.
10892 (stmtMerge): Return value rather than printing, and include arguments
10893 in value.
8dd76bee 10894
711f40b7
PE
108952003-06-03 Paul Eggert <eggert@twinsun.com>
10896
10897 Avoid warnings generated by GCC 2.95.4 when Bison is
10898 configured with --enable-gcc-warnings.
10899 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10900 yy::]b4_parser_class_name[::translate_,
10901 yy::Stack::operator[] (unsigned),
10902 yy::Stack::operator[] (unsigned) const,
10903 yy::Slice::operator[] (unsigned),
10904 yy::Slice::operator[] (unsigned) const):
10905 Rename local vars to avoid warnings.
10906 * tests/glr-regression.at (Improper handling of embedded actions
10907 and $-N in GLR parsers): Remove unused local variable from yylex.
10908 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10909 (void) as arg when not pure, since we now assume C89 when building
10910 Bison. Pacify GCC by using parameter.
10911
ac695f7d
PE
109122003-06-02 Paul Eggert <eggert@twinsun.com>
10913
10914 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10915 yy::Location::lines, yy::Location::columns): Rename arguments
10916 to avoid shadowing; this removes a warning generated by GCC 3.3.
10917
26ec81e0
PE
109182003-06-01 Paul Eggert <eggert@twinsun.com>
10919
10920 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10921 to g++, as GCC 3.3 complains if you do it.
10922 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10923 everything that WARNING_CFLAGS has, except omit warnings
10924 not suitable for C++.
10925 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10926 * tests/atlocal.in (CXXFLAGS): New var.
10927 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10928
10929 Fix a GLR parser bug I reported in February; see
161a71f3 10930 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
10931 The problem was that GLR parsers did not conform to the C standard,
10932 because actions like { $1 = $2 + $3; } expanded to expressions
10933 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10934 to a local variable. The C standard says that expressions
10935 like (var = f ()) + (var = f ()) have undefined behavior.
10936 Another problem was that GCC sometimes issues warnings that
10937 yyfill and its parameters are unused.
10938
10939 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10940 as possibly unused.
10941 (yyfill): New function.
10942 (YYFILL): Use it.
10943 (yyuserAction): Change type of yynormal to bool, so that it matches
10944 the new yyfill signature. Mark it as possibly unused.
10945
10946
10947 Follow up on a bug I reported in February, where a Bison-generated
10948 parser can loop. Provide a test case and a fix for yacc.c. I
10949 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10950 The original bug report is in:
161a71f3 10951 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
10952
10953 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10954 macro's size was becoming unwieldy.
10955 (yyerrlab): Do not discard an empty lookahead symbol, as this
10956 might destroy garbage.
10957 (yyerrorlab): New label, with the old contents of YYERROR,
10958 plus the following change: pop the stack of rhs corresponding
10959 to the production that invoked YYERROR. That is how Yacc
10960 behaves, and POSIX requires this behavior.
10961 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10962 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10963 Define 'alarm' to do nothing if unistd.h is not available.
10964 Add a new rule "exp: '-' error;" to test the above change to
10965 data/yacc.c. Use 'alarm' to abort any test taking longer than
10966 10 seconds, as it's probably looping.
10967 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10968 Also, the new yacc.c generates two fewer diagnostics for an
10969 existing test.
10970
d0829076
PE
109712003-05-24 Paul Eggert <eggert@twinsun.com>
10972
c6ae27df
PE
10973 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10974 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10975 This fixes a problem reported by John Bowman when the Compaq/HP
10976 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10977 -ansi -Wall -gall).
10978 * data/yacc.c (union yyalloc): Likewise.
10979 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 10980
d0829076
PE
10981 Switch from 'int' to 'bool' where that makes sense.
10982
10983 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10984 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10985 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10986 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10987 Return or accept bool, not int. All callers changed.
10988 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10989 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10990 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10991 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10992 bitset_or_and_cmp_): Likewise.
10993 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10994 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10995 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10996 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10997 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10998 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10999 bitset_stats_or_and_cmp): Likewise.
11000 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
11001 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
11002 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
11003 ebitset_xor_cmp): Likewise.
11004 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
11005 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
11006 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
11007 lbitset_xor_cmp): Likewise.
11008 * lib/bbitset.h: Include <stdbool.h>.
11009 (struct bitset_vtable): The following members now return bool, not
11010 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
11011 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
11012 or_and_cmp).
11013 * src/conflicts.c (count_rr_conflicts): Likewise.
11014 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
11015 All uses changed.
11016 * lib/ebitset.c (ebitset_obstack_init): Likewise.
11017 * lib/lbitset.c (lbitset_obstack_init): Likewise.
11018 * src/getargs.c (debug_flag, defines_flag, locations_flag,
11019 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11020 graph_flag): Likewise.
11021 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11022 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11023 graph_flag): Likewise.
11024 * src/output.c (error_verbose): Likewise.
11025 * src/output.h (error_verbose): Likewise.
11026 * src/reader.c (start_flag, typed): Likewise.
11027 * src/reader.h (typed): Likewise.
11028 * src/getargs.c (LOCATIONS_OPTION): New constant.
11029 (long_options, getargs): Use it.
11030 * src/lalr.c (build_relations): Use bool, not int.
11031 * src/nullable.c (nullable_compute): Likewise.
11032 * src/print.c (print_reductions): Likewise.
11033 * src/tables.c (action_row, pack_vector): Likewise.
11034 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11035 * src/output.c (prepare): Use it.
11036 * src/output.c (token_definitions_output,
11037 symbol_destructors_output, symbol_destructors_output): Use string,
11038 not boolean integer, to keep track of whether to output separator.
11039 * src/print_graph.c (print_core): Likewise.
11040 * src/state.c (state_rule_lookaheads_print): Likewise.
11041
11042 * config/install-sh: Sync from automake 1.7.5.
11043
6b2584b7
PE
110442003-05-14 Paul Eggert <eggert@twinsun.com>
11045
11046 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11047 semicolon after a grammar declaration, in the interest of possible
11048 future changes to the Bison input language.
11049 Do not allow a stray semicolon at the start of the grammar.
11050 (rhses.1): Allow one or more semicolons after any rule, including
11051 just before "|" as required by POSIX.
11052 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11053 grammar.
11054
caf37a36
ADL
110552003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11056
11057 %parse-param support for lalr1.cc.
11058
11059 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11060 b4_cc_constructor_calls, b4_cc_constructor_call,
11061 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11062 definitions.
11063 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11064 parse-param arguments.
11065 (yy::b4_parser_class_name): Declare instance variables to
11066 hold parse-param arguments.
11067 * tests/calc.at: s/value/semantic_value/ because value clashes
11068 with a member of yy::b4_parser_class_name. Adjust C++ code
11069 to handle %parse-param. Enable %parse-param test in C++.
11070
3ab37077
PE
110712003-05-12 Paul Eggert <eggert@twinsun.com>
11072
11073 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11074 English a bit. Fix fclose typo. Change "const char" to "char
11075 const", and use ANSI C rather than K&R for "main". Suggest
11076 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11077 and suggest yy_switch_to_buffer.
11078
110792003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
11080
11081 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11082 C89. This avoids a diagnostic on compilers that define __STDC__
11083 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 11084 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 11085
e743727f
PE
110862003-05-03 Paul Eggert <eggert@twinsun.com>
11087
11088 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11089 Do not overrun array bounds.
11090 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 11091 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 11092
916708d5
AD
110932003-04-29 Akim Demaille <akim@epita.fr>
11094
11095 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11096 * src/getargs.c, src/getargs.h: here, as bool, not int.
11097 (nondeterministic_parser): New.
11098 * src/parse-gram.y, src/scan-gram.l: Support
11099 %nondeterministic-parser.
11100 * src/output.c (prepare): Use nondeterministic_parser instead
11101 of glr_parser where appropriate.
11102 * src/tables.c (conflict_row, action_row, save_row)
11103 (token_actions, token_actions, pack_vector): Ditto.
11104
a06ea4aa
AD
111052003-04-29 Akim Demaille <akim@epita.fr>
11106
11107 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11108
211074ca
AD
111092003-04-29 Akim Demaille <akim@epita.fr>
11110
11111 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11112 with %pure-parser and %locations to exercise the patch from Yakov
11113 Markovitch below.
11114
6175ffe3
PE
111152003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11116
11117 * data/yacc.c: (b4_lex_param): Corrected for the case where
11118 %lex-param is provided and %pure-parser isn't.
11119
b1e95857
PE
111202003-04-27 Paul Eggert <eggert@twinsun.com>
11121
11122 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 11123 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
11124 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11125 if it is not defined.
11126 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11127
acda9df6
PE
111282003-04-26 Paul Eggert <eggert@twinsun.com>
11129
3470c57b
PE
11130 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11131 Declare to be of type suitable for the ninf value itself, not of
11132 type suitable for the corresponding table, since the latter might
11133 be unsigned but the ninf value might be negative. This fixes a
11134 bug reported by Alexandre Duret-Lutz in
161a71f3 11135 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 11136
acda9df6
PE
11137 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11138 invokes it. We shouldn't invoke it twice because it will attempt
11139 to put error.o in the archive twice. This fixes a glitch reported
11140 by Martin Mokrejs in
161a71f3 11141 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 11142
b5250f26
PE
111432003-04-21 Paul Eggert <eggert@twinsun.com>
11144
11145 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11146 to gnulib.
11147
089ac0f1
PE
111482003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11149
11150 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11151 Fix obvious typo that results in uncompilable GLR parsers
11152 when both %pure-parser and %locations are used. (trivial change)
11153
5ededac6
PE
111542003-04-17 Paul Eggert <eggert@twinsun.com>
11155
1b8f2fff
PE
11156 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11157 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11158 Do not insert the expected token via unput, as this runs afoul
11159 of a POSIX-compatibility bug in flex 2.5.31.
11160 All uses changed to BEGIN the parent state,
11161 since we no longer insert the expected token via unput.
11162 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11163 that is no longer emitted after the above change.
11164
5ededac6
PE
11165 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11166 the first one. This change is from Paul Hilfinger, and it fixes
11167 regression reported by Werner Lemberg in
161a71f3 11168 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
11169
11170 (resolve_sr_conflict): Don't invoke state_errs_set
11171 unless one or more tokens have been explicitly made errors.
11172 Otherwise, the above change causes Bison to abort.
11173
11174 * tests/existing.at (GNU pic Grammar): New test case, taken from
11175 Lemberg's email.
11176
b8be9132
AD
111772003-03-31 Akim Demaille <akim@epita.fr>
11178
11179 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11180
d423d460
AD
111812003-03-31 Akim Demaille <akim@epita.fr>
11182
11183 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11184 output.
11185
c7e441b4
AD
111862003-03-31 Akim Demaille <akim@epita.fr>
11187
11188 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11189 From Paul Hilfinger.
11190
231897ad
AD
111912003-03-29 Akim Demaille <akim@epita.fr>
11192
11193 * m4/error.m4: Do not put under dynamic conditions some code which
11194 expansion is under static control.
11195
5b066063
AD
111962003-03-29 Akim Demaille <akim@epita.fr>
11197
11198 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11199
22a74fec
AD
112002003-03-29 Akim Demaille <akim@epita.fr>
11201
11202 * doc/bison.texinfo (Strings are Destroyed): New.
11203
0eee27e7
PE
112042003-03-13 Paul Eggert <eggert@twinsun.com>
11205
11206 * .cvsignore: Add configure.lineno.
11207 * src/.cvsignore: Add yacc.
11208 * tests/.cvsignore: Add testsuite.log.
11209 * doc/fdl.texi: Sync with latest FSF version.
11210
f61aad93
PE
112112003-03-12 Paul Eggert <eggert@twinsun.com>
11212
537636c7
PE
11213 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11214 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11215 cursor, instead of leaving it undefined. This fixes a bug
11216 reported by Tim Van Holder in
161a71f3 11217 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
11218 * tests/input.at (Torturing the Scanner): Test the scanner on
11219 an empty input file, which was Tim Van Holder's test case.
11220
11221 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11222 <sys/resource.h> can be included, include sys/time.h and
11223 sys/times.h first, if available. This works around the SunOS
11224 4.1.4 porting bug reported by Bruce Becker in
161a71f3 11225 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
11226
11227 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11228 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11229 AC_HEADER_SYS_WAIT.
11230
f61aad93
PE
11231 Merge changes from gnulib. This was prompted because the CVS
11232 snapshot didn't build on Solaris 7 due to strnlen problems.
11233
11234 These changes need to be merged back into gnulib:
11235 * lib/hash.c: Include <stdbool.h> unconditionally.
11236 * m4/onceonly.m4 (m4_quote): New macro.
11237 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11238 Quote AC_FOREACH variable-expansions properly.
11239 The 2003-01-03 obstack.h change also needs merging.
11240 {end of changes requiring merging}
5b066063 11241
f61aad93
PE
11242 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11243 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11244 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11245 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11246 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11247 New files, imported from gnulib.
11248 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11249 above.
11250
11251 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11252 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11253 gnulib sources.
11254
11255 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11256 Add.
11257 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11258 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11259 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11260 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11261 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11262 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11263 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11264 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11265 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11266 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11267 (jm_PREREQ_ARGMATCH): Remove.
11268 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11269 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11270
11271 * src/system.h: Include <stdbool.h> unconditionally.
11272
11273 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11274 assuming at least C89 in the bitset code for some time now.
11275
d2ffe116
AD
112762003-03-03 Akim Demaille <akim@epita.fr>
11277
11278 * ro.po: New.
11279
052826fd
AD
112802003-03-02 Akim Demaille <akim@epita.fr>
11281
11282 * doc/bison.texinfo (Table of Symbols): Reactivate the
11283 documentation for %lex-param, and %parse-param.
11284
c4749565
AD
112852003-03-02 Akim Demaille <akim@epita.fr>
11286
11287 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11288 generate verbose error messages.
11289 Use the number of tokens as an upper bound in yytname, as it
11290 cannot be a non terminal.
11291
d5286af1
AD
112922003-03-02 Akim Demaille <akim@epita.fr>
11293
11294 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11295 message.
11296
22e304a6
AD
112972003-03-02 Akim Demaille <akim@epita.fr>
11298
22e304a6
AD
11299 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11300 Use them to exercise yycheck overrun.
11301 Based on Andrew Suffield's grammar.
11302
67a25fed
AD
113032003-03-02 Akim Demaille <akim@epita.fr>
11304
11305 Create tests/local.at for Bison generic testing macros.
11306
11307 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11308 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11309 This new file.
11310 * tests/calc.at (AT_CHECK_CALC): Adjust.
11311 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11312 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11313 * tests/local.at: here.
11314 (AT_COMPILE_CXX): Tags the tests using it as c++.
11315 Ignore the test if CXX is not functional.
11316
9c2b381f
PE
113172003-03-01 Paul Eggert <eggert@twinsun.com>
11318
11319 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11320 not loc->end, since loc->end might contain garbage and this leads
11321 to undefined behavior on some platforms.
11322 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11323 depend on *loc, so that the reader doesn't give the the false
11324 impression that *loc is initialized.
11325 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11326 does not survive the return.
11327
0433ba88
AD
113282003-03-01 Akim Demaille <akim@epita.fr>
11329
11330 * src/scan-gram.l (code_start): Always initialize it when entering
11331 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11332 yylex invocation. An alternative would be making it static, but
11333 then it starts with the second %%'s beginning, instead of its end.
11334
b305ea69
PE
113352003-02-28 Paul Eggert <eggert@twinsun.com>
11336
11337 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11338 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 11339 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 11340
c3d25e01
PE
113412003-02-26 Paul Eggert <eggert@twinsun.com>
11342
11343 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11344 Remove Sequent/Pyramid discussion (nobody uses them any more).
11345 Merge VMS and MS-DOS discussion; these ports may well be dead
11346 but let's keep mentioning them for now. Put <> around email
11347 addresses. Add copyright notice.
11348
c267ffbc
PE
113492003-02-24 Paul Eggert <eggert@twinsun.com>
11350
11351 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11352 to avoid collision with flex use of yylineno.
11353 Problem reported by Bruce Lilly in
161a71f3 11354 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
11355 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11356 * data/yacc.c (yy_reduce_print): Likewise.
11357
11358 * config/depcomp: Sync with Automake 1.7.3.
11359
f939fc12
AD
113602003-02-21 Akim Demaille <akim@epita.fr>
11361
11362 * data/lalr1.cc: Use temporary variables instead of casts to
11363 change integer types.
11364 Suggested by Paul Eggert.
11365
95923bd6
AD
113662003-02-21 Akim Demaille <akim@epita.fr>
11367
11368 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11369 to avoid confusions with lalr1.cc's notion of Position.
11370 Suggested by Paul Eggert.
11371
2cdc240e
AD
113722003-02-20 Akim Demaille <akim@epita.fr>
11373
11374 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11375 before initial_columns.
11376 (location.hh): Use consistent variable names when defining the
11377 operator<<.
11378 Use "last" so that we subtract from Positions, not from unsigned.
11379
5d003116
AD
113802003-02-20 Akim Demaille <akim@epita.fr>
11381
11382 * data/lalr1.cc (position.hh): New subfile, including the extended
11383 and Doxygen'ed documentation of class Position.
11384 (location.hh): Use it.
11385 Document a` la Doxygen.
ba1ecc07 11386 With the help of Benoit Perrot.
5d003116 11387
d02b25f9
AD
113882003-02-20 Akim Demaille <akim@epita.fr>
11389
11390 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11391 AT_YACC_IF.
11392 Redefine AT_YYERROR_SEES_LOC_IF using it.
11393 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11394 not defined.
11395 Don't use the location in yy::Parser::error_ and
11396 yy::Parser::print_ when not %locations.
11397 Activate more lalr1.cc tests.
11398
0d1c3a04
AD
113992003-02-19 Akim Demaille <akim@epita.fr>
11400
11401 * data/lalr1.cc: When displaying a line number, be sure to make it
11402 an int.
11403
60a777aa
AD
114042003-02-19 Akim Demaille <akim@epita.fr>
11405
11406 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11407 Remove, useless.
11408 (YYABORT, YYACCEPT, YYERROR): New.
11409 * tests/calc.at: Renable the lalr1.cc test.
11410
0b86fc41
AD
114112003-02-19 Akim Demaille <akim@epita.fr>
11412
11413 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11414 error recovery, mixing with/without pops and discarding of the
11415 lookahead.
11416 Exercise YYERROR.
11417 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11418
da99a5dc
PE
114192003-02-17 Paul Eggert <eggert@twinsun.com>
11420
11421 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11422 * tests/testsuite.at (AT_COMPILE): Use them.
11423 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 11424 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 11425
93b8c255
PE
114262003-02-12 Paul Eggert <eggert@twinsun.com>
11427
11428 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11429 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 11430 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
11431 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11432 Check for malloc failure, for consistency with yacc.c.
11433 (yytname_size): Remove, for consistency with yacc.c.
11434
11435 The bug still remains in data/lalr1.cc, as I didn't have time
11436 to fix it there.
11437
7548fed2
AD
114382003-02-06 Akim Demaille <akim@epita.fr>
11439
11440 * configure.ac (GXX): Rename as...
11441 (CXX): this, to keep the original Autoconf semantics.
11442 Require 2.57.
11443 * data/lalr1.cc: Fix b4_copyright invocations.
11444 If YYDEBUG is not defined, don't depend upon name_ being defined.
11445 (location.hh): Include string and iostream.
11446 (Position::filename): New member.
11447 (Position::Position ()): New.
11448 (operator<< (Position)): New.
11449 (operator- (Position, int)): New.
11450 (Location::first, Location::last): Rename as...
11451 (Location::begin, Location::end): these, to mock the conventional
11452 iterator names.
11453 (operator<< (Location)): New.
11454 * tests/atlocal.in (CXX): New.
11455 * tests/testsuite.at (AT_COMPILE_CXX): New.
11456 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11457 locations in a more synthetic way.
11458 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11459 lalr1.cc is used.
11460 Adjust the C locations to match those from Emacs: first column is
11461 column 0.
11462 Change all the expected results.
11463 Conform to the GCS: simplify the locations when applicable.
11464 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11465 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11466 these CPP macros with the m4 macros new defined by...
11467 (AT_CHECK_PUSHDEFS): this, i.e.:
11468 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 11469 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
11470 New macros.
11471 (AT_CHECK_POPDEFS): Undefine them.
11472 (AT_CHECK_CALC_LALR1_CC): New.
11473 Use it for the first lalr1.cc test.
11474
43a176ef
AD
114752003-02-04 Akim Demaille <akim@epita.fr>
11476
11477 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11478 Location as is defined.
11479
fc049e9c
AD
114802003-02-04 Akim Demaille <akim@epita.fr>
11481
11482 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11483 name_ being defined.
11484
a737b216
PE
114852003-02-03 Paul Eggert <eggert@twinsun.com>
11486
11487 * src/gram.h (start_symbol): Remove unused decl.
11488
11489 Use more-consistent naming conventions for local vars.
11490
11491 * src/derives.c (derives_compute): Change type of local var from
11492 int to rule_number.
11493 * src/gram.c (grammar_rules_partial_print): Likewise.
11494 * src/print.c (print_core): Likewise.
11495 * src/reduce.c (reduce_grammar_tables): Likewise.
11496
11497 * src/gram.c (grammar_dump): Change name of item_number *
11498 local var from r to rp.
11499 * src/nullable.c (nullable_compute): Likewise.
11500
11501 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11502
11503 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11504 for symbol or symbol_number var.
11505 * src/reader.c (grammar_start_symbol_set): Likewise.
11506 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11507 Likewise.
11508 * src/state.c (transitions_to): Likewise.
11509 * src/state.h: Likewise.
11510 * src/tables.c (symbol_number_to_vector_number): Likewise.
11511
11512 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11513 char * var.
11514
11515 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11516 var.
11517
11518 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11519 var.
11520
11521 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11522 Use str, not s, for char * var. Use ch, not c, for character var.
11523 Use size for size var.
11524
11525 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11526 char * var.
11527 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11528 uniqstr var.
11529 * src/uniqstr.h: Likewise.
11530
11531 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11532 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11533 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11534 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11535 param to have same name as that of enum, so that we don't use
11536 "s" to stand for a non-state.
11537
68e93ad5
AD
115382003-02-02 Akim Demaille <akim@epita.fr>
11539
11540 * src/scan-skel.l: Scan more than one inert character per yylex
11541 invocation.
11542
92898986
PE
115432003-02-01 Paul Eggert <eggert@twinsun.com>
11544
11545 Version 1.875a.
11546
1d9d5d71
PE
11547 * po/LINGUAS: Add ms.
11548
0435d061
AD
115492003-01-30 Akim Demaille <akim@epita.fr>
11550
11551 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11552
6029a57f
PH
115532003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11554
11555 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11556 of $1.
0435d061
AD
11557
11558 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 11559 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 11560 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 11561
6029a57f
PH
11562 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11563 (b4_rhs_location): Ditto.
0435d061 11564 (yyfill): New function to copy from stack tree into array
6029a57f 11565 incrementally.
0435d061
AD
11566 (yyuserAction): Modify to allow incremental move of semantic values
11567 to rhs array when in GLR mode.
11568 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
11569 as needed.
11570 Remove dummy use of yystack, as there is now a guaranteed use.
11571 (yydoAction): Modify to allow incremental move of semantic values
11572 to rhs array when in GLR mode.
11573 (yyresolveAction): Ditto.
11574 (yyglrShiftDefer): Update comment.
0435d061 11575 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
11576 (yyglrReduce): Ditto.
11577 (yydoAction): Ditto
0435d061 11578
6029a57f
PH
11579 * tests/glr-regr1.at: Rename to ...
11580 * tests/glr-regression.at: Add new regression test for the problems
11581 described above (adapted from S. Eken).
11582 Update copyright notice.
11583 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11584 * tests/Makefile.am: Ditto.
11585
6cee6297
PE
115862003-01-28 Paul Eggert <eggert@twinsun.com>
11587
11588 * data/lalr1.cc: Do not use @output_header_name@ unless
11589 b4_defines_flag is set. This fixes two bugs reported by
11590 Tim Van Holder in
161a71f3
PE
11591 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11592 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 11593
b2a836b5
PE
115942003-01-21 Paul Eggert <eggert@twinsun.com>
11595
11596 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11597 we don't need to worry about yyerrlab1 being reported as an
11598 "unused label" by non-GCC C compilers. The downside is that if
11599 locations are used then a couple of statements are duplicated each
11600 time YYERROR is invoked, but the upside is that the warnings
11601 should vanish.
11602 (yyerrlab1): Move code to YERROR.
11603 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11604 This reverts some of the 2002-12-27 change.
11605
4196b931
PE
116062003-01-17 Paul Eggert <eggert@twinsun.com>
11607
11608 * src/output.c (symbol_printers_output): Fix typo that led
11609 to core dump. Problem reported by Antonio Rus in
161a71f3 11610 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 11611
3ae831b4
AD
116122003-01-13 Akim Demaille <akim@epita.fr>,
11613 Quoc Peyrot <chojin@lrde.epita.fr>,
11614 Robert Anisko <anisko_r@lrde.epita.fr>
11615
11616 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11617 when the stacks contain one element, as the loop would otherwise
11618 free the last state, and then use the top state (the one we just
11619 popped). This means that the initial elements will not be freed
11620 explicitly, as is the case in yacc.c; it is not a problem, as
11621 these elements have fake values.
11622
e3aa65c5
PE
116232003-01-11 Paul Eggert <eggert@twinsun.com>
11624
11625 * NEWS: %expect-violations are now just warnings, reverting
11626 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11627 bootstrapping problem reported by Matthias Klose; see
161a71f3 11628 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
11629 * src/conflicts.c (conflicts_print): Likewise.
11630 * tests/conflicts.at (%expect not enough, %expect too much,
11631 %expect with reduce conflicts): Likewise.
11632 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11633 that the warning is enabled if the number of conflicts changes
11634 (not necessarily increases).
11635
11636 * src/getargs.c (version): Update copyright year.
11637
f0057011
AD
116382003-01-09 Akim Demaille <akim@epita.fr>
11639
11640 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11641
1ee6d2a0
PE
116422003-01-08 Paul Eggert <eggert@twinsun.com>
11643
11644 * Makefile.maint (WGETFLAGS):
11645 New macro, containing "-C off" to disable proxy caches.
11646 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11647 (rel-check): Use $(WGET) instead of wget.
11648
d4fd77c4
PE
116492003-01-06 Paul Eggert <eggert@twinsun.com>
11650
11651 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11652 the GLR paper of Scott, Johnstone and Hussain.
11653
464c6927
PE
116542003-01-04 Paul Eggert <eggert@twinsun.com>
11655
d600ee67
PE
11656 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11657 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11658 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11659 (EXTRA_LIBRARIES): New var, for liby.a.
11660 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11661 (EXTRA_SCRIPTS): New var, for yacc.
11662
464c6927
PE
11663 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11664 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11665 Problem reported by Nelson H. F. Beebe.
11666
116672003-01-03 Paul Eggert <eggert@twinsun.com>
11668
11669 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11670 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11671 when compiling Bison 1.875's `bitset bset = obstack_alloc
11672 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11673
11674 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11675 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11676 grow to a huge size with typical invocation.
d600ee67 11677
464c6927
PE
11678 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11679 Use the pattern recommended by Autoconf 2.57, except also protect
11680 against double-definition.
11681 * src/system.h: Likewise.
11682 Portability issues reported by Nelson H. F. Beebe.
d600ee67 11683
464c6927
PE
11684 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11685 All uses changed. Provide a definition in both C and C++.
11686 (yytrue, yyfalse): Define even if defined (__cplusplus).
11687
11688 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11689 Reported by Nelson H. F. Beebe.
d600ee67 11690
464c6927
PE
11691 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11692
0f42c7d5
PE
116932003-01-02 Paul Eggert <eggert@twinsun.com>
11694
11695 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11696 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11697 Bug reported by Nelson H. F. Beebe.
11698
dc546b0f
PE
116992003-01-01 Paul Eggert <eggert@twinsun.com>
11700
11701 * Version 1.875.
11702
2c09b6a7
PE
117032002-12-30 Paul Eggert <eggert@twinsun.com>
11704
11705 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11706 Moved here from...
11707 (<INITIAL>","): Here. This causes stray "," to be treated
11708 more uniformly.
11709
dc546b0f 11710 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
11711 last brace in braced code when not in Yacc mode, for compatibility
11712 with Bison 1.35. This resurrects the 2001-12-15 patch to
11713 src/reader.c.
11714
11715 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11716 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11717
535c0f63
PE
117182002-12-28 Paul Eggert <eggert@twinsun.com>
11719
11720 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11721 that of SYM's type. This fixes Debian bug 168069, reported by
11722 Thomas Olsson.
d600ee67 11723
963fcc17
PE
117242002-12-28 Paul Eggert <eggert@twinsun.com>
11725
11726 Version 1.75f.
11727
11728 Switch back to the Yacc style of conflict reports, undoing some
11729 of the 2002-07-30 change.
11730 * doc/bison.texinfo (Understanding): Use Yacc style for
11731 conflict reports. Also, use new way of locating rules.
11732 * src/conflicts.c (conflict_report):
11733 Renamed from conflict_report_yacc, removing the old
11734 'conflict_report'. Translate the entire conflict report at once,
11735 so that we don't assume that "," has the same interpretation in
11736 all languages.
11737 (conflicts_output): Use Yacc-style conflict report for each state,
11738 instead of our more-complicated style.
11739 (conflicts_print): Use Yacc-style conflict report, except print
11740 the input file name when not emulating Yacc.
11741 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11742 Conflicted Reduction, %expect not enough, %expect too much,
11743 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11744 * tests/existing.at (GNU Cim Grammar): Likewise.
11745 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11746
11747 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11748 fatal): Don't invoke fflush; it's not needed and it might even be
11749 harmful for stdout, as stdout might not be open.
11750 * src/reduce.c (reduce_print): Likewise.
11751
b1efe548
PE
117522002-12-27 Paul Eggert <eggert@twinsun.com>
11753
11754 Fix a bug where error locations were not being recorded correctly.
11755 This problem was originally reported by Paul Hilfinger in
161a71f3 11756 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
11757
11758 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11759 top of the location stack's error locations.
11760 (yyerrlab): Set it. When discarding a token, push its location
11761 onto yylerrsp so that we don't lose track of the error's end.
11762 (yyerrlab1): Now is only the target of YYERROR, so that we can
11763 properly record the location of the action that failed. For GCC
11764 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11765 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11766 (yyerrlab2): New label, which yyerrlab now falls through to.
11767 Compute the error's location by applying YYLLOC_DEFAULT to
11768 the locations of all the symbols that went into the error.
11769 * doc/bison.texinfo (Location Default Action): Mention that
11770 YYLLOC_DEFAULT is also invoked for syntax errors.
11771 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11772 Error locations include the locations of all the tokens that were
11773 discarded, not just the last token.
d600ee67 11774
983c5c2c
PE
117752002-12-26 Paul Eggert <eggert@twinsun.com>
11776
b1efe548
PE
11777 * src/files.c: Include quote.h.
11778 (compute_output_file_names): Warn if we detect conflicting
11779 outputs to the same file. This should catch the misunderstanding
11780 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11781
11782 * src/conflicts.c (conflicts_print): If the user specifies
11783 "%expect N", report an error if there are any reduce/reduce
11784 conflicts. This is what the manual says should happen.
11785 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11786 * tests/conflicts.at (%expect with reduce conflicts): New test.
11787
983c5c2c
PE
11788 Don't use m4_include on relative file names, as it doesn't work as
11789 desired if there happens to be a file with that name under ".".
d600ee67 11790
983c5c2c
PE
11791 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11792 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11793 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11794 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11795 * src/output.c (output_skeleton): Use full path names when
11796 specifying a file to include; don't rely on include path, as
11797 it's unreliable when the working file contains a file with
11798 that name.
d600ee67 11799
983c5c2c
PE
118002002-12-25 Paul Eggert <eggert@twinsun.com>
11801
11802 Remove obsolete references to bison.simple and bison.hairy.
11803 Problem mentioned by Aubin Mahe in
161a71f3 11804 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
11805 * data/glr.c: Comment fix.
11806 * doc/bison.1: Remove references. Also, mention "yacc".
11807
11808 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11809 with -g option.
11810
11811 * src/parse-gram.y (declaration): Use enum "report_states" rather
11812 than its numeric value 1.
11813
11814 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11815 opening a new one. This fixes Debian bug 165349, reported by
11816 Bruce Stephens.
11817
23f2d9dc
PE
118182002-12-24 Paul Eggert <eggert@twinsun.com>
11819
11820 Version 1.75e.
11821
11822 * Makefile.maint (cvs-update): Don't assume that the shell
11823 supports $(...), as Solaris sh doesn't.
11824
11825 * src/parse-gram.y (lloc_default): Remove test for empty
11826 nonterminals at the end, since it didn't change the result.
11827
118282002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
11829
11830 If the user does not define YYSTYPE as a macro, Bison now declares it
11831 using typedef instead of defining it as a macro. POSIX requires this.
11832 For consistency, YYLTYPE is also declared instead of defined.
11833
11834 %union directives can now have a tag before the `{', e.g., the
11835 directive `%union foo {...}' now generates the C code
11836 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11837 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11838 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11839 instead of `yyltype'.
11840
11841 `yystype' and `yyltype' are now obsolescent macros instead of being
11842 typedefs or tags; they are no longer documented and will be
11843 withdrawn in a future release.
11844
11845 * data/glr.c (b4_location_type): Remove.
11846 (YYSTYPE): Renamed from yystype.
11847 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11848 (struct YYLTYPE): Renamed from struct yyltype.
11849 (YYLTYPE): Renamed from yyltype.
11850 (yyltype, yystype): New (and obsolescent) macros,
11851 for backward compatibility.
11852 * data/yacc.c: Likewise.
11853
11854 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11855 does not specify a union tag. This is for compatibility with
11856 Solaris 9 yacc.
11857
11858 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11859 const *, since it is now modified by stripping surrounding { }.
11860 (current_braced_code): Remove.
11861 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11862 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11863 trailing " {...}". Now of type <chars>.
11864 (grammar_declaration): Adjust to bundled tokens.
11865 (code_content): Remove; stripping is now done by add_param.
11866 (print_token_value): Print contents of bundled tokens.
11867 (token_name): New function.
11868
11869 * src/reader.h (braced_code, current_braced_code): Remove.
11870 (token_name): New decl.
11871
11872 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11873 token_type, not braced_code code_kind. All uses changed.
11874 (SC_PRE_CODE): New state, for scanning after a keyword that
11875 has (or usually has) an immediately-following braced code.
11876 (token_type): New local var, to keep track of which token type
11877 to return when scanning braced code.
11878 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 11879 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
11880 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11881 instead of returning a token type immediately.
11882 (<INITIAL>"{"): Set token type.
11883 (<SC_BRACED_CODE>"}"): Use it.
11884 (handle_action_dollar, handle_action_at): Now returns bool
11885 indicating success. Fail if ! current_rule; this prevents a core dump.
11886 (handle_symbol_code_dollar, handle_symbol_code_at):
11887 Remove; merge body into caller.
11888 (handle_dollar, handle_at): Complain in invalid contexts.
11889
11890 * NEWS, doc/bison.texinfo: Document the above.
11891 * NEWS: Fix years and program names in copyright notice.
11892
879ca4f8
PE
118932002-12-17 Paul Eggert <eggert@twinsun.com>
11894
11895 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11896 Reporting, Table of Symbols): Omit mentions of %lex-param and
11897 %parse-param from the documentation for now.
11898
1c5fe69d
PE
118992002-12-15 Paul Eggert <eggert@twinsun.com>
11900
11901 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11902 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11903 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
11904 disagreed with the Bison documentation. Bug
11905 reported by Andrew Walrond.
d600ee67 11906
1c5fe69d
PE
11907 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11908 as the caller now does that.
11909 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11910 (YYEMPTY): Parenthesize right hand side, since others use it.
11911 (yyparse): Don't assume that our generated code is the only code
11912 that sets yychar.
11913
d1de5372
PE
119142002-12-13 Paul Eggert <eggert@twinsun.com>
11915
11916 Version 1.75d.
11917
11918 POSIX requires a "yacc" command.
11919 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11920 (MOSTLYCLEANFILES): Add yacc.
11921 (yacc): New rule.
1c5fe69d 11922 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
11923 as an alias for bison y.
11924
11925 * po/LINGUAS: Add da.
d600ee67 11926
d1de5372
PE
11927 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11928 problem with latest <getopt.h>.
11929 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11930
11931 * doc/fdl.texi: Upgrade to 1.2.
11932 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11933 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11934 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11935 gnulib.
11936 * config/install-sh: Sync with autotools.
11937
11938 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 11939 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
11940 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11941 locations are requested.
11942 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11943 locations are requested.
11944
d0f3fe23
PE
119452002-12-12 Paul Eggert <eggert@twinsun.com>
11946
11947 Remove unportable casts and storage allocation tricks.
11948 While we're at it, remove almost all casts, since they
11949 usually aren't needed and are a sign of trouble.
11950
11951 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11952
11953 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11954 the pointer DSET returned by malloc; this isn't portable.
11955 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11956 Similarly for DERIVES.
11957 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11958 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11959 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11960
11961 * src/derives.c (derives_compute): Do not bother invoking
11962 int_of_rule_number, since rule numbers are integers.
11963
11964 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11965 rather than XMALLOC (char, N).
11966
11967 * src/files.c (filename_split): Rewrite to avoid cast.
11968
11969 * src/gram.h (symbol_number_as_item_number,
11970 item_number_as_symbol_number, rule_number_as_item_number,
11971 item_number_as_rule_number):
11972 Now inline functions rather than macros, to avoid casts.
11973 * src/state.h (state_number_as_int): Likewise.
11974 * src/tables.c (state_number_to_vector_number,
11975 symbol_number_to_vector_number): Likewise.
11976
11977 * src/gram.h (int_of_rule_number): Remove; no longer used.
11978
11979 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11980 since the resulting storage is always stored into.
11981
11982 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11983 where it's needed.
11984
11985 * src/muscle_tab.c (muscle_m4_output):
11986 Now inline. Return bool, not int.
11987 * src/state.c (state_compare): Likewise.
11988 * src/symtab.c (symbol_check_defined,
11989 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11990 hash_compare_symbol, hash_symbol):
11991 Likewise.
11992 * src/uniqstr.c (uniqstr_print): Likewise.
11993 * src/muscle_tab.c (muscle_m4_output_processor):
11994 New function, to avoid casts.
11995 * src/state.c (state_comparator, stage_hasher): Likewise.
11996 * src/symtab.c (symbol_check_defined_processor,
11997 symbol_check_alias_consistency_processor, symbol_pack_processor,
11998 symbol_translation_processor, hash_symbol_comparator,
11999 hash_symbol_hasher): Likewise.
12000 * src/uniqstr.c (uniqstr_print_processor): Likewise.
12001 * src/muscle_tab.c (muscles_m4_output):
12002 Use new functions instead of casting old functions unportably.
12003 * src/state.c (state_hash_new): Likewise.
12004 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
12005 symbols_token_translations_init):
12006 Likewise.
12007 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
12008
12009 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
12010 var instead of casting to long, to avoid casts.
12011 (prepare_states): Use MALLOC rather than alloca, so that we don't
12012 have to worry about alloca.
12013 * src/state.c (state_hash_lookup): Likewise.
12014
12015 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
12016 local var instead of casting to unsigned char, to avoid casts.
12017
12018 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
12019 STATE_ALLOC): Remove.
12020 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12021 rather than calloc, and use offsetof to avoid allocating slightly
12022 too much storage.
12023 (state_new): Initialize all members.
12024
12025 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12026
12027 * src/symtab.c (symbol_free): Remove; unused.
12028 (symbol_get): Remove cast in lhs of assignment.
12029 (symbols_do): Now static. Accept generic arguments, not
12030 hashing-related ones.
12031
12032 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12033 (symbol_processor): Remove.
12034 (symbols_do): Remove decl; now static.
12035
12036 * src/system.h (alloca): Remove; decl no longer needed.
12037 (<stddef.h>): Include, for offsetof.
12038 (<inttypes.>, <stdint.h>): Include if available.
12039 (uintptr_t): New type, if system lacks it.
12040 (CALLOC, MALLOC, REALLOC): New macros.
12041 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12042 new macros.
12043
12044 * src/tables.c (table_size): Now int, to pacify GCC.
12045 (table_grow, table_ninf_remap): Use signed table size.
12046 (save_row): Don't bother initializing locals when not needed.
12047 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12048 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12049
12050 * src/vcg.h: Correct misspellings.
12051
12052 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12053
12054
12055 * src/getargs.c (getargs): Don't assume EOF == -1.
12056
26b4a969
PE
120572002-12-09 Paul Eggert <eggert@twinsun.com>
12058
12059 Change identifier spellings to avoid collisions with names
12060 that are reserved by POSIX.
12061
12062 Don't use names ending in _t, since POSIX reserves them.
12063 For consistency, remove _e and _s endings -- they're weren't
12064 needed to remove ambiguity. All uses changed.
12065 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12066 turn was just renamed from struniq_t.
12067 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12068 which in turn was just renamed from struniq_processor_t.
12069 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12070 in turn was renamed from hash_compare_struniq_t.
12071 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12072 (state_list): Renamed from state_list_t.
12073 * src/assoc.h (assoc): Renamed from assoc_t.
12074 * src/conflicts.c (enum conflict_resolution): Renamed from
12075 enum conflict_resolution_e.
12076 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12077 (rule_list): Renamed from rule_list_t.
12078 * src/getargs.h (enum trace): Renamed from enum trace_e.
12079 (enum report): Renamed from enum report_e.
12080 * src/gram.h (item_number): Renamed from item_number_t.
12081 (rule_number): Renamed from rule_number_t.
12082 (struct rule_s): Remove the "rule_s" part; not used.
12083 (rule): Renamed from rule_t.
12084 (rule_filter): Renamed from rule_filter_t.
12085 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12086 (goto_list): Renamed from goto_list_t.
12087 * src/lalr.h (goto_number): Renamed from goto_number_t.
12088 * src/location.h (location): Renamed from location_t.
12089 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12090 and moved here from:
12091 * src/muscle_tab.h (muscle_entry_t): here.
12092 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12093 (rule_list): Renamed from rule_list_t.
12094 * src/print_graph.c (static_graph): Renamed from graph.
12095 * src/reader.h (braced_code): Renamed from braced_code_t.
12096 Remove brace_code_e tag.
12097 * src/relation.h (relation_node): Renamed from relation_node_t.
12098 (relation_nodes): Renamed from relation_nodes_t.
12099 (relation): Renamed from relation_t.
12100 * src/state.h (state_number): Renamed from state_number_t.
12101 (struct state): Renamed from struct state_s.
12102 (state): Renamed from state_t.
12103 (transitions): Renamed from transitions_t. Unused (and
12104 misspelled) transtion_s tag removed.
12105 (errs): Renamed from errs_t. Unused errs_s tag removed.
12106 (reductions): Renamed from reductions_t. Unused tag
12107 reductions_s removed.
12108 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12109 (struct symbol_list): Renamed from struct symbol_list_s.
12110 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12111 (struct symbol): Renamed from struct symbol_s.
12112 (symbol): Renamed from symbol_t.
12113 * src/tables.c (vector_number): Renamed from vector_number_t.
12114 (action_number): Renamed from action_t.
12115 * src/tables.h (base_number): Renamed from base_t.
12116 * src/vcg.h (enum color): Renamed from enum color_e.
12117 (enum textmode): Renamed from enum textmode_e.
12118 (enum shape): Renamed from enum shape_e.
12119 (struct colorentry): Renamed from struct colorentry_s.
12120 (struct classname): Renamed from struct classname_s.
12121 (struct infoname): Renamed from struct infoname_s.
12122 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12123 (enum decision): Renamed from enum decision_e.
12124 (enum orientation): Renamed from enum orientation_e.
12125 (enum alignment): Renamed from enum alignment_e.
12126 (enum arrow_mode): Renamed from enum arrow_mode_e.
12127 (enum crossing_type): Renamed from enum crossing_type_e.
12128 (enum view): Renamed from enum view_e.
12129 (struct node): Renamed from struct node_s.
12130 (node): Renamed from node_t.
12131 (enum linestyle): Renamed from enum linestyle_e.
12132 (enum arrowstyle): Renamed from enum arrowstyle_e.
12133 (struct edge): Renamed from struct edge.
12134 (edge): Renamed from edge_t.
12135 (struct graph): Renamed from struct graph_s.
12136 (graph): Renamed from graph_t.
12137 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12138 Rename value_t -> value.
12139 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12140 value_t_as_yystype -> value_as_yystype.
12141
12142 Don't include <errno.h> in the mainstream code, since it
12143 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12144 * lib/get-errno.c, lib/get-errno.h: New files.
12145 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12146 get-errno.c.
12147 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12148 * src/output.c (output_skeleton): Likewise.
12149 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12150 instead of errno.
12151 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12152 Likewise.
12153 (handle_action_dollar, handle_action_at): Likewise.
12154 * src/system.h: Do not include <errno.h>.
12155 (TAB_EXT): Renamed from EXT_TAB.
12156 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12157
12158 Avoid str[a-z]*, since <string.h> reserves that name space.
12159 Change all instances of "struniq" in names to "uniqstr", and
12160 likewise for "STRUNIQ" and "UNIQSTR".
12161 * src/uniqstr.c: Renamed from src/struniq.c.
12162 * src/uniqstr.h: Renamed from src/struniq.h.
12163 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12164 * src/files.c (strsuffix): Remove; unused.
12165 (concat2): Renamed from stringappend. Now static.
12166 * src/files.h (strsuffix, stringappend): Remove; unused.
12167 * src/parse-gram.y (<chars>): Renamed from <string>.
12168 (<uniqstr>): Renamed from <struniq>.
12169 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12170 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12171 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12172 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12173 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12174 (N_EXPAND): Renamed from N_STRETCH.
12175
12176 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12177 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12178 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12179 Remove; unused.
12180 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12181 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12182 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12183 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12184 (BASE_MAXIMUM): Renamed from BASE_MAX.
12185 (BASE_MINIMUM): Renamed from BASE_MIN.
12186 (ACTION_MAX): Remove; unused.
12187 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12188 Unnecessary casts removed from above defines.
12189
12190
12191 Fix misspelling in names.
12192 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12193 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12194 G_NODE_ALIGNEMENT.
12195
12196
12197 * lib/timevar.c (timevar_report): Renamed from time_report,
12198 for consistency with other names.
12199 * lib/timevar.h (timevar_report): New decl.
12200 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12201
12202
12203 Sort include-file uses.
12204
12205 Reorder all include files under src to be in the order "system.h".
12206 then the ../lib include files in angle brackets (alphabetized),
12207 then the . include files in double-quotes (alphabetized). Fix
12208 dependency breakages encountered in this process, as follows:
12209 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12210 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12211 * src/state.h: Include "symtab.h".
12212
996b1c7e
PE
122132002-12-08 Paul Eggert <eggert@twinsun.com>
12214
12215 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12216 since this causes problems when __file__ contains character
12217 sequences like "@" that are treated specially by src/scan-skel.l.
12218 Instead, just use the file's basename. This fixes the bug
12219 reported by Martin Mokrejs in
161a71f3 12220 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 12221
e19c4e5d
PE
122222002-12-06 Paul Eggert <eggert@twinsun.com>
12223
12224 Add support for rules that do not have trailing semicolons, as
12225 POSIX requires. Improve the quality of locations in Bison
12226 diagnostics.
26b4a969 12227
e19c4e5d
PE
12228 * src/location.c: Include <quotearg.h>.
12229 (empty_location): Now const.
12230 (location_print): New function. Follow the recommendation of the
12231 GNU Coding Standards for locations that span file boundaries.
12232 * src/location.h: Do not include <quotearg.h>; no longer needed.
12233 (boundary): New type.
12234 (location_t): Use it. This allows locations to span file boundaries.
12235 All member uses changed: file -> start.file or end.file (as needed),
12236 first_line -> start.line, first_column -> start.column,
12237 last_line -> end.line, last_column -> end.column.
12238 (equal_boundaries): New function.
12239 (LOCATION_RESET, LOCATION_STEP): Remove.
12240 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12241 (empty_location): Now const.
12242 (location_print): New decl.
12243 * src/parse-gram.y (lloc_default): New function, which handles
12244 empty locations more accurately.
12245 (YYLLOC_DEFAULT): Use it.
12246 (%token COLON): Remove.
12247 (%token ID_COLON): New token.
26b4a969 12248 (rules): Use it.
e19c4e5d
PE
12249 (declarations, rules): Remove trailing semicolon.
12250 (declaration, rules_or_grammar_declaration):
12251 Allow empty (";") declaration.
12252 (symbol_def): Remove empty actions; no longer needed.
12253 (rules_or_grammar_declaration): Remove trailing semicolon.
12254 (semi_colon.opt): Remove.
12255 * src/reader.h: Include location.h.
12256 (scanner_cursor): New decl.
12257 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12258 rolling our own.
12259 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12260 of *loc.
12261 (STEP): Remove. No longer needed, now that adjust_location does
12262 the work. All uses removed.
12263 (scanner_cursor): New var.
12264 (adjust_location): Renamed from extend_location. It now sets
12265 *loc and adjusts the scanner cursor. All uses changed.
12266 Don't bother testing for CR.
12267 (handle_syncline): Remove location arg; now updates scanner cursor.
12268 All callers changed.
12269 (unexpected_end_of_file): Now accepts start boundary of token or
12270 comment, not location. All callers changed. Update scanner cursor,
12271 not the location.
12272 (SC_AFTER_IDENTIFIER): New state.
12273 (context_state): Renamed from c_context. All uses changed.
12274 (id_loc, code_start, token_start): New local vars.
12275 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12276 processing of Yacc white space and equivalents here.
12277 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12278 instead of returning ID immediately, since we need to search for
12279 a subsequent colon.
12280 (<INITIAL>"'", "\""): Save token_start.
12281 (<INITIAL>"%{", "{", "%%"): Save code_start.
12282 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12283 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12284 BEGIN context_state at end, not INITIAL.
12285 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12286 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12287 Return correct token start.
12288 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12289 the start of a character, string or multiline comment is found.
12290 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12291 Reduction): Adjust reported locations to match the more-precise
12292 results now expected.
12293 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12294 * tests/reduce.at (Useless Rules, Reduced Automaton,
12295 Underivable Rules): Likewise.
12296 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12297 or "|"' now that so many other tokens are allowed by the new grammar.
12298
12299 * src/complain.h (current_file): Remove duplicate decl;
12300 current_file is now owned by files.h.
12301 * src/complain.c, src/scan-gram.l: Include files.h.
12302
123032002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 12304
e19c4e5d
PE
12305 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12306 promotes to int; it might be unsigned int.
12307 * data/yacc.c (yy_reduce_print): Likewise.
12308
12309 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12310 be #defined in the prologue, not in the Bison declarations.
12311 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 12312
b64755e3
PE
123132002-12-02 Paul Eggert <eggert@twinsun.com>
12314
12315 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12316 * lib/strtoul.c: New file, from gnulib.
12317 This fixes a porting bug reported by Peter Klein in
161a71f3 12318 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 12319
6e746484
PE
123202002-11-30 Paul Eggert <eggert@twinsun.com>
12321
b64755e3
PE
12322 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12323 and put only a forward declaration in the prologue. This is for
12324 consistency with the other scanner helper functions.
12325
6ba55592
PE
12326 Type clashes now generate warnings, not errors, since it
12327 appears that POSIX may allow some grammars with type clashes.
12328 * src/reader.c (grammar_current_rule_check): Warn about
12329 type clashes instead of complaining.
12330 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12331
6e746484
PE
12332 Add Yacc library, since POSIX requires it.
12333 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12334 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12335 * lib/main.c, lib/yyerror.c: New files.
12336
12337 gram_error can be static; it need not be extern.
12338 * src/reader.h (gram_error): Remove decl.
12339 * src/parse-gram.y (gram_error): Now static. Add static decl.
12340 (print_token_value): Omit parameter names from forward decl,
12341 for consistency.
12342
88510f9c
PE
123432002-11-29 Paul Eggert <eggert@twinsun.com>
12344
6e746484
PE
12345 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12346 be declared before being used. E.g., one should typically
12347 declare them in the prologue. Use GNU coding style in examples.
12348 Put "const" consistently after the type it modifies. Mention
12349 that C99 supports "inline". Mention that yyerror traditionally
12350 returns "int".
12351
88510f9c
PE
12352 %parse-param and %lex-param now take just one argument, the
12353 declaration; the argument name is deduced from the declaration.
12354
12355 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12356 Reporting, Table of Symbols): Document this.
12357 * src/parse-gram.y (add_param): New function.
12358 (COMMA): Remove.
12359 (declaration): Implement new rule for %parse-param and %lex-param.
12360 * src/scan-gram.l: "," now elicits a warning, rather than being
12361 a token; this is more compatible with byacc.
12362 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12363
bb92250c
PE
123642002-11-27 Paul Eggert <eggert@twinsun.com>
12365
12366 Rename identifiers to avoid real and potential collisions.
12367
12368 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12369 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 12370 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
12371 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12372 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12373 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12374 All uses changed.
12375 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12376 The name "yycontrol" violates the name space rules, and this stuff
12377 wasn't being used anyway.
12378 (input): Remove action; this stuff wasn't being used.
12379 (gram_error): Rename local variable yylloc -> loc.
12380 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12381 (YY_DECL): Don't use "yy" at start of local variables.
12382 All uses changed, e.g., yylloc -> loc.
12383 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12384 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12385 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12386 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12387
12388 * src/parse-gram.y (gram_error): loc is now const *.
12389 * src/reader.h (gram_error): Likewise.
12390
3af4feb2
PE
123912002-11-24 Paul Eggert <eggert@twinsun.com>
12392
12393 Version 1.75c.
12394
12395 * tests/actions.at (Actions after errors): Use an output format
12396 more similar to that of the Printers and Destructors test.
12397 Test the position of the ';' token too.
12398 (Printers and Destructors): Likewise.
12399 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12400 unnecessarily alarming people when the test fails.
12401
12402 * data/yacc.c (yyerrlab1): Move this label down, so that the
12403 parser does not discard the lookahead token if the user code
12404 invokes YYERROR. This change is required for POSIX conformance.
12405
12406 * lib/error.c: Sync with gnulib.
12407
124082002-11-22 Paul Eggert <eggert@twinsun.com>
12409
12410 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12411 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12412 * lib/xmalloc.c: Likewise.
26b4a969 12413
58004308
PE
124142002-11-20 Paul Eggert <eggert@twinsun.com>
12415
12416 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12417
124182002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 12419
58004308
PE
12420 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12421 should use `if (! x) abort ();' rather than `assert (x);', and
12422 anyway it's one less thing to worry about configuring.
12423
12424 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12425 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12426 and replace all instances of assert with abort.
12427 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12428 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12429
12430 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12431 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12432 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12433 hash_find_entry, hash_rehash, hash_insert): Likewise.
12434 * src/conflicts.c (resolve_sr_conflict): Likewise.
12435 * src/lalr.c (set_goto_map, map_goto): Likewise.
12436 * src/nullable.c (nullable_compute): Likewise.
12437 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12438 * src/reader.c (packgram, reader): Likewise.
12439 * src/state.c (state_new, state_free, state_transitions_set,
12440 state_reduction_find): Likewise.
12441 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12442 symbol_pack): Likewise.
12443 * src/tables.c (conflict_row, pack_vector): Likewise.
12444 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12445 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12446 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12447 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12448
12449 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12450 (ARGMATCH_CONSTRAINT): New macro.
12451 (ARGMATCH_ASSERT): Use it.
12452
12453 * src/system.h (verify): New macro.
12454 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12455 rather than assert.
12456 * src/tables.c (tables_generate): Likewise.
12457
12458 * src/struniq.c (struniq_assert): Now returns void, and aborts
12459 if the assertion is false.
12460 (struniq_assert_p): Remove.
12461 * src/struniq.h: Likewise.
12462
76ae8198
PE
124632002-11-18 Paul Eggert <eggert@twinsun.com>
12464
12465 * data/glr.c (yygetLRActions): Replace `yyindex' with
12466 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12467 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 12468 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 12469
d3c4e709
AD
124702002-11-18 Akim Demaille <akim@epita.fr>
12471
12472 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12473 space.
12474 From Tim Van Holder.
12475
8d8a7238
PE
124762002-11-17 Paul Eggert <eggert@twinsun.com>
12477
12478 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12479 to "SyntaxError" for consistency with my 2002-11-15 change.
12480
12481 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12482 not define to {}, since this breaks the common use of `YYDPRINTF
12483 ((...));' if a single statement is desired (e.g. before `else').
12484 Work around GCC warnings by surrounding corresponding calls with
12485 {} if needed.
12486 (yyhasResolvedValue): Remove unused function.
12487 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12488 loop body.
12489 (yyreportSyntaxError): Renamed from yyreportParseError.
12490 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12491 All uses changed.
12492 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12493 extern when possible. Remove unused initializations.
12494
b0937b22
AD
124952002-11-16 Akim Demaille <akim@epita.fr>
12496
12497 Augment the similarity between GLR and LALR traces.
12498
12499 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12500 (YY_REDUCE_PRINT): New.
12501 (yyparse): Use them.
12502 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12503 YYDPRINT here.
12504 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12505 state reached after the reduction/recovery, since...
12506 (yyparse, yyprocessOneStack): Report the state we are entering in.
12507
c5e3e510
AD
125082002-11-16 Akim Demaille <akim@epita.fr>
12509
12510 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12511 Add support for --trace=skeleton.
12512 * src/scan-skel.l: %option debug.
12513 Scan strings of non-@ or \n instead of character by character.
12514 (scan_skel): Handle trace_skeleton.
12515 (QPUTS): New.
12516 (@output_parser_name@, @output_header_name@): ``Restore'' their
12517 support (used to be M4 macros).
12518 * data/yacc.c: Quote larger chunks, a la glr.c.
12519 * data/lalr1.cc: Likewise.
12520 The header guards are no longer available, so use some other
12521 string than `YYLSP_NEEDED'.
12522
4c6cc1db
AD
125232002-11-16 Akim Demaille <akim@epita.fr>
12524
12525 Make the ``Printers and Destructors'' test more verbose, taking
12526 `yacc.c''s behavior as (possibly wrong) reference.
12527
12528 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12529 instead of fprint on stdout.
12530 Set and report the last_line of the symbols.
12531 Consistently display values and locations.
12532
6d9e8019
PE
125332002-11-16 Paul Eggert <eggert@twinsun.com>
12534
12535 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12536
6e649e65
PE
125372002-11-15 Paul Eggert <eggert@twinsun.com>
12538
b25d88f6
PE
12539 * tests/actions.at (Actions after errors): New test case.
12540
6e649e65
PE
12541 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12542 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12543 tests/action.at, tests/calc.at, tests/conflicts.at,
12544 tests/cxx-type.at, tests/regression.at:
12545 "parse error" -> "syntax error" for POSIX compatibility.
12546 "parsing stack overflow..." -> "parser stack overflow" so
12547 that code matches Bison documentation.
12548
0f39aab9
AD
125492002-11-15 Akim Demaille <akim@epita.fr>
12550
12551 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12552 take two BRACED_CODE, not two string_content.
12553 Free the scanner's obstack when we are done.
12554 (code_content): New.
12555 * tests/calc.at: Adjust.
12556 * doc/bison.texinfo: Adjust.
12557 Also, make sure to include the `,' for these declarations.
12558
761c1926
AD
125592002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12560
12561 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12562 definition; avoids potential autoreconf problems.
12563
b0f98b10
AD
125642002-11-15 Akim Demaille <akim@epita.fr>
12565
12566 Always check the value returned by yyparse.
12567
12568 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12569 returned by yyparse.
12570 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12571 Adjust calls.
12572 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12573 returned by yyparse.
12574
970785f1
PH
125752002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12576
12577 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12578 on input.at test.
12579
8fcc7db1
PE
125802002-11-14 Paul Eggert <eggert@twinsun.com>
12581
7ec1b48e
PE
12582 * src/output.c (output_skeleton): Call xfopen instead of
12583 duplicating xfopen's body.
12584
cfff7583 12585 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 12586 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 12587
8fcc7db1
PE
12588 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12589 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12590 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12591 file twice in the grammar, as an extra check.
12592
12593 * tests/input.at (Torturing the Scanner): Surround the
12594 backslash-newline tests with "#if 0", to make it less likely that
12595 we'll run into compiler bugs. Bring back solitary \ inside
12596 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 12597 test backslash-newline in C character constant.
8fcc7db1 12598
4e8d992c
AD
125992002-11-14 Akim Demaille <akim@epita.fr>
12600
12601 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12602 status of the compiler.
f32b346d 12603 Calling `exit 1' is no longer needed.
4e8d992c
AD
12604 Reported by Nelson H. F. Beebe.
12605
9501dc6e
AD
126062002-11-14 Akim Demaille <akim@epita.fr>
12607
12608 * tests/atlocal.in (CPPFLAGS): We have config.h.
12609 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12610 New.
12611 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12612 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12613 * tests/regression.at, tests/torture.at: Use them for all the
12614 grammars that are to be compiled.
12615 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12616 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12617 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12618
18b519c0
AD
126192002-11-14 Akim Demaille <akim@epita.fr>
12620
12621 * doc/bison.texinfo: Various formatting changes (alignments in
12622 samples, additional @group/@end group, GCS in samples.
12623 Use @deffn instead of simple @table to define the directives,
12624 macros, variables etc.
12625
9a86cdb9
PE
126262002-11-13 Paul Eggert <eggert@twinsun.com>
12627
daa33def 12628 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 12629 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 12630
daa33def 12631 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 12632 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
12633 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12634 * tests/headers.at (export YYLTYPE): Likewise.
12635
12636 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 12637 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 12638
9a86cdb9
PE
12639 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12640 comments, since they're not portable. Use GNU coding style.
12641
9c1e26bd
AD
126422002-11-13 Akim Demaille <akim@epita.fr>
12643
12644 * data/yacc.c: Leave bigger chunks of quoted text.
12645 (YYDSYMPRINTF): New.
12646 Use it to report symbol activities.
12647 * data/glr.c (YYDSYMPRINTF): New.
12648 Use it.
12649
87f721cc
PE
126502002-11-12 Paul Eggert <eggert@twinsun.com>
12651
12652 Version 1.75b.
12653
12654 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12655 (yyglrReduce): Return yyok, not 0.
12656 This should avoid the enumerated-type warnings reported
464c6927 12657 by Nelson H. F. Beebe in
161a71f3 12658 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
12659
12660 * lib/bbitset.h (BITSET_INLINE): Remove.
12661 * lib/bitset.h [! BITSET_INLINE]: Remove.
12662 (bitset_set, bitset_reset, bitset_test): Rename local vars
12663 to avoid shadowing warnings by GCC.
12664
12665 * data/glr.c (inline): Remove #define. It's the user's
12666 responsibility to #define it away, just like 'const'.
464c6927 12667 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 12668 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 12669
87f721cc
PE
12670 * Makefile.maint (po-check): Scan .l and .y files instead of the
12671 .c and the .h files that they generate. This fixes the bug
12672 reported by Tim Van Holder in:
161a71f3 12673 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
12674 Look for N_ as well as for _. Try to avoid matching #define for
12675 N_ and _.
12676 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12677 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12678 * src/scan-gram.l: Revamp regular expressions so that " and '
12679 do not confuse xgettext.
12680
12681 * src/struniq.h (struniq_new): Do not declare the return type
12682 to be 'const'; this violates the C standard.
12683 * src/struniq.c (struniq_new): Likewise.
12684
be14ade5
AD
126852002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12686
12687 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12688 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12689 linker.
12690
05291fbc
AD
126912002-11-12 Akim Demaille <akim@epita.fr>
12692
12693 * Makefile.maint: Sync with Autoconf:
12694 (local_updates): New.
12695
1f5fd52e
AD
126962002-11-12 Akim Demaille <akim@epita.fr>
12697
12698 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12699
283f1e64
AD
127002002-11-12 Akim Demaille <akim@epita.fr>
12701
12702 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12703 locations.
12704
886b69d1
AD
127052002-11-12 Akim Demaille <akim@epita.fr>
12706
12707 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12708 not yyvalue.
12709
3df37415
AD
127102002-11-12 Akim Demaille <akim@epita.fr>
12711
12712 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12713 Use it to test the GLR parser.
12714
7bd6c77e
AD
127152002-11-12 Akim Demaille <akim@epita.fr>
12716
12717 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12718 defines it.
12719 * data/glr.c (yystos): New.
12720 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12721 (YYDSYMPRINT): New.
12722 (yyval): Don't define it, it is handled via M4.
12723 (yyrecoverParseError): Free verbosely the discarded symbols.
12724 * data/yacc.c (yysymprint): Remove, rather...
12725 (b4_yysymprint_generate): invoke.
12726 * data/c.m4 (b4_yysymprint_generate): New.
12727 Accept pointers as arguments, as opposed to the version from
12728 yacc.c.
12729 (b4_yydestruct_generate): Likewise.
12730 * tests/cations.at (Printers and Destructors): Use Bison directives
12731 instead of CPP macros.
12732 Don't rely on internal details.
12733
b0400cc6
AD
127342002-11-12 Akim Demaille <akim@epita.fr>
12735
12736 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12737 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12738 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12739 it against YYEMPTY and so forth), work on yytoken (i.e., set
12740 it to YYEMPTY etc.).
12741 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12742 (b4_symbol_actions): Remove.
12743 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12744 for 0, end-of-input.
12745
72f889cc
AD
127462002-11-12 Akim Demaille <akim@epita.fr>
12747
12748 * doc/bison.texinfo (Destructor Decl): New.
12749
b1ae9233
AD
127502002-11-12 Akim Demaille <akim@epita.fr>
12751
12752 * src/tables.c (tables_generate): Use free for pointers that
12753 cannot be NULL, not XFREE.
12754 (pack_vector): Use assert, not fatal, for bound violations.
12755 * src/state.c (state_new): Likewise.
12756 * src/reader.c (reader): Likewise.
12757 * src/lalr.c (set_goto_map): Likewise.
72f889cc 12758 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
12759 the file name.
12760
7ec2d4cd
AD
127612002-11-12 Akim Demaille <akim@epita.fr>
12762
12763 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12764 Restore.
12765 * src/scan-gram.l (last_string): Is global to the file, not to
12766 yylex.
12767 * src/parse-gram.y (input): Don't append the epilogue here,
12768 (epilogue.opt): do it here, and free the scanner's obstack.
12769 * src/reader.c (epilogue_set): Rename as...
12770 (epilogue_augment): this.
12771 * data/c.m4 (b4_epilogue): Defaults to empty.
12772
573a6cd3
AD
127732002-11-12 Akim Demaille <akim@epita.fr>
12774
12775 * src/getargs.c (long_options): Remove duplicates.
12776 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12777 Remove.
12778 * doc/bison.rnh: Remove.
12779 * doc/bison.texinfo (VMS Invocation): Remove.
12780
95612cfa
AD
127812002-11-12 Akim Demaille <akim@epita.fr>
12782
12783 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12784 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12785
12786 Use struniq for symbols.
12787
12788 * src/symtab.h (symbol_t): The tag member is a struniq.
12789 (symbol_type_set): Adjust.
12790 * src/symtab.c (symbol_new): Takes a struniq.
12791 (symbol_free): Don't free the tag member.
12792 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12793 (hash_compare_symbol, hash_symbol): these.
12794 Use the fact that tags as struniqs.
12795 (symbol_get): Use struniq_new.
12796 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12797 Returns a strniq.
12798 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12799 and type members are struniqs.
12800 * src/reader.c (get_merge_function)
12801 (grammar_current_rule_merge_set): Adjust.
12802 (TYPE, current_type): Are struniq.
12803
12804 Use struniq for file names.
12805
12806 * src/files.h, src/files.c (infile): Split into...
12807 (grammar_file, current_file): these.
12808 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12809 * src/reduce.c (reduce_print): Likewise.
12810 * src/getargs.c (getargs): Likewise.
12811 * src/complain.h, src/complain.c: Likewise.
12812 * src/main.c (main): Call struniqs_new early enough to use it for
12813 file names.
12814 Don't free the input file name.
12815
3e6656f9
AD
128162002-11-12 Akim Demaille <akim@epita.fr>
12817
12818 * src/symtab.c (symbol_free): Remove dead deactivated code:
12819 type_name are properly removed.
12820 Don't use XFREE to free items that cannot be NULL.
12821 * src/struniq.h, src/struniq.c: New.
12822 * src/main.c (main): Initialize/free struniqs.
12823 * src/parse-gram.y (%union): Add astruniq member.
12824 (yyprint): Adjust.
12825 * src/scan-gram.l (<{tag}>): Return a struniq.
12826 Free the obstack bit that used to store it.
12827 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12828
7672019c
PE
128292002-11-11 Paul Eggert <eggert@twinsun.com>
12830
12831 Revamp to fix many (but not all) of the C- and M4-related quoting
12832 problems. Among other things, this fixes the Bison bug reported
12833 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 12834 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
12835
12836 Use new @ escapes consistently. Represent brackets with @{ and @}
12837 rather than @<:@ and @:>@, since this works a bit better with dumb
12838 editors like vi. Represent @ with @@, since @ is now consistently
12839 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12840 __ofile__, to avoid unexpected expansions. Similarly, use @output
12841 rather than #output.
12842
12843 * data/c.m4 (b4_copyright): Omit file name from comment, since
12844 the file name could contain "*/".
12845 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12846 be quoted. All uses changed.
12847
12848 * data/glr.c: Use new @ escapes consistently.
12849 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12850 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12851 Remove, since they couldn't handle arbitrary characters in file
12852 names.
12853 * data/lalr1.cc: Likewise.
12854 * data/yacc.c: Likewise.
12855
12856 * src/files.c (output_infix): Remove; all uses removed.
12857 * src/files.h: Likewise.
12858
12859 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12860 mishandled funny characters in file names, and anyway it isn't
12861 needed any more.
12862 * data/yacc.c: Likewise.
12863 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12864
12865 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12866 * data/yacc.c: Likewise.
12867
12868 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12869 strings now.
12870 (muscle_init): Quote filename as a C string.
12871 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12872 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12873 * src/output.c (escaped_file_name_output): New function.
12874 (prepare_symbols): Quote tokens for M4.
12875 (prepare): Don't insert output_infix, output_prefix,
12876 output_parser_name, output_header_name; this is now down by scan-skel.
12877 Insert skeleton as a C string.
12878
12879 * src/output.c (user_actions_output, symbol_destructors_output,
12880 symbol_printers_output): Quote filenames for C and M4.
12881 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12882
12883 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12884 escapes other than \\ and \'; this simplifies the code.
12885 (<SC_STRING>): Likewise, for \\ and \".
12886 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12887 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12888 Use new escapes @{ and @} for [ and ].
12889
12890 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12891 them with auto vars.
12892 Switch to new escape scheme, where @ is the escape character uniformly.
12893 Abort if a stray escape character is found. Avoid unbounded input
12894 buffer when parsing non-escaped text.
12895
12896 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12897 __oline__, #output, $@, and @{ do not have unintended meanings.
12898
acea4f3b
PE
128992002-11-09 Paul Eggert <eggert@twinsun.com>
12900
12901 Fix the test failure due to GCC warnings described in
161a71f3 12902 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
12903 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12904 evaluate to 0 if it's impossible for NINF to be in the respective
12905 table.
12906 (yygetLRActions, yyrecoverParseError): Use them.
12907
12908 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12909 counted in the token inserted at end of file. Now takes
12910 location_t *, not location_t, so that the location can be
12911 adjusted. All uses changed.
12912
12913 * tests/regression.at (Invalid inputs): Adjust wording in
12914 diagnostic to match the new behavior.
12915
12916 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12917 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12918 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12919 abort ();'. This reduces the runtime of the "Many lookaheads"
12920 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12921 GCC 3.2.
12922
20ef1ad5
PE
129232002-11-07 Paul Eggert <eggert@twinsun.com>
12924
12925 * src/parse-gram.y (CHARACTER): Remove unused token.
12926 All uses removed.
12927
12928 * src/scan-gram.l: Remove stack option. We no longer use the
12929 stack, since the stack was never deeper than 1; instead, use the
12930 new auto var c_context to record the stacked value.
12931
12932 Remove nounput option. At an unexpected end of file, we now unput
12933 the minimal input necessary to end cleanly; this simplifies the
12934 code.
12935
12936 Avoid unbounded token sizes where this is easy.
12937
12938 (unexpected_end_of_file): New function.
12939 Use it to systematize the error message on unexpected EOF.
12940 (last-string): Now auto, not static.
12941 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12942 (scanner_last_string_free): Remove; not used.
12943 (percent_percent_count): Move decl to just before use.
12944 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12945 not the (never otherwised-used) CHARACTER.
12946
93724f13
AD
129472002-11-07 Akim Demaille <akim@epita.fr>
12948
12949 Let yyerror always receive the msg as last argument, so that
12950 yyerror can be variadic.
12951
12952 * data/yacc.c (b4_yyerror_args): New.
12953 Use it when calling yyerror.
12954 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12955 Use it when calling yyerror.
12956 * doc/bison.texinfo (Error Reporting): Adjust.
12957 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12958 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12959
6e40b4eb
AD
129602002-11-06 Akim Demaille <akim@epita.fr>
12961
12962 #line should have quoted strings.
12963 Ideally, this should be done by m4_quotearg.
12964
12965 * src/scan-skel.l: Include quotearg.h.
12966 Quote __ofile__.
12967 * src/output.c (symbol_printers_output)
12968 (symbol_destructors_output): Quote the file name.
12969
2dfbfc12
AD
129702002-11-06 Akim Demaille <akim@epita.fr>
12971
12972 * tests/regression.at (Invalid inputs): Adjust to the recent
12973 messages.
12974
437c2d80
AD
129752002-11-06 Akim Demaille <akim@epita.fr>
12976
12977 Restore --no-lines.
12978 Reported by Jim Kent.
12979
12980 * data/c.m4 (b4_syncline): New.
12981 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12982 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12983 * src/output.c (user_actions_output): Likewise.
12984 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 12985 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 12986
900c5db5
AD
129872002-11-06 Akim Demaille <akim@epita.fr>
12988
12989 * src/main.c (main): Free `infile'.
12990 * src/scan-gram.l (handle_syncline): New.
12991 Recognize `#line'.
12992 * src/output.c (user_actions_output, symbol_destructors_output)
12993 (symbol_printers_output): Use the location's file name, not
12994 infile.
12995 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12996
e183b123 129972002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 12998
e183b123 12999 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 13000 either has GLR conflict entries.
e183b123 13001
193eb6b7
PE
130022002-11-05 Paul Eggert <eggert@twinsun.com>
13003
e183b123
PE
13004 * src/scan-gram.l: Use more accurate diagnostics, e.g.
13005 "integer out of range" rather than "invalid value".
13006 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
13007 accordingly.
13008
193eb6b7
PE
13009 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
13010 Also, remove one static variable in the scanner.
13011
13012 * src/scan-gram.l (braces_level): Now auto, not static.
13013 Initialize to zero if the compiler is being picky.
13014 (INITIAL): Clear braces_level instead of incrementing it.
13015 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
13016 as POSIX 1003.1-2001 requires.
13017 * src/system.h (IF_LINT): New macro, taken from coreutils.
13018 * configure.ac: Define "lint" if --enable-gcc-warnings.
13019
29c01725
AD
130202002-11-05 Akim Demaille <akim@epita.fr>
13021
13022 * src/scan-gram.l: When it starts with `%', complain about the
13023 whole directive, not just that `invalid character: %'.
13024
8aeac3ca
AD
130252002-11-04 Akim Demaille <akim@epita.fr>
13026
13027 * Makefile.maint: Update from Autoconf.
13028 (update, cvs-update, po-update, do-po-update): New.
13029
793a58bb
AD
130302002-11-04 Akim Demaille <akim@epita.fr>
13031
13032 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13033 and yyerror.
13034 Have yyerror `use' its arguments.
13035 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13036 returns true when location & yacc & pure & parse-param.
13037 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13038
c4d720cd
AD
130392002-11-04 Akim Demaille <akim@epita.fr>
13040
13041 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13042 clashes.
13043 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13044 font-lock-mode.
13045 Use complain_at.
13046 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13047 slot 0.
13048
613a0dc5
PE
130492002-11-03 Paul Eggert <eggert@twinsun.com>
13050
13051 * src/reader.c (get_merge_function, grammar_current_rule_check):
13052 Use consistent diagnostics for reporting type name clashes.
13053 Quote the types with <>, for consistency with Yacc.
13054 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13055
2a8d363a
AD
130562002-11-03 Akim Demaille <akim@epita.fr>
13057
13058 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13059 New.
13060 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13061 (b4_parse_param): Remove.
13062 Use b4_identification.
13063 Propagate b4_pure_args where needed to pass them to yyerror.
13064 * data/glr.m4 (b4_parse_param): Remove.
13065 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13066 (b4_lpure_formals): New.
13067 Use b4_identification.
13068 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13069 b4_user_formals and b4_user_args.
13070 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13071 (yyreportAmbiguity): When using a pure parser, also need
13072 the location, and the parse-params.
13073 Adjust callers.
13074 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13075 When using a pure parser, also need the parse-params.
13076 Adjust callers.
13077 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13078 (%pure-parser + %parse-param) LALR and GLR parsers.
13079 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13080 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13081 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13082 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13083 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13084 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13085 * doc/bison.texinfo: Untabify the whole file.
13086 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13087 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13088 (Error Reporting): Adjust to these new directives.
13089 Document %error-verbose, deprecate YYERROR_VERBOSE.
13090
9e32add8
AD
130912002-11-03 Akim Demaille <akim@epita.fr>
13092
13093 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13094 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13095 command line options.
13096 * tests/cxx-type.at: Formatting changes.
13097
b02d90a5
PE
130982002-11-03 Paul Eggert <eggert@twinsun.com>
13099
13100 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13101 to count columns correctly, and to check for invalid inputs.
9e32add8 13102
b02d90a5
PE
13103 Use mbsnwidth to count columns correctly. Account for tabs, too.
13104 Include mbswidth.h.
13105 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13106 (extend_location): New function.
13107 (YY_LINES): Remove.
13108
13109 Handle CRLF in C code rather than in Lex code.
13110 (YY_INPUT): New macro.
13111 (no_cr_read): New function.
13112
13113 Scan UCNs, even though we don't fully handle them yet.
13114 (convert_ucn_to_byte): New function.
13115
13116 Handle backslash-newline correctly in C code.
13117 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13118 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13119 all uses changed.
13120 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13121 Use {splice} wherever C allows backslash-newline.
13122 YY_STEP after space, newline, vertical-tab.
13123 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 13124
b02d90a5
PE
13125 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13126
13127 ({int}, handle_action_dollar, handle_action_at): Check for integer
13128 overflow.
9e32add8 13129
b02d90a5
PE
13130 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13131
13132 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13133 as well as \000. Check for UCHAR_MAX, not 255.
13134 Allow \x with an arbitrary positive number of digits, as in C.
13135 Check for overflow here.
13136 Allow \? and UCNs, for compatibility with C.
13137
13138 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13139 with quote slot used by complain_at.
13140
13141 * tests/input.at: Add tests for backslash-newline, m4 quotes
13142 in symbols, long literals, and funny escapes in strings.
13143
13144 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13145 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13146 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13147 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13148 * m4/mbswidth.m4: New file, from GNU coreutils.
13149
13150 * doc/bison.texinfo (Grammar Outline): Document // comments.
13151 (Symbols): Document that trigraphs have no special meaning in Bison,
13152 nor is backslash-newline allowed.
13153 (Actions): Document that trigraphs have no special meaning.
13154
13155 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13156 no longer used.
13157
131582002-11-02 Paul Eggert <eggert@twinsun.com>
13159
13160 * src/reader.c: Don't include quote.h; not needed.
13161 (get_merge_function): Reword warning to be consistent with
13162 type clash diagnostic in grammar_current_rule_check.
13163
13164 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13165 bug in trigraph handling.
13166
13167 * src/output.c (prepare_symbols): When printing token names,
13168 escape "[" as "@<:@" and likewise for "]".
13169
13170 * src/system.h (errno): Remove declaration, as we are now
13171 assuming C89 or better, and C89 guarantees errno.
13172
762b212b
PE
131732002-10-30 Paul Eggert <eggert@twinsun.com>
13174
13175 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13176 Check for close failures.
13177 * src/files.h (xfclose): Return void, not int, since it always
13178 returned zero.
13179 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13180 indicates one.
13181 * src/output.c (output_skeleton): Use xfclose rather than fclose
13182 and ferror. xfclose now checks ferror.
13183
13184 * data/glr.c (YYLEFTMOST_STATE): Remove.
13185 (yyreportTree): Use a stack-based leftmost state. This avoids
13186 our continuing battles with bogus warnings about initializers.
13187
56100c60
AD
131882002-10-30 Akim Demaille <akim@epita.fr>
13189
13190 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13191 #if.
13192
51b4a04c
PH
131932002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13194
13195 * tests/glr-regr1.at: New test for reported regressions.
13196 * tests/testsuite.at: Add glr-regr1.at test.
13197 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 13198
bf1ebda2
PE
131992002-10-24 Paul Eggert <eggert@twinsun.com>
13200
5c16c6b1
PE
13201 Version 1.75a.
13202
bf1ebda2
PE
13203 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13204 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13205 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13206 Don't assume strdup exists; POSIX says its an XSI extension.
13207 Check for buffer overflow on input.
13208
b526ee61
AD
132092002-10-24 Akim Demaille <akim@epita.fr>
13210
13211 * src/output.c (output_skeleton): Don't disable M4sugar comments
13212 too soon: it results in comments being expanded.
13213 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13214 first output.
13215
f1886bb2
AD
132162002-10-24 Akim Demaille <akim@epita.fr>
13217
13218 * data/yacc.c (m4_int_type): New.
13219 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13220 char' as only yacc.c wants K&R portability.
13221 * data/glr.c (yysigned_char): Remove.
13222 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13223 Reported by Quoc Peyrot.
13224
c5576256
PE
132252002-10-23 Paul Eggert <eggert@twinsun.com>
13226
13227 * src/main.c (main): With --trace=time, report times even if a
13228 non-fatal error occurs. Formerly, the times were reported in some
13229 such cases but not in others.
13230 * src/reader.c (reader): Just return if a complaint has been issued,
13231 instead of exiting, so that 'main' can report times.
13232
27b0ffea
AD
132332002-10-22 Akim Demaille <akim@epita.fr>
13234
13235 * src/system.h: Include sys/types.
13236 Reported by Bert Deknuydt.
13237
223a7883
PE
132382002-10-23 Paul Eggert <eggert@twinsun.com>
13239
13240 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13241 Suggested by Art Haas.
13242
132432002-10-22 Paul Eggert <eggert@twinsun.com>
13244
13245 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13246 decl; not needed any more.
13247 * src/main.c (main): Use return to exit, undoing yesterday's change.
13248 The last OS that we could find where this wouldn't work is
13249 SunOS 3.5, and that's too old to worry about now.
13250
13251 * data/glr.c (struct yyltype): Define members even when not
13252 doing locations. This is more consistent with yacc.c, and it
13253 works around the following bug reports:
161a71f3
PE
13254 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13255 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 13256
223a7883
PE
13257 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13258 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13259 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13260
8b76775a
AD
132612002-10-22 Akim Demaille <akim@epita.fr>
13262
13263 * data/README: New.
13264
6db10d14
PE
132652002-10-21 Paul Eggert <eggert@twinsun.com>
13266
13267 Be consistent about 'bool'; the old code used an enum in one
13268 module and an int in another, and this violates the C standard.
13269 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13270 * configure.ac (AC_HEADER_STDBOOL): Add.
13271 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13272 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13273 * src/symtab.c (hash_compare_symbol_t): Likewise.
13274 * src/system.h (bool, false, true): Use a definition consistent
13275 with ../lib/hash.c. All uses changed.
13276
13277 * src/complain.c (warning_issued): Renamed from warn_message_count,
13278 so that we needn't worry about integer overflow (!).
13279 Now of type bool. All uses changed.
13280 (complaint_issued): Renamed from complain_message_count; likewise.
13281
13282 * src/main.c (main): Use exit to exit with failure.
27b0ffea 13283
6db10d14
PE
13284 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13285 rather than 1 and 0.
13286 * src/main.c (main): Likewise.
13287 * src/getargs.c (getargs): Likewise.
13288 * src/reader.c (reader): Likewise.
13289
13290 * src/getarg.c (getargs): Remove duplicate code for
13291 "Try `bison --help'".
13292
13293 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13294 What was that "2" for?
13295
13296 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13297 * src/getargs.c (usage): Likewise.
13298
13299 * src/getargs.c (getargs): When there are too few operands, report
13300 the last one. When there are too many, report the first extra
13301 one. This is how diffutils does it.
13302
92a060fd
PE
133032002-10-20 Paul Eggert <eggert@twinsun.com>
13304
13305 Remove K&R vestiges.
13306 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13307 * src/complain.c (VA_START): Remove. Assume prototypes.
13308 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13309 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13310 fatal): Assume prototypes.
13311 * src/complain.h: Assume prototypes.
13312 * src/system.h (PARAMS): Remove.
13313 Include <limits.h> unconditionally, since it's guaranteeed even
13314 for a freestanding C89 compiler.
13315 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13316 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 13317
e7cb57c0
AD
133182002-10-20 Akim Demaille <akim@epita.fr>
13319
13320 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13321 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13322 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13323 (yyresolveStates, yyresolveAction, yyresolveStack)
13324 (yyprocessOneStack): Use them.
13325 (yy_reduce_print): New.
13326 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13327
0245f82d
AD
133282002-10-20 Akim Demaille <akim@epita.fr>
13329
13330 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13331 arguments and output `void'.
13332 (b4_c_function): Rename as...
13333 (b4_c_function_def): this.
13334 (b4_c_function_decl, b4_c_ansi_function_def)
13335 (b4_c_ansi_function_decl): New.
13336 Change the interpretation of the arguments: before `int, foo', now
13337 `int foo, foo'.
13338 * data/yacc.c (yyparse): Prototype and define thanks to these.
13339 Adjust b4_c_function_def uses.
13340 * data/glr.c (yyparse): Likewise, but ANSI only.
13341
39912f52
AD
133422002-10-20 Akim Demaille <akim@epita.fr>
13343
13344 * src/output.c (prepare): Move the definition of `tokens_number',
13345 `nterms_number', `undef_token_number', `user_token_number_max'
13346 to...
13347 (prepare_tokens): Here.
13348 (prepare_tokens): Rename as...
13349 (prepare_symbols): this.
13350 (prepare): Move the definition of `rules_number' to...
13351 (prepare_rules): here.
13352 (prepare): Move the definition of `last', `final_state_number',
13353 `states_number' to...
13354 (prepare_states): here.
13355 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13356
20c1e2ad
AD
133572002-10-20 Akim Demaille <akim@epita.fr>
13358
13359 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13360
21964f43
AD
133612002-10-20 Akim Demaille <akim@epita.fr>
13362
13363 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13364 * data/c.m4: here.
13365
66d30cd4
AD
133662002-10-20 Akim Demaille <akim@epita.fr>
13367
13368 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13369 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13370 `pair'.
13371 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13372 `name' to...
13373 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13374 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13375 These.
13376
95f2c9fe
PE
133772002-10-19 Paul Eggert <eggert@twinsun.com>
13378
13379 Do not create a temporary file, as that involves security and
13380 cleanup headaches. Instead, use a pair of pipes.
13381 Derived from a suggestion by Florian Krohm.
13382 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13383 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13384 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13385 (BISON_PREREQ_SUBPIPE): Add.
13386 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13387 Add subpipe.h, subpipe.c.
13388 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13389 * po/POTFILES.in: Add lib/subpipe.c.
13390 * src/output.c: Include "subpipe.h".
13391 (m4_invoke): Remove decl.
13392 (scan_skel): New decl.
13393 (output_skeleton): Use pipe rather than temporary file for m4 input.
13394 Check that m4sugar.m4 is readable, to avoid deadlock.
13395 Check for pipe I/O error.
13396 * src/scan-skel.l (readpipe): Remove decl.
13397 (scan_skel): New function, to be used in place of m4_invoke.
13398 Read from stream rather than file.
66d30cd4 13399
95f2c9fe
PE
13400 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13401 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13402 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13403 this generates a more-accurate value anyway.
13404
13405 * lib/timevar.c (timervar_accumulate): Rename locals to
13406 avoid confusion with similarly-named more-global.
13407 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13408
13409 * src/output.c (prepare): Use xstrdup to convert char const *
13410 to char *, to avoid GCC warning.
13411
c19988b7
AD
134122002-10-19 Akim Demaille <akim@epita.fr>
13413
13414 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13415 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13416 Use them to have `calc.y' ready for %pure-parser.
13417 * data/yacc.c (YYLEX): Pass a yylex return type to
13418 b4_c_function_call.
13419
ae7453f2
AD
134202002-10-19 Akim Demaille <akim@epita.fr>
13421
13422 Prototype support of %lex-param and %parse-param.
13423
13424 * src/parse-gram.y: Add the definition of the %lex-param and
13425 %parse-param tokens, plus their rules.
13426 Drop the `_' version of %glr-parser.
13427 Add the "," token.
13428 * src/scan-gram.l (INITIAL): Scan them.
13429 * src/muscle_tab.c: Comment changes.
13430 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13431 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13432 (muscle_entry_s): The `value' member is no longer const.
13433 Adjust all dependencies.
13434 * src/muscle_tab.c (muscle_init): Adjust: use
13435 MUSCLE_INSERT_STRING.
13436 Initialize the obstack earlier.
13437 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13438 (muscle_pair_list_grow): New.
13439 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13440 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13441 * tests/calc.at: Use %locations, not --locations.
13442 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13443
0e575721
AD
134442002-10-19 Akim Demaille <akim@epita.fr>
13445
13446 * src/getargs.c (usage): Take status as argument and exit
13447 accordingly.
13448 Report the traditional `Try ... --help' message when status != 0.
13449 (usage, version): Don't take a FILE * as arg, it is pointless.
13450 (getargs): When there is an incorrect number of arguments, make it
13451 an error, and report it GNUlically thanks to `usage ()'.
13452
724ce7f5
PE
134532002-10-18 Paul Eggert <eggert@twinsun.com>
13454
3a781eb2
PE
13455 * data/glr.c (yyreportParseError): Don't assume that sprintf
13456 yields the length of the printed string, as this is not true
13457 on SunOS 4.1.4. Reported by Peter Klein.
13458
724ce7f5
PE
13459 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13460 * tests/conflicts.at (%nonassoc and eof): Likewise.
13461 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13462
473d0a75
AD
134632002-10-17 Akim Demaille <akim@epita.fr>
13464
13465 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13466 * src/getargs.c (trace_types, trace_args): Adjust.
13467 * src/reader.c (grammar_current_rule_prec_set)
13468 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13469 Standardize error messages.
13470 And s/@prec/%prec/!
13471 (reader): Use trace_flag to enable scanner/parser debugging,
13472 instead of an adhoc scheme.
13473 * src/scan-gram.l: Remove trailing debugging code.
13474
e76d2469
PE
134752002-10-16 Paul Eggert <eggert@twinsun.com>
13476
93e2236a
PE
13477 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13478 MUSCLE_TAB_H.
13479
e76d2469
PE
13480 * NEWS: Officially drop support for building Bison with K&R C,
13481 since it didn't work anyway and it's not worth worrying about.
13482 * Makefile.maint (wget_files): Remove ansi2knr.c.
13483 (ansi2knr.c-url_prefix): Remove.
13484 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13485 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13486 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13487
5bd1c419
PE
134882002-10-15 Paul Eggert <eggert@twinsun.com>
13489
13490 Stop using the "enum_" trick for K&R-style function definitions;
13491 it confused me, and I was the author! Instead, assume that people
13492 who want to use K&R C compilers (when using these modules in GCC,
13493 perhaps?) will run ansi2knr.
13494
13495 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13496 All uses of "enum_" changed to "enum ".
13497 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13498 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 13499
5bd1c419
PE
13500 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13501 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13502 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13503 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13504 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13505 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13506 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13507 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13508 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13509 Use function prototypes; this removes the need for declaring
13510 static functions simply to provide their prototypes.
13511 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13512 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13513 bitset_count_, bitset_create, bitset_dump, bitset_first,
13514 bitset_free, bitset_init, bitset_last, bitset_next,
13515 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13516 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13517 bitset_print, bitset_release_memory, bitset_toggle_,
13518 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13519 debug_bitset): Likewise.
13520 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13521 * lib/bitset_stats.c (bitset_log_histogram_print,
13522 bitset_percent_histogram_print, bitset_stats_and,
13523 bitset_stats_and_cmp, bitset_stats_and_or,
13524 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13525 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13526 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13527 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13528 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13529 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13530 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13531 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13532 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13533 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13534 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13535 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13536 bitset_stats_zero): Likewise.
13537 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13538 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13539 bitsetv_dump, debug_bitsetv): Likewise.
13540 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13541 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13542 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13543 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13544 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13545 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13546 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13547 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13548 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13549 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13550 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13551 Likewise.
13552 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13553 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13554 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13555 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13556 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13557 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13558 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13559 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13560 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13561 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13562 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 13563
ae26e1f0
AD
135642002-10-14 Akim Demaille <akim@epita.fr>
13565
13566 Version 1.75.
13567
d43baf71
AD
135682002-10-14 Akim Demaille <akim@epita.fr>
13569
13570 * tests/Makefile.am (maintainer-check-posix): New.
13571
7ebc83e3
AD
135722002-10-14 Akim Demaille <akim@epita.fr>
13573
13574 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13575 member.
13576
05846dae
AD
135772002-10-14 Akim Demaille <akim@epita.fr>
13578
13579 * src/tables.c (table_ninf_remap): base -> tab.
13580 Reported by Matt Rosing.
13581
1318e37d
PE
135822002-10-14 Paul Eggert <eggert@twinsun.com>
13583
447fbb17
PE
13584 * tests/action.at, tests/calc.at, tests/conflicts.at,
13585 tests/cxx-type.at, tests/headers.at, tests/input.at,
13586 tests/regression.at, tests/synclines.at, tests/torture.at:
13587 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13588 so that the tests still work even if POSIXLY_CORRECT is set.
13589 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 13590
1318e37d
PE
13591 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13592 for portability to K&R hosts. Fix typo: signed char is guaranteed
13593 only to 127, not to 128.
13594 * data/glr.c (yysigned_char): New type.
13595 * data/yacc.c (yysigned_char): Likewise.
13596 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13597
cc0f0794
PE
135982002-10-13 Paul Eggert <eggert@twinsun.com>
13599
5038f418
PE
13600 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13601 true due to limited range of data type" warning from GCC.
13602
cc0f0794
PE
13603 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13604 by wrapping enum yytokentype's definition inside #ifndef
13605 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13606
6fed0802
AD
136072002-10-13 Akim Demaille <akim@epita.fr>
13608
13609 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13610 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13611
32f0598d
AD
136122002-10-13 Akim Demaille <akim@epita.fr>
13613
13614 * Makefile.maint: Update from Autoconf 2.54.
13615 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13616
7ea9a33f
AD
136172002-10-13 Akim Demaille <akim@epita.fr>
13618
13619 * src/print.c (print_state): Separate the list of solved conflicts
13620 from the other items.
13621 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13622
ea99527d
AD
136232002-10-13 Akim Demaille <akim@epita.fr>
13624
13625 Let nondeterministic skeletons be usable with deterministic
13626 tables.
13627
13628 With the patch, GAWK compiled by GCC without -O2 passes its test
13629 suite using a GLR parser driven by LALR tables. It fails with -O2
13630 because `struct stat' gives two different answers on my machine:
13631 88 (definition of an auto var) and later 96 (memset on this var).
13632 Hence the stack is badly corrumpted. The headers inclusion is to
13633 blame: if I move the awk.h inclusion before GLR's system header
13634 inclusion, the two struct stat have the same size.
13635
13636 * src/tables.c (pack_table): Always create conflict_table.
13637 (token_actions): Always create conflict_list.
13638 * data/glr.c (YYFLAG): Remove, unused.
13639
f377f69f
AD
136402002-10-13 Akim Demaille <akim@epita.fr>
13641
13642 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13643 (O0FLAGS): New.
13644 (VALGRIND, GXX): New.
13645 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13646 * tests/bison.in: Run $PREBISON a pre-command.
13647 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13648 (maintainer-check-g++): New.
13649 * Makefile.am (maintainer-check): New.
13650
2a1fe6ed
AD
136512002-10-13 Akim Demaille <akim@epita.fr>
13652
13653 * data/glr.c: Formatting changes.
13654 Tweak some trace messages to match yacc.c's.
13655
f50adbbd
AD
136562002-10-13 Akim Demaille <akim@epita.fr>
13657
13658 GLR parsers sometimes raise parse errors instead of performing the
13659 default reduction.
13660 Reported by Charles-Henry de Boysson.
13661
13662 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 13663 check the length of the traces when %glr.
f50adbbd
AD
13664 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13665 GLR's traces.
13666 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13667 Test GLR parsers.
13668 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13669 (yyltype): Remove the yy prefix from the member names.
13670 (yytable): Complete its comment.
13671 (yygetLRActions): Map error action number from YYTABLE from
13672 YYTABLE_NINF to 0.
13673 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13674 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13675 not satisfying as we could compare an YYACTION computed from
13676 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13677 only value for error actions.
13678 (yyreportParseError): In verbose parse error messages, don't issue
13679 `error' in the list of expected tokens.
13680 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13681 next action to perform to match glr.c's decoding.
13682 (yytable): Complete its comment.
13683
bcbad5b9
PE
136842002-10-13 Paul Eggert <eggert@twinsun.com>
13685
13686 Fix problem reported by Henrik Grubbstroem in
161a71f3 13687 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
13688 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13689 because the Bison parser reads the second action before reducing
13690 the first one.
13691 * src/scan-gram.l (rule_length): New static var.
13692 Use it to keep track of the rule length in the scanner, since
13693 we can't expect the parser to be in lock-step sync with the scanner.
13694 (handle_action_dollar, handle_action_at): Use this var.
13695 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 13696
14904b89
PE
136972002-10-12 Paul Eggert <eggert@twinsun.com>
13698
1fe611e5
PE
13699 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13700 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13701 Include <sys/time.h> when checking for clock_t and struct tms.
13702 Use same include order as source.
13703 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 13704 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 13705
1fe611e5
PE
13706 * lib/timevar.c: Update copyright date and clarify comments.
13707 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 13708
1fe611e5
PE
13709 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13710 GCC version as of today, then merge Bison's changes.
13711 Change "GCC" to "Bison" in copyright notice. timevar.def's
13712 author is Akim, so change that too.
13713
98194095
PE
13714 * src/reader.c (grammar_current_rule_check):
13715 Don't worry about the default action if $$ is untyped.
13716 Prevents bogus warnings reported by Jim Gifford in
161a71f3 13717 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 13718
14904b89
PE
13719 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13720 * data/glr.c, data/lalr1.cc, data/yacc.c:
13721 Output token definitions before the first part of user declarations.
13722 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 13723 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 13724
ff6dca18
PE
137252002-10-11 Paul Eggert <eggert@twinsun.com>
13726
13727 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13728 (yyparse): here. This undoes some of the 2002-07-25 change.
13729 Compatibility problem reported by Ralf S. Engelschall with
13730 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13731
eb714592
AD
137322002-10-11 Akim Demaille <akim@epita.fr>
13733
13734 * tests/regression.at Characters Escapes): New.
13735 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13736 characters.
13737 Reported by Jan Nieuwenhuizen.
13738
b7195100
AD
137392002-10-11 Akim Demaille <akim@epita.fr>
13740
13741 * po/id.po: New.
13742
f28a0f2d
PE
137432002-10-10 Paul Eggert <eggert@twinsun.com>
13744
13745 Portability fixes for bitsets; this also avoids several GCC
13746 warnings.
13747
13748 * lib/abitset.c: Include <stddef.h>, for offsetof.
13749 * lib/lbitset.c: Likewise.
13750
13751 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13752 properly for vectors of objects. Do not assume that adding a
13753 header size to a multiple of a word size yields a value that is
13754 properly aligned for the whole union.
13755 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13756
13757 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13758 unique names for structures.
13759 * lib/ebitset.c (ebitset_bytes): Likewise.
13760 * lib/lbitset.c (lbitset_bytes): Likewise.
13761
13762 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13763 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13764 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13765 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13766 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13767 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13768 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13769 to improve the type-checking that GCC can do.
13770 * lib/bitset.c (bitset_op4_cmp): Likewise.
13771 * lib/bitset_stats.c (bitset_stats_count,
13772 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13773 bitset_stats_copy, bitset_stats_disjoint_p,
13774 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13775 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13776 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13777 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13778 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13779 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13780 bitset_stats_or_and_cmp): Likewise.
13781 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13782 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13783 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13784 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13785
13786 * lib/abitset.h: Include bitset.h, not bbitset.h.
13787 * lib/ebitset.h: Likewise.
13788 * lib/lbitset.h: Likewise.
13789
13790 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13791 All instances of parameters of type enum bitset_opts are now of
13792 type enum_bitset_opts, to conform to the C Standard, and similarly
13793 for enum_bitset_type.
13794 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13795 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13796
13797 Do not use "struct bitset_struct" to mean different things in
13798 different modules. Not only is this confusing, it violates
13799 the C Standard, which requires that structure types in different
13800 modules must be compatible if one is to be passed to the other.
13801 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13802 All instances of "struct bitset_struct *" replaced with "bitset".
13803 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13804 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13805 struct lbitset_struct, struct bitset_stats_struct): New types.
13806 All uses of struct bitset_struct changed to union bitset_union,
13807 etc.
ba0fe3c7 13808 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
13809 struct bitset_struct): Remove.
13810 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13811 struct bitset_struct): Remove.
13812 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13813 bitset_struct): Remove.
13814 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13815 Likewise.
13816
13817 Do not call a function of type T using a call that assumes the
13818 function is of a different type U. Standard C requires that a
13819 function must be called with a type that is compatible with its
13820 definition.
13821 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13822 New decls.
13823 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13824 New functions.
13825 * lib/ebitset.c (PFV): Remove.
13826 * lib/lbitset.c (PFV): Likewise.
13827 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13828 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13829 decls.
13830 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13831 (ebitset_vtable): Use them.
13832 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13833 lbitset_xor): New functions.
13834 (lbitset_vtable): Use them.
13835
13836 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13837 Declare.
13838
13839 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13840 GCC warning.
13841 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13842 Use offsetof, for simplicity.
13843
6fbe4984
PE
138442002-10-06 Paul Eggert <eggert@twinsun.com>
13845
13846 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13847 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 13848 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
13849 which was inadvertently undone by the 2002-09-30 patch.
13850 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13851 the same width as int.
13852
420f93c8
PE
138532002-10-04 Paul Eggert <eggert@twinsun.com>
13854
13855 Version 1.50.
13856
13857 * configure.ac (AC_INIT), NEWS: Increment version number.
13858
13859 * doc/bison.texinfo: Minor spelling, grammar, and white space
13860 fixes.
13861 (Symbols): Mention that any negative value returned from yylex
13862 signifies end-of-input. Warn about negative chars. Mention
13863 the portable Standard C character set.
13864
13865 The GNU coding standard says CFLAGS and YFLAGS are reserved
13866 for the installer to set.
13867 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13868 * src/Makefile.am (AM_CFLAGS): Likewise.
13869 (AM_YFLAGS): Renamed from YFLAGS.
13870
13871 Fix some MAX and MIN problems.
13872 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13873 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13874 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13875 * src/reader.c (reader): Use it.
13876
13877 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13878 POSIX 1003.1-2001 has removed fgrep.
13879
138802002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13881
13882 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13883 interpreted as signed.
13884 * lib/ebitset.c (ebitset_list): Fix bug.
13885
ff68026d
PE
138862002-10-01 Paul Eggert <eggert@twinsun.com>
13887
13888 More fixes for 64-bit hosts and large bitsets.
13889
13890 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13891 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13892 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13893 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13894 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13895 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13896 bitset_count_): Likewise.
13897 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13898 bitset_first, bitset_last): Likewise.
13899 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13900 bitset_stats_list_reverse, bitset_stats_size,
13901 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13902 Likewise.
13903 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13904 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13905 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13906 bitsetv_reflexive_transitive_closure): Likewise.
13907 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13908 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13909 Likewise.
13910 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13911 Likewise.
420f93c8 13912
ff68026d
PE
13913 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13914 Use size_t, not unsigned int, to count bytes.
13915 * lib/abitset.h (abitset_bytes): Likewise.
13916 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13917 Likewise.
13918 * lib/bitset.h (bitset_bytes): Likewise.
13919 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13920 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13921 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13922 * lib/ebitset.c (ebitset_bytes): Likewise.
13923 * lib/ebitset.h (ebitset_bytes): Likewise.
13924 * lib/lbitset.c (lbitset_bytes): Likewise.
13925 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 13926
ff68026d
PE
13927 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13928 abitset_subset_p, abitset_disjoint_p, abitset_and,
13929 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13930 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13931 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13932 abitset_or_and, abitset_or_and_cmp):
13933 Use bitset_windex instead of unsigned int.
13934 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13935 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13936 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13937 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13938 Likewise.
13939 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 13940
ff68026d
PE
13941 * lib/bitset.c (bitset_print):
13942 Use proper printf formats for widths of integer types.
13943 * lib/bitset_stats.c (bitset_percent_histogram_print,
13944 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13945 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13946 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13947 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 13948
ff68026d
PE
13949 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13950 BITSET_SIZE_MAX): New macros.
13951 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13952 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13953 to BITSET_WINDEX_MAX.
13954
13955 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13956 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13957 since we now return the bitset_bindex type (not int).
13958
13959 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13960 when computing sizes.
13961 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13962
13963 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13964 and avoid cast to unsigned.
13965
6aa452a6
AD
139662002-09-30 Akim Demaille <akim@epita.fr>
13967
13968 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13969 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13970 Updates from Michael Hayes.
13971
927f7817
AD
139722002-09-30 Art Haas <ahaas@neosoft.com>
13973
13974 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13975 invocations.
13976 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13977 defined.
13978
9738f41e
AD
139792002-09-27 Akim Demaille <akim@epita.fr>
13980
13981 Version 1.49c.
13982
a5c75d7f
AD
139832002-09-27 Akim Demaille <akim@epita.fr>
13984
13985 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13986 (Because of AC_LIBSOURCE).
13987
8280e179
AD
139882002-09-27 Akim Demaille <akim@epita.fr>
13989
13990 Playing with Autoscan.
13991
13992 * configure.ac: Remove the old LIBOBJ tweaks.
13993 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13994 * lib/strrchr.c: New.
13995 * lib/strtol.c: New, from the Coreutils 4.5.1.
13996
ae64af35
AD
139972002-09-27 Akim Demaille <akim@epita.fr>
13998
13999 Playing with Autoscan.
14000
14001 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
14002 * lib/Makefile.am (libbison_a_SOURCES): No longer include
14003 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
14004 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
14005 Coreutils 4.5.1.
14006
d1a1114f
AD
140072002-09-24 Akim Demaille <akim@epita.fr>
14008
14009 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
14010 (Frequently Asked Questions, Parser Stack Overflow): New.
14011
b906441c
AD
140122002-09-13 Akim Demaille <akim@epita.fr>
14013
14014 Playing with autoscan.
14015
14016 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
14017 * src/files.c (skeleton_find): Remove, unused.
14018 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
14019 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14020
bd701811
AD
140212002-09-13 Akim Demaille <akim@epita.fr>
14022
14023 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14024 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14025
e0a13e7b
AD
140262002-09-13 Akim Demaille <akim@epita.fr>
14027
14028 * configure.ac: Require 2.54.
14029 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14030 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14031 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14032 Remove, provided by Autoconf macros.
14033
c97011bf
AD
140342002-09-12 Akim Demaille <akim@epita.fr>
14035
14036 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14037
d862b1be
AD
140382002-09-12 Akim Demaille <akim@epita.fr>
14039
14040 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14041 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14042 Reported by Martin Mokrejs.
14043
3d38c03a
AD
140442002-09-10 Akim Demaille <akim@epita.fr>
14045
14046 * src/parse-gram.y: Associate a human readable string to each
14047 token type.
14048 * tests/regression.at (Invalid inputs): Adjust.
14049
b6347355
AD
140502002-09-10 Gary V. Vaughan <gary@gnu.org>
14051
14052 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14053 with an Autoconf-2.5x style configure.ac.
14054
09ba4ab2
PE
140552002-09-06 Paul Eggert <eggert@twinsun.com>
14056
14057 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14058 exception applies only to yacc.c. This is a modification of a
14059 patch originally suggested by Akim Demaille.
14060
21846f69
AD
140612002-09-06 Akim Demaille <akim@epita.fr>
14062
09ba4ab2
PE
14063 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14064 here to...
14065 * data/yacc.c: here.
14066
21846f69
AD
14067 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14068 LocationType.
14069 (b4_ltype): Default to yy::Location from location.hh.
14070
c0ad8bf3
AD
140712002-09-04 Jim Meyering <jim@meyering.net>
14072
14073 * data/yacc.c: Guard the declaration of yytoknum also with
14074 `#ifdef YYPRINT', so it is declared only when used.
14075
3a93251e
AD
140762002-09-04 Akim Demaille <akim@epita.fr>
14077
14078 * configure.in: Rename as...
14079 * configure.ac: this.
14080 Bump to 1.49c.
14081
427c0dda
AD
140822002-09-04 Akim Demaille <akim@epita.fr>
14083
14084 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14085 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14086 translate maintainer only messages.
14087
6a254321
PE
140882002-08-12 Paul Eggert <eggert@twinsun.com>
14089
645e30d1
PE
14090 Version 1.49b.
14091
6a254321
PE
14092 * Makefile.am (SUBDIRS): Remove intl.
14093 (DISTCLEANFILES): Remove.
14094 * NEWS: Mention that GNU M4 is now required. Clarify what is
14095 meant by "larger grammars". Mention the pt_BR translation.
14096 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14097 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14098 Bump version from 0.11.2 to 0.11.5.
14099 (BISON_PREREQ_STAGE): Remove.
14100 (AM_GNU_GETTEXT): Use external gettext.
14101 (AC_OUTPUT): Remove intl/Makefile.
14102
14103 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14104
14105 * data/glr.c: Include string.h, for strlen.
14106 (yyreportParseError): Use size_t for yysize.
14107 (yy_yypstack): No longer nested inside yypstates, as nested
14108 functions are not portable. Do not assume size_t is the
14109 same width as int.
14110 (yypstates): Do not assume that ptrdiff_t is the same width
14111 as int, and similarly for yyposn and YYINDEX.
14112
14113 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14114
14115 * lib/Makefile.am (INCLUDES): Do not include from the intl
14116 directory, which has been removed.
14117 * src/Makefile.am (INCLUDES): Likewise.
14118
14119 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14120 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14121 New vars.
14122
14123 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14124 * tests/Makefile.am (EXTRA_DIST): Likewise.
14125
14126 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14127 Do not assume that bitset_windex is the same width as unsigned.
14128
14129 * lib/abitset.c (abitset_unused_clear): Do not assume that
14130 bitset_word is the same width as int.
14131 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14132 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14133 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14134 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14135 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14136
14137 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14138 portability to one's complement hosts!).
14139 * lib/ebitset.c (ebitset_op1): Likewise.
14140 * lib/lbitset.c (lbitset_op1): Likewise.
14141
14142 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14143 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14144 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14145 Sync with fileutils.
14146 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14147 lib/gettext.h: Sync with diffutils.
14148
14149 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14150 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14151
14152 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14153 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14154 check for void *.
14155
14156 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14157 size_t; the old version tried to do this but casted improperly.
14158 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14159 (bitset_test): Now returns int, not unsigned long.
14160
14161 * lib/bitset_stats.c: Include "gettext.h".
14162 (_): New macro.
14163 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14164 name locals "index", as it generates unnecessary warnings on some
14165 hosts that have an "index" function.
14166
14167 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14168 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14169 they need translation.
14170 * src/LR0.c (state_list_append, new_itemsets, get_state,
14171 append_states, generate_states): Likewise.
14172 * src/assoc.c (assoc_to_string): Likewise.
14173 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14174 * src/gram.c (grammar_dump): Likewise.
14175 * src/injections.c (injections_compute): Likewise.
14176 * src/lalr.c (lookaheads_print): Likewise.
14177 * src/relation.c (relation_transpose): Likewise.
14178 * src/scan-gram.l: Likewise.
14179 * src/tables.c (table_grow, pack_vector): Likewise.
14180
14181 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14182 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14183 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14184 * m4/mbstate_t.m4: Sync with fileutils.
14185 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14186
14187 * po/LINGUAS: Add pt_BR.
14188 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14189 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14190 lib/timevar.c.
14191 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14192 manual recommends.
14193 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14194
14195 * src/complain.c (strerror_r): Remove decl; not needed.
14196 (strerror): Use same pattern as ../lib/error.c.
14197
14198 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14199
14200 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14201
14202 * src/main.c (main): Cast result of bindtextdomain and textdomain
14203 to void, to avoid a GCC warning when --disable-nls is in effect.
14204
14205 * src/scan-gram.l: Use strings rather than escapes when possible,
14206 to minimize the number of warnings from xgettext.
14207 (handle_action_dollar, handle_action_at): Don't use isdigit,
14208 as it mishandles negative chars and it may not work as expected
14209 outside the C locale.
14210
14211 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14212 this is a GCC extension and is not portable to other compilers.
14213
14214 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14215 Do not include <ctype.h>; no longer needed.
14216 Do not include <malloc.h>; no longer needed (and generates
14217 warnings on OpenBSD 3.0).
14218
14219 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14220 it's not portable.
14221
14222 * tests/regression.at: Do not use 'cc -c input.c -o input';
14223 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14224
14225 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14226 exit status as failure, not just exit status 1. Sun C exits
14227 with status 2 sometimes.
14228
14229 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14230 Use it for the two large tests.
14231
c8f002c7
AD
142322002-08-02 Akim Demaille <akim@epita.fr>
14233
14234 * src/conflicts.c (conflicts_output): Don't output rules never
14235 reduced here, since anyway that computation doesn't work.
14236 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14237 (rule_useless_p, rule_never_reduced_p): New.
14238 (grammar_rules_partial_print): Use a filter instead of a range.
14239 Display the title only if needed.
14240 (grammar_rules_print): Adjust.
14241 (grammar_rules_never_reduced_report): New.
14242 * src/tables.c (action_row): Move the computation of rules never
14243 reduced to...
14244 (token_actions): here.
14245 * src/main.c (main): Make the parser before making the report, so
14246 that rules never reduced are computed.
14247 Call grammar_rules_never_reduced_report.
14248 * src/print.c (print_results): Report rules never reduced.
14249 * tests/conflicts.at, tests/reduce.at: Adjust.
14250
cd08e51e
AD
142512002-08-01 Akim Demaille <akim@epita.fr>
14252
14253 Instead of attaching lookaheads and duplicating the rules being
14254 reduced by a state, attach the lookaheads to the reductions.
14255
14256 * src/state.h (state_t): Remove the `lookaheads',
14257 `lookaheads_rule' member.
14258 (reductions_t): Add a `lookaheads' member.
14259 Use a regular array for the `rules'.
14260 * src/state.c (reductions_new): Initialize the lookaheads member
14261 to 0.
14262 (state_rule_lookaheads_print): Adjust.
14263 * src/state.h, src/state.c (state_reductions_find): New.
14264 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14265 (count_rr_conflicts): Adjust.
14266 * src/lalr.c (LArule): Remove.
14267 (add_lookback_edge): Adjust.
14268 (state_lookaheads_count): New.
14269 (states_lookaheads_initialize): Merge into...
14270 (initialize_LA): this.
14271 (lalr_free): Adjust.
14272 * src/main.c (main): Don't free nullable and derives too early: it
14273 is used by --verbose.
14274 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14275
bb0027a9
AD
142762002-08-01 Akim Demaille <akim@epita.fr>
14277
14278 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14279 `rule_number_t**'.
14280 (set_derives, free_derives): Rename as...
14281 (derives_compute, derives_free): this.
14282 Adjust all dependencies.
14283 * src/nullable.c (set_nullable, free_nullable): Rename as...
14284 (nullable_compute, nullable_free): these.
14285 (rule_list_t): Store rule_t *, not rule_number_t.
14286 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14287 pointers, instead of their numbers.
14288 * src/main.c (main): Call nullable_free, and derives_free earlier,
14289 as they were lo longer used.
14290
3325ddc4
AD
142912002-08-01 Akim Demaille <akim@epita.fr>
14292
14293 * lib/timevar.c (get_time): Include children time.
14294 * src/lalr.h (LA, LArule): Don't export them: used with the
14295 state_t.
14296 * src/lalr.c (LA, LArule): Static.
14297 * src/lalr.h, src/lalr.c (lalr_free): New.
14298 * src/main.c (main): Call it.
14299 * src/tables.c (pack_vector): Check whether loc is >= to the
14300 table_size, not >.
14301 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14302 (tables_generate): do it, since that's also it which allocates
14303 them.
14304 Don't free LA and LArule, main does.
14305
c6f1a33c
AD
143062002-07-31 Akim Demaille <akim@epita.fr>
14307
14308 Separate parser tables computation and output.
14309
14310 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14311 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14312 (yydefgoto, yydefact, high): Move to...
14313 * src/tables.h, src/tables.c: here.
14314 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14315 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14316 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14317 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14318 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14319 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14320 (action_row, save_row, token_actions, save_column, default_goto)
14321 (goto_actions, sort_actions, matching_state, pack_vector)
14322 (table_ninf_remap, pack_table, prepare_actions): Move to...
14323 * src/tables.c: here.
14324 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14325 * src/output.c (token_actions, output_base, output_conflicts)
14326 (output_check): Merge into...
14327 (prepare_actions): this.
14328 (actions_output): Rename as...
14329 (user_actions_output): this.
14330 * src/main.c (main): Call tables_generate and tables_free.
14331
1509d42f
AD
143322002-07-31 Akim Demaille <akim@epita.fr>
14333
14334 Steal GCC's --time-report support.
14335
14336 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14337 stolen/adjusted from GCC.
14338 * m4/stage.m4: Remove time related checks.
14339 * m4/timevar.m4: New.
14340 * configure.in: Adjust.
14341 * src/system.h: Adjust to using timevar.h.
14342 * src/getargs.h, src/getargs.c: Support trace_time for
14343 --trace=time.
14344 * src/main.c (stage): Remove.
14345 (main): Replace `stage' invocations with timevar calls.
14346 * src/output.c: Insert pertinent timevar calls.
14347
273a74fa
AD
143482002-07-31 Akim Demaille <akim@epita.fr>
14349
14350 Let --trace have arguments.
14351
14352 * src/getargs.h (enum trace_e): New.
14353 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14354 (long_options, short_options): --trace/-T takes an optional
14355 argument.
14356 Change all the uses of trace_flag to reflect the new flags.
14357 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14358
14359 Strengthen `stage' portability.
14360
14361 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14362 * configure.in: Use it.
14363 Don't check for malloc.h and sys/times.h.
14364 * src/system.h: Include them when appropriate.
14365 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14366 times and struct tms are available.
14367
217598da
AD
143682002-07-30 Akim Demaille <akim@epita.fr>
14369
14370 In verbose parse error message, don't report `error' as an
14371 expected token.
14372 * tests/actions.at (Printers and Destructors): Adjust.
14373 * tests/calc.at (Calculator $1): Adjust.
14374 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14375 error message, do not report the parser accepts the error token in
14376 that state.
14377
52489d44
AD
143782002-07-30 Akim Demaille <akim@epita.fr>
14379
14380 Normalize conflict related messages.
14381
14382 * src/complain.h, src/complain.c (warn, complain): New.
14383 * src/conflicts.c (conflicts_print): Use them.
14384 (conflict_report_yacc): New, extracted from...
14385 (conflicts_print): here.
14386 * tests/conflicts.at, tests/existing.at: Adjust.
14387
e8832397
AD
143882002-07-30 Akim Demaille <akim@epita.fr>
14389
14390 Report rules which are never reduced by the parser: those hidden
14391 by conflicts.
14392
14393 * src/LR0.c (save_reductions): Don't make the final state too
14394 different: save its reduction (accept) instead of having a state
14395 without any action (no shift or goto, no reduce).
14396 Note: the final state is now a ``regular'' state, i.e., the
14397 parsers now contain `reduce 0' as default reduction.
14398 Nevertheless, since they decide to `accept' when yystate =
14399 final_state, they still will not reduce rule 0.
14400 * src/print.c (print_actions, print_reduction): Adjust.
14401 * src/output.c (action_row): Track reduced rules.
14402 (token_actions): Report rules never reduced.
14403 * tests/conflicts.at, tests/regression.at: Adjust.
14404
caf23d24
AD
144052002-07-30 Akim Demaille <akim@epita.fr>
14406
14407 `stage' was accidently included in a previous patch.
14408 Initiate its autoconfiscation.
14409
14410 * configure.in: Look for malloc.h and sys/times.h.
14411 * src/main.c (stage): Adjust.
14412 Report only when trace_flag.
14413
640748ee
AD
144142002-07-29 Akim Demaille <akim@epita.fr>
14415
14416 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14417 state_number_t.
14418 (errs_t): symbol_t*, not symbol_number_t.
14419 (reductions_t): rule_t*, not rule_number_t.
14420 (FOR_EACH_SHIFT): New.
14421 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14422 * src/print.c, src/print_graph.c: Adjust.
14423
88bce5a2
AD
144242002-07-29 Akim Demaille <akim@epita.fr>
14425
14426 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14427
14428 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14429 (endtoken, accept): these.
14430 * src/reader.c (reader): Set endtoken's default tag to "$end".
14431 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14432 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14433 Adjust.
14434
1bfb97db
AD
144352002-07-29 Akim Demaille <akim@epita.fr>
14436
14437 * src/reduce.c (reduce_grammar): When the language is empty,
14438 complain about the start symbol, not the axiom.
14439 Use its location.
14440 * tests/reduce.at (Empty Language): New.
14441
fc5734fe
AD
144422002-07-26 Akim Demaille <akim@epita.fr>
14443
14444 * src/reader.h, src/reader.c (gram_error): ... can't get
14445 yycontrol without making too strong assumptions on the parser
14446 itself.
14447 * src/output.c (prepare_tokens): Use the real 0th value of
14448 token_translations instead of `0'.
14449 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14450 visible here.
14451 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14452 for the time being: %locations ought to provide it to yyerror.
14453
3650b4b8
AD
144542002-07-25 Akim Demaille <akim@epita.fr>
14455
14456 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14457 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14458 * tests/regression.at (Web2c Actions): Adjust.
14459
4b3d3a8e
AD
144602002-07-25 Akim Demaille <akim@epita.fr>
14461
14462 Stop storing rules from 1 to nrules + 1.
14463
14464 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14465 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14466 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14467 Iterate from 0 to nrules.
14468 Use rule_number_as_item_number and item_number_as_rule_number.
14469 Adjust to `derive' now containing possibly 0.
14470 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14471 Handle the `- 1' part in rule numbers from/to item numbers.
14472 * src/conflicts.c (log_resolution): Fix the message which reversed
14473 shift and reduce.
14474 * src/output.c (action_row): Initialize default_rule to -1.
14475 (token_actions): Adjust.
14476 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14477 expected output.
14478 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14479
4a2a22f4
AD
144802002-07-25 Akim Demaille <akim@epita.fr>
14481
14482 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14483 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14484 (b4_c_knr_arg_decl): New.
14485 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14486 yyreport_parse_error.
14487
b8df3223
AD
144882002-07-25 Akim Demaille <akim@epita.fr>
14489
14490 * data/yacc.c (yyreport_parse_error): New, extracted from...
14491 (yyparse): here.
14492 (yydestruct, yysymprint): Move above yyparse.
14493 Be K&R compliant.
14494
a762e609
AD
144952002-07-25 Akim Demaille <akim@epita.fr>
14496
14497 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14498 replace...
14499 (b4_sint_type, b4_uint_type): these.
14500 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14501 * tests/regression.at (Web2c Actions): Adjust.
14502
12b0043a
AD
145032002-07-25 Akim Demaille <akim@epita.fr>
14504
14505 * src/gram.h (TIEM_NUMBER_MAX): New.
14506 (item_number_of_rule_number, rule_number_of_item_number): Rename
14507 as...
14508 (rule_number_as_item_number, item_number_as_rule_number): these.
14509 Adjust dependencies.
14510 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14511 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14512 (symbol_number_to_vector_number): New.
14513 (order): Of vector_number_t* type.
14514 (base_t, BASE_MAX, BASE_MIN): New.
14515 (froms, tos, width, pos, check): Of base_t type.
14516 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14517 (actrow): Of action_number_t type.
14518 (conflrow): Of unsigned int type.
14519 (table_ninf, base_ninf): New.
14520 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14521 (muscle_insert_int_table, muscle_insert_base_table)
14522 (muscle_insert_rule_number_table): New.
14523 (prepare_tokens): Output `toknum' as int_table.
14524 (action_row): Returns a rule_number_t.
14525 Use ACTION_MIN, not SHRT_MIN.
14526 (token_actions): yydefact is rule_number_t*.
14527 (table_ninf_remap): New.
14528 (pack_table): Use it for `base' and `table'.
14529 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14530 replaced with...
14531 (YYPACT_NINF, YYTABLE_NINF): these.
14532 (yypact, yytable): Compute their types instead of hard-coded
14533 `short'.
14534 * tests/regression.at (Web2c Actions): Adjust.
14535
5dde258a
AD
145362002-07-19 Akim Demaille <akim@epita.fr>
14537
14538 * src/scan-gram.l (id): Can start with an underscore.
14539
a945ec39
AD
145402002-07-16 Akim Demaille <akim@epita.fr>
14541
14542 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14543 Adjust all former `associativity' dependencies.
14544 * src/symtab.c (symbol_new): Default associativity is `undef', not
14545 `right'.
14546 (symbol_check_alias_consistence): Adjust.
14547
fae437e8
AD
145482002-07-09 Akim Demaille <akim@epita.fr>
14549
14550 * doc/bison.texinfo: Properly set the ``header'' part.
14551 Use @dircategory ``GNU programming tools'' as per Texinfo's
14552 documentation.
14553 Use @copying.
14554
1a715ef2
AD
145552002-07-09 Akim Demaille <akim@epita.fr>
14556
14557 * lib/quotearg.h: Protect against multiple inclusions.
14558 * src/location.h (location_t): Add a `file' member.
14559 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14560 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14561 `error_one_per_line' support.
14562
a5d50994
AD
145632002-07-09 Akim Demaille <akim@epita.fr>
14564
14565 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14566 * src/reader.c (lineno): Remove.
14567 Adjust all dependencies.
14568 (get_merge_function): Take a location and use complain_at.
14569 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14570 * tests/regression.at (Invalid inputs, Mixing %token styles):
14571 Adjust.
14572
b275314e
AD
145732002-07-09 Akim Demaille <akim@epita.fr>
14574
14575 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14576 recovery rule, and forbid extensions when --yacc.
14577 (gram_error): Use complain_at.
14578 * src/reader.c (reader): Exit if there were parse errors.
14579
865b9df1
AD
145802002-07-09 Akim Demaille <akim@epita.fr>
14581
14582 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14583 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14584 Reported by R Blake <blakers@mac.com>.
14585
c76e14da
AD
145862002-07-09 Akim Demaille <akim@epita.fr>
14587
14588 * data/yacc.c: Output the copyright notive in the header.
14589
7db2ed2d
AD
145902002-07-03 Akim Demaille <akim@epita.fr>
14591
14592 * src/output.c (froms, tos): Are state_number_t.
14593 (save_column): sp, sp1, and sp2 are state_number_t.
14594 (prepare): Rename `final' as `final_state_number', `nnts' as
14595 `nterms_number', `nrules' as `rules_number', `nstates' as
14596 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14597 unused.
14598 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14599 * data/lalr1.cc (nsym_): Remove, unused.
14600
e68e0410
AD
146012002-07-03 Akim Demaille <akim@epita.fr>
14602
14603 * src/lalr.h, src/lalr.c (goto_number_t): New.
14604 * src/lalr.c (goto_list_t): New.
14605 Propagate them.
14606 * src/nullable.c (rule_list_t): New.
14607 Propagate.
14608 * src/types.h: Remove.
14609
e1a4f3a4
AD
146102002-07-03 Akim Demaille <akim@epita.fr>
14611
14612 * src/closure.c (print_fderives): Use rule_rhs_print.
14613 * src/derives.c (print_derives): Use rule_rhs_print.
14614 (rule_list_t): New, replaces `shorts'.
14615 (set_derives): Add comments.
14616 * tests/sets.at (Nullable, Firsts): Adjust.
14617
536545f3
AD
146182002-07-03 Akim Demaille <akim@epita.fr>
14619
14620 * src/output.c (prepare_actions): Free `tally' and `width'.
14621 (prepare_actions): Allocate and free `order'.
14622 * src/symtab.c (symbols_free): Free `symbols'.
14623 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14624 * src/output.c (m4_invoke): Move to...
14625 * src/scan-skel.l: here.
14626 (<<EOF>>): Close yyout, and free its name.
14627
8b752b00
AD
146282002-07-03 Akim Demaille <akim@epita.fr>
14629
14630 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14631
14632 * src/LR0.c (new_state): Merge into...
14633 (state_list_append): this.
14634 (new_states): Merge into...
14635 (generate_states): here.
14636 (set_states): Don't ensure a proper `errs' state member here, do it...
14637 * src/conflicts.c (conflicts_solve): here.
14638 * src/state.h, src/state.c: Comment changes.
14639 (state_t): Rename member `shifts' as `transitions'.
14640 Adjust all dependencies.
14641 (errs_new): For consistency, also take the values as argument.
14642 (errs_dup): Remove.
14643 (state_errs_set): New.
14644 (state_reductions_set, state_transitions_set): Assert that no
14645 previous value was assigned.
14646 (state_free): New.
14647 (states_free): Use it.
14648 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14649 temporary storage: use `errs' and `nerrs' as elsewhere.
14650 (set_conflicts): Allocate and free this `errs'.
14651
613f5e1a
AD
146522002-07-02 Akim Demaille <akim@epita.fr>
14653
14654 * lib/libiberty.h: New.
14655 * lib: Update the bitset implementation from upstream.
14656 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14657 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14658 * src/main.c: Adjust bitset stats calls.
14659
26e0cadc
PE
146602002-07-01 Paul Eggert <eggert@twinsun.com>
14661
14662 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14663 char, so that negative chars don't collide with $.
14664
1154cced
AD
146652002-06-30 Akim Demaille <akim@epita.fr>
14666
14667 Have the GLR tests be `warning' checked, and fix the warnings.
14668
14669 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14670 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14671 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14672 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14673 (yyaddDeferredAction): static.
14674 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14675 (yyreportParseError): yyprefix is const.
14676 yytokenp is used only when verbose.
14677 (yy__GNUC__): Replace with __GNUC__.
14678 (yypdumpstack): yyi is size_t.
14679 (yypreference): Un-yy local variables and arguments, to avoid
14680 clashes with `yyr1'. Anyway, we are not in the user name space.
14681 (yytname_size): be an int, as is compared with ints.
14682 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14683 Use them.
14684 * tests/cxx-gram.at: Use quotation to protect $1.
14685 Use AT_COMPILE to enable warnings hunts.
14686 Prototype yylex and yyerror.
14687 `Use' argc.
14688 Include `string.h', not `strings.h'.
14689 Produce and prototype stmtMerge only when used.
14690 yylex takes a location.
14691
97650f4e
AD
146922002-06-30 Akim Demaille <akim@epita.fr>
14693
14694 We spend a lot of time in quotearg, in particular when --verbose.
14695
14696 * src/symtab.c (symbol_get): Store a quoted version of the key.
14697 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14698 Adjust all callers.
14699
d2576365
AD
147002002-06-30 Akim Demaille <akim@epita.fr>
14701
14702 * src/state.h (reductions_t): Rename member `nreds' as num.
14703 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14704 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14705
ccaf65bc
AD
147062002-06-30 Akim Demaille <akim@epita.fr>
14707
14708 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14709 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14710 (shifts_to): Rename as...
14711 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14712 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14713 (TRANSITION_IS_DISABLED, transitions_to): these.
14714
87675353
AD
147152002-06-30 Akim Demaille <akim@epita.fr>
14716
14717 * src/print.c (print_shifts, print_gotos): Merge into...
14718 (print_transitions): this.
14719 (print_transitions, print_errs, print_reductions): Align the
14720 lookaheads columns.
14721 (print_core, print_transitions, print_errs, print_state,
14722 print_grammar): Output empty lines separator before, not after.
14723 (state_default_rule_compute): Rename as...
14724 (state_default_rule): this.
14725 * tests/conflicts.at (Defaulted Conflicted Reduction),
14726 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14727 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14728
ce4ccb4b
AD
147292002-06-30 Akim Demaille <akim@epita.fr>
14730
14731 Display items as we display rules.
14732
14733 * src/gram.h, src/gram.c (rule_lhs_print): New.
14734 * src/gram.c (grammar_rules_partial_print): Use it.
14735 * src/print.c (print_core): Likewise.
14736 * tests/conflicts.at (Defaulted Conflicted Reduction),
14737 (Unresolved SR Conflicts): Adjust.
14738 (Unresolved SR Conflicts): Adjust and rename as...
14739 (Resolved SR Conflicts): this, as was meant.
14740 * tests/regression.at (Web2c Report): Adjust.
14741
bc933ef1
AD
147422002-06-30 Akim Demaille <akim@epita.fr>
14743
14744 * src/print.c (state_default_rule_compute): New, extracted from...
14745 (print_reductions): here.
14746 Pessimize, but clarify the code.
14747 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14748
53d4308d
AD
147492002-06-30 Akim Demaille <akim@epita.fr>
14750
14751 * src/output.c (action_row): Let default_rule be always a rule
14752 number.
14753
574fb2d5
AD
147542002-06-30 Akim Demaille <akim@epita.fr>
14755
14756 * src/closure.c (print_firsts, print_fderives, closure):
14757 Use BITSET_EXECUTE.
14758 * src/lalr.c (lookaheads_print): Likewise.
14759 * src/state.c (state_rule_lookaheads_print): Likewise.
14760 * src/print_graph.c (print_core): Likewise.
14761 * src/print.c (print_reductions): Likewise.
14762 * src/output.c (action_row): Likewise.
14763 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14764
05811fd7
AD
147652002-06-30 Akim Demaille <akim@epita.fr>
14766
14767 * src/print_graph.c: Use report_flag.
14768
0e4d5753
AD
147692002-06-30 Akim Demaille <akim@epita.fr>
14770
14771 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14772 to...
14773 * src/relation.h, src/relation.c (traverse, relation_digraph)
14774 (relation_print, relation_transpose): New.
14775
24c7d800
AD
147762002-06-30 Akim Demaille <akim@epita.fr>
14777
14778 * src/state.h, src/state.c (shifts_to): New.
14779 * src/lalr.c (build_relations): Use it.
14780
9222837b
AD
147812002-06-30 Akim Demaille <akim@epita.fr>
14782
14783 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14784 (item_number_of_rule_number, rule_number_of_item_number): New.
14785 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14786 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14787 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14788 Propagate their use.
14789 Much remains to be done, in particular wrt `shorts' from types.h.
14790
260008e5
AD
147912002-06-30 Akim Demaille <akim@epita.fr>
14792
14793 * src/symtab.c (symbol_new): Initialize the `printer' member.
14794
8a731ca8
AD
147952002-06-30 Akim Demaille <akim@epita.fr>
14796
14797 * src/LR0.c (save_reductions): Remove, replaced by...
14798 * src/state.h, src/state.c (state_reductions_set): New.
14799 (reductions, errs): Rename as...
14800 (reductions_t, errs_t): these.
14801 Adjust all dependencies.
14802
32e1e0a4
AD
148032002-06-30 Akim Demaille <akim@epita.fr>
14804
14805 * src/LR0.c (state_list_t, state_list_append): New.
14806 (first_state, last_state): Now symbol_list_t.
14807 (this_state): Remove.
14808 (new_itemsets, append_states, save_reductions): Take a state_t as
14809 argument.
14810 (set_states, generate_states): Adjust.
14811 (save_shifts): Remove, replaced by...
14812 * src/state.h, src/state.c (state_shifts_set): New.
14813 (shifts): Rename as...
14814 (shifts_t): this.
14815 Adjust all dependencies.
14816 * src/state.h (state_t): Remove the `next' member.
14817
e5fb6710
AD
148182002-06-30 Akim Demaille <akim@epita.fr>
14819
14820 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14821 escaped in slot 0.
14822
c7ca99d4
AD
148232002-06-30 Akim Demaille <akim@epita.fr>
14824
14825 Use hash.h for the state hash table.
14826
14827 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14828 (allocate_storage): Use state_hash_new.
14829 (free_storage): Use state_hash_free.
14830 (new_state, get_state): Adjust.
14831 * src/lalr.h, src/lalr.c (states): Move to...
14832 * src/states.h (state_t): Remove the `link' member, no longer
14833 used.
14834 * src/states.h, src/states.c: here.
14835 (state_hash_new, state_hash_free, state_hash_lookup)
14836 (state_hash_insert, states_free): New.
14837 * src/states.c (state_table, state_compare, state_hash): New.
14838 * src/output.c (output_actions): Do not free states now, since we
14839 still need to know the final_state number in `prepare', called
14840 afterwards. Do it...
14841 * src/main.c (main): here: call states_free after `output'.
14842
df0e7316
AD
148432002-06-30 Akim Demaille <akim@epita.fr>
14844
14845 * src/state.h, src/state.c (state_new): New, extracted from...
14846 * src/LR0.c (new_state): here.
14847 * src/state.h (STATE_ALLOC): Move to...
14848 * src/state.c: here.
14849 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14850 * src/state.h, src/state.c: here.
14851
39f41916
AD
148522002-06-30 Akim Demaille <akim@epita.fr>
14853
14854 * src/reader.c (gensym): Rename as...
14855 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14856 (getsym): Rename as...
14857 (symbol_get): this.
14858
d57650a5
AD
148592002-06-30 Akim Demaille <akim@epita.fr>
14860
14861 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14862 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14863 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14864 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14865
5a08f1ce
AD
148662002-06-30 Akim Demaille <akim@epita.fr>
14867
14868 Make the test suite pass with warnings checked.
14869
14870 * tests/actions.at (Printers and Destructors): Improve.
14871 Avoid unsigned vs. signed issues.
14872 * tests/calc.at: Don't exercise the scanner here, do it...
14873 * tests/input.at (Torturing the Scanner): here.
14874
720623af
PH
148752002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14876
88e7e941 14877 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
14878 reorganize first lines parallel to yacc.c.
14879
fb8135fa
AD
148802002-06-28 Akim Demaille <akim@epita.fr>
14881
14882 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14883 (b4_token_enum, b4_token_defines): New, factored from...
14884 * data/lalr1.cc, data/yacc.c, glr.c: here.
14885
41442480
AD
148862002-06-28 Akim Demaille <akim@epita.fr>
14887
14888 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14889 unused variables.
14890 * src/output.c (merger_output): static.
14891
e0e5bf84
AD
148922002-06-28 Akim Demaille <akim@epita.fr>
14893
ba0fe3c7 14894 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
14895 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14896 pacify GCC.
14897 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 14898
676385e2
PH
148992002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14900
14901 Accumulated changelog for new GLR parsing features.
14902
6a254321 14903 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
14904 conflicts_total_count.
14905 * src/conflicts.h: Ditto.
14906 * src/output.c (token_actions): Use the new name.
14907 (output_conflicts): Change conflp => conflict_list_heads, and
14908 confl => conflict_list for better readability.
14909 * data/glr.c: Use the new names.
14910 * NEWS: Add self to GLR announcement.
e0e5bf84 14911
676385e2
PH
14912 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14913
14914 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14915 Akim Demaille.
14916
14917 * data/bison.glr: Change name to glr.c
14918 * data/glr.c: Renamed from bison.glr.
14919 * data/Makefile.am: Add glr.c
e0e5bf84
AD
14920
14921 * src/getargs.c:
14922
676385e2 14923 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 14924 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 14925
676385e2
PH
14926 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14927
14928 * data/bison.glr: Be sure to restore the
14929 current #line when returning to the skeleton contents after having
14930 exposed the input file's #line.
14931
14932 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14933
14934 * data/bison.glr: Bring up to date with changes to bison.simple.
14935
14936 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14937
14938 * data/bison.glr: Correct definitions that use b4_prefix.
14939 Various reformatting.
14940 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14941 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14942 yytokenp argument; now part of stack.
14943 (yychar): Define to behave as documented.
14944 (yyclearin): Ditto.
e0e5bf84 14945
676385e2
PH
14946 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14947
14948 * src/reader.h: Add declaration for free_merger_functions.
14949
14950 * src/reader.c (merge_functions): New variable.
14951 (get_merge_function): New function.
14952 (free_merger_functions): New function.
14953 (readgram): Check for %prec that is not followed by a symbol.
14954 Handle %dprec and %merge declarations.
14955 (packgram): Initialize dprec and merger fields in rules array.
14956
14957 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14958 conflict_list_cnt, conflict_list_free): New variables.
14959 (table_grow): Also grow conflict_table.
e0e5bf84 14960 (prepare_rules): Output dprec and merger tables.
676385e2 14961 (conflict_row): New function.
e0e5bf84 14962 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
14963 default reduction in conflicted states for GLR parser so that there
14964 are spaces for the conflict lists.
14965 (save_row): Also save conflict information.
14966 (token_actions): Allocate conflict list.
14967 (merger_output): New function.
14968 (pack_vector): Pack conflict table, too.
14969 (output_conflicts): New function to output yyconflp and yyconfl.
14970 (output_check): Allocate conflict_tos.
14971 (output_actions): Output conflict tables, also.
14972 (output_skeleton): Output b4_mergers definition.
14973 (prepare): Output b4_max_rhs_length definition.
14974 Use 'bison.glr' as default skeleton for GLR parsers.
14975
14976 * src/gram.c (glr_parser): New flag.
14977 (grammar_free): Call free_merger_functions.
14978
14979 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14980 all pairs of conflicting reductions, rather than just all tokens
14981 causing conflicts. Needed to size conflict tables.
e0e5bf84 14982 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
14983 interface.
14984 (conflicts_print): Ditto.
14985 (count_total_conflicts): New function.
14986
14987 * src/reader.h (merger_list): New type.
14988 (merge_functions): New variable.
14989
14990 * src/lex.h (tok_dprec, tok_merge): New token types.
14991
14992 * src/gram.h (rule_s): Add dprec and merger fields.
14993 (glr_parser): New flag.
14994
14995 * src/conflicts.h (count_total_conflicts): New function.
14996
14997 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14998
14999 * doc/bison.texinfo (Generalized LR Parsing): New section.
15000 (GLR Parsers): New section.
15001 (Language and Grammar): Mention GLR parsing.
15002 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
15003 Correct typo ("tge" -> "the").
15004
15005 * data/bison.glr: New skeleton for GLR parsing.
15006
15007 * tests/cxx-gram.at: New tests for GLR parsing.
15008
15009 * tests/testsuite.at: Include cxx-gram.at.
15010
15011 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 15012
676385e2
PH
15013 * src/parse-gram.y:
15014
15015 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
15016
15017 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 15018
b5480d74 150192002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
15020
15021 * src/options.h, src/options.c: Remove.
15022 * src/getargs.c (short_options, long_options): New.
15023
60491a94
AD
150242002-06-27 Akim Demaille <akim@epita.fr>
15025
15026 * data/bison.simple, data/bison.c++: Rename as...
15027 * data/yacc.c, data/lalr1.cc: these.
15028 * doc/bison.texinfo (Environment Variables): Remove.
15029
9be0c25b
AD
150302002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15031
15032 * src/getargs.c (report_argmatch): Initialize strtok().
15033
1ae72863
AD
150342002-06-20 Akim Demaille <akim@epita.fr>
15035
15036 * data/bison.simple (b4_symbol_actions): New, replaces...
15037 (b4_symbol_destructor, b4_symbol_printer): these.
15038 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15039 user token numbers.
15040
87542d29
AD
150412002-06-20 Akim Demaille <akim@epita.fr>
15042
15043 * data/bison.simple (yydestructor): Rename as...
15044 (yydestruct): this.
15045
1a31ed21
AD
150462002-06-20 Akim Demaille <akim@epita.fr>
15047
15048 * src/symtab.h, src/symtab.c (symbol_type_set)
15049 (symbol_destructor_set, symbol_precedence_set): The location is
15050 the last argument.
15051 Adjust all callers.
15052
e776192e
AD
150532002-06-20 Akim Demaille <akim@epita.fr>
15054
15055 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15056 internals.
15057 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15058 Takes a location.
15059 * src/symtab.h, src/symtab.c (symbol_class_set)
15060 (symbol_user_token_number_set): Likewise.
15061 Adjust all callers.
15062 Promote complain_at.
15063 * tests/input.at (Type Clashes): Adjust.
15064
5c1180b3
AD
150652002-06-20 Akim Demaille <akim@epita.fr>
15066
15067 * data/bison.simple (YYLEX): Fix the declaration when
15068 %pure-parser.
15069
e3170060
AD
150702002-06-20 Akim Demaille <akim@epita.fr>
15071
15072 * data/bison.simple (yysymprint): Don't print the token number,
15073 just its name.
15074 * tests/actions.at (Destructors): Rename as...
15075 (Printers and Destructors): this.
15076 Also exercise %printer.
15077
253862fd
AD
150782002-06-20 Akim Demaille <akim@epita.fr>
15079
15080 * data/bison.simple (YYDSYMPRINT): New.
15081 Use it to remove many of the #if YYDEBUG/if (yydebug).
15082
366eea36
AD
150832002-06-20 Akim Demaille <akim@epita.fr>
15084
15085 * src/symtab.h, src/symtab.c (symbol_t): printer and
15086 printer_location are new members.
15087 (symbol_printer_set): New.
15088 * src/parse-gram.y (PERCENT_PRINTER): New token.
15089 Handle its associated rule.
15090 * src/scan-gram.l: Adjust.
15091 (handle_destructor_at, handle_destructor_dollar): Rename as...
15092 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15093 * src/output.c (symbol_printers_output): New.
15094 (output_skeleton): Call it.
15095 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15096 since there are already many grammar files with a user `yyprint'.
15097 Replace the calls to YYPRINT to calls to yysymprint.
15098 * tests/calc.at: Adjust.
15099 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15100 taking advantage of parser very internal details (stack size!).
15101
4f25ebb0
AD
151022002-06-20 Akim Demaille <akim@epita.fr>
15103
15104 * src/scan-gram.l: Complete the scanner with the missing patterns
15105 to pacify Flex.
15106 Use `quote' and `symbol_tag_get' where appropriate.
15107
93b68a0e
AD
151082002-06-19 Akim Demaille <akim@epita.fr>
15109
15110 * tests/actions.at (Destructors): Augment to test locations.
15111 * data/bison.simple (yydestructor): Pass it the current location
15112 if locations are enabled.
15113 Prototype only when __STDC__ or C++.
15114 Change the argument names to move into the yy name space: there is
15115 user code here.
15116
58612f1d
AD
151172002-06-19 Akim Demaille <akim@epita.fr>
15118
74310291
AD
15119 * data/bison.simple (b4_pure_if): New.
15120 Use it instead of #ifdef YYPURE.
15121
151222002-06-19 Akim Demaille <akim@epita.fr>
15123
15124 * data/bison.simple (b4_location_if): New.
58612f1d
AD
15125 Use it instead of #ifdef YYLSP_NEEDED.
15126
f25bfb75
AD
151272002-06-19 Akim Demaille <akim@epita.fr>
15128
15129 Prepare @$ in %destructor, but currently don't bind it in the
15130 skeleton, as %location use is not cleaned up yet.
15131
15132 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15133 (handle_action_at): New.
15134 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15135 a braced_code_t and a location as additional arguments.
15136 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15137 unquote one when outputting `b4_dollar_dollar'.
15138 Adjust callers.
15139 * data/bison.simple (b4_eval): Remove.
15140 (b4_symbol_destructor): Adjust.
15141 * tests/input.at (Invalid @n): Adjust.
15142
c732d2c6
AD
151432002-06-19 Zack Weinberg <zack@codesourcery.com>
15144
15145 * doc/bison.texinfo: Document ability to have multiple
15146 prologue sections.
15147
8c165d89
AD
151482002-06-18 Akim Demaille <akim@epita.fr>
15149
15150 * src/files.c (compute_base_names): When computing the output file
15151 names from the input file name, strip the directory part.
15152
ca98bf57
AD
151532002-06-18 Akim Demaille <akim@epita.fr>
15154
15155 * data/bison.simple.new: Comment changes.
15156 Reported by Andreas Schwab.
15157
0bfb02ff
AD
151582002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15159
15160 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15161 there are no `label `yyoverflowlab' defined but not used' warnings
15162 when yyoverflow is defined.
15163
24c0aad7
AD
151642002-06-18 Akim Demaille <akim@epita.fr>
15165
15166 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15167 new member.
15168 (symbol_destructor_set): Adjust.
15169 * src/output.c (symbol_destructors_output): Output the destructor
15170 locations.
15171 Output the symbol name.
15172 * data/bison.simple (b4_symbol_destructor): Adjust.
15173
5719c109
AD
151742002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15175 and Akim Demaille <akim@epita.fr>
15176
15177 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15178 what's left on the stack when the error recovery hits EOF.
15179 * tests/actions.at (Destructors): Complete to exercise this case.
15180
9280d3ef
AD
151812002-06-17 Akim Demaille <akim@epita.fr>
15182
15183 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15184 arguments is really empty, not only equal to `[]'.
15185 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15186 member.
15187 (symbol_destructor_set): New.
15188 * src/output.c (symbol_destructors_output): New.
15189 * src/reader.h (brace_code_t, current_braced_code): New.
15190 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15191 (handle_dollar): Rename as...
15192 (handle_action_dollar): this.
15193 (handle_destructor_dollar): New.
15194 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15195 (grammar_declaration): Use it.
15196 * data/bison.simple (yystos): Is always defined.
15197 (yydestructor): New.
15198 * tests/actions.at (Destructors): New.
15199 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15200
dafdc66f
AD
152012002-06-17 Akim Demaille <akim@epita.fr>
15202
15203 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15204 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15205 rule_length only when needed.
15206 * src/output.c (actions_output, token_definitions_output): Output
15207 the full M4 block.
15208 * src/symtab.c: Don't access directly to the symbol tag, use
15209 symbol_tag_get.
15210 * src/parse-gram.y: Use symbol_list_free.
15211
56c47203
AD
152122002-06-17 Akim Demaille <akim@epita.fr>
15213
15214 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15215 (symbol_list_prepend, get_type_name): Move to...
15216 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15217 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15218 Adjust all callers.
15219 (symbol_list_free): New.
15220 * src/scan-gram.l (handle_dollar): Takes a location.
15221 * tests/input.at (Invalid $n): Adjust.
15222
1e0bab92
AD
152232002-06-17 Akim Demaille <akim@epita.fr>
15224
15225 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15226 (symbol_list_prepend): New.
15227 * src/parse-gram.y (%union): `list' is a new member.
15228 (symbols.1): New, replaces...
15229 (terms_to_prec.1, nterms_to_type.1): these.
15230 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15231 Take a location as additional argument.
15232 Adjust all callers.
15233
04e60654
AD
152342002-06-15 Akim Demaille <akim@epita.fr>
15235
15236 * src/parse-gram.y: Move %token in the declaration section so that
15237 we don't depend upon CVS Bison.
15238
10e5b8bd
AD
152392002-06-15 Akim Demaille <akim@epita.fr>
15240
15241 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15242 * src/print.c (print_core): Use it.
15243
9801d40c
AD
152442002-06-15 Akim Demaille <akim@epita.fr>
15245
15246 * src/conflicts.c (log_resolution): Accept the rule involved in
15247 the sr conflicts instead of the lookahead number that points to
15248 that rule.
15249 (flush_reduce): Accept the current lookahead vector as argument,
15250 instead of the index in LA.
15251 (resolve_sr_conflict): Accept the current number of lookahead
15252 bitset to consider for the STATE, instead of the index in LA.
15253 (set_conflicts): Adjust.
15254 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15255
c0263492
AD
152562002-06-15 Akim Demaille <akim@epita.fr>
15257
15258 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15259 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15260 Adjust all dependencies.
15261 * src/lalr.c (initialize_lookaheads): Split into...
15262 (states_lookaheads_count, states_lookaheads_initialize): these.
15263 (lalr): Adjust.
15264
9757c359
AD
152652002-06-15 Akim Demaille <akim@epita.fr>
15266
15267 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15268 out of...
15269 (grammar_rules_print): here.
15270 * src/reduce.c (reduce_output): Use it.
15271 * tests/reduce.at (Useless Rules, Reduced Automaton)
15272 (Underivable Rules): Adjust.
15273
6b98e4b5
AD
152742002-06-15 Akim Demaille <akim@epita.fr>
15275
15276 Copy BYacc's nice way to report the grammar.
15277
15278 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15279 New.
15280 Don't print the rules' location, it is confusing and useless.
15281 (rule_print): Use grammar_rhs_print.
15282 * src/print.c (print_grammar): Use grammar_rules_print.
15283
6b98e4b5
AD
152842002-06-15 Akim Demaille <akim@epita.fr>
15285
15286 Complete and rationalize `useless thing' warnings.
15287
15288 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15289 (symbol_tag_print): New.
15290 Use them everywhere in place of accessing directly the tag member.
15291 * src/gram.h, src/gram.c (rule_print): New.
15292 Use it where a rule used to be printed `by hand'.
15293 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15294 (reduce_grammar_tables): Report the useless rules.
15295 (reduce_print): Useless things are a warning, not an error.
15296 Report it as such.
15297 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15298 (Reduced Automaton, Underivable Rules): Adjust.
15299 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15300 * tests/conflicts.at (Unresolved SR Conflicts)
15301 (Solved SR Conflicts): Adjust.
15302
ee000ba4
AD
153032002-06-15 Akim Demaille <akim@epita.fr>
15304
15305 Let symbols have a location.
15306
15307 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15308 (getsym): Adjust.
15309 Adjust all callers.
15310 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15311 Use location_t, not int.
15312 * src/symtab.c (symbol_check_defined): Take advantage of the
15313 location.
15314 * tests/regression.at (Invalid inputs): Adjust.
15315
8efe435c
AD
153162002-06-15 Akim Demaille <akim@epita.fr>
15317
15318 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15319 (input): Don't try to initialize yylloc here, do it in the
15320 scanner.
15321 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15322 * src/gram.h (rule_t): Change line and action_line into location
15323 and action_location, of location_t type.
15324 Adjust all dependencies.
15325 * src/location.h, src/location.c (empty_location): New.
15326 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15327 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15328 (grammar_current_rule_symbol_append)
15329 (grammar_current_rule_action_append): Expect a location as argument.
15330 * src/reader.c (grammar_midrule_action): Adjust to attach an
15331 action's location as dummy symbol location.
15332 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15333 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15334 the line numbers.
15335
1921f1d7
AD
153362002-06-14 Akim Demaille <akim@epita.fr>
15337
15338 Grammar declarations may be found in the grammar section.
15339
15340 * src/parse-gram.y (rules_or_grammar_declaration): New.
15341 (declarations): Each declaration may end with a semicolon, not
15342 just...
15343 (grammar_declaration): `"%union"'.
15344 (grammar): Branch to rules_or_grammar_declaration.
15345
4515534c
AD
153462002-06-14 Akim Demaille <akim@epita.fr>
15347
15348 * src/main.c (main): Invoke scanner_free.
15349
f958596b
AD
153502002-06-14 Akim Demaille <akim@epita.fr>
15351
15352 * src/output.c (m4_invoke): Extracted from...
15353 (output_skeleton): here.
15354 Free tempfile.
15355
2c569025
AD
153562002-06-14 Akim Demaille <akim@epita.fr>
15357
15358 * src/parse-gram.y (directives, directive, gram)
15359 (grammar_directives, precedence_directives, precedence_directive):
15360 Rename as...
15361 (declarations, declaration, grammar, grammar_declaration)
15362 (precedence_declaration, precedence_declarator): these.
15363 (symbol_declaration): New.
15364
592e8d4d
AD
153652002-06-14 Akim Demaille <akim@epita.fr>
15366
15367 * src/files.c (action_obstack): Remove, unused.
15368 (output_obstack): Remove it, and all its dependencies, as it is no
15369 longer needed.
15370 * src/reader.c (epilogue_set): Build the epilogue in the
15371 muscle_obstack.
15372 * src/output.h, src/output.c (muscle_obstack): Move to...
15373 * src/muscle_tab.h, src/muscle_tab.h: here.
15374 (muscle_init): Initialize muscle_obstack.
15375 (muscle_free): New.
15376 * src/main.c (main): Call it.
15377
0c15323d
AD
153782002-06-14 Akim Demaille <akim@epita.fr>
15379
15380 * src/location.h: New, extracted from...
15381 * src/reader.h: here.
15382 * src/Makefile.am (noinst_HEADERS): Merge into
15383 (bison_SOURCES): this.
15384 Add location.h.
15385 * src/parse-gram.y: Use location_t instead of Bison's.
15386 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15387 Use location_t instead of ints.
15388
e96c9728
AD
153892002-06-14 Akim Demaille <akim@epita.fr>
15390
15391 * data/bison.simple, data/bison.c++: Be sure to restore the
15392 current #line when returning to the skeleton contents after having
15393 exposed the input file's #line.
15394
75d1fe16
AD
153952002-06-12 Akim Demaille <akim@epita.fr>
15396
15397 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15398 eager.
15399 * tests/actions.at (Exotic Dollars): New.
15400
6c35d22c
AD
154012002-06-12 Akim Demaille <akim@epita.fr>
15402
15403 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15404 ['"/] too eagerly.
15405 * tests/input.at (Torturing the Scanner): New.
15406
1d6412ad
AD
154072002-06-11 Akim Demaille <akim@epita.fr>
15408
15409 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15410 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15411 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15412 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15413 * src/reader.c (reader): Use it.
15414
4cdb01db
AD
154152002-06-11 Akim Demaille <akim@epita.fr>
15416
15417 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15418 Adjust all callers.
15419 (scanner_last_string_free): New.
15420
44995b2e
AD
154212002-06-11 Akim Demaille <akim@epita.fr>
15422
15423 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15424 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15425 (last_string, YY_OBS_FREE): New.
15426 Use them when returning an ID.
15427
e9955c83
AD
154282002-06-11 Akim Demaille <akim@epita.fr>
15429
15430 Have Bison grammars parsed by a Bison grammar.
15431
15432 * src/reader.c, src/reader.h (prologue_augment): New.
15433 * src/reader.c (copy_definition): Remove.
15434
15435 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15436 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15437 (grammar_current_rule_prec_set, grammar_current_rule_check)
15438 (grammar_current_rule_symbol_append)
15439 (grammar_current_rule_action_append): Export.
15440 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15441 (symbol_list_action_append): Remove.
15442 Hook the routines from reader.
15443 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15444 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15445
15446 * src/reader.c (read_declarations): Remove, unused.
15447
15448 * src/parse-gram.y: Handle the epilogue.
15449 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15450 (grammar_start_symbol_set): this.
15451 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15452 * src/reader.c (readgram): Remove, unused.
15453 (reader): Adjust to insert eoftoken and axiom where appropriate.
15454
15455 * src/reader.c (copy_dollar): Replace with...
15456 * src/scan-gram.h (handle_dollar): this.
15457 * src/parse-gram.y: Remove `%thong'.
15458
15459 * src/reader.c (copy_at): Replace with...
15460 * src/scan-gram.h (handle_at): this.
15461
15462 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15463 New.
15464
15465 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15466 time being.
15467
15468 * src/reader.h, src/reader.c (grammar_rule_end): New.
15469
15470 * src/parse.y (current_type, current_class): New.
15471 Implement `%nterm', `%token' support.
15472 Merge `%term' into `%token'.
15473 (string_as_id): New.
15474 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15475 type name.
15476
15477 * src/parse-gram.y: Be sure to handle properly the beginning of
15478 rules.
15479
15480 * src/parse-gram.y: Handle %type.
15481 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15482
15483 * src/parse-gram.y: More directives support.
15484 * src/options.c: No longer handle source directives.
15485
15486 * src/parse-gram.y: Fix %output.
15487
15488 * src/parse-gram.y: Handle %union.
15489 Use the prologue locations.
15490 * src/reader.c (parse_union_decl): Remove.
15491
15492 * src/reader.h, src/reader.c (epilogue_set): New.
15493 * src/parse-gram.y: Use it.
15494
15495 * data/bison.simple, data/bison.c++: b4_stype is now either not
15496 defined, then default to int, or to the contents of %union,
15497 without `union' itself.
15498 Adjust.
15499 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15500
15501 * src/output.c (actions_output): Don't output braces, as they are
15502 already handled by the scanner.
15503
15504 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15505 characters to themselves.
15506
15507 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15508 that the epilogue has a proper #line.
15509
15510 * src/parse-gram.y: Handle precedence/associativity.
15511
15512 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15513 a terminal.
15514 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15515 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15516 at all to define terminals that cannot be emitted.
15517
15518 * src/scan-gram.l: Escape M4 characters.
15519
15520 * src/scan-gram.l: Working properly with escapes in user
15521 strings/characters.
15522
15523 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15524 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15525 grammar.
15526 Use more modest sizes, as for the time being the parser does not
15527 release memory, and therefore the process swallows a huge amount
15528 of memory.
15529
15530 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15531 stricter %token grammar.
15532
15533 * src/symtab.h (associativity): Add `undef_assoc'.
15534 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15535 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15536
15537 * tests/regression.at (Invalid %directive): Remove, as it is now
15538 meaningless.
15539 (Invalid inputs): Adjust to the new error messages.
15540 (Token definitions): The new grammar doesn't allow too many
15541 eccentricities.
15542
15543 * src/lex.h, src/lex.c: Remove.
15544 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15545 (copy_character, copy_string2, copy_string, copy_identifier)
15546 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15547 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15548 (parse_action): Remove.
15549 * po/POTFILES.in: Adjust.
15550
2e047461
AD
155512002-06-11 Akim Demaille <akim@epita.fr>
15552
cd05d13c 15553 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
15554 rule's action member: return the action as a string.
15555 Don't require `rule_length' as an argument: compute it.
15556 (grammar_current_rule_symbol_append)
15557 (grammar_current_rule_action_append): New, eved out from
15558 (readgram): here.
15559 Remove `action_flag', `rulelength', unused now.
15560
9af3fbce
AD
155612002-06-11 Akim Demaille <akim@epita.fr>
15562
15563 * src/reader.c (grammar_current_rule_prec_set).
15564 (grammar_current_rule_check): New, eved out from...
15565 (readgram): here.
15566 Remove `xaction', `first_rhs': useless.
15567 * tests/input.at (Type clashes): New.
15568 * tests/existing.at (GNU Cim Grammar): Adjust.
15569
1485e106
AD
155702002-06-11 Akim Demaille <akim@epita.fr>
15571
15572 * src/reader.c (grammar_midrule_action): New, Eved out from
15573 (readgram): here.
15574
da4160c3
AD
155752002-06-11 Akim Demaille <akim@epita.fr>
15576
15577 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15578 New.
15579 (readgram): Use them as replacement of inlined code, crule and
15580 crule1.
15581
f6d0f937
AD
155822002-06-11 Akim Demaille <akim@epita.fr>
15583
15584 * src/reader.c (grammar_end, grammar_symbol_append): New.
15585 (readgram): Use them.
15586 Make the use of `p' as local as possible.
15587
69078d4b
AD
155882002-06-10 Akim Demaille <akim@epita.fr>
15589
15590 GCJ's parser requires the tokens to be defined before the prologue.
15591
15592 * data/bison.simple: Output the token definition before the user's
15593 prologue.
15594 * tests/regression.at (Braces parsing, Duplicate string)
15595 (Mixing %token styles): Check the output from bison.
15596 (Early token definitions): New.
15597
5e424082
AD
155982002-06-10 Akim Demaille <akim@epita.fr>
15599
15600 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15601 assigning twice the same user number to a token, so that we can
15602 use it in...
15603 * src/lex.c (lex): here.
15604 Also use `symbol_class_set' instead of hand written code.
15605 * src/reader.c (parse_assoc_decl): Likewise.
15606
44536b35
AD
156072002-06-10 Akim Demaille <akim@epita.fr>
15608
15609 * src/symtab.c, src/symtab.c (symbol_class_set)
15610 (symbol_user_token_number_set): New.
15611 * src/reader.c (parse_token_decl): Use them.
15612 Use a switch instead of ifs.
15613 Use a single argument.
15614
8b9f2372
AD
156152002-06-10 Akim Demaille <akim@epita.fr>
15616
15617 Remove `%thong' support as it is undocumented, unused, duplicates
15618 `%token's job, and creates useless e-mail traffic with people who
15619 want to know what it is, why it is undocumented, unused, and
15620 duplicates `%token's job.
15621
15622 * src/reader.c (parse_thong_decl): Remove.
15623 * src/options.c (option_table): Remove "thong".
15624 * src/lex.h (tok_thong): Remove.
15625
3ae2b51f
AD
156262002-06-10 Akim Demaille <akim@epita.fr>
15627
15628 * src/symtab.c, src/symtab.c (symbol_type_set)
15629 (symbol_precedence_set): New.
15630 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15631 (value_components_used): Remove, unused.
15632
2f1afb73
AD
156332002-06-09 Akim Demaille <akim@epita.fr>
15634
15635 Move symbols handling code out of the reader.
15636
15637 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15638 (axiom): Move to...
15639 * src/symtab.h, src/symtab.c: here.
15640
15641 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15642 * src/reader.c (startval): Rename as...
15643 * src/symtab.h, src/symtab.c (startsymbol): this.
15644 * src/reader.c: Adjust.
15645
15646 * src/reader.c (symbol_check_defined, symbol_make_alias)
15647 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15648 (token_translations_init)
15649 Move to...
15650 * src/symtab.c: here.
15651 * src/reader.c (packsymbols): Move to...
15652 * src/symtab.h, src/symtab.c (symbols_pack): here.
15653 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15654 argument.
15655
e9bca3ad
AD
156562002-06-03 Akim Demaille <akim@epita.fr>
15657
15658 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15659 then statements.
15660
86eff183
AD
156612002-06-03 Akim Demaille <akim@epita.fr>
15662
15663 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15664 structs with non literals.
15665 * src/scan-skel.l: never-interactive.
15666 * src/conflicts.c (enum conflict_resolution_e): No trailing
15667 comma.
15668 * src/getargs.c (usage): Split long literal strings.
15669 Reported by Hans Aberg.
15670
717be197
AD
156712002-05-28 Akim Demaille <akim@epita.fr>
15672
15673 * data/bison.c++: Use C++ ostreams.
15674 (cdebug_): New member.
15675
670ddffd
AD
156762002-05-28 Akim Demaille <akim@epita.fr>
15677
15678 * src/output.c (output_skeleton): Be sure to allocate enough room
15679 for `/' _and_ for `\0' in full_skeleton.
15680
769b430f
AD
156812002-05-28 Akim Demaille <akim@epita.fr>
15682
15683 * data/bison.c++: Catch up with bison.simple:
15684 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15685 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15686 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15687 and popping traces.
15688
7067cb36
PH
156892002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15690
15691 * src/output.c (output_skeleton): Put an explicit path in front of
15692 the skeleton file name, rather than relying on the -I directory,
15693 to partially alleviate effects of having a skeleton file lying around
15694 in the current directory.
769b430f 15695
4a713ec2
PH
156962002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15697
769b430f 15698 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
15699 obstack_printf should be obstack_fgrow1.
15700
b408954b
AD
157012002-05-26 Akim Demaille <akim@epita.fr>
15702
15703 * src/state.h (state_t): `solved_conflicts' is a new member.
15704 * src/LR0.c (new_state): Set it to 0.
15705 * src/conflicts.h, src/conflicts.c (print_conflicts)
15706 (free_conflicts, solve_conflicts): Rename as...
15707 (conflicts_print, conflicts_free, conflicts_solve): these.
15708 Adjust callers.
15709 * src/conflicts.c (enum conflict_resolution_e)
15710 (solved_conflicts_obstack): New, used by...
15711 (log_resolution): this.
15712 Adjust to attach the conflict resolution to each state.
15713 Complete the description with the precedence/associativity
15714 information.
15715 (resolve_sr_conflict): Adjust.
15716 * src/print.c (print_state): Output its solved_conflicts.
15717 * tests/conflicts.at (Unresolved SR Conflicts)
15718 (Solved SR Conflicts): Exercise --report=all.
15719
a49aecd5
AD
157202002-05-26 Akim Demaille <akim@epita.fr>
15721
15722 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15723 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15724 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15725 (token_number_t, item_number_as_token_number)
15726 (token_number_as_item_number, muscle_insert_token_number_table):
15727 Rename as...
15728 (symbol_number_t, item_number_as_symbol_number)
15729 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15730 these, since it is more appropriate.
15731
5504898e
AD
157322002-05-26 Akim Demaille <akim@epita.fr>
15733
15734 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15735 `Error:' lines.
15736 * data/bison.simple (yystos) [YYDEBUG]: New.
15737 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15738 error recovery.
15739 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15740
ec3bc396
AD
157412002-05-25 Akim Demaille <akim@epita.fr>
15742
15743 * doc/bison.texinfo (Debugging): Split into...
15744 (Tracing): this new section, its former contents, and...
15745 (Understanding): this new section.
15746 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15747 by...
15748 (report_flag): this.
15749 Adjust all dependencies.
15750 (report_args, report_types, report_argmatch): New.
15751 (usage, getargs): Report/support -r, --report.
15752 * src/options.h
15753 (struct option_table_struct): Rename as..,
15754 (struct option_table_s): this.
15755 Rename the `set_flag' member to `flag' to match with getopt_long's
15756 struct.
15757 * src/options.c (option_table): Split verbose into an entry for
15758 %verbose, and another for --verbose.
15759 Support --report/-r, so remove -r from the obsolete --raw.
15760 * src/print.c: Attach full item sets and lookaheads reports to
15761 report_flag instead of trace_flag.
15762 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15763
78df8250
PE
157642002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15765 and Paul Eggert <eggert@twinsun.com>
769b430f 15766
78df8250
PE
15767 * data/bison.simple (yyparse): Correct error handling to conform to
15768 POSIX and yacc. Specifically, after syntax error is discovered,
15769 do not reduce further before shifting the error token.
15770 Clean up the code a bit by removing the labels yyerrdefault,
15771 yyerrhandle, yyerrpop.
15772 * NEWS: Document the above.
15773
c0c9ea05
PH
157742002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15775
15776 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15777 type; it isn't always big enough, since it doesn't necessarily
15778 include non-terminals.
769b430f 15779 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
15780 the latter can be removed.
15781 (yy_token_number_type): Remove, only one use.
15782 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15783 don't use TokenNumberType as element type.
769b430f 15784
c0c9ea05
PH
15785 * tests/regression.at: Modify expected output to agree with change
15786 to yyr1 and yytranslate.
769b430f 15787
6390a83f
FK
157882002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15789
15790 * src/reader.c (parse_action): Use copy_character instead of
15791 obstack_1grow.
15792
db7c8e9a
AD
157932002-05-13 Akim Demaille <akim@epita.fr>
15794
15795 * tests/regression.at (Token definitions): Prototype yylex and
15796 yyerror.
15797
fcc61800
PH
157982002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15799
158c687b 15800 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
15801 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15802 32-bit arithmetic.
15803 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15804
5683e9b2
AD
158052002-05-07 Akim Demaille <akim@epita.fr>
15806
15807 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15808 avoid GCC warnings.
15809
0c2d3f4c
AD
158102002-05-07 Akim Demaille <akim@epita.fr>
15811
15812 Kill GCC warnings.
15813
15814 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15815 over the RHS of each rule.
15816 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15817 * src/state.h (state_t): Member `nitems' is unsigned short.
15818 * src/LR0.c (get_state): Adjust.
15819 * src/reader.c (packgram): Likewise.
15820 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15821 `Type'.
15822 (muscle_insert_int_table): Remove, unused.
15823 (prepare_rules): Remove `max'.
15824
1565b720
AD
158252002-05-06 Akim Demaille <akim@epita.fr>
15826
15827 * src/closure.c (print_firsts): Display of the symbol tags.
15828 (bitmatrix_print): Move to...
15829 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15830 here.
15831 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15832
cfaee611
AD
158332002-05-06 Akim Demaille <akim@epita.fr>
15834
15835 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15836 hash_do_for_each.
15837
458be8e0
AD
158382002-05-06 Akim Demaille <akim@epita.fr>
15839
15840 * src/LR0.c (new_state, get_state): Instead of using the global
15841 `kernel_size' and `kernel_base', have two new arguments:
15842 `core_size' and `core'.
15843 Adjust callers.
15844
a900a624
AD
158452002-05-06 Akim Demaille <akim@epita.fr>
15846
15847 * src/reader.c (packgram): No longer end `ritem' with a 0
15848 sentinel: it is not used.
15849
d4e7d3a1
AD
158502002-05-05 Akim Demaille <akim@epita.fr>
15851
15852 New experimental feature: display the lookaheads in the report and
15853 graph.
15854
15855 * src/print (print_core): When --trace-flag, display the rules
15856 lookaheads.
15857 * src/print_graph.c (print_core): Likewise.
15858 Swap the arguments.
15859 Adjust caller.
15860
39ceb25b
AD
158612002-05-05 Akim Demaille <akim@epita.fr>
15862
15863 * tests/torture.at (Many lookaheads): New test.
15864
5372019f
AD
158652002-05-05 Akim Demaille <akim@epita.fr>
15866
15867 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15868 (GENERATE_MUSCLE_INSERT_TABLE): this.
15869 (output_int_table, output_unsigned_int_table, output_short_table)
15870 (output_token_number_table, output_item_number_table): Replace with...
15871 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15872 (muscle_insert_short_table, muscle_insert_token_number_table)
15873 (muscle_insert_item_number_table): these.
15874 Adjust all callers.
15875 (prepare_tokens): Don't free `translations', since...
15876 * src/reader.h, src/reader.c (grammar_free): do it.
15877 Move to...
15878 * src/gram.h, src/gram.c (grammar_free): here.
15879 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15880 b4_translate_max.
15881
5df5f6d5
AD
158822002-05-05 Akim Demaille <akim@epita.fr>
15883
15884 * src/output.c (output_unsigned_int_table): New.
15885 (prepare_rules): `i' is unsigned.
15886 `prhs', `rline', `r2' are unsigned int.
15887 Rename muscle `rhs_number_max' as `rhs_max'.
15888 Output muscles `prhs_max', `rline_max', and `r2_max'.
15889 Free rline and r1.
15890 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15891 to compute types instead of constant types.
15892 * tests/regression.at (Web2c Actions): Adjust.
15893
b87f8b21
AD
158942002-05-04 Akim Demaille <akim@epita.fr>
15895
15896 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15897 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15898 Adjust dependencies.
15899 * src/output.c (token_definitions_output): Be sure not to output a
15900 `#define 'a'' when fed with `%token 'a' "a"'.
15901 * tests/regression.at (Token definitions): New.
15902
8bb936e4
PE
159032002-05-03 Paul Eggert <eggert@twinsun.com>
15904
15905 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15906 for K&R C.
15907
159082002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15909
15910 * Makefile.am (SUBDIRS): Remove intl.
15911 (EXTRA_DIST): Add config/config.rpath.
15912
53c71a12
AD
159132002-05-03 Akim Demaille <akim@epita.fr>
15914
15915 * data/bison.simple (m4_if): Don't output empty enums.
15916 And actually, output valid enum definitions :(.
15917
289dd0cf
AD
159182002-05-03 Akim Demaille <akim@epita.fr>
15919
15920 * configure.bat: Remove, completely obsolete.
15921 * Makefile.am (EXTRA_DIST): Adjust.
15922 Don't distribute config.rpath...
15923 * config/Makefile.am (EXTRA_DIST): Do it.
15924
db85e524
AD
159252002-05-03 Akim Demaille <akim@epita.fr>
15926
15927 * configure.in (GETTEXT_VERSION): New.
15928 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15929
83ccf991
AD
159302002-05-03 Akim Demaille <akim@epita.fr>
15931
15932 * data/bison.simple (b4_token_enum): New.
15933 (b4_token_defines): Use it to output tokens both as #define and
15934 enums.
15935 Suggested by Paul Eggert.
15936 * src/output.c (token_definitions_output): Don't output spurious
15937 white spaces.
15938
1f418995
AD
159392002-05-03 Akim Demaille <akim@epita.fr>
15940
15941 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15942
45119f04
RA
159432002-05-02 Robert Anisko <robert@lrde.epita.fr>
15944
15945 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15946 Update the stack class, give a try to deque as the default container.
15947
b2d52318
AD
159482002-05-02 Akim Demaille <akim@epita.fr>
15949
15950 * data/bison.simple (yyparse): Do not implement @$ = @1.
15951 (YYLLOC_DEFAULT): Adjust to do it.
15952 * doc/bison.texinfo (Location Default Action): Fix.
15953
3a8b4109
AD
159542002-05-02 Akim Demaille <akim@epita.fr>
15955
15956 * src/reader.c (parse_braces): Merge into...
15957 (parse_action): this.
15958
84614e13
AD
159592002-05-02 Akim Demaille <akim@epita.fr>
15960
15961 * configure.in (ALL_LINGUAS): Remove.
15962 * po/LINGUAS, hr.po: New.
15963
fdbcd8e2
AD
159642002-05-02 Akim Demaille <akim@epita.fr>
15965
15966 Remove the so called hairy (semantic) parsers.
15967
15968 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15969 * src/gram.h, src/gram.c (semantic_parser): Remove.
15970 (rule_t): Remove the guard and guard_line members.
15971 * src/lex.h (token_t): remove tok_guard.
15972 * src/options.c (option_table): Remove %guard and %semantic_parser
15973 support.
15974 * src/output.c, src/output.h (guards_output): Remove.
15975 (prepare): Adjust.
15976 (token_definitions_output): Don't output the `T'
15977 tokens (???).
15978 (output_skeleton): Don't output the guards.
15979 * src/files.c, src/files.c (attrsfile): Remove.
15980 * src/reader.c (symbol_list): Remove the guard and guard_line
15981 members.
15982 Adjust dependencies.
15983 (parse_guard): Remove.
15984 * data/bison.hairy: Remove.
15985 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15986 BISON_HAIRY.
15987
82b6cb3f
AD
159882002-05-02 Akim Demaille <akim@epita.fr>
15989
15990 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15991 (parse_guard): Rename the formal argument `stack_offset' as
15992 `rule_length', which is more readable.
15993 Adjust callers.
15994 (copy_at, copy_dollar): Instead of outputting the hard coded
15995 values of $$, $n and so forth, output invocation to b4_lhs_value,
15996 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
15997 Note: this patch partially drops `semantic-parser' support: it
15998 always does `rule_length - n', where semantic parsers ought to
15999 always use `-n'.
82b6cb3f
AD
16000 * data/bison.simple, data/bison.c++ (b4_lhs_value)
16001 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
16002
6cbfbcc5
AD
160032002-05-02 Akim Demaille <akim@epita.fr>
16004
16005 * configure.in (AC_INIT): Bump to 1.49b.
16006 (AM_INIT_AUTOMAKE): Short invocation.
16007
b8548114
AD
160082002-05-02 Akim Demaille <akim@epita.fr>
16009
16010 Version 1.49a.
16011
c20cd1fa
AD
160122002-05-01 Akim Demaille <akim@epita.fr>
16013
16014 * src/skeleton.h: Remove.
16015
8a9566d4
AD
160162002-05-01 Akim Demaille <akim@epita.fr>
16017
16018 * src/skeleton.h: Fix the #endif.
16019 Reported by Magnus Fromreide.
16020
8c6d399a
PE
160212002-04-26 Paul Eggert <eggert@twinsun.com>
16022
16023 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16024 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 16025 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 16026
2b7ed18a
RA
160272002-04-25 Robert Anisko <robert@lrde.epita.fr>
16028
16029 * src/scan-skel.l: Postprocess quadrigraphs.
16030
16031 * src/reader.c (copy_character): New function, used to output
16032 single characters while replacing `[' and `]' with quadrigraphs, to
16033 avoid troubles with M4 quotes.
16034 (copy_comment): Output characters with copy_character.
16035 (read_additionnal_code): Likewise.
16036 (copy_string2): Likewise.
16037 (copy_definition): Likewise.
16038
16039 * tests/calc.at: Exercise M4 quoting.
16040
34a89c50
AD
160412002-04-25 Akim Demaille <akim@epita.fr>
16042
16043 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16044 between `!' and the command.
16045 Reported by Paul Eggert.
16046
0dd1580a
RA
160472002-04-24 Robert Anisko <robert@lrde.epita.fr>
16048
16049 * tests/calc.at: Exercise prologue splitting.
16050
16051 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16052 `b4_post_prologue' instead of `b4_prologue'.
16053
16054 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16055 muscles.
16056 (output): Free pre_prologue_obstack and post_prologue_obstack.
16057 * src/files.h, src/files.c (attrs_obstack): Remove.
16058 (pre_prologue_obstack, post_prologue_obstack): New.
16059 * src/reader.c (copy_definition): Add a parameter to specify the
16060 obstack to fill, instead of using attrs_obstack unconditionally.
16061 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16062 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16063
83c1796f
PE
160642002-04-23 Paul Eggert <eggert@twinsun.com>
16065
16066 * data/bison.simple: Remove unnecessary commentary and white
16067 space differences from 1_29-branch.
16068 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16069
16070 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16071 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16072 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16073 constructors or destructors.
16074
16075 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16076
1207eeac
AD
160772002-04-23 Akim Demaille <akim@epita.fr>
16078
16079 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16080 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16081 location with columns.
16082 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16083 All reported by Paul Eggert.
16084
78ab8f67
AD
160852002-04-22 Akim Demaille <akim@epita.fr>
16086
16087 * src/reduce.c (dump_grammar): Move to...
16088 * src/gram.h, src/gram.c (grammar_dump): here.
16089 Be sure to separate long item numbers.
16090 Don't read the members of a rule's prec if its nil.
16091
133c20e2
AD
160922002-04-22 Akim Demaille <akim@epita.fr>
16093
16094 * src/output.c (table_size, table_grow): New.
16095 (MAXTABLE): Remove, replace uses with table_size.
16096 (pack_vector): Instead of dying when the table is too big, grow it.
16097
9515e8a7
AD
160982002-04-22 Akim Demaille <akim@epita.fr>
16099
16100 * data/bison.simple (yyr1): Its type is that of a token number.
16101 * data/bison.c++ (r1_): Likewise.
16102 * tests/regression.at (Web2c Actions): Adjust.
16103
23c5a174
AD
161042002-04-22 Akim Demaille <akim@epita.fr>
16105
16106 * src/reader.c (token_translations_init): 256 is now the default
16107 value for the error token, i.e., it will be assigned another
16108 number if the user assigned 256 to one of her tokens.
16109 (reader): Don't force 256 to error.
16110 * doc/bison.texinfo (Symbols): Adjust.
16111 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16112 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16113 etc. instead of 10, 20, 30 (which was used to `jump' over error
16114 (256) and undefined (2)).
16115
5fbb0954
AD
161162002-04-22 Akim Demaille <akim@epita.fr>
16117
16118 Propagate more token_number_t.
16119
16120 * src/gram.h (token_number_as_item_number)
16121 (item_number_as_token_number): New.
16122 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16123 Use it to create output_item_number_table and
16124 output_token_number_table.
16125 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16126 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16127 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16128 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16129
4f940944
AD
161302002-04-22 Akim Demaille <akim@epita.fr>
16131
16132 * src/output.h, src/output.c (get_lines_number): Remove.
16133
3ded9a63
AD
161342002-04-19 Akim Demaille <akim@epita.fr>
16135
16136 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16137 as Lex/Flex'.
16138 (Debugging): More details about enabling the debugging features.
16139 (Table of Symbols): Describe $$, $n, @$, and @n.
16140 Suggested by Tim Josling.
16141
e0c471a9
AD
161422002-04-19 Akim Demaille <akim@epita.fr>
16143
16144 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16145
fecc10cd
AD
161462002-04-10 Akim Demaille <akim@epita.fr>
16147
16148 * src/system.h: Rely on HAVE_LIMITS_H.
16149 Suggested by Paul Eggert.
16150
51dec47b
AD
161512002-04-09 Akim Demaille <akim@epita.fr>
16152
16153 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16154 full stderr, and strip it according to the bison options, instead
16155 of composing the error message from different bits.
16156 This makes it easier to check for several error messages.
16157 Adjust all the invocations.
16158 Add an invocation exercising the error token.
16159 Add an invocation demonstrating a stupid error message.
16160 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16161 Adjust the tests.
16162 Error message are for stderr, not stdout.
16163
007a50a4
AD
161642002-04-09 Akim Demaille <akim@epita.fr>
16165
16166 * src/gram.h, src/gram.c (error_token_number): Remove, use
16167 errtoken->number.
16168 * src/reader.c (reader): Don't specify the user token number (2)
16169 for $undefined, as it uselessly prevents using it.
16170 * src/gram.h (token_number_t): Move to...
16171 * src/symtab.h: here.
16172 (state_t.number): Is a token_number_t.
16173 * src/print.c, src/reader.c: Use undeftoken->number instead of
16174 hard coded 2.
16175 (Even though this 2 is not the same as above: the number of the
16176 undeftoken remains being 2, it is its user token number which
16177 might not be 2).
16178 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16179 `user_token_number_max'.
16180 Output `undef_token_number'.
16181 * data/bison.simple, data/bison.c++: Use them.
16182 Be sure to map invalid yylex return values to
16183 `undef_token_number'. This saves us from gratuitous SEGV.
16184
16185 * tests/conflicts.at (Solved SR Conflicts)
16186 (Unresolved SR Conflicts): Adjust.
16187 * tests/regression.at (Web2c Actions): Adjust.
16188
06446ccf
AD
161892002-04-08 Akim Demaille <akim@epita.fr>
16190
16191 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16192 Adding #line.
16193 Remove the duplicate `typedefs'.
16194 (RhsNumberType): Fix the declaration and various other typos.
16195 Use __ofile__.
16196 * data/bison.simple: Use __ofile__.
16197 * src/scan-skel.l: Handle __ofile__.
16198
62a3e4f0
AD
161992002-04-08 Akim Demaille <akim@epita.fr>
16200
16201 * src/gram.h (item_number_t): New, the type of item numbers in
16202 RITEM. Note that it must be able to code symbol numbers as
16203 positive number, and the negation of rule numbers as negative
16204 numbers.
16205 Adjust all dependencies (pretty many).
16206 * src/reduce.c (rule): Remove this `short *' pointer: use
16207 item_number_t.
16208 * src/system.h (MINSHORT, MAXSHORT): Remove.
16209 Include `limits.h'.
16210 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16211 (shortcpy): Remove.
16212 (MAXTABLE): Move to...
16213 * src/output.c (MAXTABLE): here.
16214 (prepare_rules): Use output_int_table to output rhs.
16215 * data/bison.simple, data/bison.c++: Adjust.
16216 * tests/torture.at (Big triangle): Move the limit from 254 to
16217 500.
16218 * tests/regression.at (Web2c Actions): Ajust.
16219
16220 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16221 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16222 passes, but produces negative #line number, once fixed, GCC is
16223 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16224 C), it passes.
16225 * src/state.h (state_h): Code input lines on ints, not shorts.
16226
bb88b0fc
AD
162272002-04-08 Akim Demaille <akim@epita.fr>
16228
16229 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16230 and then the grammar.
16231
9a636f47
AD
162322002-04-08 Akim Demaille <akim@epita.fr>
16233
16234 * src/system.h: No longer using strndup.
16235
680e8701
AD
162362002-04-07 Akim Demaille <akim@epita.fr>
16237
16238 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16239 * src/output.c (output_table_data): Return the longest number.
16240 (prepare_tokens): Output `token_number_max').
16241 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16242 New.
16243 Use them to define yy_token_number_type/TokenNumberType.
16244 Use this type for yytranslate.
16245 * tests/torture.at (Big triangle): Push the limit from 124 to
16246 253.
16247 * tests/regression.at (Web2c Actions): Adjust.
16248
817e9f41
AD
162492002-04-07 Akim Demaille <akim@epita.fr>
16250
16251 * tests/torture.at (Big triangle): New.
16252 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16253 * tests/existing.at: here.
16254
5123689b
AD
162552002-04-07 Akim Demaille <akim@epita.fr>
16256
16257 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16258 nritems.
16259 Adjust dependencies.
16260
f3849179
AD
162612002-04-07 Akim Demaille <akim@epita.fr>
16262
16263 * src/reader.c: Normalize increments to prefix form.
16264
bd02036a
AD
162652002-04-07 Akim Demaille <akim@epita.fr>
16266
16267 * src/reader.c, symtab.c: Remove debugging code.
16268
db8837cb
AD
162692002-04-07 Akim Demaille <akim@epita.fr>
16270
16271 Rename all the `bucket's as `symbol_t'.
16272
16273 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16274 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16275 * src/symtab.c, src/symtab.h (bucket): Rename as...
16276 (symbol_t): this.
16277 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16278 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16279 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16280 (buckets_new, buckets_free, buckets_do): Rename as...
16281 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16282 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16283 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16284 (symbols_new, symbols_free, symbols_do): these.
16285
72a23c97
AD
162862002-04-07 Akim Demaille <akim@epita.fr>
16287
16288 Use lib/hash for the symbol table.
16289
16290 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16291 EOF.
16292 * src/lex.c (lex): Set the `number' member of new terminals.
16293 * src/reader.c (bucket_check_defined, bucket_make_alias)
16294 (bucket_check_alias_consistence, bucket_translation): New.
16295 (reader, grammar_free, readgram, token_translations_init)
16296 (packsymbols): Adjust.
16297 (reader): Number the predefined tokens.
16298 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16299 for predefined tokens.
16300 * src/symtab.h (bucket): Remove all the hash table related
16301 members.
16302 * src/symtab.c (symtab): Replace by...
16303 (bucket_table): this.
16304 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16305 (buckets_new, buckets_do): New.
16306
280a38c3
AD
163072002-04-07 Akim Demaille <akim@epita.fr>
16308
16309 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16310 (start_symbol, max_user_token_number, semantic_parser)
16311 (error_token_number): Initialize.
16312 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16313 Initialize.
16314 (reader): Don't.
16315 (errtoken, eoftoken, undeftoken, axiom): Extern.
16316
03b31c0c
AD
163172002-04-07 Akim Demaille <akim@epita.fr>
16318
16319 * src/gram.h (rule_s): prec and precsym are now pointers
16320 to the bucket giving the priority/associativity.
16321 Member `associativity' removed: useless.
16322 * src/reduce.c, src/conflicts.c: Adjust.
16323
8b3df748
AD
163242002-04-07 Akim Demaille <akim@epita.fr>
16325
16326 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16327 Properly escape the symbols' TAG when outputting them.
16328
e601aa1d
AD
163292002-04-07 Akim Demaille <akim@epita.fr>
16330
16331 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16332
b0299a2e
AD
163332002-04-07 Akim Demaille <akim@epita.fr>
16334
16335 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16336 (LArule): this, which is an array to rule_t*.
16337 * src/print.c, src/conflicts.c: Adjust.
16338
d7e1f00c
AD
163392002-04-07 Akim Demaille <akim@epita.fr>
16340
16341 * src/gram.h (rule_t): Rename `number' as `user_number'.
16342 `number' is a new member.
16343 Adjust dependencies.
16344 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16345
cc9305dd
AD
163462002-04-07 Akim Demaille <akim@epita.fr>
16347
16348 As a result of the previous patch, it is no longer needed
16349 to reorder ritem itself.
16350
16351 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16352
b0940840
AD
163532002-04-07 Akim Demaille <akim@epita.fr>
16354
16355 Be sure never to walk through RITEMS, but use only data related to
16356 the rules themselves. RITEMS should be banished.
16357
16358 * src/output.c (output_token_translations): Rename as...
16359 (prepare_tokens): this.
16360 In addition to `translate', prepare the muscles `tname' and
16361 `toknum', which were handled by...
16362 (output_rule_data): this.
16363 Remove, and move the remainder of its outputs into...
16364 (prepare_rules): this new routines, which also merges content from
16365 (output_gram): this.
16366 (prepare_rules): Be sure never to walk through RITEMS.
16367 (output_stos): Rename as...
16368 (prepare_stos): this.
16369 (output): Always invoke prepare_states, after all, just don't use it
16370 in the output if you don't need it.
16371
643a5994
AD
163722002-04-07 Akim Demaille <akim@epita.fr>
16373
16374 * src/LR0.c (new_state): Display `nstates' as the name of the
16375 newly created state.
16376 Adjust to initialize first_state and last_state if needed.
16377 Be sure to distinguish the initial from the final state.
16378 (new_states): Create the itemset of the initial state, and use
16379 new_state.
16380 * src/closure.c (closure): Now that the initial state has its
16381 items properly set, there is no need for a special case when
16382 creating `ruleset'.
16383
16384 As a result, now the rule 0, reducing to $axiom, is visible in the
16385 outputs. Adjust the test suite.
16386
16387 * tests/conflicts.at (Solved SR Conflicts)
16388 (Unresolved SR Conflicts): Adjust.
16389 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16390 * tests/conflicts.at (S/R in initial): New.
16391
b4c4ccc2
AD
163922002-04-07 Akim Demaille <akim@epita.fr>
16393
16394 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16395 the RHS of the rules.
16396 * src/output.c (output_gram): Likewise.
16397
bba97eb2
AD
163982002-04-07 Akim Demaille <akim@epita.fr>
16399
16400 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16401 bucket.
16402 Adjust all dependencies.
16403 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16404 `number' of the buckets too.
16405 * src/gram.h: Include `symtab.h'.
16406 (associativity): Move to...
16407 * src/symtab.h: here.
16408 No longer include `gram.h'.
16409
c3b407f4
AD
164102002-04-07 Akim Demaille <akim@epita.fr>
16411
16412 * src/gram.h, src/gram.c (rules_rhs_length): New.
16413 (ritem_longest_rhs): Use it.
16414 * src/gram.h (rule_t): `number' is a new member.
16415 * src/reader.c (packgram): Set it.
16416 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16417 the end of `rules', and count them out of `nrules'.
16418 (reduce_output, dump_grammar): Adjust.
16419 * src/print.c (print_grammar): It is no longer needed to check for
16420 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16421 * tests/reduce.at (Reduced Automaton): New test.
16422
11652ab3
AD
164232002-04-07 Akim Demaille <akim@epita.fr>
16424
16425 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16426 lacking `+ 1' to nrules, Bison reported as useless a token if it
16427 was used solely to set the precedence of the last rule...
16428
26b23c1a
AD
164292002-04-07 Akim Demaille <akim@epita.fr>
16430
16431 * data/bison.c++, data/bison.simple: Don't output the current file
16432 name in #line, to avoid useless diffs between two identical
16433 outputs under different names.
16434
18bcecb0
AD
164352002-04-07 Akim Demaille <akim@epita.fr>
16436
16437 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16438 Normalize loops to using `< nrules + 1', not `<= nrules'.
16439
fa770c86
AD
164402002-04-07 Akim Demaille <akim@epita.fr>
16441
16442 * TODO: Update.
16443
d9b739c3
AD
164442002-04-07 Akim Demaille <akim@epita.fr>
16445
16446 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16447 bucket.value as bucket.number.
16448
99013900
AD
164492002-04-07 Akim Demaille <akim@epita.fr>
16450
16451 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16452 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16453 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16454 RHS, instead of being an index in RITEMS.
16455
e966383b
PE
164562002-04-04 Paul Eggert <eggert@twinsun.com>
16457
16458 * doc/bison.texinfo: Update copyright date.
16459 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16460 (Symbols): Warn about running Bison in one character set,
16461 but compiling and/or running in an incompatible one.
16462 Warn about character code 256, too.
16463
164642002-04-03 Paul Eggert <eggert@twinsun.com>
16465
16466 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16467 YYERROR_VERBOSE is nonzero, not whether it is defined.
16468
16469 Merge changes from bison-1_29-branch.
c307773e 16470
8d6c48b9
PE
164712002-03-20 Paul Eggert <eggert@twinsun.com>
16472
16473 Merge fixes from Debian bison_1.34-1.diff.
16474
16475 * configure.in (AC_PREREQ): 2.53.
16476
e53c6322
AD
164772002-03-20 Akim Demaille <akim@epita.fr>
16478
16479 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16480
9ffbeca7
PE
164812002-03-19 Paul Eggert <eggert@twinsun.com>
16482
21db0b2a
PE
16483 * src/bison.simple (YYCOPY): New macro.
16484 (YYSTACK_RELOCATE): Use it.
16485 Remove Type arg; no longer needed. All callers changed.
16486 (yymemcpy): Remove; no longer needed.
16487
9ffbeca7
PE
16488 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16489 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16490
642cb8f8
AD
164912002-03-19 Akim Demaille <akim@epita.fr>
16492
16493 Test and fix the #line outputs.
16494
16495 * tests/atlocal.at (GCC): New.
16496 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 16497 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
16498 (Action synch line, Epilogue synch line): New tests.
16499 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16500 * data/bison.simple, data/bison.c++: Use it.
16501
3c31a486
AD
165022002-03-19 Akim Demaille <akim@epita.fr>
16503
16504 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16505 (Solved SR Conflicts, %expect not enough, %expect right)
16506 (%expect too much): Move to...
16507 * tests/conflicts.at: this new file.
16508
0d8bed56
AD
165092002-03-19 Akim Demaille <akim@epita.fr>
16510
16511 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16512 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16513 that we can move to enums for instance.
16514 * src/output.c (token_definitions_output): Output a list of
16515 `token-name, token-number' instead of the #define.
16516 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16517
9208d17f
AD
165182002-03-14 Akim Demaille <akim@epita.fr>
16519
16520 Use Gettext 0.11.1.
16521
af27eacb
RA
165222002-03-09 Robert Anisko <robert@lrde.epita.fr>
16523
16524 * data/bison.c++: Make the user able to add members to the generated
16525 parser by subclassing.
16526
9101a310
RA
165272002-03-05 Robert Anisko <robert@lrde.epita.fr>
16528
16529 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16530 a character.
16531 Reported by Nicolas Tisserand and Nicolas Burrus.
16532
fff9bf0b
RA
165332002-03-04 Robert Anisko <robert@lrde.epita.fr>
16534
16535 * src/reader.c: Warn about lacking semi-colons, do not complain.
16536
64dba31e
RA
165372002-03-04 Robert Anisko <robert@lrde.epita.fr>
16538
16539 * data/bison.c++: Remove a debug line.
16540
374f5a14
RA
165412002-03-04 Robert Anisko <robert@lrde.epita.fr>
16542
16543 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16544 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16545 provide a default implementation.
16546
bfcf1f3a
AD
165472002-03-04 Akim Demaille <akim@epita.fr>
16548
16549 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16550 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16551 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16552 * tests/semantic.at (Parsing Guards): Similarly.
16553 * src/reader.at (readgram): Complain if the last rule is not ended
16554 with a semi-colon.
16555
65ccf9fc
AD
165562002-03-04 Akim Demaille <akim@epita.fr>
16557
16558 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16559 * src/closure.c: here.
16560 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16561 RTC.
16562 * src/warshall.h, src/warshall.c: Remove.
16563 * tests/sets.at (Broken Closure): Adjust.
16564
d0039cbc
AD
165652002-03-04 Akim Demaille <akim@epita.fr>
16566
16567 * src/output.c (output_skeleton): tempdir is const.
16568 bytes_read is unused.
16569
345cea78
AD
165702002-03-04 Akim Demaille <akim@epita.fr>
16571
16572 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16573 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16574 Update.
16575 From Michael Hayes.
16576
564801f7
AD
165772002-03-04 Akim Demaille <akim@epita.fr>
16578
16579 * src/closure.c (closure): `r' is unused.
16580
e5352bc7
AD
165812002-03-04 Akim Demaille <akim@epita.fr>
16582
16583 * tests/sets.at (Broken Closure): Add the ending `;'.
16584 * src/reader.at (readgram): Complain if a rule is not ended with a
16585 semi-colon.
16586
914feea9
AD
165872002-03-04 Akim Demaille <akim@epita.fr>
16588
16589 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16590 (count_sr_conflicts): Use bitset_count.
16591 * src/reduce.c (inaccessable_symbols): Ditto.
16592 (bits_size): Remove.
16593 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16594
f0250de6
AD
165952002-03-04 Akim Demaille <akim@epita.fr>
16596
16597 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16598 * src/reduce.c: Remove the `bitset_zero's following the
16599 `bitset_create's, as now it is performed by the latter.
16600
ef017502
AD
166012002-03-04 Akim Demaille <akim@epita.fr>
16602
16603 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16604 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16605 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16606 latest sources from Michael.
16607
76514394
AD
166082002-03-04 Akim Demaille <akim@epita.fr>
16609
16610 * src/output.c (output): Don't free the grammar.
16611 * src/reader.c (grammar_free): New.
16612 * src/main.c (main): Call it and don't free symtab here.
16613
55024580
AD
166142002-03-04 Akim Demaille <akim@epita.fr>
16615
16616 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16617 before returning.
16618 Reported by Benoit Perrot.
16619
f9abaa2c
AD
166202002-03-04 Akim Demaille <akim@epita.fr>
16621
16622 Use bitset operations when possible, not loops over bits.
16623
16624 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16625 bitset_or.
16626 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16627 * src/reduce.c (useless_nonterminals): Formatting changes.
16628 * src/warshall.c (TC): Use bitset_or.
16629
0e721e75
AD
166302002-03-04 Akim Demaille <akim@epita.fr>
16631
16632 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16633 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16634 Ditto.
16635
0fb1ffb1
AD
166362002-03-04 Akim Demaille <akim@epita.fr>
16637
16638 * src/lalr.c (F): Now a bitset*.
16639 Adjust all dependencies.
16640
b86796bf
AD
166412002-03-04 Akim Demaille <akim@epita.fr>
16642
16643 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16644 Adjust all dependencies.
16645
602bbf31
AD
166462002-03-04 Akim Demaille <akim@epita.fr>
16647
16648 * src/L0.c, src/LR0.h (nstates): Be size_t.
16649 Adjust comparisons (signed vs unsigned).
16650 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16651 bitset*.
16652 Adjust all dependencies.
16653
d8a0245c
AD
166542002-03-04 Akim Demaille <akim@epita.fr>
16655
16656 * src/closure.c (firsts): Now, also a bitset.
16657 Adjust all dependencies.
16658 (varsetsize): Remove, now unused.
16659 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16660
34ba9743
AD
166612002-03-04 Akim Demaille <akim@epita.fr>
16662
16663 * src/print.c: Convert to use bitset.h, not hand coded iterations
16664 over ints.
16665
ed86e78c
AD
166662002-03-04 Akim Demaille <akim@epita.fr>
16667
16668 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16669
dfdb1797
AD
166702002-03-04 Akim Demaille <akim@epita.fr>
16671
16672 * src/closure.c (ruleset): Be a bitset.
16673 (rulesetsize): Remove.
16674
7086e707
AD
166752002-03-04 Akim Demaille <akim@epita.fr>
16676
16677 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16678 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16679 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16680 * src/closure.c (fderives): Be an array of bitsets.
16681
98254360
RA
166822002-02-28 Robert Anisko <robert@lrde.epita.fr>
16683
16684 * data/bison.c++: Merge the two generated headers. Insert a copyright
16685 notice in each output file.
16686
a75c057f
AD
166872002-02-28 Akim Demaille <akim@epita.fr>
16688
16689 * data/bison.c++: Copy the prologue of bison.simple to fetch
16690 useful M4 definitions, such as b4_header_guard.
16691
06b00abc
AD
166922002-02-25 Akim Demaille <akim@epita.fr>
16693
16694 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
16695 translator friendly scheme for the bgr
16696 copyright notice.
06b00abc 16697
70e7d534
AD
166982002-02-25 Akim Demaille <akim@epita.fr>
16699
16700 * src/output.c (header_output): Remove, now handled completely via
16701 M4.
16702
abe017f6
AD
167032002-02-25 Akim Demaille <akim@epita.fr>
16704
16705 * m4/m4.m4: New, from CVS Autoconf.
16706 * configure.in: Invoke it.
16707 * src/output.c (output_skeleton): Use its result instead of the
16708 hard coded name.
16709
381fb12e
AD
167102002-02-25 Akim Demaille <akim@epita.fr>
16711
16712 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16713 Fileutils 4.1.5.
16714 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16715 * src/output.c (output_skeleton): Use mkstemp to create a real
16716 temporary file.
16717 Move the filling of `skeleton' and its muscle to...
16718 (prepare): here.
16719 (output): Move the definition of the prologue muscle to...
16720 (prepare): here.
16721 * src/system.h (DEFAULT_TMPDIR): New.
16722
6f38107f
PE
167232002-02-14 Paul Eggert <eggert@twinsun.com>
16724
16725 Remove the support for C++ namespace cleanliness; it was
16726 causing more problems than it was curing, since it didn't work
16727 properly on some nonstandard C++ compilers. This can wait
16728 for a proper C++ parser.
16729
16730 * NEWS: Document this.
16731 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16732 of C++, as it's treated like C now.
16733 * src/bison.simple (YYSTD): Remove.
16734 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16735 Treat C++ just like Standard C instead of trying to support
16736 namespace cleanliness.
16737
80cce3da
AD
167382002-02-14 Akim Demaille <akim@epita.fr>
16739
16740 * tests/regression.at (else): Adjust to Andreas' change.
16741
842e8679
AD
167422002-02-14 Akim Demaille <akim@epita.fr>
16743
16744 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16745
4bda3f10
AD
167462002-02-13 Andreas Schwab <schwab@suse.de>
16747
16748 * src/output.c (output_rule_data): Don't output NULL, it might
16749 not be defined yet.
16750
4162fa07 167512002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 16752
4162fa07
RA
16753 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16754 (Copyright notice): Update.
b418ecd8 16755
bd16a5dc
AD
167562002-02-11 Akim Demaille <akim@epita.fr>
16757
16758 * tests/regression.at (%nonassoc and eof): Don't include
16759 nonportable headers.
16760
8d69a1a3
RA
167612002-02-08 Robert Anisko <robert@lrde.epita.fr>
16762
16763 * data/bison.c++: Correct error recovery. Make the user able to
16764 initialize the starting location.
16765
9b2d0677
AD
167662002-02-07 Akim Demaille <akim@epita.fr>
16767
16768 * tests/input.at: New.
16769
69e2658b
RA
167702002-02-07 Robert Anisko <robert@lrde.epita.fr>
16771
16772 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 16773 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
16774 directives around tables only needed for debugging.
16775
4aacc3a7
RA
167762002-02-07 Robert Anisko <robert@lrde.epita.fr>
16777
16778 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16779 C++ parsers.
16780 (yy::b4_name::parse): Use print_.
16781
762a801e
RA
167822002-02-07 Robert Anisko <robert@lrde.epita.fr>
16783
16784 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16785
4bb2bc3f
RA
167862002-02-07 Robert Anisko <robert@lrde.epita.fr>
16787
16788 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16789 C++ parsers.
16790 (yy::b4_name::parse): Build verbose error messages, and use error_.
16791
6b45a3ca
RA
167922002-02-06 Robert Anisko <robert@lrde.epita.fr>
16793
16794 * data/bison.c++: Fix m4 quoting in comments.
16795
50997c6e
RA
167962002-02-06 Robert Anisko <robert@lrde.epita.fr>
16797
16798 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16799 not expanded by m4.
16800
3f3eed27
AD
168012002-02-05 Akim Demaille <akim@epita.fr>
16802
16803 * data/bison.c++: Adjust to the M4 back end.
16804 More is certainly needed.
16805
be2a1a68
AD
168062002-02-05 Akim Demaille <akim@epita.fr>
16807
16808 Give a try to M4 as a back end.
16809
16810 * lib/readpipe.c: New, from wdiff.
16811 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16812 BISON_HAIRY.
16813 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16814 specific values. Now it is m4 that performs the lookup.
16815 * src/parse-skel.y: Remove.
16816 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16817 * src/output.c (actions_output, guards_output)
16818 (token_definitions_output): No longer keeps track of the output
16819 line number, hence remove the second argument.
16820 (guards_output): Check against the guard member of a rule, not the
16821 action member.
16822 Adjust callers.
16823 (output_skeleton): Don't look for the skeleton location, let m4 do
16824 that.
16825 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16826 file will be used.
16827 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16828 (prepare): Given that for the time being changesyntax is not
16829 usable in M4, rename the muscles using `-' to `_'.
16830 Define `defines_flag', `output_parser_name' and `output_header_name'.
16831 * src/output.h (actions_output, guards_output)
16832 (token_definitions_output): Adjust prototypes.
16833 * src/scan-skel.l: Instead of scanning the skeletons, it now
16834 processes the output of m4: `__oline__' and `#output'.
16835 * data/bison.simple: Adjust to be used by M4(sugar).
16836 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16837 to date.
16838 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16839 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16840 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16841 shamelessly stolen from CVS Autoconf.
16842
beda758b
AD
168432002-02-05 Akim Demaille <akim@epita.fr>
16844
16845 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16846 * configure.in: Check for the declarations of free and malloc.
16847 * src/muscle_tab.c: Adjust.
16848
5ece6d43
AD
168492002-02-05 Akim Demaille <akim@epita.fr>
16850
16851 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16852 which have no values.
16853
5bb18f9a
AD
168542002-02-05 Akim Demaille <akim@epita.fr>
16855
16856 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16857 * data/: here.
16858
894dd62e
PE
168592002-01-29 Paul Eggert <eggert@twinsun.com>
16860
16861 * src/bison.simple (YYSIZE_T): Do not define merely because
16862 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16863 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16864
82841af7
AD
168652002-01-27 Akim Demaille <akim@epita.fr>
16866
16867 Fix `%nonassoc and eof'.
16868
16869 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16870 which were not properly copied! Replace
16871 memcpy (res->errs, src->errs, src->nerrs);
16872 with
16873 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16874 !!!
16875 * tests/regression.at (%nonassoc and eof): Adjust to newest
16876 Autotest: `.' is not in the PATH.
16877
318b76e9
AD
168782002-01-27 Akim Demaille <akim@epita.fr>
16879
16880 * tests/sets.at (AT_EXTRACT_SETS): New.
16881 (Nullable): Use it.
16882 (Firsts): New.
16883
30d2f3d5
AD
168842002-01-26 Akim Demaille <akim@epita.fr>
16885
16886 * tests/actions.at, tests/calc.at, tests/headers.at,
16887 * tests/torture.at: Adjust to the newest Autotest which no longer
16888 forces `.' in the PATH.
16889
30f8c395
AD
168902002-01-25 Akim Demaille <akim@epita.fr>
16891
16892 * tests/regression.at (%nonassoc and eof): New.
16893 Suggested by Robert Anisko.
16894
29ae55f1
AD
168952002-01-24 Akim Demaille <akim@epita.fr>
16896
16897 Bison dumps core when trying to complain about broken input files.
16898 Reported by Cris van Pelt.
16899
16900 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16901 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16902 into...
16903 (Invalid inputs): Strengthen: exercise parse_percent_token.
16904
2b548aa6
RA
169052002-01-24 Robert Anisko <robert.anisko@epita.fr>
16906
16907 * src/Makefile.am: Add bison.c++.
16908 * src/bison.c++: New skeleton.
16909
bb0146c2
AD
169102002-01-21 Paolo Bonzini <bonzini@gnu.org>
16911
16912 * po/it.po: New.
16913
bec30531
AD
169142002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16915
16916 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16917
fc6edc45
MA
169182002-01-20 Marc Autret <marc@gnu.org>
16919
16920 * src/files.c (compute_output_file_names): Fix
16921
5e5d5415
MA
169222002-01-20 Marc Autret <marc@gnu.org>
16923
16924 * tests/output.at: New test.
16925 * src/files.c (compute_base_names): Don't map extensions when
16926 the YACC flag is set, use defaults.
16927 Reported by Evgeny Stambulchik.
16928
44ea3fbd
MA
169292002-01-20 Marc Autret <marc@gnu.org>
16930
ba0fe3c7
PE
16931 * src/system.h: Need to define __attribute__ away for non-GCC
16932 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
16933 Suggested by Albert Chin-A-Young.
16934
338963d1
TVH
169352002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16936
16937 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16938 canonical definition.
16939 * src/system.h: Use the canonical definition for PARAMS (avoids
16940 a conflict with the macro from lib/hash.h).
16941
c57b2479
AD
169422002-01-11 Akim Demaille <akim@epita.fr>
16943
16944 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 16945 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 16946
b85810ae
AD
169472002-01-09 Akim Demaille <akim@epita.fr>
16948
16949 * src/files.c, src/files.h (output_infix): New.
16950 (tab_extension): Remove.
16951 (compute_base_names): Compute the former, drop the latter.
16952 * src/output.c (prepare): Insert the muscles `output-infix', and
16953 `output-suffix'.
16954 * src/parse-skel.y (string, string.1): New.
16955 (section.header): Use it.
16956 (section.yacc): Remove.
16957 (prefix): Remove too.
16958 * src/scan-skel.l: Adjust.
16959 * src/bison.simple, src/bison.hairy: Adjust.
16960
cae60122
AD
169612002-01-09 Akim Demaille <akim@epita.fr>
16962
16963 * configure.in (WERROR_CFLAGS): Compute it.
16964 * src/Makefile.am (CFLAGS): Pass it.
16965 * tests/atlocal.in (CFLAGS): Idem.
16966 * src/files.c: Fix a few warnings.
16967 (get_extension_index): Remove, unused.
16968
ae404801
AD
169692002-01-08 Akim Demaille <akim@epita.fr>
16970
16971 * src/getargs.c (AS_FILE_NAME): New.
16972 (getargs): Use it to convert DOSish file names.
16973 * src/files.c (base_name): Rename as full_base_name to avoid
16974 clashes with `base_name ()'.
16975 (filename_split): New.
16976 (compute_base_names): N-th rewrite, using filename_split.
16977
22312b71
AD
169782002-01-08 Akim Demaille <akim@epita.fr>
16979
16980 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16981 New, stolen from the Fileutils 4.1.
16982 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16983 * configure.in: Check for the presence of memrchr, and of its
16984 prototype.
16985
a67cef01
TVH
169862002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16987
16988 * lib/hash.h (__P): Added definition for this macro.
16989 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16990 BUILT_SOURCES, to ensure they are generated first.
16991 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16992 %error-verbose to allow bootstrapping with bison 1.30x.
16993
2b25d624
AD
169942002-01-06 Akim Demaille <akim@epita.fr>
16995
16996 * src/reader.c (parse_braces): Don't fetch the next char, the
16997 convention is to fetch on entry.
16998 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16999 'switch' without a following semicolon.
17000 * tests/regression.at (braces parsing): New.
17001
3460813b
AD
170022002-01-06 Akim Demaille <akim@epita.fr>
17003
17004 Bison is dead wrong in its RR conflict reports.
17005
17006 * tests/torture.at (GNU Cim Grammar): New.
17007 * src/conflicts.c (count_rr_conflicts): Fix.
17008
73784c64
AD
170092002-01-06 Akim Demaille <akim@epita.fr>
17010
17011 Creating package.m4 from configure.ac causes too many problems.
17012
17013 * tests/Makefile.am (package.m4): Create it by hand,
17014 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
17015
25d81090
AD
170162002-01-06 Akim Demaille <akim@epita.fr>
17017
17018 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
17019 skeleton.h.
17020
a9b8959e
PE
170212002-01-04 Paul Eggert <eggert@twinsun.com>
17022
17023 * doc/bison.texinfo (Debugging):
17024 Remove YYSTDERR; it's no longer defined or used.
17025 Also, s/cstdio.h/cstdio/.
17026
25d81090
AD
170272002-01-03 Akim Demaille <akim@epita.fr>
17028
17029 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17030
1109455c
AD
170312002-01-03 Akim Demaille <akim@epita.fr>
17032
17033 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17034 tracing code to --trace, wait for a better --trace option, with
17035 args.
17036
7ea5e977
AD
170372002-01-03 Akim Demaille <akim@epita.fr>
17038
17039 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17040 The ISO C++ standard is extremely clear about it: stderr is
17041 considered a macro, not a regular symbol (see table 94 `Header
17042 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17043 Therefore std:: does not apply to it. It still does with fprintf.
17044 Also, s/cstdio.h/cstdio/.
17045
fab5b110
AD
170462002-01-03 Akim Demaille <akim@epita.fr>
17047
17048 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17049 for non system headers.
17050
aed7fd9b
AD
170512002-01-02 Akim Demaille <akim@epita.fr>
17052
17053 Equip the skeleton chain with location tracking, runtime trace,
17054 pure parser and scanner.
17055
17056 * src/parse-skel.y: Request a pure parser, locations, and prefix
17057 renaming.
17058 (%union): Having several members with the same type does not help
17059 type mismatches, simplify.
17060 (YYPRINT, yyprint): New.
17061 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17062 (skel_error): this.
17063 Handle locations.
17064 * src/scan-skel.l: Adjust to these changes.
17065 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17066 (LOCATION_PRINT, skel_control_t): New.
17067
24fad99e
AD
170682001-12-30 Akim Demaille <akim@epita.fr>
17069
17070 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17071 replace `gb' with BLANKS.
17072 * src/scan-skel.l: Adjust.
17073
a4b36db4
AD
170742001-12-30 Akim Demaille <akim@epita.fr>
17075
17076 * src/system.h: We don't need nor want bcopy.
17077 Throw away MS-DOS crap: we don't need getpid.
17078 * configure.in: We don't need strndup. It was even causing
17079 problems: because Flex includes the headers *before* us,
17080 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17081 not visible.
17082 * lib/xstrndup.c: New.
17083 * src/scan-skel.l: Use it.
17084 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17085 * src/parse-skel.y: Use %directives instead of #defines.
17086
1239777d
AD
170872001-12-30 Akim Demaille <akim@epita.fr>
17088
17089 * src/skeleton.h: New.
17090 * src/output.c (output_parser, output_master_parser): Remove, dead
17091 code.
17092 * src/output.h (get_lines_number, actions_output, guards_output)
17093 (token_definitions_output): Prototype them.
17094 * src/parse-skel.y: Add the license notice.
17095 Include output.h and skeleton.h.
17096 (process_skeleton): Returns void, and takes a single parameter.
17097 * src/scan-skel.l: Add the license notice.
17098 Include skeleton.h.
17099 Don't use %option yylineno: it seems that then Flex imagines
17100 REJECT has been used, and therefore it won't reallocate its
17101 buffers (which makes no other sense to me than a bug). It results
17102 in warnings for `unused: yy_flex_realloc'.
17103
9b3add5b
RA
171042001-12-30 Robert Anisko <robert.anisko@epita.fr>
17105
17106 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17107 (MUSCLE_INSERT_PREFIX): ...to there.
17108 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17109 (MUSCLE_INSERT_PREFIX): Move from here...
17110
17111 * src/bison.hairy: Add a section directive. Put braces around muscle
17112 names. This parser skeleton is still broken, but Bison should not
17113 choke on a bad muscle 'syntax'.
17114 * src/bison.simple: Add a section directive. Put braces around muscle
17115 names.
17116
17117 * src/files.h (strsuffix, stringappend): Add declarations.
17118 (tab_extension): Add declaration.
17119 (short_base_name): Add declaration.
17120
17121 * src/files.c (strsuffix, stringappend): No longer static. These
17122 functions are used in the skeleton parser.
17123 (tab_extension): New.
17124 (compute_base_names): Use the computations done in this function
fab5b110 17125 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
17126 names.
17127 (short_base_name): No longer static.
17128
17129 * src/output.c (output_skeleton): New.
17130 (output): Disable call to output_master_parser, and give a try to
17131 a new skeleton handling system.
17132 (guards_output, actions_output): No longer static.
17133 (token_definitions_output, get_lines_number): No longer static.
17134
17135 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17136
fab5b110 17137 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
17138 parse-skel.y.
17139
17140 * src/parse-skel.y: New file.
17141 * src/scan-skel.l: New file.
17142
b5b61c61
AD
171432001-12-29 Akim Demaille <akim@epita.fr>
17144
17145 %name-prefix is broken.
17146
17147 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17148 Adjust all dependencies.
17149 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17150 %name-prefix.
17151
17152 Renaming yylval but not yylloc is not consistent. Now we do.
17153
17154 * src/bison.simple: Prefix yylloc if used.
17155 * doc/bison.texinfo (Decl Summary): Document that.
17156
8c9a50be
AD
171572001-12-29 Akim Demaille <akim@epita.fr>
17158
17159 * doc/bison.texinfo: Promote `%long-directive' over
17160 `%long_directive'.
17161 Remove all references to fixed-output-files, yacc is enough.
17162
d99361e6
AD
171632001-12-29 Akim Demaille <akim@epita.fr>
17164
17165 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17166 user prologue. These are defaults.
17167 * tests/actions.at (Mid-rule actions): Make sure the user can
17168 define YYDEBUG and YYERROR_VERBOSE.
17169
b9cecb91
AD
171702001-12-29 Akim Demaille <akim@epita.fr>
17171
17172 * src/output.c (header_output): Don't forget to export YYLTYPE and
17173 yylloc.
17174 * tests/headers.at (export YYLTYPE): New, make sure it does.
17175 * tests/regression.at (%union and --defines, Invalid CPP headers):
17176 Move to...
17177 * tests/headers.at: here.
17178
aea13e97
AD
171792001-12-29 Akim Demaille <akim@epita.fr>
17180
17181 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17182
931394cb
AD
171832001-12-29 Akim Demaille <akim@epita.fr>
17184
17185 * tests/actions.at (Mid-rule actions): Output on a single line
17186 instead of several.
17187
704a47c4
AD
171882001-12-29 Akim Demaille <akim@epita.fr>
17189
17190 * doc/bison.texinfo: Formatting changes.
17191
091e20bb
AD
171922001-12-29 Akim Demaille <akim@epita.fr>
17193
17194 Don't store the token defs in a muscle, just be ready to output it
17195 on command. Now possible via `symbols'. Fixes a memory leak.
17196
17197 * src/output.c (token_definitions_output): New.
17198 (output_parser, header_output): Use it.
17199 * src/reader.c (symbols_save): Remove.
17200
cce71710
AD
172012001-12-29 Akim Demaille <akim@epita.fr>
17202
17203 * src/bison.simple: Do not provide a default for YYSTYPE and
17204 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17205 default.
17206
82c035a8
AD
172072001-12-29 Akim Demaille <akim@epita.fr>
17208
17209 Mid-rule actions are simply... ignored!
17210
17211 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17212 the empty-rule associated to the dummy symbol, not to the host
17213 rule.
17214 * tests/actions.at (Mid-rule actions): New.
17215
8419d367
AD
172162001-12-29 Akim Demaille <akim@epita.fr>
17217
17218 Memory leak.
17219
17220 * src/reader.c (reader): Free grammar.
17221
375d5806
AD
172222001-12-29 Akim Demaille <akim@epita.fr>
17223
17224 Memory leak.
17225
17226 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17227 since it allocates it for each state, although only one is needed.
17228 (allocate_storage): Do it here.
17229
f51cb8ff
AD
172302001-12-29 Akim Demaille <akim@epita.fr>
17231
17232 * src/options.h, src/options.c (create_long_option_table): Rename
17233 as...
17234 (long_option_table_new): this, with a clearer prototype.
17235 (percent_table): Remove, unused,
17236 * src/getargs.c (getargs): Adjust.
17237
29e88316
AD
172382001-12-29 Akim Demaille <akim@epita.fr>
17239
17240 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17241 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17242 as states.
17243
b9f71f19
AD
172442001-12-29 Akim Demaille <akim@epita.fr>
17245
17246 * src/lalr.c (build_relations): Rename `states' as `states1'.
17247 Sorry, I don't understand exactly what it is, no better name...
17248
1a2b5d37
AD
172492001-12-29 Akim Demaille <akim@epita.fr>
17250
17251 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17252 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17253 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17254 as rules.
17255
1cca533e
AD
172562001-12-29 Akim Demaille <akim@epita.fr>
17257
17258 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17259 ago.
17260
c03ae966
AD
172612001-12-29 Akim Demaille <akim@epita.fr>
17262
17263 * src/reader.c, src/reader.h (user_toknums): Remove.
17264 Adjust all users to use symbols[i]->user_token_number.
17265
5a670b1e
AD
172662001-12-29 Akim Demaille <akim@epita.fr>
17267
17268 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17269 Adjust all users to use symbols[i]->prec or ->assoc.
17270
ad949da9
AD
172712001-12-29 Akim Demaille <akim@epita.fr>
17272
17273 * src/reader.c, src/reader.h (tags): Remove.
17274 Adjust all users to use symbols[i]->tag.
17275
0e78e603
AD
172762001-12-29 Akim Demaille <akim@epita.fr>
17277
17278 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17279 and rule_table.
17280 * src/reader.c (packsymbols): Fill this table.
17281 Drop sprec.
17282 * src/conflicts.c (resolve_sr_conflict): Adjust.
17283 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17284 single table.
17285 Use symbols[i]->tag instead of tags[i].
17286
213e640e
AD
172872001-12-29 Akim Demaille <akim@epita.fr>
17288
17289 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17290 In addition, put a comment in there, to replace...
17291 * tests/regression.at (%union and C comments): Remove.
17292
e7b8bef1
AD
172932001-12-29 Akim Demaille <akim@epita.fr>
17294
17295 * tests/regression.at (Web2c Actions): Blindly move the actual
17296 output as expected output. The contents *seem* right to me, but I
17297 can't pretend reading perfectly parser tables... Nonetheless, all
17298 the other tests pass correctly, the table look OK, even though the
17299 presence of `$axiom' is to be noted: AFAICS it is useless (but
17300 harmless).
17301
b68e7744
AD
173022001-12-29 Akim Demaille <akim@epita.fr>
17303
17304 * src/reader.c (readgram): Don't add the rule 0 if there were no
17305 rules read. In other words, add it _after_ having performed
17306 grammar sanity checks.
17307 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17308
78d5bae9
AD
173092001-12-29 Akim Demaille <akim@epita.fr>
17310
17311 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17312 visible, and some states have now a different number.
17313
ff442794
AD
173142001-12-29 Akim Demaille <akim@epita.fr>
17315
17316 * src/reader.c (readgram): Bind the initial rule's lineno to that
17317 of the first rule.
17318 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17319 (Solved SR Conflicts): Adjust rule 0's line number.
17320
610ab194
AD
173212001-12-29 Akim Demaille <akim@epita.fr>
17322
17323 Fix the `GAWK Grammar' failure.
17324
17325 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17326 the reductions of the first state which was mistakenly confused
17327 with the final state because precisely final_state was initialized
17328 to 0.
17329 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17330 now noticed by Bison.
17331 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17332 have a reduction on $default.
17333
29d29c8f
AD
173342001-12-29 Akim Demaille <akim@epita.fr>
17335
17336 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17337 rule line numbers.
17338 * src/closure.c (print_closure): Likewise.
17339 * src/derives.c (print_derives): Likewise.
17340 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17341 now.
17342
7c6b64d0
AD
173432001-12-29 Akim Demaille <akim@epita.fr>
17344
17345 * src/lalr.c (lookaheads_print): New.
17346 (lalr): Call it when --trace-flag.
17347 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17348 are dumped.
17349
3d4daee3
AD
173502001-12-29 Akim Demaille <akim@epita.fr>
17351
17352 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17353 when walking through ritem, even via rule->rhs.
17354 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17355 (useful_production, useless_nonterminals): Likewise.
17356 (reduce_grammar_tables): Likewise, plus update nritems.
17357 * src/nullable.c (set_nullable): Likewise.
17358 * src/lalr.c (build_relations): Likewise.
17359 * tests/sets.at (Nullable): Adjust.
17360 Fortunately, now, the $axiom is no longer nullable.
17361
9e7f6bbd
AD
173622001-12-29 Akim Demaille <akim@epita.fr>
17363
17364 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17365 the 0-sentinel.
17366 * src/gram.c (ritem_longest_rhs): Likewise.
17367 * src/reduce.c (nonterminals_reduce): Likewise.
17368 * src/print_graph.c (print_graph): Likewise.
17369 * src/output.c (output_rule_data): Likewise.
17370 * src/nullable.c (set_nullable): Likewise.
17371
255ef638
AD
173722001-12-29 Akim Demaille <akim@epita.fr>
17373
17374 * src/output.c: Comment changes.
17375
0d8a7363
AD
173762001-12-27 Paul Eggert <eggert@twinsun.com>
17377
17378 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17379 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17380 Sparc, as they were causing more porting problems than the
17381 (minor) performance improvement was worth.
17382
17383 Also, catch up with 1.31's YYSTD.
17384
3db472b9
AD
173852001-12-27 Akim Demaille <akim@epita.fr>
17386
17387 * src/output.c (output_gram): Rely on nritems, not the
17388 0-sentinel. See below.
17389 Use -1 as separator, not 0.
17390 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17391 Rely on -1 as separator in yyrhs, instead of 0.
17392 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17393 twice `Now at end of input', therefore there are two lines less to
17394 expect.
17395
b365aa05
AD
173962001-12-27 Akim Demaille <akim@epita.fr>
17397
17398 * tests/regression.at (Unresolved SR Conflicts):
17399 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17400 below.
17401
30171f79
AD
174022001-12-27 Akim Demaille <akim@epita.fr>
17403
17404 * src/LR0.c (new_state): Recognize the final state by the fact it
17405 is reached by eoftoken.
17406 (insert_start_shifting_state, insert_eof_shifting_state)
17407 (insert_accepting_state, augment_automaton): Remove, since now
17408 these states are automatically computed from the initial state.
17409 (generate_states): Adjust.
17410 * src/print.c: When reporting a rule number to the user, substract
17411 1, so that the axiom rule is rule 0, and the first user rule is 1.
17412 * src/reduce.c: Likewise.
17413 * src/print_graph.c (print_core): For the time being, just as for
17414 the report, depend upon --trace-flags to dump the full set of
17415 items.
17416 * src/reader.c (readgram): Once the grammar read, insert the rule
17417 0: `$axiom: START-SYMBOL $'.
17418 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17419 number of the states has changed (the final state is no longer
17420 necessarily the last), catch up.
17421
75142d45
AD
174222001-12-27 Akim Demaille <akim@epita.fr>
17423
17424 Try to make the use of the eoftoken valid. Given that its value
17425 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17426 is used instead of > 0 where appropriate, (ii), depend upon nritems
17427 instead of the 0-sentinel.
17428
17429 * src/gram.h, src/gram.c (nritems): New.
17430 Expected to be duplication of nitems, but for the time being...
17431 * src/reader.c (packgram): Assert nritems and nitems are equal.
17432 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17433 * src/closure.c (print_closure, print_fderives): Likewise.
17434 * src/gram.c (ritem_print): Likewise.
17435 * src/print.c (print_core, print_grammar): Likewise.
17436 * src/print_graph.c: Likewise.
17437
b7c49edf
AD
174382001-12-27 Akim Demaille <akim@epita.fr>
17439
17440 * src/main.c (main): If there are complains after grammar
17441 reductions, then output the report anyway if requested, then die.
17442 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17443 * src/reader.c (eoftoken): New.
17444 (parse_token_decl): If the token being defined has value `0', it
17445 is the eoftoken.
17446 (packsymbols): No longer hack `tags' to insert `$' by hand.
17447 Be sure to preserve the value of the eoftoken.
17448 (reader): Make sure eoftoken is defined.
17449 Initialize nsyms to 0: now eoftoken is created just like the others.
17450 * src/print.c (print_grammar): Don't special case the eof token.
17451 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17452 lie anyway, albeit pleasant.
17453 * tests/calc.at: Exercise error messages with eoftoken.
17454 Change the grammar so that empty input is invalid.
17455 Adjust expectations.
17456 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17457
ec2da99f
AD
174582001-12-27 Akim Demaille <akim@epita.fr>
17459
17460 * configure.in: Check the protos of strchr ans strspn.
17461 Replace strchr if needed.
17462 * src/system.h: Provide the protos of strchr, strspn and memchr if
17463 missing.
17464 * lib/strchr.c: New.
17465 * src/reader.c (symbols_save): Use strchr.
17466
8adfa272
AD
174672001-12-27 Akim Demaille <akim@epita.fr>
17468
17469 * src/print.c, src/print_graph.c (escape): New.
17470 Use it to quote the TAGS outputs.
17471 * src/print_graph.c (print_state): Now errors are in red, and
17472 reductions in green.
17473 Prefer high to wide: output the state number on a line of its own.
17474
80dac38c
AD
174752001-12-27 Akim Demaille <akim@epita.fr>
17476
17477 * src/state.h, src/state.c (reductions_new): New.
17478 * src/LR0.c (set_state_table): Let all the states have a
17479 `reductions', even if reduced to 0.
17480 (save_reductions): Adjust.
17481 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17482 * src/print.c (print_reductions, print_actions): Adjust.
17483 * src/output.c (action_row): Adjust.
17484
2cec70b9
AD
174852001-12-27 Akim Demaille <akim@epita.fr>
17486
17487 * src/state.h, src/state.c (errs_new, errs_dup): New.
17488 * src/LR0.c (set_state_table): Let all the states have an errs,
17489 even if reduced to 0.
17490 * src/print.c (print_errs, print_reductions): Adjust.
17491 * src/output.c (output_actions, action_row): Adjust.
17492 * src/conflicts.c (resolve_sr_conflict): Adjust.
17493
13ca549a
AD
174942001-12-27 Akim Demaille <akim@epita.fr>
17495
17496 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17497
5092aba5
AD
174982001-12-27 Akim Demaille <akim@epita.fr>
17499
17500 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17501 * src/print.c: here.
17502 (lookaheadset, shiftset): New, used as additional storage by
17503 print_reductions.
17504 (print_results): Adjust.
17505 (print_shifts, print_gotos, print_errs): New, extracted from...
17506 (print_actions): here.
17507 * src/print_graph.c (print_actions): Remove dead code.
17508
11e2beca
AD
175092001-12-27 Akim Demaille <akim@epita.fr>
17510
17511 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17512 `$n' and `@n'.
17513
dac3c910
AD
175142001-12-27 Akim Demaille <akim@epita.fr>
17515
17516 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17517 (build_relations): Adjust.
17518
d0b0fefa
AD
175192001-12-27 Akim Demaille <akim@epita.fr>
17520
17521 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17522 duplication.
17523
adc8c848
AD
175242001-12-27 Akim Demaille <akim@epita.fr>
17525
17526 * src/reader.c (packgram): Catch nitems overflows.
17527
14d293ac
AD
175282001-12-27 Akim Demaille <akim@epita.fr>
17529
17530 * src/files.c, src/files.h (guard_obstack): Remove.
17531 * src/output.c (output): Adjust.
17532 * src/reader.c (parse_braces): New, factoring...
17533 (copy_action, copy_guard): these two which are renamed as...
17534 (parse_action, parse_guard): these.
17535 As a voluntary consequence, using braces around guards is now
17536 mandatory.
17537
f499b062
AD
175382001-12-27 Akim Demaille <akim@epita.fr>
17539
17540 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17541 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17542 members.
17543 (symbol_list_new): Adjust.
17544 (copy_action): action_line is the first line, not the last.
17545 (copy_guard): Just as for actions, store the `action' only, not
17546 the switch/case/break flesh.
17547 Don't parse the user action that might follow the guard, let...
17548 (readgram): do it, i.e., now, there can be an action after a
17549 guard.
17550 In other words the guard is just explicitly optional.
17551 (packgram): Adjust.
17552 * src/output.c (guards_output): New.
17553 (output_parser): Call it when needed.
17554 (output): Also free the guard and attrs obstacks.
17555 * src/files.c, src/files.h (obstack_save): Remove.
17556 (output_files): Remove.
17557 As a result, if one needs the former `.act' file, using an
17558 appropriate skeleton which requires actions and guards is now
17559 required.
17560 * src/main.c (main): Adjust.
17561 * tests/semantic.at: New.
17562 * tests/regression.at: Use `input.y' as input file name.
17563 Avoid 8+3 problems by requiring input.c when the test needs the
17564 parser.
17565
d945f5cd
AD
175662001-12-27 Akim Demaille <akim@epita.fr>
17567
17568 * src/reader.c (symbol_list_new): Be sure to initialize all the
17569 fields.
17570
d200e455
AD
175712001-12-27 Akim Demaille <akim@epita.fr>
17572
17573 All the hacks using a final pseudo state are now useless.
17574
17575 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17576 * src/lalr.c (nLA): New.
17577 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17578 instead of lookaheadsp from the pseudo state (nstate + 1).
17579
f9507c28
AD
175802001-12-27 Akim Demaille <akim@epita.fr>
17581
17582 * src/output.c (action_row, token_actions): Use a state_t instead
17583 of a integer, and nlookaheads instead of the following state's
17584 lookaheadsp.
17585
065fbd27
AD
175862001-12-27 Akim Demaille <akim@epita.fr>
17587
17588 * src/conflicts.c (log_resolution, flush_shift)
17589 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17590 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17591 (conflicts_print, print_reductions): Use a state_t instead of an
17592 integer when referring to a state.
17593 As much as possible, depend upon nlookaheads, instead of the
17594 `lookaheadsp' member of the following state (since lookaheads of
17595 successive states are successive, the difference between state n + 1
17596 and n served as the number of lookaheads for state n).
17597 * src/lalr.c (add_lookback_edge): Likewise.
17598 * src/print.c (print_core, print_actions, print_state)
17599 (print_results): Likewise.
17600 * src/print_graph.c (print_core, print_actions, print_state)
17601 (print_graph): Likewise.
17602 * src/conflicts.h: Adjust.
17603
1b177bd7
AD
176042001-12-27 Akim Demaille <akim@epita.fr>
17605
17606 * src/bison.hairy: Formatting/comment changes.
17607 ANSIfy.
17608 Remove `register' indications.
17609 Add plenty of `static'.
17610
7742ddeb
AD
176112001-12-27 Akim Demaille <akim@epita.fr>
17612
17613 * src/output.c (prepare): Drop the muscle `ntbase' which
17614 duplicates ntokens.
17615 * src/bison.simple: Formatting/comment changes.
17616 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17617 is an undocumented synonym.
17618
1fa14068
AD
176192001-12-22 Akim Demaille <akim@epita.fr>
17620
17621 * src/output.c (output_table_data): Change the prototype to use
17622 `int' for array ranges: some invocations do pass an int, not a
17623 short.
17624 Reported by Wayne Green.
17625
b9752825
AD
176262001-12-22 Akim Demaille <akim@epita.fr>
17627
17628 Some actions of web2c.y are improperly triggered.
17629 Reported by Mike Castle.
17630
17631 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17632 * tests/regression.at (Web2c): Rename as...
17633 (Web2c Report): this.
17634 (Web2c Actions): New.
17635
776209d6
AD
176362001-12-22 Akim Demaille <akim@epita.fr>
17637
17638 Reductions in web2c.y are improperly reported.
17639 Reported by Mike Castle.
17640
17641 * src/conflicts.c (print_reductions): Fix.
17642 * tests/regression.at (Web2c): New.
17643
275fc3ad
AD
176442001-12-18 Akim Demaille <akim@epita.fr>
17645
17646 Some host fail on `assert (!"foo")', which expands to
17647 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17648 Reported by Nelson Beebee.
17649
17650 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17651 `#define it_succeeded 0' and `assert (it_succeeded)'.
17652
897668ee
MA
176532001-12-17 Marc Autret <autret_m@epita.fr>
17654
17655 * src/bison.simple: Don't hard code the skeleton line and filename.
17656 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17657 New line counter 'skeleton_line' (skeleton-line muscle).
17658
ab3399e0
PE
176592001-12-17 Paul Eggert <eggert@twinsun.com>
17660
17661 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17662 YYDEBUG must be defined to a nonzero value.
17663
17664 * src/bison.simple (yytname): Do not assume that the user defines
17665 YYDEBUG to a properly parenthesized expression.
17666
3877f72b
AD
176672001-12-17 Akim Demaille <akim@epita.fr>
17668
17669 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17670 nlookaheads is a new member.
17671 Adjust all users.
17672 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17673 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17674 state.
776209d6 17675
331dbc1b
AD
176762001-12-17 Akim Demaille <akim@epita.fr>
17677
17678 * src/files.h, src/files.c (open_files, close_files): Remove.
17679 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17680 let...
17681 * src/reader.c (reader): Do it.
776209d6 17682
be750e4c
AD
176832001-12-17 Akim Demaille <akim@epita.fr>
17684
17685 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 17686
709ae8c6
AD
176872001-12-17 Akim Demaille <akim@epita.fr>
17688
17689 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17690 (flush_reduce): New.
17691 (resolve_sr_conflict): Adjust.
776209d6 17692
f87685c3
AD
176932001-12-17 Akim Demaille <akim@epita.fr>
17694
17695 * src/output.c (output_obstack): Be static and rename as...
17696 (format_obstack): this, to avoid any confusion with files.c's
17697 output_obstack.
17698 * src/reader.h (muscle_obstack): Move to...
17699 * src/output.h: here, since it's defined in output.c.
17700
837491d8
AD
177012001-12-17 Akim Demaille <akim@epita.fr>
17702
17703 * src/output.c (action_row, save_column, default_goto)
17704 (sort_actions, matching_state, pack_vector): Better variable
17705 locality.
17706
796d61fb
AD
177072001-12-17 Akim Demaille <akim@epita.fr>
17708
17709 * src/output.c: Various formatting changes.
776209d6 17710
64d15509
AD
177112001-12-17 Akim Demaille <akim@epita.fr>
17712
17713 * src/files.c (output_files): Free the output_obstack.
17714 * src/main.c (main): Call print and print_graph conditionally.
17715 * src/print.c (print): Work unconditionally.
17716 * src/print_graph.c (print_graph): Work unconditionally.
17717 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17718
fbc8ecb7
MA
177192001-12-16 Marc Autret <autret_m@epita.fr>
17720
17721 * src/output.c (actions_output): Fix. When we use %no-lines,
17722 there is one less line per action.
17723
f0440388
MA
177242001-12-16 Marc Autret <autret_m@epita.fr>
17725
17726 * src/bison.simple: Remove a useless #line directive.
17727 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17728 * src/output.c (get_lines_number): New.
776209d6 17729 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
17730 output muscles.
17731 Fix line numbering.
17732 (actions_output): Computes the number of lines taken by actions.
17733 (output_master_parser): Insert new skeleton which is the name of
17734 the output parser file name.
17735
a79986b8
MA
177362001-12-15 Marc Autret <autret_m@epita.fr>
17737
17738 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17739
4ec8e00f
MA
177402001-12-15 Marc Autret <autret_m@epita.fr>
17741
17742 * src/output.c (output_gram): Keep track of the hairy one.
17743
1a4648ff
AD
177442001-12-15 Akim Demaille <akim@epita.fr>
17745
17746 Make `make distcheck' work.
17747
17748 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17749 system.h which uses libgettext.h.
17750
9c2c67e6
AD
177512001-12-15 Akim Demaille <akim@epita.fr>
17752
17753 * src/nullable.c (set_nullable): Useless rules must be skipped,
17754 otherwise, since we range over their symbols, we might look at a
17755 nonterminal which no longer ``exists'', i.e., it is not counted in
17756 `nvars', hence we overflow our arrays.
17757
93ede233
AD
177582001-12-15 Akim Demaille <akim@epita.fr>
17759
17760 The header can also be produced directly, without any obstack!
17761 Yahoo!
17762
17763 * src/files.c, src/files.h (defines_obstack): Remove.
17764 (compute_header_macro): Global.
17765 (defines_obstack_save): Remove.
17766 * src/reader.c (parse_union_decl): No longer output to
17767 defines_obstack: its content can be found in the `stype' muscle
17768 anyway.
17769 (output_token_translations): Merge into...
17770 (symbols_output): this.
17771 Rename as...
17772 (symbols_save): this.
17773 (reader): Adjust.
17774 * src/output.c (header_output): New.
17775 (output): Call it.
17776
2666f928
AD
177772001-12-15 Akim Demaille <akim@epita.fr>
17778
17779 * src/reader.c (parse_union_decl): Instead of handling two obstack
17780 simultaneously, use one to define the `stype' muscle, and use the
17781 value of the latter to fill defines_obstack.
17782 (copy_comment): Remove.
17783 (copy_comment2): Work for a single obstack.
17784 Rename as...
17785 (copy_comment): this.
17786
428046f8
AD
177872001-12-15 Akim Demaille <akim@epita.fr>
17788
17789 * src/lex.c, src/lex.h (xgetc): No longer static.
17790 * src/reader.c (parse_union_decl): Revamp.
17791
ea52d706
AD
177922001-12-15 Akim Demaille <akim@epita.fr>
17793
17794 Still making progress in separating Bison into (i) input, (ii)
17795 process, (iii) output: now we can directly output the parser file
17796 without using table_obstack at all.
17797
17798 * src/files.c, src/files.h (table_obstack): Bye bye.
17799 (parser_file_name): New.
17800 * src/files.c (compute_output_file_names): Compute it.
17801 * src/output.c (actions_output, output_parser)
17802 (output_master_parser): To a file instead of an obstack.
17803
3f96f4dc
AD
178042001-12-15 Akim Demaille <akim@epita.fr>
17805
17806 Attach actions to rules, instead of pre-outputting them to
17807 actions_obstack.
17808
17809 * src/gram.h (rule_t): action and action_line are new members.
17810 * src/reader.c (symbol_list): Likewise.
17811 (copy_action): Save the actions within the rule.
17812 (packgram): Save them in rule_table.
17813 * src/output.c (actions_output): New.
17814 (output_parser): Use it on `%%actions'.
17815 (output_rule_data): Don't free rule_table.
17816 (output): Do it.
17817 (prepare): Don't save the `action' muscle.
17818 * src/bison.simple: s/%%action/%%actions/.
17819
51576fb3
AD
178202001-12-15 Akim Demaille <akim@epita.fr>
17821
17822 * src/reader.c (copy_action): When --yacc, don't append a `;'
17823 to the user action: let it fail if lacking.
dee049eb 17824 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 17825
2648a72d
AD
178262001-12-14 Akim Demaille <akim@epita.fr>
17827
17828 * src/lex.c (literalchar): Simply return the char you decoded, non
17829 longer mess around with obstacks and int pointers.
17830 Adjust all callers.
17831
92790e5b
AD
178322001-12-14 Akim Demaille <akim@epita.fr>
17833
17834 * src/lex.c (literalchar): Don't escape the special characters,
17835 just decode them, and keep them as char (before, eol was output as
17836 the 2 char string `\n' etc.).
17837 * src/output.c (output_rule_data): Use quotearg to output the
17838 token strings.
17839
927c1557
PE
178402001-12-13 Paul Eggert <eggert@twinsun.com>
17841
17842 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17843 Do not infringe on the global user namespace when using C++.
17844 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17845 All uses of `fprintf' and `stderr' changed.
17846
17847 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17848
ed8e1f68
AD
178492001-12-13 Akim Demaille <akim@epita.fr>
17850
17851 The computation of nullable is broken: it doesn't handle empty
17852 RHS's properly.
17853
17854 * tests/torture.at (GNU AWK Grammar): New.
17855 * tests/sets.at (Nullable): New.
17856 * src/nullable.c (set_nullable): Instead of blindly looping over
17857 `ritems', loop over the rules, and then over their rhs's.
17858
17859 Work around Autotest bugs.
17860
17861 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17862 frame, because Autotest understand lines starting with a `+' as
17863 traces from the shell. Then, they are not processed properly.
17864 Admittedly an Autotest bug, but we don't have time to wait for
17865 Autotest to catch up.
17866 * tests/regression.at (Broken Closure): Adjust to the new table
17867 frames.
17868 Move to...
17869 * tests/sets.at: here.
17870
cb581495
AD
178712001-12-13 Akim Demaille <akim@epita.fr>
17872
17873 * src/closure.c (closure): Use nrules instead of playing tricks
17874 with BITS_PER_WORD.
17875
2e729273
AD
178762001-12-13 Akim Demaille <akim@epita.fr>
17877
17878 * src/print.c (print_actions): Output the handling of `$' as the
17879 traces do: shifting the token EOF. Before EOF was treated as a
17880 nonterminal.
17881 * tests/regression.at: Adjust some tests.
17882 * src/print_graph.c (print_core): Complete the set of items via
17883 closure. The next-to-final and final states are still unsatisfying,
17884 but that's to be addressed elsewhere.
17885 No longer output the rule numbers, but do output the state number.
17886 A single loop for the shifts + gotos is enough, but picked a
17887 distinct color for each.
17888 (print_graph): Initialize and finalize closure.
17889
107f7dfb
AD
178902001-12-13 Akim Demaille <akim@epita.fr>
17891
17892 * src/reader.c (readgram): Remove dead code, an strip useless
17893 braces.
17894 (get_type): Remove, unused.
17895
9b53a24f
AD
178962001-12-12 Akim Demaille <akim@epita.fr>
17897
17898 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17899 on that of lib/error.c.
17900
dbfb6dcd
AD
179012001-12-12 Akim Demaille <akim@epita.fr>
17902
17903 Some hosts don't like `/' in includes.
17904
17905 * src/system.h: Include libgettext.h without qualifying the path.
17906 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17907 $(top_srcdir).
17908
c25fb648
MA
179092001-12-11 Marc Autret <autret_m@epita.fr>
17910
17911 * src/output.c (output_parser): Remove useless muscle.
17912
710ddc4f
MA
179132001-12-11 Marc Autret <autret_m@epita.fr>
17914
17915 * src/bison.simple: Remove #line just before %%epilogue. It
17916 is now handled in ...
17917 * src/reader.c (read_additionnal_code): Add the output of a
17918 #line for the epilogue.
17919
e83d80b8
MA
179202001-12-10 Marc Autret <autret_m@epita.fr>
17921
927c1557 17922 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
17923 replace precedent remove.
17924 * src/bison.simple: Remove #line before %%prologue because
17925 %%input-line is wrong at this time.
17926
971d5158
MA
179272001-12-10 Marc Autret <autret_m@epita.fr>
17928
17929 * src/reader.c (symbols_output): Clean up.
927c1557 17930 * src/output.c (output_gram, output): Clean up.
971d5158 17931
5edafffd
AD
179322001-12-10 Akim Demaille <akim@epita.fr>
17933
17934 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17935 * src/LR0.c (set_state_table): here.
17936 * src/lalr.c (lalr): Call it.
17937
0279f8e9
AD
179382001-12-10 Akim Demaille <akim@epita.fr>
17939
17940 * src/state.h (shifts): Remove the `number' member: shifts are
17941 attached to state, hence no longer need to be labelled with a
17942 state number.
17943
190c4f5f
AD
179442001-12-10 Akim Demaille <akim@epita.fr>
17945
17946 Now that states have a complete set of members, the linked list of
17947 shifts is useless: just fill directly the state's shifts member.
17948
17949 * src/state.h (shifts): Remove the `next' member.
17950 * src/LR0.c (first_state, last_state): Remove.
17951 Adjust the callers.
17952 (augment_automaton): Don't look for the shifts that must be added
17953 a shift on EOF: it is those of the state we looked for! But now,
17954 since shifts are attached, it is no longer needed to looking
17955 merely by its id: its number.
17956
2a73b93d
AD
179572001-12-10 Akim Demaille <akim@epita.fr>
17958
17959 * src/LR0.c (augment_automaton): Better variable locality.
17960 Remove an impossible branch: if there is a state corresponding to
17961 the start symbol being shifted, then there is shift for the start
17962 symbol from the initial state.
17963
74392f6a
AD
179642001-12-10 Akim Demaille <akim@epita.fr>
17965
17966 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17967 only when appropriate: when insert_start_shifting_state' is not
17968 invoked.
17969 * tests/regression.at (Rule Line Numbers): Adjust.
17970
37c82725
AD
179712001-12-10 Akim Demaille <akim@epita.fr>
17972
17973 * src/LR0.c (augment_automaton): Now that all states have shifts,
17974 merge the two cases addition shifts to the initial state.
17975
6a164e0c
AD
179762001-12-10 Akim Demaille <akim@epita.fr>
17977
17978 * src/lalr.c (set_state_table): Move to...
17979 * src/LR0.c: here.
17980 * src/lalr.c (lalr): Don't call it...
17981 * src/LR0.c (generate_states): do it.
17982 * src/LR0.h (first_state): Remove, only the table is used.
17983
7215de24
AD
179842001-12-10 Akim Demaille <akim@epita.fr>
17985
17986 * src/LR0.h (first_shift, first_reduction): Remove.
17987 * src/lalr.c: Don't use first_shift: find shifts through the
17988 states.
17989
80e25d4d
AD
179902001-12-10 Akim Demaille <akim@epita.fr>
17991
17992 * src/LR0.c: Attach shifts to states as soon as they are
17993 computed.
17994 * src/lalr.c (set_state_table): Instead of assigning shifts to
17995 state, just assert that the mapping was properly done.
17996
0ab3728b
AD
179972001-12-10 Akim Demaille <akim@epita.fr>
17998
17999 * src/LR0.c (insert_start_shift): Rename as...
18000 (insert_start_shifting_state): this.
18001 (insert_eof_shifting_state, insert_accepting_state): New.
18002 (augment_automaton): Adjust.
18003 Better locality of the variables.
18004 When looking if the start_symbol is shifted from the initial
18005 state, using `while (... symbol != start_symbol ...)' sounds
18006 better than `while (... symbol < start_symbol ...)': If fail
18007 to see how the order between symbols could be relevant!
18008
78af9bbc
AD
180092001-12-10 Akim Demaille <akim@epita.fr>
18010
18011 * src/getargs.h: Don't declare `spec_name_prefix' and
18012 `spec_file_prefix', declared by src/files.h.
18013 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
18014 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
18015 * src/output.c (prepare): Adjust.
18016 * src/reader.c (symbols_output): Likewise.
18017 * src/vmsgetargs.c: Vaguely adjust, but who cares?
18018
bdef2a41
AD
180192001-12-10 Akim Demaille <akim@epita.fr>
18020
18021 * src/muscle_tab.c (muscle_init): NULL is a better default than
18022 `"0"'.
18023
3735969c
AD
180242001-12-10 Akim Demaille <akim@epita.fr>
18025
18026 * src/reader.c (reader): Calling symbols_output once is enough.
18027
49701457
AD
180282001-12-10 Akim Demaille <akim@epita.fr>
18029
18030 Now that states have a complete set of members, the linked list of
18031 reductions is useless: just fill directly the state's reductions
18032 member.
18033
18034 * src/state.h (struct reductions): Remove member `number' and
18035 `next'.
18036 * src/LR0.c (first_reduction, last_reduction): Remove.
18037 (save_reductions): Don't link the new reductions, store them in
18038 this_state.
18039 * src/lalr.c (set_state_table): No need to attach reductions to
18040 states, it's already done.
18041 * src/output.c (output_actions): No longer free the shifts, then
18042 the reductions, then the states: free all the states and their
18043 members.
18044
0edad749
AD
180452001-12-10 Akim Demaille <akim@epita.fr>
18046
18047 * src/options.c (OPTN, DRTV, BOTH): New.
18048 (option_table): Use them.
18049
0edad749
AD
18050 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18051 the job of system.h.
18052 * src/options.c: Don't include stdio.h and xalloc.h for the same
18053 reasons.
18054
5449dd0f
AD
180552001-12-10 Akim Demaille <akim@epita.fr>
18056
18057 * src/output.c (output, prepare): Make sure the values of the
18058 muscles `action' and `prologue' are 0-terminated.
18059
a870c567
AD
180602001-12-10 Akim Demaille <akim@epita.fr>
18061
18062 Clean up GCC warnings.
18063
18064 * src/reader.c (copy_action): `buf' is not used.
18065 (parse_skel_decl): Be static.
18066 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18067 * src/options.h (create_long_option_table): Have a real prototype.
18068 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18069 (hash_delete_at): Return const void *.
18070 Adjust casts to preserve the const.
18071
80df8768
AD
180722001-12-10 Akim Demaille <akim@epita.fr>
18073
18074 * configure.in: Require 2.52g.
18075 M4 is not needed, but AUTOM4TE is.
18076 * m4/m4.m4: Remove.
18077 * tests/Makefile.am: Adjust.
18078
f693ad14
AD
180792001-12-10 Akim Demaille <akim@epita.fr>
18080
18081 One structure for states is enough, even though theoretically
18082 there are LR(0) states and LALR(1) states.
18083
18084 * src/lalr.h (state_t): Remove.
18085 (state_table): Be state_t **, not state_t *.
18086 * src/state.h (core, CORE_ALLOC): Rename as...
18087 (state_t, STATE_ALLOC): this.
18088 Add the LALR(1) members: shifts, reductions, errs.
18089 * src/LR0.c (state_table): Rename as...
18090 (state_hash): this, to avoid name clashes with the global
18091 `state_table'.
18092 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18093 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18094
74ffbcb6
AD
180952001-12-10 Akim Demaille <akim@epita.fr>
18096
18097 Bison dumps core on bash.y.
18098 Reported by Pascal Bart.
18099
18100 * src/warshall.c (bitmatrix_print): New.
18101 (TC): Use it.
ba0fe3c7 18102 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
18103 j must be the outer loop.
18104 * tests/regression.at (Broken Closure): New.
18105
07708e19
AD
181062001-12-05 Akim Demaille <akim@epita.fr>
18107
18108 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18109 its argument.
ba1ecc07 18110 Reported by Peter Hamorsky.
07708e19 18111
92b16366
AD
181122001-12-05 Akim Demaille <akim@epita.fr>
18113
18114 * src/conflicts.c (err_table): Remove.
18115 (resolve_sr_conflict): Adjust.
18116 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18117 Rename as...
18118 (state_t.reductions, state_t.shifts): this.
18119
076ab033
AD
181202001-12-05 Akim Demaille <akim@epita.fr>
18121
18122 * src/reduce.c (reduce_grammar_tables): No longer disable the
18123 removal of useless rules via CPP but via `if (0)', so that the
18124 compiler still check the code is valid.
18125 For instance, it should have noticed `rline' no longer exists: use
18126 the `line' member of rule_t.
18127 * src/gram.c (dummy, rline): Remove, unused.
18128
3843c413
AD
181292001-12-05 Akim Demaille <akim@epita.fr>
18130
18131 * src/output.c (pack_vector): Use assert, not berror.
18132 * src/main.c (berror): Remove, unused.
18133
43168960
AD
181342001-12-05 Akim Demaille <akim@epita.fr>
18135
18136 New experimental feature: if --verbose --trace output all the
18137 items of a state, not only its kernel.
18138
18139 * src/print.c (print_core): If `trace_flag', then invoke closure
18140 before outputting the items of the state (print_core is no longer
18141 a correct name them).
18142 (print_results): Invoke new_closure/free_closure if needed.
18143
b2872512
AD
181442001-12-05 Akim Demaille <akim@epita.fr>
18145
18146 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18147 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18148 (nitemset): for consistency with the rest of the project.
18149
23cbcc6c
AD
181502001-12-05 Akim Demaille <akim@epita.fr>
18151
18152 * src/closure.c (print_closure): Improve.
18153 (closure): Use it for printing input and output.
18154
03ec521c
AD
181552001-12-05 Akim Demaille <akim@epita.fr>
18156
18157 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18158 indexed by nonterminals.
18159
3a7456dd
AD
181602001-12-05 Akim Demaille <akim@epita.fr>
18161
18162 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18163 what it was!).
18164 * src/warshall.h: Remove accidental duplication of the content.
18165
1cbcf2e7
AD
181662001-12-05 Akim Demaille <akim@epita.fr>
18167
18168 * src/closure.c (set_fderives): De-obfuscate.
18169
84182270
AD
181702001-12-05 Akim Demaille <akim@epita.fr>
18171
18172 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18173
3f6f053c
AD
181742001-12-05 Akim Demaille <akim@epita.fr>
18175
18176 * src/closure.c (set_firsts): De-obfuscate.
18177
7a5350ba
AD
181782001-12-05 Akim Demaille <akim@epita.fr>
18179
18180 * src/output.c (action_row): De-obfuscate
18181 using the good o' techniques: arrays not pointers, variable
18182 locality, BITISSET, RESETBIT etc.
18183
d954473d
AD
181842001-12-05 Akim Demaille <akim@epita.fr>
18185
18186 Pessimize the code to simplify it: from now on, all the states
18187 have a valid SHIFTS, which NSHIFTS is possibly 0.
18188
18189 * src/LR0.c (shifts_new): Be global and move to..
18190 * src/state.c, src/state.h: here.
18191 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18192 * src/print_graph: Adjust.
18193
9839bbe5
AD
181942001-12-05 Akim Demaille <akim@epita.fr>
18195
18196 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18197 * src/conflicts.c: Use it.
18198 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18199 incorrectly ``simplified''.
18200
9f136c07
AD
182012001-12-05 Akim Demaille <akim@epita.fr>
18202
18203 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18204 using the good o' techniques: arrays not pointers, variable
18205 locality, BITISSET, RESETBIT etc.
18206
b608206e
AD
182072001-12-05 Akim Demaille <akim@epita.fr>
18208
18209 * src/state.h (SHIFT_SYMBOL): New.
18210 * src/conflicts.c: Use it to deobfuscate.
18211
52afa962
AD
182122001-12-05 Akim Demaille <akim@epita.fr>
18213
18214 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18215 (print_reductions): De-obfuscate using the good o' techniques:
18216 arrays not pointers, variable locality, BITISSET.
18217
e74dc321
AD
182182001-12-05 Akim Demaille <akim@epita.fr>
18219
18220 * src/conflicts.c (print_reductions): Arrays, not pointers.
18221 Use BITISSET.
18222
768fca83
AD
182232001-12-05 Akim Demaille <akim@epita.fr>
18224
18225 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18226
a17e599f
AD
182272001-12-05 Akim Demaille <akim@epita.fr>
18228
18229 * src/conflicts.c (print_reductions): Improve variable locality.
18230
a04bc341
AD
182312001-12-05 Akim Demaille <akim@epita.fr>
18232
18233 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18234
c8ea038e
AD
182352001-12-05 Akim Demaille <akim@epita.fr>
18236
18237 * src/conflicts.c (print_reductions): Improve variable locality.
18238
aa2aab3c
AD
182392001-12-05 Akim Demaille <akim@epita.fr>
18240
18241 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18242 * src/lalr.c: Use them.
18243
b178c8cc
AD
182442001-12-05 Akim Demaille <akim@epita.fr>
18245
18246 * src/LR0.c (augment_automaton): Formatting changes.
18247 Better variable locality.
18248
f67d13aa
AD
182492001-12-05 Akim Demaille <akim@epita.fr>
18250
18251 * src/lalr.c (matrix_print): New.
18252 (transpose): Use it.
18253 Use arrays instead of pointers.
18254
c2713865
AD
182552001-12-05 Akim Demaille <akim@epita.fr>
18256
18257 * src/lalr.c (maxrhs): Move to...
18258 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18259 * src/lalr.c (build_relations): Adjust.
18260
9887c18a
AD
182612001-12-05 Akim Demaille <akim@epita.fr>
18262
18263 * src/lalr.c (transpose): Free the memory allocated to the
18264 argument, as it is replaced by the results by the unique caller.
18265 (build_relations): Merely invoke transpose: it handles the memory
18266 deallocation.
18267 Improve variable locality.
18268 Avoid variables used as mere abbreviations.
18269 (compute_lookaheads): Use arrays instead of pointers.
18270
4d4f699c
AD
182712001-12-05 Akim Demaille <akim@epita.fr>
18272
18273 * src/lalr.c (initialize_F): Improve variable locality.
18274 Avoid variables used as mere abbreviations.
18275
80a69750
AD
182762001-12-05 Akim Demaille <akim@epita.fr>
18277
18278 * src/derives.c (print_derives): Display the ruleno.
18279 * src/lalr.c (initialize_F, transpose): Better variable locality
18280 to improve readability.
18281 Avoid variables used as mere abbreviations.
18282
fe961097
AD
182832001-12-05 Akim Demaille <akim@epita.fr>
18284
18285 * src/lalr.c (traverse): Use arrays instead of pointers.
18286
e3e4e814
AD
182872001-12-05 Akim Demaille <akim@epita.fr>
18288
18289 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18290 the handling of squeue.
18291 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18292
630e182b
AD
182932001-12-05 Akim Demaille <akim@epita.fr>
18294
18295 Because useless nonterminals are now kept alive (instead of being
18296 `destroyed'), we now sometimes examine them, and store information
18297 related to them. Hence we need to know their number, and adjust
18298 memory allocations.
18299
18300 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18301 static.
18302 * src/LR0.c (allocate_itemsets): The memory allocated to
18303 `symbol_count' was used for two different purpose: once to count
18304 the number of occurrences of each symbol, and later reassigned to
18305 `shift_symbol', containing the symbol that can be shifted from a
18306 given state.
18307 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18308 only, and...
18309 (new_itemsets): Allocate `shift_symbol' here.
18310 (allocate_itemsets): symbol_count includes useless nonterminals.
18311 Make room for them.
18312 (free_storage): Use `free', not `XFREE', for pointers that cannot
18313 be null.
18314
81b51460
AD
183152001-12-05 Akim Demaille <akim@epita.fr>
18316
18317 * src/nullable.c (set_nullable): Deobfuscate the handling of
18318 ritem.
18319 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18320
3067fbef
AD
183212001-12-05 Akim Demaille <akim@epita.fr>
18322
18323 * src/gram.c, src/gram.h (ritem_print): New.
18324 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18325 (This useless function was defined only to work around VMS linkers
18326 that can't handle compilation units with variables only).
18327 * src/reduce.c (dump_grammar): Use it to trace the construction of
18328 ritem.
18329
c2bea5f9
PE
183302001-12-04 Paul Eggert <eggert@twinsun.com>
18331
7d27c823
PE
18332 * src/bison.simple (union yyalloc): Change member names
18333 to be the same as the stack names.
18334 (yyparse): yyptr is now union yyalloc *, not char *.
18335 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18336 and may generate better code on some machines.
c2bea5f9
PE
18337 (yystpcpy): Use prototype if __STDC__ is defined, not just
18338 if __cplusplus is defined.
35687a9d 18339
2c8a9dfa
AD
183402001-11-30 Akim Demaille <akim@epita.fr>
18341
18342 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18343 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18344 Gettext doesn't compile cleanly, and dies with -Werror.
18345 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18346 Include WARNING_CFLAGS here.
18347 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18348 before being defined.
18349
f4e421e6
AD
183502001-11-27 Paul Eggert <eggert@twinsun.com>
18351
18352 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18353 First arg is int, not unsigned.
18354 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18355 (SIZE_MAX, UINT_MAX): New macros.
18356 (quotearg_n_options): Abort if N is negative.
18357 Avoid overflow check on hosts where size_t is 64 bits and int
18358 is 32 bits, as overflow is impossible there.
18359 Fix off-by-one typo that caused unnecessary reallocation.
18360
7093d0f5
AD
183612001-11-29 Paul Eggert <eggert@twinsun.com>
18362
18363 Name space cleanup in generated parser.
18364
18365 * doc/bison.texinfo (Bison Parser): Discuss system headers
18366 and their effect on the user name space.
18367
18368 * src/bison.simple:
18369 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18370 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18371 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18372
18373 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18374 on user names when possible.
18375
18376 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18377 Simplify test for whather <alloca.h> exists.
18378
18379 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18380
18381 (<stdio.h>): Include if YYDEBUG.
18382
18383 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18384 ! defined (yyoverflow) && ! defined (yymemcpy).
18385
18386 (yymemcpy, yyparse): Rename local variables as needed so that
18387 they all begin with 'yy'.
18388
18389 (yystrlen, yystpcpy): New functions.
18390
18391 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18392 All uses changed.
18393
18394 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18395 instead of relying on string.h functions. Use YYSTACK_ALLOC
18396 and YYSTACK_FREE instead of malloc and free.
18397
fd51e5ff
AD
183982001-11-30 Akim Demaille <akim@epita.fr>
18399
18400 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18401 before their first uses.
18402 (YYBISON, YYPURE): Move to the top of the output.
18403
7d13ff5f
AD
184042001-11-30 Akim Demaille <akim@epita.fr>
18405
18406 * tests/reduce.at (Useless Nonterminals): Fix.
18407
892a3995
AD
184082001-11-30 Akim Demaille <akim@epita.fr>
18409
18410 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18411 if body instead of `;' to pacify GCC's warnings.
18412
68f1e3ed
AD
184132001-11-30 Akim Demaille <akim@epita.fr>
18414
18415 Instead of mapping the LHS of unused rules to -1, keep the LHS
18416 valid, but flag the rules as invalid.
18417
18418 * src/gram.h (rule_t): `useful' is a new member.
18419 * src/print.c (print_grammar): Adjust.
18420 * src/derives.c (set_derives): Likewise.
18421 * src/reader.c (packgram, reduce_output): Likewise.
18422 * src/reduce.c (reduce_grammar_tables): Likewise.
18423 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18424
d2d1b42b
AD
184252001-11-30 Akim Demaille <akim@epita.fr>
18426
18427 * src/reduce.c (reduce_output): Formatting changes.
18428 * src/print.c (print_results, print_grammar): Likewise.
18429 * tests/regression.at (Rule Line Numbers)
18430 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18431
760b53a8
AD
184322001-11-30 Akim Demaille <akim@epita.fr>
18433
18434 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18435 useless nonterminals, move them at the end of the symbol arrays.
18436 (reduce_output): Adjust.
18437 * tests/reduce.at (Useless Nonterminals): Adjust.
18438
00238958
AD
184392001-11-30 Akim Demaille <akim@epita.fr>
18440
18441 * src/reduce.c: Various comment/formatting changes.
18442 (nonterminals_reduce): New, extracted from...
18443 (reduce_grammar_tables): here.
18444 (reduce_grammar): Call nonterminals_reduce.
18445
396452de
PE
184462001-11-29 Paul Eggert <eggert@twinsun.com>
18447
18448 * src/bison.simple (YYSTACK_REALLOC): Remove.
18449 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18450 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18451 New macros.
18452 (union yyalloc): New type.
18453 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18454 an arbitrary restriction on hosts where size_t is wider than int.
18455
18456 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18457 a parser stack overflow. Allocate just one block of memory for all
18458 three stacks, instead of allocating three blocks; this typically is
18459 faster and reduces fragmentation.
18460
18461 Do not limit the number of items in the stack to a value that fits
18462 in 'int', as this is an arbitrary limit on hosts with 64-bit
18463 size_t and 32-bit int.
18464
147e184c
MA
184652001-11-29 Marc Autret <autret_m@epita.fr>
18466
18467 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18468 of defining YYERROR_VERBOSE.
18469 [AT_DATA]: $4 is now out of C declarations in the prologue.
18470
426cf563
MA
184712001-11-28 Marc Autret <autret_m@epita.fr>
18472
18473 * src/reader.c (parse_dquoted_param): New.
18474 (parse_skel_decl): Use it.
18475 * src/lex.h: Add its prototype.
18476 * src/lex.c (literalchar): Become not static.
18477
c7925b99
MA
184782001-11-28 Marc Autret <autret_m@epita.fr>
18479
18480 * src/output.h: And put its extern declaration here.
18481 * src/output.c (error_verbose): Define here.
18482 (prepare): Echo name modification.
18483 * src/getargs.h: Clean its extern declaration.
18484 * src/getargs.c (error_verbose_flag): Remove.
18485 (getargs): Remove case 'e'.
18486 * src/options.c (option_table): 'error-verbose' is now seen as simple
18487 percent option.
18488 Include output.h.
18489
18490 * src/reader.c (read_declarations): Remove case tok_include.
18491 (parse_include_decl): Remove.
18492 * src/lex.h (token_t): Remove tok_include.
18493 * src/options.c (option_table): 'include' is now a simple command line
18494 option.
18495
5b5d1929
MA
184962001-11-28 Marc Autret <autret_m@epita.fr>
18497
18498 * src/bison.simple: Adjust muscle names.
18499 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18500 * src/output.c (prepare): s/_/-/ for the muscles names.
18501 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18502
8850be4b
MA
185032001-11-28 Marc Autret <autret_m@epita.fr>
18504
18505 * src/bison.simple: Fix debug.
18506 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18507
4a38e613
AD
185082001-11-28 Akim Demaille <akim@epita.fr>
18509
18510 * src/LR0.c (shifts_new): New.
18511 (save_shifts, insert_start_shift, augment_automaton): Use it.
18512
4b35e1c1
AD
185132001-11-28 Akim Demaille <akim@epita.fr>
18514
18515 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18516 keep ruleno only.
18517
d2b04478
AD
185182001-11-28 Akim Demaille <akim@epita.fr>
18519
18520 * src/closure.c (closure): Instead of looping over word in array
18521 then bits in words, loop over bits in array.
18522
2c4c30aa
AD
185232001-11-28 Akim Demaille <akim@epita.fr>
18524
18525 * src/closure.c (closure): No longer optimize the special case
18526 where all the bits of `ruleset[r]' are set to 0, to make the code
18527 clearer.
18528
576890b7
AD
185292001-11-28 Akim Demaille <akim@epita.fr>
18530
18531 * src/closure.c (closure): `r' and `c' are new variables, used to
18532 de-obfuscate accesses to RULESET and CORE.
18533
cb487d7d
AD
185342001-11-28 Akim Demaille <akim@epita.fr>
18535
18536 * src/reduce.c (reduce_print): Use ngettext.
18537 (dump_grammar): Improve the trace accuracy.
18538
6013d43f
AD
185392001-11-28 Akim Demaille <akim@epita.fr>
18540
18541 * src/reduce.c (dump_grammar): Don't translate trace messages.
18542
cb4956ee
AD
185432001-11-28 Akim Demaille <akim@epita.fr>
18544
18545 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18546 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18547 as all tags are free'ed afterwards.
18548 From Enrico Scholz.
18549
648185ab
PE
185502001-11-27 Paul Eggert <eggert@twinsun.com>
18551
18552 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18553 use alloca when we didn't want to, and vice versa.
18554
68254a03
MA
185552001-11-27 Marc Autret <autret_m@epita.fr>
18556
9113b58f
AD
18557 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18558 initialization.
68254a03
MA
18559 * src/output.c (prepare): Remove its update.
18560
04d843a2
MA
185612001-11-27 Marc Autret <autret_m@epita.fr>
18562
18563 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18564 Use %error-verbose.
18565
d2079671 185662001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
18567
18568 * src/bison.simple: Remove YYERROR_VERBOSE using.
18569 Use %%error_verbose.
18570 (yyparse): Likewise.
18571 * src/output.c (prepare): Give its final value.
18572 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18573 * src/getargs.h: Add its extern declaration.
18574 * src/getargs.c (error_verbose_flag): New int.
18575 (getargs): Update to catch new case.
18576 * src/options.c (option_table): 'error-verbose' is a new option.
18577 (shortopts): Update.
18578
e0327bc8
AD
185792001-11-27 Akim Demaille <akim@epita.fr>
18580
18581 * src/system.h: Use intl/libgettext.h.
18582 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18583
000f1a3c
AD
185842001-11-27 Akim Demaille <akim@epita.fr>
18585
18586 * tests/torture.at (Exploding the Stack Size with Malloc):
18587 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18588
26cfe0be
AD
185892001-11-27 Akim Demaille <akim@epita.fr>
18590
18591 * src/files.c: Include error.h.
18592 Reported by Hans Aberg.
18593
f6bd5427
MA
185942001-11-26 Marc Autret <autret_m@epita.fr>
18595
d2079671 18596 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
18597 (read_declarations): Add case tok_include.
18598 * src/getargs.h (include): Add its extern definition.
18599 * src/getargs.c (include): New const char *.
18600 (getargs): Add case '-I'.
18601 * src/options.c (option_table): Add include as command line and
18602 percent option.
18603 * src/lex.h (token_t): Add tok_include.
18604
2ca209c1
AD
186052001-11-26 Akim Demaille <akim@epita.fr>
18606
18607 * src/reader.c (readgram): Make sure rules for mid-rule actions
18608 have a lineno equal to that of their host rule.
18609 Reported by Hans Aberg.
18610 * tests/regression.at (Rule Line Numbers): New.
18611
0e41b407
AD
186122001-11-26 Akim Demaille <akim@epita.fr>
18613
18614 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18615 size_ts.
18616
186172001-11-26 Akim Demaille <akim@epita.fr>
18618
18619 * src/complain.c, src/complain.h (error): Remove, provided by
18620 lib/error.[ch].
18621
e0c40012
AD
186222001-11-26 Akim Demaille <akim@epita.fr>
18623
18624 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18625 issue an error message.
18626 * tests/regression.at (Invalid %directive): New.
18627 Reported by Hans Aberg.
18628
5e147124
AD
186292001-11-26 Akim Demaille <akim@epita.fr>
18630
18631 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18632 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18633
a034c8b8
AD
186342001-11-26 Akim Demaille <akim@epita.fr>
18635
18636 * src/conflicts.c (conflicts_print): Don't complain at all when
18637 there are no reduce/reduce conflicts, and as many shift/reduce
18638 conflicts as expected.
18639 * tests/regression.at (%expect right): Adjust.
18640
c64a20f3
AD
186412001-11-23 Akim Demaille <akim@epita.fr>
18642
18643 * lib/alloca.c: Update, from fileutils.
18644
5b0d29bb
AD
186452001-11-23 Akim Demaille <akim@epita.fr>
18646
18647 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18648
722c4bfe
AD
186492001-11-23 Akim Demaille <akim@epita.fr>
18650
18651 * src/system.h: Include alloca.h.
18652 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18653
6255b435
AD
186542001-11-23 Akim Demaille <akim@epita.fr>
18655
18656 * src/print_graph.c (print_actions): Remove `rule', unused.
18657 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18658 pacify GCC's signed < unsigned warnings.
18659 * src/closure.c (itemsetsize): Likewise.
18660 * src/reader.c (symbol_list_new): Static.
18661
b29b2ed5
AD
186622001-11-23 Akim Demaille <akim@epita.fr>
18663
18664 Attaching lineno to buckets is stupid, since only one copy of each
18665 symbol is kept, only the line of the first occurrence is kept too.
18666
18667 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18668 * src/reader.c (rline_allocated): Remove, unused.
18669 (symbol_list): Have a `line' member.
18670 (symbol_list_new): New.
18671 (readgram): Use it.
18672 * src/print.c (print_grammar): Output the rule line numbers.
18673 * tests/regression.at (Solved SR Conflicts)
18674 (Unresolved SR Conflicts): Adjust.
18675 Reported by Hans Aberg.
18676
a81b1d4a
MA
186772001-11-22 Marc Autret <autret_m@epita.fr>
18678
18679 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18680
c1ecb3c1
MA
186812001-11-22 Marc Autret <autret_m@epita.fr>
18682
18683 * src/muscle_tab.c (muscle_init): Remove initialization of
18684 skeleton muscle.
18685 * src/output.c (output_master_parser): Do it here.
18686
fbe01355
AD
186872001-11-20 Akim Demaille <akim@epita.fr>
18688
18689 * po/sv.po: New.
18690 * configure.in (ALL_LINGUAS): Adjust.
18691 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18692 longer contains strings to translate.
18693
81e895c0
AD
186942001-11-19 Akim Demaille <akim@epita.fr>
18695
18696 * src/conflicts.c (conflicts_print): Add a missing \n.
18697
6bb1878b
AD
186982001-11-19 Akim Demaille <akim@epita.fr>
18699
18700 * src/nullable.c (nullable_print): New.
18701 (set_nullable): Call it when tracing.
18702 Better locality of variables.
18703
d9ec2d07
AD
187042001-11-19 Akim Demaille <akim@epita.fr>
18705
18706 * src/print.c (print_actions): Better locality of variables.
18707
720e5c1b
AD
187082001-11-19 Akim Demaille <akim@epita.fr>
18709
18710 * src/derives.c (print_derives): Fix and enrich.
18711 * src/closure.c (print_fderives): Likewise.
18712
fb908786
AD
187132001-11-19 Akim Demaille <akim@epita.fr>
18714
18715 * src/closure.c (itemsetend): Remove, replaced with...
18716 (itemsetsize): new.
18717
125ecb56
AD
187182001-11-19 Akim Demaille <akim@epita.fr>
18719
18720 * src/LR0.c (kernel_end): Remove, replaced with...
18721 (kernel_size): new.
18722
d8cf039f
AD
187232001-11-19 Akim Demaille <akim@epita.fr>
18724
18725 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18726 to clarify.
18727
7bec0760
AD
187282001-11-19 Akim Demaille <akim@epita.fr>
18729
18730 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18731
c87d4863
AD
187322001-11-19 Akim Demaille <akim@epita.fr>
18733
18734 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18735 trace messages.
18736 * src/LR0.c: Likewise.
18737 (allocate_itemsets): Use arrays instead of pointers to clarify.
18738
9bfe901c
AD
187392001-11-19 Akim Demaille <akim@epita.fr>
18740
18741 * src/getargs.c (statistics_flag): Replace with...
18742 (trace_flag): New.
18743 (longopts): Accept --trace instead of --statistics.
18744 * src/getargs.h, src/options.c: Adjust.
18745 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18746 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18747
97db7bd4
AD
187482001-11-19 Akim Demaille <akim@epita.fr>
18749
cc72668c 18750 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
18751 pointers to clarify the code.
18752 (save_reductions, save_shifts): Factor common parts of alternatives.
18753
2c5f66ed
AD
187542001-11-19 Akim Demaille <akim@epita.fr>
18755
18756 * src/LR0.c (new_state, get_state): Complete TRACE code.
18757 * src/closure.c: Include `reader.h' to get `tags', needed by the
18758 trace code.
18759 Rename the conditional DEBUG as TRACE.
18760 Output consistently TRACEs to stderr, not stdout.
18761 * src/derives.c: Likewise.
18762 * src/reduce.c: (inaccessable_symbols): Using if is better style
18763 than goto.
18764 Use `#if TRACE' instead of `#if 0' for tracing code.
18765
300f275f
AD
187662001-11-19 Akim Demaille <akim@epita.fr>
18767
18768 * src/system.h (LIST_FREE, shortcpy): New.
18769 * src/LR0.c: Use them.
18770 * src/output.c (free_itemsets, free_reductions, free_shifts):
18771 Remove, replaced by LIST_FREE.
18772
f59c437a
AD
187732001-11-19 Akim Demaille <akim@epita.fr>
18774
18775 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18776 (REDUCTIONS_ALLOC): New.
18777 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18778 allocation.
18779
6986fd9e
AD
187802001-11-19 Akim Demaille <akim@epita.fr>
18781
18782 * src/LR0.c (new_state): Complete trace code.
18783 * src/nullable.c (set_nullable): Don't translate traces.
18784
4bc30f78
AD
187852001-11-19 Akim Demaille <akim@epita.fr>
18786
18787 * src/print_graph.c (print_core): Better locality of variables.
18788 * src/print.c (print_core): Likewise.
18789
08a946e0
AD
187902001-11-19 Akim Demaille <akim@epita.fr>
18791
18792 * src/vcg.c: You do the output, so you are responsible of the
18793 handling of VCG syntax, in particular: use quotearg.
18794 * src/print_graph.c: Don't.
18795 (print_actions): Don't output the actions as part of the nodes,
18796 since that's the job of the edges.
18797 (print_state): Don't output by hand: fill the node description,
9bfe901c 18798 and ask for its output.
08a946e0 18799
f0473484
AD
188002001-11-19 Akim Demaille <akim@epita.fr>
18801
cc72668c
AD
18802 * src/bison.simple (yyparse): When verbosely reporting an error,
18803 no longer put additional quotes around token names.
f0473484
AD
18804 * tests/calc.at: Adjust.
18805
e41dc700
AD
188062001-11-19 Akim Demaille <akim@epita.fr>
18807
18808 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18809 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18810 * src/output.c: Adjust.
18811
652a871c
AD
188122001-11-19 Akim Demaille <akim@epita.fr>
18813
18814 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18815 (rule_t): this.
18816 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18817
b2ed6e58
AD
188182001-11-19 Akim Demaille <akim@epita.fr>
18819
18820 * src/gram.h (rule_t): New.
18821 (rule_table): New.
18822 (rrhs, rlhs): Remove, part of state_t.
18823 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18824 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18825 * src/reader.c, src/reduce.c: Adjust.
18826
edad7067
AD
188272001-11-19 Akim Demaille <akim@epita.fr>
18828
18829 * src/reader.c (symbols_output): New, extracted from...
18830 (packsymbols): Here.
18831 (reader): Call it.
18832
3feec034
AD
188332001-11-19 Akim Demaille <akim@epita.fr>
18834
18835 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18836 (maxrhs): this new function.
18837
ddcd5fdf
AD
188382001-11-19 Akim Demaille <akim@epita.fr>
18839
cc72668c 18840 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
18841 Adjust.
18842
bb527fc2
AD
188432001-11-19 Akim Demaille <akim@epita.fr>
18844
cc72668c 18845 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
18846 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18847 * src/lalr.c: Adjust.
18848
a845a697
AD
188492001-11-19 Akim Demaille <akim@epita.fr>
18850
18851 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18852 (set_state_table): handle the `lookaheads' members.
18853
f004bf6a
AD
188542001-11-19 Akim Demaille <akim@epita.fr>
18855
cc72668c
AD
18856 * src/lalr.h (lookaheads): Removed array, whose contents is now
18857 a member of...
f004bf6a
AD
18858 (state_t): this structure.
18859 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18860 Adjust.
18861
de326cc0
AD
188622001-11-19 Akim Demaille <akim@epita.fr>
18863
cc72668c
AD
18864 * src/lalr.h (consistent): Removed array, whose contents is now
18865 a member of...
de326cc0
AD
18866 (state_t): this structure.
18867 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18868 Adjust.
18869
90b4416b
AD
188702001-11-19 Akim Demaille <akim@epita.fr>
18871
cc72668c
AD
18872 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18873 contents are now members of...
90b4416b
AD
18874 (state_t): this structure.
18875 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18876 Adjust.
18877
9703cc49
AD
188782001-11-19 Akim Demaille <akim@epita.fr>
18879
18880 * src/lalr.h (state_t): New.
18881 (state_table): Be a state_t * instead of a core **.
18882 (accessing_symbol): Remove, part of state_t.
18883 * src/lalr.c: Adjust.
18884 (set_accessing_symbol): Merge into...
18885 (set_state_table): this.
18886 * src/print_graph.c, src/conflicts.c: Adjust.
18887
d803322e
AD
188882001-11-14 Akim Demaille <akim@epita.fr>
18889
18890 * tests/calc.at, tests/output.at, tests/regression.at,
18891 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18892 now the tests are run in private dirs, therefore AC_CLEANUP and
18893 family can be simplified to 0-ary.
18894 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18895 use abs. path to find config.h.
18896 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18897 stderr, there can be way too much random noise.
18898 Instead pass -Werror to GCC and rely on the exit status.
18899 Reported by Wolfram Wagner.
18900
3d76b07d
AD
189012001-11-14 Akim Demaille <akim@epita.fr>
18902
18903 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18904 defined only if yyoverflow is defined, to avoid `warning: unused
18905 variable `yyvs1''.
18906 Reported by The Test Suite.
18907
09b503c8
AD
189082001-11-14 Akim Demaille <akim@epita.fr>
18909
18910 * src/print.c: Include reduce.h.
18911 Reported by Hans Aberg.
18912
189132001-11-14 Akim Demaille <akim@epita.fr>
18914
18915 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18916 Revert a previous patch: these are really const.
18917 * src/conflicts.c (conflict_report): Additional useless pair of
18918 braces to pacify GCC's warnings for `if () if () {} else {}'.
18919 * src/lex.c (parse_percent_token): Replace equal_offset with
18920 arg_offset.
18921 arg is const.
18922 Be sure to strdup `arg' when used, since there is no reason for
18923 token_buffer not to change.
18924
0f37a994
AD
189252001-11-14 Akim Demaille <akim@epita.fr>
18926
18927 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18928 definition.
18929 * src/main.c (main): Use them.
18930 Suggested by Hans Aberg.
18931
d39d93b8
AD
189322001-11-12 Akim Demaille <akim@epita.fr>
18933
18934 * src/system.h (ngettext): Now that we use ngettext, be sure to
18935 provide a default definition when NLS are not used.
18936
9edcd895
AD
189372001-11-12 Akim Demaille <akim@epita.fr>
18938
18939 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18940 Use @kbd to denote user input.
18941 (Language and Grammar): ANSIfy the example.
18942 Adjust its layout for info/notinfo.
18943 (Location Tracking Calc): Output error messages to stderr.
18944 Output locations in a more GNUtically correct way.
18945 Fix a couple of Englishos.
18946 Adjust @group/@end group pairs.
18947
7da99ede
AD
189482001-11-12 Akim Demaille <akim@epita.fr>
18949
e3aa65c5 18950 %expect was not functioning at all.
7da99ede
AD
18951
18952 * src/conflicts.c (expected_conflicts): Set to -1.
18953 (conflict_report): Use ngettext.
18954 (conflicts_print): Check %expect and make its violation an error.
18955 * doc/bison.texinfo (Expect Decl): Adjust.
18956 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18957 * tests/regression.at (%expect not enough, %expect right)
18958 (%expect too much): New.
18959
ba9dda1a
AD
189602001-11-12 Akim Demaille <akim@epita.fr>
18961
18962 * tests/regression.at (Conflicts): Rename as...
18963 (Unresolved SR Conflicts): this.
18964 (Solved SR Conflicts): New.
18965
337c5bd1
AD
189662001-11-12 Akim Demaille <akim@epita.fr>
18967
18968 * src/reduce.c (print_results): Rename as...
18969 (reduce_output): This.
18970 Output to OUT, passed as argument, instead of output_obstack.
18971 (dump_grammar): Likewise.
18972 (reduce_free): New.
18973 Also free V1.
18974 (reduce_grammar): No longer call reduce_output, since...
18975 * src/print.c (print_results): do it.
18976 * src/main.c (main): Call reduce_free;
18977
c73a41af
AD
189782001-11-12 Akim Demaille <akim@epita.fr>
18979
18980 * src/conflicts.c (print_reductions): Accept OUT as argument.
18981 Output to it, not to output_obstack.
18982 * src/print.c (print_actions): Adjust.
18983
0df87bb6
AD
189842001-11-12 Akim Demaille <akim@epita.fr>
18985
18986 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18987 the result instead of using...
18988 (src_total, rrc_total, src_count, rrc_count): Remove.
18989 (any_conflicts): Remove.
18990 (print_conflicts): Split into...
18991 (conflicts_print, conflicts_output): New.
18992 * src/conflicts.h: Adjust.
18993 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 18994 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
18995 * tests/regression.at (Conflicts): New.
18996 Reported by Tom Lane.
18997
e4d3d4de
AD
189982001-11-12 Akim Demaille <akim@epita.fr>
18999
19000 * tests/regression.at (Invalid input): Remove, duplicate with
19001 ``Invalid input: 1''.
19002
6d7d248e
AD
190032001-11-12 Akim Demaille <akim@epita.fr>
19004
19005 * tests/torture.at (AT_DATA_STACK_TORTURE)
19006 (Exploding the Stack Size with Alloca)
19007 (Exploding the Stack Size with Malloc): New.
19008
e9e4c321
AD
190092001-11-12 Akim Demaille <akim@epita.fr>
19010
19011 * src/bison.simple (YYSTACK_REALLOC): New.
19012 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 19013 Reported by Per Allansson.
e9e4c321 19014
5f7e0832
AD
190152001-11-12 Pascal Bart <pascal.bart@epita.fr>
19016
19017 * src/bison.simple: Define type yystype instead of YYSTYPE, and
19018 define CPP macro, which substitute YYSTYPE by yystype.
19019 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
19020 with yyltype/YYLTYPE. This allows inclusion of the generated
19021 header within the parser if the compiler, such as GGC, accepts
19022 multiple equivalent #defines.
19023 From Akim.
19024
e3f1699f
AD
190252001-11-05 Akim Demaille <akim@epita.fr>
19026
19027 * src/reader.c (symbols_output): New, extracted from...
19028 (packsymbols): here.
19029 (reader): Adjust.
19030
65be0866
AD
190312001-11-05 Akim Demaille <akim@epita.fr>
19032
19033 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19034
e4d910bf
AD
190352001-11-05 Akim Demaille <akim@epita.fr>
19036
19037 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19038 pattern.
19039
951366c1
AD
190402001-11-05 Akim Demaille <akim@epita.fr>
19041
19042 * src/options.h (struct option_table_struct): set_flags is void*.
19043 * src/options.c (longopts): Support `--output' and `%output'.
19044 (usage): Adjust.
19045 * src/lex.h (tok_setopt): Remove, replaced with...
19046 (tok_intopt, tok_stropt): these new guys.
19047 * src/lex.c (getopt.h): Not needed.
19048 (token_buffer, unlexed_token_buffer): Not const.
19049 (percent_table): Promote `-' over `_' in directive names.
19050 Active `%name-prefix', `file-prefix', and `output'.
19051 (parse_percent_token): Accept possible arguments to directives.
19052 Promote `-' over `_' in directive names.
19053
d8988b2f
AD
190542001-11-04 Akim Demaille <akim@epita.fr>
19055
19056 * doc/bison.texinfo (Decl Summary): Split the list into
19057 `directives for grammars' and `directives for bison'.
19058 Sort'em.
19059 Add description of `%name-prefix', `file-prefix', and `output'.
19060 Promote `-' over `_' in directive names.
19061 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19062 Simplify the description of `--name-prefix'.
19063 Promote `-' over `_' in directive names.
19064 Promote `--output' over `--output-file'.
19065 Fix the description of `--defines'.
19066 * tests/output.at: Exercise %file-prefix and %output.
19067
6468d18e
AD
190682001-11-02 Akim Demaille <akim@epita.fr>
19069
19070 * doc/refcard.tex: Update.
19071
6b7e85b9
AD
190722001-11-02 Akim Demaille <akim@epita.fr>
19073
19074 * src/symtab.h (SUNDEF): New.
19075 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19076 stand for `uninitialized', instead of 0.
19077 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19078 * src/lex.c (lex): Adjust.
19079
19080 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19081 Number it 0.
19082 Let yylex return it instead of a plain 0.
19083 Reported by Dick Streefland.
19084
cd5aafcf
AD
190852001-11-02 Akim Demaille <akim@epita.fr>
19086
19087 * tests/regression.at (Mixing %token styles): New test.
19088
037ca2f1
AD
190892001-11-02 Akim Demaille <akim@epita.fr>
19090
19091 * src/reader.c (parse_thong_decl): Formatting changes.
19092 (token_translations_init): New, extracted from...
19093 (packsymbols): Here.
19094 Adjust.
19095
270a173c
AD
190962001-11-01 Akim Demaille <akim@epita.fr>
19097
19098 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19099 Check that `9foo.y' produces correct cpp guards.
19100 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19101 guards.
19102 Reported by Wwp.
19103
561f9a30
AD
191042001-11-01 Akim Demaille <akim@epita.fr>
19105
19106 * tests/regression.at (Invalid input: 2): New.
19107 * src/lex.c (unlexed_token_buffer): New.
19108 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19109 too.
19110 Reported by Wwp.
19111
f987e9d2
AD
191122001-11-01 Akim Demaille <akim@epita.fr>
19113
19114 * tests/calc.at: Catch up with 1.30.
19115 * configure.in: Bump to 1.49a.
19116 Adjust to newer Autotest.
19117
0846f581
PB
191182001-10-19 Pascal Bart <pascal.bart@epita.fr>
19119
19120 * src/conflicts.c: Move global variables rrc_total and src_total ...
19121 (print_conflicts): here.
19122 * src/output.c (output): Free global variable user_toknums.
19123 * src/lex.c (token_obstack): Become static.
19124
3c1a79b3
AD
191252001-10-18 Akim Demaille <akim@epita.fr>
19126
19127 * tests/atlocal.in (GCC): Add.
19128 * tests/calc.at: s/m4_match/m4_bmatch/.
19129 s/m4_patsubst/m4_bpatsubst/.
19130 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19131 * configure.in: AC_SUBST(GCC).
19132
5d52e7d0
MA
191332001-10-14 Marc Autret <autret_m@epita.fr>
19134
19135 * src/options.c (create_long_option_table): Fix.
19136
631aa1d3
AD
191372001-10-10 Akim Demaille <akim@epita.fr>
19138
19139 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19140
f6ec6d13
AD
191412001-10-04 Akim Demaille <akim@epita.fr>
19142
19143 * src/reader.c (parse_union_decl): Push the caracters in
19144 union_obstack, not attrs_obstack.
19145
342b8b6e
AD
191462001-10-04 Akim Demaille <akim@epita.fr>
19147
19148 Merge in the branch 1.29.
19149
19150 * src/reader.c (packsymbols): Use a temporary obstack for
19151 `%%tokendef', since output_stack is already used elsewhere.
19152
19153 2001-10-02 Akim Demaille <akim@epita.fr>
19154
19155 Bump 1.29d.
19156
19157 2001-10-02 Akim Demaille <akim@epita.fr>
19158
19159 Version 1.29c.
19160
19161 2001-10-02 Akim Demaille <akim@epita.fr>
19162
19163 * tests/regression.at (Invalid CPP headers): New.
19164 From Alexander Belopolsky.
19165 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19166
19167 2001-10-02 Akim Demaille <akim@epita.fr>
19168
19169 * tests/regression.at (Invalid input): New.
19170 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19171 Reported by Shura.
19172
19173 2001-10-02 Akim Demaille <akim@epita.fr>
19174
19175 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19176
19177 2001-10-02 Akim Demaille <akim@epita.fr>
19178
19179 * src/output.c (output_parser): Assert `skeleton'.
19180 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19181 systems.
19182 From Shura.
19183
19184 2001-10-01 Marc Autret <autret_m@epita.fr>
19185
19186 * src/lex.h: Echo modifications.
19187 * src/lex.c (unlex): Parameter is now token_t.
19188 From Hans Aberg.
19189
19190 2001-10-01 Marc Autret <autret_m@epita.fr>
19191
19192 * src/main.c: Include lex.h.
19193 From Hans Aberg.
19194
19195 2001-09-29 Akim Demaille <akim@epita.fr>
19196
19197 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19198
19199 2001-09-28 Akim Demaille <akim@epita.fr>
19200
19201 * tests/testsuite.at: Update to newer Autotest.
19202 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19203
19204 2001-09-27 Akim Demaille <akim@epita.fr>
19205
19206 Position independent wrapper.
19207
19208 * tests/bison: Remove.
19209 * tests/bison.in: New.
19210 * configure.in: Adjust.
19211
19212 2001-09-27 Paul Eggert <eggert@twinsun.com>
19213
19214 Port quotearg fixes from tar 1.13.24.
19215
19216 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19217 tm to be declared.
19218 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19219 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19220
19221 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19222 * m4/mbrtowc.m4: New file.
19223 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19224 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19225
19226 2001-09-27 Akim Demaille <akim@epita.fr>
19227
19228 Bump to 1.29c.
19229
19230 2001-09-27 Akim Demaille <akim@epita.fr>
19231
19232 Version 1.29b.
19233
19234 2001-09-25 Akim Demaille <akim@epita.fr>
19235
19236 * src/system.h: Include `xalloc.h'.
19237 Remove it from the C files.
19238 * src/files.c (output_files): Free the obstacks.
19239 * src/lex.c (init_lex): Rename as...
19240 (lex_init): this.
19241 (lex_free): New.
19242 * src/main.c (main): Use it.
19243
19244 2001-09-24 Marc Autret <autret_m@epita.fr>
19245
19246 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19247 to output informations in fout (FILE*).
19248 (open_graph, close_graph): Likewise.
19249 (output_graph, output_edge, output_node): Likewise.
19250 * src/vcg.h: Update function prototypes.
19251 * src/print_graph.c (print_graph): Open output graph file.
19252 (print_actions): Adjust.
19253 * src/files.h: Remove extern declaration.
19254 * src/files.c: Remove graph_obstack declaration.
19255 (open_files): Remove graph_obstack initialization.
19256 (output_files): Remove graph_obstack saving.
19257
19258 2001-09-24 Marc Autret <autret_m@epita.fr>
19259
19260 * src/files.c (compute_output_file_names): Fix.
19261
19262 2001-09-24 Marc Autret <autret_m@epita.fr>,
19263 Akim Demaille <akim@epita.fr>
19264
19265 * src/reader.c (reader): Remove call to free_symtab ().
19266 * src/main.c (main): Call it here.
19267 Include symtab.h.
19268 * src/conflicts.c (initialize_conflicts): Rename as...
19269 (solve_conflicts): this.
19270 * src/print.c (print_core, print_actions, print_state)
19271 (print_grammar): Dump to a file instead a `output_obstack'.
19272 (print_results): Dump `output_obstack', and then proceed with the
19273 FILE *.
19274 * src/files.c (compute_output_file_names, close_files): New.
19275 (output_files): Adjust.
19276 * src/main.c (main): Adjust.
19277
19278 2001-09-23 Marc Autret <autret_m@epita.fr>
19279
19280 * src/files.c (compute_header_macro): Computes header macro name
19281 from spec_defines_file when given.
19282
19283 2001-09-23 Marc Autret <autret_m@epita.fr>
19284
19285 * src/files.c (output_files): Add default extensions.
19286
19287 2001-09-22 Akim Demaille <akim@epita.fr>
19288
19289 * src/conflicts.c (finalize_conflicts): Rename as...
19290 (free_conflicts): this.
19291
19292 2001-09-22 Akim Demaille <akim@epita.fr>
19293
19294 * src/gram.c (gram_free): Rename back as...
19295 (dummy): this.
19296 (output_token_translations): Free `token_translations'.
19297 * src/symtab.c (free_symtab): Free the tag field.
19298
19299 2001-09-22 Akim Demaille <akim@epita.fr>
19300
19301 Remove `translations' as it is always set to true.
19302
19303 * src/gram.h: Adjust.
19304 * src/reader.c (packsymbols, parse_token_decl): Adjust
19305 * src/print.c (print_grammar): Adjust.
19306 * src/output.c (output_token_translations): Adjust.
19307 * src/lex.c (lex): Adjust.
19308 * src/gram.c: Be sure the set pointers to NULL.
19309 (dummy): Rename as...
19310 (gram_free): this.
19311
19312 2001-09-22 Akim Demaille <akim@epita.fr>
19313
19314 * configure.in: Invoke AM_LIB_DMALLOC.
19315 * src/system.h: Use dmalloc.
19316 * src/LR0.c: Be sure to have pointers initialized to NULL.
19317 (allocate_itemsets): Allocate kernel_items only if needed.
19318
19319 2001-09-22 Akim Demaille <akim@epita.fr>
19320
19321 * configure.in: Bump to 1.29b.
19322 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19323 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19324 need xmalloc.c in calc.y.
19325 From Pascal Bart.
19326
19327 2001-09-21 Akim Demaille <akim@epita.fr>
19328
19329 Version 1.29a.
19330 * Makefile.maint, config/config.guess, config/config.sub,
19331 * config/missing: Update from masters.
19332 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19333 upon package.m4.
19334 * configure.in (ALL_LINGUAS): Add `tr'.
19335
19336 2001-09-21 Akim Demaille <akim@epita.fr>
19337
19338 * tests/Makefile.am (package.m4): Move to...
19339 ($(srcdir)/$(TESTSUITE)): here.
19340
19341 2001-09-20 Akim Demaille <akim@epita.fr>
19342
19343 * src/complain.c: No longer try to be standalone: use system.h.
19344 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19345 * src/complain.h: Likewise.
19346 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19347 Remove the unused variable `n'.
19348 From Albert Chin-A-Young.
19349
19350 2001-09-18 Marc Autret <autret_m@epita.fr>
19351
19352 * doc/bison.1: Update.
19353 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19354 descriptions.
19355 (Option Cross Key): Update.
19356 Add --graph.
19357
19358 2001-09-18 Marc Autret <autret_m@epita.fr>
19359
19360 * tests/regression.at: New test (comment in %union).
19361
19362 2001-09-18 Marc Autret <autret_m@epita.fr>
19363
19364 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19365 do that.
19366 Reported by Keith Browne.
19367
19368 2001-09-18 Marc Autret <autret_m@epita.fr>
19369
19370 * tests/output.at: Add tests for --defines and --graph.
19371
19372 2001-09-18 Marc Autret <autret_m@epita.fr>
19373
19374 * tests/output.at: Removes tests of %{header,src}_extension features.
19375
19376 2001-09-18 Akim Demaille <akim@epita.fr>
19377
19378 * tests/Makefile.am (package.m4): New.
19379 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19380 (_AT_CHECK_CALC_ERROR): Likewise.
19381 Factor the `, ' part of verbose error messages.
19382
19383 2001-09-18 Marc Autret <autret_m@epita.fr>
19384
19385 * src/getargs.c (longopts): Declare --defines and --graph as options
19386 with optional arguments.
19387 * src/files.h: Add extern declarations.
19388 * src/files.c (spec_graph_file, spec_defines_file): New.
19389 (output_files): Update.
19390 Remove CPP-outed code.
19391
19392 2001-09-18 Marc Autret <autret_m@epita.fr>
19393
19394 Turn off %{source,header}_extension feature.
19395
19396 * src/files.c (compute_exts_from_gf): Update.
19397 (compute_exts_from_src): Update.
19398 (output_files): CPP-out useless code.
19399 * src/files.h: Remove {header,source}_extension extern declarations.
19400 * src/reader.c (parse_dquoted_param): CPP-out.
19401 (parse_header_extension_decl): Remove.
19402 (parse_source_extension_decl): Remove.
19403 (read_declarations): Remove cases tok_{hdrext,srcext}.
19404 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19405 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19406
19407 2001-09-10 Akim Demaille <akim@epita.fr>
19408
19409 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19410 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19411 (AT_CHECK_OUTPUT): this.
19412 Merely check ls' exit status, its output is useless.
19413
19414 2001-09-10 Akim Demaille <akim@epita.fr>
19415
19416 * tests/calc.at: Use m4_match.
19417 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19418
19419 2001-09-10 Marc Autret <autret_m@epita.fr>,
19420 Akim Demaille <akim@epita.fr>
19421
19422 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19423 enum color_e.
19424 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19425 to `normal'.
19426 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19427 * src/lex.h: Adjust prototype.
19428 (token_t): Add `tok_undef'.
19429 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19430 (parse_percent_token): Now returns token_t.
19431 Add default statement in switch.
19432 (lex): Separate `c' as an input variable, from the token_t result
19433 part.
19434 (unlexed): Is a token_t.
19435
19436 2001-09-10 Akim Demaille <akim@epita.fr>
19437
19438 * configure.in: Bump to 1.29a.
19439
19440 2001-09-07 Akim Demaille <akim@epita.fr>
19441
19442 Version 1.29.
19443
19444 2001-08-30 Akim Demaille <akim@epita.fr>
19445
19446 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19447 * m4/atconfig.m4: Remove.
19448 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19449 * tests/bison: New.
19450 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19451 m4_if, m4_patsubst, and m4_regexp.
19452 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19453 `input' file instead of echo.
19454
19455 2001-08-29 Akim Demaille <akim@epita.fr>
19456
19457 Bump to 1.28e.
19458
19459 2001-08-29 Akim Demaille <akim@epita.fr>
19460
19461 Version 1.28d.
19462
19463 2001-08-29 Paul Eggert <eggert@twinsun.com>
19464
19465 * src/bison.simple (yyparse): Don't take the address of an
19466 item before the start of an array, as that doesn't conform to
19467 the C Standard.
19468
19469 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19470
19471 * doc/bison.texinfo (Location Tracking Calc): New node.
19472
19473 2001-08-29 Paul Eggert <eggert@twinsun.com>
19474
19475 * src/output.c (output): Do not define const, as this now
19476 causes more problems than it cures.
19477
19478 2001-08-29 Akim Demaille <akim@epita.fr>
19479
19480 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19481 the nodes.
19482 Be sure to tag the `detailmenu'.
19483
19484 2001-08-29 Akim Demaille <akim@epita.fr>
19485
19486 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19487 download in a tmp dir.
19488
19489 2001-08-28 Marc Autret <autret_m@epita.fr>
19490
19491 * config/depcomp: New file.
19492
19493 2001-08-28 Marc Autret <autret_m@epita.fr>
19494
19495 * doc/bison.1 (mandoc): Adjust.
19496 From Juan Manuel Guerrero.
19497
19498 2001-08-28 Marc Autret <autret_m@epita.fr>
19499
19500 * src/print_graph.c (print_state): Fix.
19501
19502 2001-08-27 Marc Autret <autret_m@epita.fr>
19503
19504 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19505 char * members.
19506 Echo modifications to the functions prototypes.
19507 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19508
19509 2001-08-27 Marc Autret <autret_m@epita.fr>
19510
19511 * src/vcg.c: Include `xalloc.h'.
19512 (add_colorentry): New.
19513 (add_classname): New.
19514 (add_infoname): New.
19515 * src/vcg.h: Add new prototypes.
19516
19517 2001-08-27 Akim Demaille <akim@epita.fr>
19518
19519 * Makefile.maint: Sync. again with CVS Autoconf.
19520
19521 2001-08-27 Akim Demaille <akim@epita.fr>
19522
19523 * Makefile.maint: Formatting changes.
19524 (po-update, cvs-update, update): New targets.
19525 (AMTAR): Remove.
19526
19527 2001-08-27 Akim Demaille <akim@epita.fr>
19528
19529 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19530 * Makefile.maint: Sync. with CVS Autoconf.
19531
19532 2001-08-27 Marc Autret <autret_m@epita.fr>
19533
19534 * src/vcg.h (struct infoname_s): New.
19535 (struct colorentry_s): New.
19536 (graph_s): New fields {vertical,horizontal}_order in structure.
19537 Add `infoname' field.
19538 Add `colorentry' field;
19539 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19540 (G_HORIZONTAL_ORDER): New.
19541 (G_INFONAME): New.
19542 (G_COLORENTRY): New.
19543 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19544 Add output of `infoname'.
19545 Add output of `colorentry'.
19546
19547 2001-08-27 Marc Autret <autret_m@epita.fr>
19548
19549 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19550 This one shadowed a global parameter.
19551
19552 2001-08-24 Marc Autret <autret_m@epita.fr>
19553
19554 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19555 instead of `unsigned'.
19556 (print_state): Do not call obstack_object_size () in obstack_grow ()
19557 to avoid macro variables shadowing.
19558
19559 2001-08-23 Marc Autret <autret_m@epita.fr>
19560
19561 * src/lex.c (percent_table): Typo: s/naem/name/.
19562 Add graph option.
19563 Normalize new options declarations.
19564
19565 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19566
19567 * tests/suite.at: Exercise %header_extension and %source_extension.
19568
19569 2001-08-16 Marc Autret <autret_m@epita.fr>
19570
19571 * src/reader.c (parse_dquoted_param): New.
19572 (parse_header_extension_decl): Use it.
19573 (parse_source_extension_decl): Likewise.
19574
19575 2001-08-16 Marc Autret <autret_m@epita.fr>
19576
19577 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19578 (get_xxxx_str): Use assert () instead of complain ().
19579 Remove return invokations in default cases.
19580 (get_decision_str): Modify default behaviour. Remove second argument.
19581 Echo modifications on calls.
19582 (output_graph): Fix.
19583
19584 2001-08-16 Marc Autret <autret_m@epita.fr>
19585
19586 * src/getargs.c (usage): Update with ``-g, --graph''.
19587
19588 2001-08-16 Marc Autret <autret_m@epita.fr>
19589
19590 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19591 (Option Cross Key): Likewise.
19592 * doc/bison.1: Update.
19593
1c8c2190
PB
195942001-09-25 Pascal Bart <pascal.bart@epita.fr>
19595
19596 * src/output.c (output_master_parser): Don't finish action_obstack.
19597 (output_parser): Don't care about the muscle action, here.
19598 (prepare): Copy the action_obstack in the action muscle.
19599 (output): Free action_obstack.
19600
180d45ba
PB
196012001-09-23 Pascal Bart <pascal.bart@epita.fr>
19602
19603 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19604 will contain `%union' declaration.
19605 (parse_union_decl): Delete #line directive output.
19606 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19607 informations about %union.
19608 (parse_union_decl): Copy the union_obstack in the muscle stype.
19609 * src/bison.simple: Add new #line directive.
19610 Add typdef %%stype YYSTYPE.
19611
c51d1a19
PB
196122001-09-23 Pascal Bart <pascal.bart@epita.fr>
19613
19614 * src/bison.simple: Add new `#line' directive.
19615
6f9344da
PB
196162001-09-22 Pascal Bart <pascal.bart@epita.fr>
19617
19618 * src/bison.simple: New `#line' directive.
19619 * src/output.c (output_parser): Support new dynamic muscle input_line.
19620
652def80
MA
196212001-09-22 Marc Autret <autret_m@epita.fr>
19622
19623 * src/output.c (output_master_parser): New.
19624 (output_parser): Be more re-entrant.
19625
25b222fa
MA
196262001-09-21 Marc Autret <autret_m@epita.fr>
19627
19628 * src/reader.c (copy_definition, parse_union_decl): Update and use
19629 `linef' muscle.
19630 (copy_action): Likewise.
19631 Use obstack_1grow ().
19632 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19633
6bc35ae5
MA
196342001-09-21 Marc Autret <autret_m@epita.fr>
19635
19636 * src/options.c (option_table): Adjust.
19637 * src/lex.c (parse_percent_token): Fix.
19638
c0629aa1
PB
196392001-09-20 Pascal Bart <pascal.bart@epita.fr>
19640
19641 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 19642
82b6d266
PB
196432001-09-20 Pascal Bart <pascal.bart@epita.fr>
19644
19645 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19646 is now an option_table_struct*.
19647 (option_strcmp): New function option_strcmp.
19648 (parse_percent_token): Call option_strcmp.
19649 * src/getargs.c (xalloc.h, options.h): Include it.
19650 (getargs): Call create_long_option_table.
19651 (getargs): Free longopts at the end of the function.
19652 (shortopts): Move in options.c.
19653 * src/options.c (create_long_option_table): New function. Convert
19654 information from option_table to option structure.
19655 * src/reader.c (options.h): Include it.
19656
19657 * src/Makefile.am: Adjust.
19658 * src/options.c (option_table): Create from longopts and percent_table.
19659 * src/getargs.c (longopts): Delete.
19660 * src/lex.c (struct percent_table_struct): Delete.
19661 (percent_table): Delete.
19662 (options.h): Include it.
19663 * src/options.c: Create.
19664 * src/options.h: Create.
19665 Declare enum opt_access_e.
19666 Define struct option_table_struct.
19667
75f5aaea
MA
196682001-09-20 Marc Autret <autret_m@epita.fr>
19669
19670 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19671 sections of Bison.
19672
f508cb0a
PB
196732001-09-19 Pascal Bart <pascal.bart@epita.fr>
19674
19675 * src/bison.simple: s/%%filename/%%skeleton.
19676 * src/muscle_tab.c (getargs.h): Include it.
19677 (muscle_init): Insert new muscle skeleton.
19678
13105fc1
PB
196792001-09-18 Pascal Bart <pascal.bart@epita.fr>
19680
19681 * src/output.c (output_parser): Delete unused variable actions_dumped.
19682
b0c4483e
PB
196832001-09-07 Pascal Bart <pascal.bart@epita.fr>
19684
19685 * src/output.c (output): Delete call to reader_output_yylsp.
19686 * src/reader.c (reader): Likewise.
ba0fe3c7 19687 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 19688
11d82f03
MA
196892001-09-02 Marc Autret <autret_m@epita.fr>
19690
19691 * src/reader.c: Include muscle_tab.h.
19692 (parse_union_decl): Update.
19693 (parse_macro_decl): Rename parse_muscle_decl.
19694 Update to use renamed functions and variable.
19695 (read_declarations, copy_action, read_additionnal_code, : Updated
19696 with correct variables and functions names.
19697 (packsymbols, reader): Likewise.
342b8b6e 19698
11d82f03 19699 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 19700
11d82f03
MA
19701 * src/output.c: Include muscle_tab.h
19702 In all functions using macro_insert, change by using muscle_insert ().
19703 (macro_obstack): Rename muscle_obstack.
19704 Echo modifications in the whole file.
19705 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19706 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19707 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19708
19709 * src/muscle_tab.h: Update double inclusion macros.
19710 (macro_entry_s): Rename muscle_entry_s.
19711 Update prototypes.
342b8b6e 19712
11d82f03
MA
19713 * src/muscle_tab.c: Include muscle_tab.h.
19714 Rename macro_tabble to muscle_table.
19715 (mhash1, mhash2, mcmp): Use muscle_entry.
19716 (macro_init): Rename muscle_init. Update.
19717 (macro_insert): Rename muscle_insert. Update.
19718 (macro_find): Rename muscle_find. Update.
19719
19720 * src/main.c: Include muscle_tab.h.
19721 (main): Call muscle_init ().
19722 * src/Makefile.am (bison_SOURCES): Echo modifications.
19723
93a37297
MA
197242001-09-02 Marc Autret <autret_m@epita.fr>
19725
f753cd62 19726 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 19727
f753cd62
MA
19728 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19729
197302001-09-02 Marc Autret <autret_m@epita.fr>
19731
19732 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 19733
682d48cd
PB
197342001-09-01 Pascal Bart <pascal.bart@epita.fr>
19735
342b8b6e 19736 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
19737 filename.
19738
087c8fda
MA
197392001-09-01 Marc Autret <autret_m@epita.fr>
19740
19741 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19742 to an explicit value to activate the feature. We do it here.
19743
dda680cb
PB
197442001-08-31 Pascal Bart <pascal.bart@epita.fr>
19745
19746 * src/output.c (prepare): Delete the `filename' muscule insertion.
19747 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19748 (parse_union_decl): Likewise.
19749 * src/macrotab.c (macro_init): Initialize filename by infile.
19750
9e644e64
MA
197512001-08-31 Marc Autret <autret_m@epita.fr>
19752
19753 * src/bison.simple (YYLSP_NEEDED): New definition.
19754 * src/output.c (prepare): Add macro insertion of `locations_flag'
19755
17da6427
PB
197562001-08-31 Pascal Bart <pascal.bart@epita.fr>
19757
19758 * src/output.c (prepare): Delete insertion of previous muscles,
19759 and insert the `prefix' muscles.
19760 * src/macrotab.c (macro_init): Likewise.
19761 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 19762 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
19763 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19764 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 19765 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
19766 name_prefix.
19767
e8cb70b9
PB
197682001-08-31 Pascal Bart <pascal.bart@epita.fr>
19769
19770 * src/main.c (main): Standardize.
19771 * src/output.c (output_table_data, output_parser): Likewise.
19772 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19773
63c2d5de
MA
197742001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19775
342b8b6e 19776 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
19777 %%epilogue.
19778 * src/output.c (output): Rename %%declarations to %%prologue.
19779 * src/bison.simple: Echo modifications.
342b8b6e 19780
d8cb5183
MA
197812001-08-31 Marc Autret <autret_m@epita.fr>
19782
19783 * src/reader.c (readgram): CleanUp.
19784 (output_token_defines): Likewise.
19785 (packsymbols): Likewise.
19786 (reader): Likewise.
19787 * src/output.c (output): CPP-out useless code.
19788
6c686258
PB
197892001-08-31 Pascal Bart <pascal.bart@epita.fr>
19790
342b8b6e 19791 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
19792 output_trailers and output_headers.
19793 * src/output.h: Remove obsolete functions prototypes of output_headers
19794 and output_trailers.
19795
8f451ef7
PB
197962001-08-30 Pascal Bart <pascal.bart@epita.fr>
19797
19798 * src/main.c: Include macrotab.h.
342b8b6e 19799 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
19800 Adjust functions prototypes.
19801 * src/macrotab.c (macro_insert): Constify key and value.
19802 (macro_find): Constify key.
19803 (macro_insert): Include 'xalloc.h'
19804 (macro_insert): Use XMALLOC.
19805 (macro_find): Constify return value.
19806 * src/output.c (output_table_data): Rename table to table_data.
19807 (output_parser): Constify macro_key, macro_value.
19808
997b6fd0 198092001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
19810
19811 * src/reader.c (parse_skel_decl): New.
342b8b6e 19812 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
19813 * src/lex.h (token_t): New token `tok_skel'.
19814 * src/lex.c (percent_table): Add skeleton option entry.
19815 Standardize.
19816
ff48177d
MA
198172001-08-29 Marc Autret <autret_m@epita.fr>
19818
19819 * src/bison.simple: Add %%user_code directive at the end.
19820 * src/reader.c (read_additionnal_code): New.
19821 (reader): Use it.
19822 * src/output.c (output_program): Remove.
19823 (output): Update.
19824
b33160bf
MA
198252001-08-28 Marc Autret <autret_m@epita.fr>
19826
19827 * src/output.c (output_actions): Clean up.
4e5caae2 19828 (output_gram): CPP-out useless code.
b33160bf
MA
19829 * src/reader.c (reader): Clean up, CPP-out useless code.
19830
d1a2daf7
PB
198312001-08-28 Pascal Bart <pascal.bart@epita.fr>
19832
342b8b6e 19833 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 19834 directive.
d1a2daf7
PB
19835 * src/bison.simple: Add `%%definitions'.
19836
2b763dfe
MA
198372001-08-28 Marc Autret <autret_m@epita.fr>
19838
19839 * config/depcomp: New file.
19840
f1a87ef6
PE
198412001-08-27 Paul Eggert <eggert@twinsun.com>
19842
19843 * src/bison.simple (yyparse): Don't take the address of an
19844 item before the start of an array, as that doesn't conform to
19845 the C Standard.
19846
82e236e2
RA
198472001-08-27 Robert Anisko <robert.anisko@epita.fr>
19848
f1a87ef6 19849 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
19850 obstack. It was done too late here.
19851
19852 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19853 completely wrong.
19854 (reader): Initialize the macro obstack here, since we need it to grow
19855 '%define' directives.
19856
19857 * src/reader.h: Declare the macro obstack as extern.
19858
b0cfa28a
RA
198592001-08-27 Robert Anisko <robert.anisko@epita.fr>
19860
19861 * src/output.c (output_parser): Fix. Store single '%' characters in
19862 the output obstack instead of throwing them away.
19863
6fc74234
AD
198642001-08-27 Akim Demaille <akim@epita.fr>
19865
19866 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19867
9c76d118
RA
198682001-08-25 Robert Anisko <robert.anisko@epita.fr>
19869
19870 * lib/Makefile.am: Adjust.
19871
a8289c62
RA
198722001-08-25 Robert Anisko <robert.anisko@epita.fr>
19873
19874 * src/bison.simple: Update and add '%%' directives.
19875
b6610515
RA
198762001-08-25 Robert Anisko <robert.anisko@epita.fr>
19877
19878 * src/reader.c (reader): Remove calls to 'output_headers' and
19879 'output_trailers'. Remove some C output.
19880 (readgram): Disable a piece of code that was writing a default
19881 definition for 'YYSTYPE'.
19882 (reader_output_yylsp): Remove.
19883 (packsymbols): Output token defintions to a macro.
19884 (copy_definition): Disable C output.
6fc74234 19885
b6610515
RA
19886 * src/reader.c (parse_macro_decl): New function used to parse macro
19887 declarations.
19888 (copy_string2): Put the body of copy_string into this new function.
19889 Add a parameter to let the caller choose whether he wants to copy the
19890 string delimiters or not.
19891 (copy_string): Be a simple call to copy_string2 with the last argument
19892 bound to true.
19893 (read_declarations): Add case for macro definition.
19894 (copy_identifier): New.
6fc74234 19895 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
19896 rather than lex.
19897
26f609ff
RA
198982001-08-25 Robert Anisko <robert.anisko@epita.fr>
19899
19900 * src/output.c (prepare): Add prefixed names.
19901 (output_parser): Output semantic actions.
19902 (output_parser): Fix bug on '%%line' directives.
6fc74234 19903
26f609ff
RA
19904 * src/output.c (output_headers): Remove. The C code printed by this
19905 function should now be in the skeletons.
19906 (output_trailers): Remove.
19907 (output): Disable call to 'reader_output_yylsp'.
19908 (output_rule_data): Do not output tables to the table obstack.
19909
19910 * src/output.c: Remove some C dedicated output.
19911 Improve the use of macro and output obstacks.
19912 (output_defines): Remove.
6fc74234 19913
26f609ff
RA
19914 * src/output.c (output_token_translations): Associate 'translate'
19915 table with a macro. No output to the table obstack.
19916 (output_gram): Same for 'rhs' and 'prhs'.
19917 (output_stos): Same for 'stos'.
19918 (output_rule_data): Same for 'r1' and 'r2'.
19919 (token_actions): Same for 'defact'.
19920 (goto_actions): Same for 'defgoto'.
19921 (output_base): Same for 'pact' and 'pgoto'.
19922 (output_table): Same for 'table'.
19923 (output_check): Same for 'check'.
6fc74234 19924
26f609ff
RA
19925 * src/output.c (output_table_data): New function.
19926 (output_short_table): Remove.
19927 (output_short_or_char_table): Remove.
6fc74234 19928
26f609ff
RA
19929 * src/output.c (output_parser): Replace most of the skeleton copy code
19930 with something new. Skeletons are now processed character by character
19931 rather than line by line, and Bison looks for '%%' macros. This is the
19932 first step in making Bison's output process (a lot) more flexible.
19933 (output_parser): Use the macro table.
19934
6f43b113
RA
199352001-08-25 Robert Anisko <robert.anisko@epita.fr>
19936
19937 * src/main.c (main): Initialize the macro table.
19938
dd3127cf
RA
199392001-08-25 Robert Anisko <robert.anisko@epita.fr>
19940
19941 * src/lex.c (percent_table): Add tok_define.
19942 * src/lex.h: Add tok_define.
19943
aa321494
RA
199442001-08-25 Robert Anisko <robert.anisko@epita.fr>
19945
19946 * src/macrotab.c: New file.
19947 * src/macrotab.h: New file.
19948 * src/Makefile.am: Update.
19949
68bd3b6b
RA
199502001-08-25 Robert Anisko <robert.anisko@epita.fr>
19951
19952 * lib/hash.c: New file.
19953 * lib/hash.h: New file.
19954 * lib/Makefile.am: Update.
19955
45f8dd1e
AD
199562001-08-15 Akim Demaille <akim@epita.fr>
19957
19958 Version 1.28c.
19959
40a64a7a 199602001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
19961
19962 * src/reader.c (readgram): Indent output macro YYSTYPE.
19963 (packsymbols): Likewise.
19964 (output_token_defines): Likewise.
19965 * src/files.c: Standardize.
19966 (compute_header_macro): New.
19967 (defines_obstack_save): New. Use compute_header_macro.
19968 (output_files): Update. Use defines_obstack_save.
19969
f9a8293a
AD
199702001-08-15 Akim Demaille <akim@epita.fr>
19971
19972 * doc/bison.texinfo (Table of Symbols): Document
19973 YYSTACK_USE_ALLOCA.
19974
150ca7a7
AD
199752001-08-15 Akim Demaille <akim@epita.fr>
19976
19977 * missing: Update from CVS Automake.
19978 * config/config.guess, config/config.sub, config/texinfo.tex:
19979 Update from gnu.org.
19980
69b5cec4
AD
199812001-08-15 Akim Demaille <akim@epita.fr>
19982
19983 * Makefile.maint: Sync with CVS Autoconf.
19984
f2b5126e
PB
199852001-08-14 Pascal Bart <pascal.bart@epita.fr>
19986
69b5cec4 19987 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
19988 `fdl.texi'.
19989 * doc/fdl.texi: Add to package.
19990
4ecbf796
MA
199912001-08-14 Marc Autret <autret_m@epita.fr>
19992
19993 Turn on %{source,header}_extension features.
19994
69b5cec4 19995 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
19996 source_extension.
19997 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 19998 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
19999 between options.
20000
95fb5662
MA
200012001-08-14 Marc Autret <autret_m@epita.fr>
20002
20003 * src/files.c (compute_base_names): Add extensions computing when
20004 `--file-prefix' used.
20005 Standardize function calls.
20006
78d09da9
MA
200072001-08-13 Marc Autret <autret_m@epita.fr>
20008
69b5cec4 20009 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
20010 defining it (defined but null disables alloca).
20011
5a009f2c
MA
200122001-08-13 Marc Autret <autret_m@epita.fr>
20013
20014 * src/bison.simple (_yy_memcpy): CPP reformat.
20015
1e41465a
PB
200162001-08-13 Pascal Bart <pascal.bart@epita.fr>
20017
20018 * tests/atconfig.in (CPPFLAGS): Fix.
20019
c67a198d
PB
200202001-08-10 Pascal Bart <pascal.bart@epita.fr>
20021
79282c6c 20022 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
20023 `gpl.texi'.
20024 * doc/gpl.texi: Add to package.
20025
09a6de7e
MA
200262001-08-10 Marc Autret <autret_m@epita.fr>
20027
20028 * src/print_graph.h: Fix.
20029 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20030
b77b9ee0
AD
200312001-08-10 Akim Demaille <akim@epita.fr>
20032
20033 * src/system.h: Provide default declarations for stpcpy, strndup,
20034 and strnlen.
20035
3e259915
MA
200362001-08-10 Robert Anisko <anisko_r@epita.fr>
20037
20038 * doc/bison.texinfo (Locations): Update @$ stuff.
20039
ca96bc2d
MA
200402001-08-09 Robert Anisko <anisko_r@epita.fr>
20041
20042 * src/bison.simple (YYLLOC_DEFAULT): Update.
20043 (yyparse): Adjust.
20044
fdc6758b
MA
200452001-08-08 Marc Autret <autret_m@epita.fr>
20046
b77b9ee0 20047 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
20048 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20049 Reported by Fabrice Bauzac.
957d4dbf 20050
600cad3b
MA
200512001-08-08 Marc Autret <autret_m@epita.fr>
20052
20053 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20054 * src/vcg.c (output_node): Fix.
20055 * src/vcg.h: Cleanup.
20056 * src/print_graph.c: Add comments.
b77b9ee0 20057 (node_output_size): New global variable. Simplify the formatting of
600cad3b 20058 the VCG graph output.
b77b9ee0 20059 (print_actions): Unused code is now used. It notifies the final state
600cad3b 20060 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 20061 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
20062 blue.
20063 Get the current node name and node_obstack by argument.
20064 (node_obstack): New variable.
20065 (print_state): Manage node_obstack.
20066 (print_core): Use node_obstack given by argument.
20067 A node is not only computed here but in print_actions also.
20068 (print_graph): CPP out useless code instead of commenting it.
20069
976e528f
AD
200702001-08-07 Pascal Bart <pascal.bart@epita.fr>
20071
20072 * tests/atconfig.in (CPPFLAGS): Fix.
20073
20e8e5ca
AD
200742001-08-07 Akim Demaille <akim@epita.fr>
20075
20076 * src/print_graph.c (quote): New.
20077 (print_core): Use it.
20078
957d4dbf 200792001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 20080
3e3da797
AD
20081 * src/vcg.c (complain.h): Include it.
20082 Unepitaize `return' invocations.
c4b66126 20083 [NDEBUG] (main): Remove.
79282c6c 20084 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
20085 * src/files.c (open_files): Initialize graph_obstack.
20086 * src/print_graph.c (print_actions): CPP out useless code.
20087 (print_core): Don't output the last `\n' in labels.
20088 Use `quote'.
20089 * src/files.c (output_files): Output the VCG file.
20090 * src/main.c (main): Invoke print_graph ();
3e3da797 20091
957d4dbf 200922001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
20093
20094 Automaton VCG graph output.
20095 Using option ``-g'' or long option ``--graph'', you can generate
20096 a gram_filename.vcg file containing a VCG description of the LALR (1)
20097 automaton of your grammar.
20098
20099 * src/main.c: Call to print_graph() function.
20100 * src/getargs.h: Update.
20101 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20102 (graph_flag): New flag.
20103 (longopts): Update.
20104 (getargs): Add case `g'.
20105 * src/files.c (graph_obstack): New obstack struct.
20106 (open_files): Initialize new obstack.
20107 (output_files): Saves graph_obstack if required.
20108 * src/files.h (graph_obstack): New extern declaration.
20109 * src/Makefile.am: Add new source files.
20110
927c1557 201112001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
20112
20113 * src/print_graph.c, src/print_graph.h (graph): New.
20114 * src/vcg.h: New file.
20115 * src/vcg.c: New file, VCG graph handling.
20116
7333d403
AD
201172001-08-06 Marc Autret <autret_m@epita.fr>
20118
20119 Add of %source_extension and %header_extension which specify
20120 the source or/and the header output file extension.
20121
20122 * src/files.c (compute_base_names): Remove initialisation of
20123 src_extension and header_extension.
20124 (compute_exts_from_gf): Update.
20125 (compute_exts_from_src): Update.
20126 (output_files): Update.
20127 * src/reader.c (parse_header_extension_decl): New.
20128 (parse_source_extension_decl): New.
20129 (read_declarations): New case statements for the new tokens.
20130 * src/lex.c (percent_table): Add entries for %source_extension
20131 and %header_extension.
20132 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20133
84163231
AD
201342001-08-06 Marc Autret <autret_m@epita.fr>
20135
20136 * configure.in: Bump to 1.28c.
20137 * doc/bison.texinfo: Texinfo thingies.
20138
8303fc42
AD
201392001-08-04 Pascal Bart <pascal.bart@epita.fr>
20140
20141 * tests/atconfig.in (CPPFLAGS): Add.
20142 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20143
70a84437
AD
201442001-08-03 Akim Demaille <akim@epita.fr>
20145
20146 Version 1.28b.
20147
2ce10144
AD
201482001-08-03 Akim Demaille <akim@epita.fr>
20149
20150 * tests/Makefile.am (check-local): Ship testsuite.
20151 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20152 Include `string.h'.
20153
1e3e4bc1
AD
201542001-08-03 Akim Demaille <akim@epita.fr>
20155
20156 * configure.in: Try using -Wformat when compiling.
20157
42b45b7f
AD
201582001-08-03 Akim Demaille <akim@epita.fr>
20159
20160 * configure.in: Bump to 1.28b.
20161
8f13fe33
AD
201622001-08-03 Akim Demaille <akim@epita.fr>
20163
20164 * src/complain.c: Adjust strerror_r portability issues.
20165
b37ba92c
AD
201662001-08-03 Akim Demaille <akim@epita.fr>
20167
20168 Version 1.28a.
20169
b0ce6046
AD
201702001-08-03 Akim Demaille <akim@epita.fr>
20171
20172 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20173 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20174 * src/getargs.c: Include complain.h.
20175 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20176 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20177
d01c415b
AD
201782001-08-03 Akim Demaille <akim@epita.fr>
20179
20180 * src/reader.c (readgram): Display hidden chars in error messages.
20181
459dd1a6
AD
201822001-08-03 Akim Demaille <akim@epita.fr>
20183
20184 Update to gettext 0.10.39.
20185
53b74c0c
AD
201862001-08-03 Akim Demaille <akim@epita.fr>
20187
20188 * lib/strspn.c: New.
20189
234a3be3
AD
201902001-08-01 Marc Autret <autret_m@epita.fr>
20191
20192 * doc/bison.texinfo: Update.
20193 * doc/bison.1 (mandoc): Update.
20194 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20195 * src/files.c: Support output files extensions computing.
20196 (src_extension): New static variable.
20197 (header_extension): New static variable.
20198 (tr): New function.
20199 (get_extension_index): New function, gets the index of an extension
20200 filename in a string.
20201 (compute_exts_from_gf): New function, computes extensions from the
20202 grammar file extension.
20203 (compute_exts_from_src): New functions, computes extensions from the
20204 C source file extension, file given by ``-o'' option.
20205 (compute_base_names): Update.
20206 (output_files): Update.
20207
847bf1f5
AD
202082001-08-01 Robert Anisko <anisko_r@epita.fr>
20209
d995fee7 20210 * doc/bison.texi: Document @$.
847bf1f5
AD
20211 (Locations): New section.
20212
d074a105
AD
202132001-07-18 Akim Demaille <akim@epita.fr>
20214
20215 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20216 * config/prev-version.txt, config/move-if-change: New.
20217 * Makefile.am: Adjust.
20218
3419715d
AD
202192001-07-08 Pascal Bart <pascal.bart@epita.fr>
20220
20221 * src/bison.simple (yyparse): Suppress warning `comparaison
20222 between signed and unsigned'.
20223
62ab6972
AD
202242001-07-05 Pascal Bart <pascal.bart@epita.fr>
20225
20226 * src/getargs.h (raw_flag): Remove.
20227 * src/getargs.c: Die on `-r'/`--raw'.
20228 * src/lex.c (parse_percent_token): Die on `%raw'.
20229 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20230 * tests/calc.at: Suppress test with option `--raw'.
20231
1e24cc5b
AD
202322001-07-14 Akim Demaille <akim@epita.fr>
20233
20234 * config/: New.
20235 * configure.in: Require Autoconf 2.50.
20236 Update to gettext 0.10.38.
20237
32dfccf8
AD
202382001-03-16 Akim Demaille <akim@epita.fr>
20239
20240 * doc/bison.texinfo: ANSIfy the examples.
20241
cd5bd6ac
AD
202422001-03-16 Akim Demaille <akim@epita.fr>
20243
20244 * getargs.c (skeleton): New variable.
20245 (longopts): --skeleton is a new option.
20246 (shortopts, getargs): -S is a new option.
20247 * getargs.h: Declare skeleton.
20248 * output.c (output_parser): Use it.
20249
5141b016
AD
202502001-03-16 Akim Demaille <akim@epita.fr>
20251
20252 * m4/strerror_r.m4: New.
20253 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20254 * lib/error.h, lib/error.c: Update.
20255
447992b9
AD
202562001-03-16 Akim Demaille <akim@epita.fr>
20257
20258 * src/getargs.c (longopts): Clean up.
20259
274d42ce
AD
202602001-02-21 Akim Demaille <akim@epita.fr>
20261
20262 * src/reader.c (gensym): `gensym_count' is your own.
20263 Use a static buf to create the symbol name, as token_buffer is no
20264 longer a buffer.
20265
22c821f3
AD
202662001-02-08 Akim Demaille <akim@epita.fr>
20267
20268 * src/conflicts.c (conflict_report): Be sure not to append to res
20269 between two calls, which could happen if both first sprintf were
20270 skipped, but not the first cp += strlen.
20271
18569462
AD
202722001-02-08 Akim Demaille <akim@epita.fr>
20273
20274 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20275 New, from fileutils 4.0.37.
20276 * configure.in: Require Autoconf 2.49c. I took some time before
20277 making this decision. This is the only way out for portability
20278 issues in Bison, it would mean way too much duplicate effort to
20279 import in Bison features implemented in 2.49c since 2.13.
20280 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20281
0d8f3c8a
AD
202822001-02-02 Akim Demaille <akim@epita.fr>
20283
20284 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 20285 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 20286
f17bcd1f
AD
202872001-01-19 Akim Demaille <akim@epita.fr>
20288
20289 Get rid of the ad hoc handling of token_buffer in the scanner: use
20290 the obstacks.
20291
20292 * src/lex.c (token_obstack): New.
20293 (init_lex): Initialize it. No longer call...
20294 (grow_token_buffer): this. Remove it.
20295 Adjust all the places which used it to use the obstack.
20296
511e79b3
AD
202972001-01-19 Akim Demaille <akim@epita.fr>
20298
20299 * src/lex.h: Rename all the tokens:
20300 s/\bENDFILE\b/tok_eof/g;
20301 s/\bIDENTIFIER\b/tok_identifier/g;
20302 etc.
20303 Let them be enums, not #define, to ease debugging.
20304 Adjust all the code.
20305
0d6508ef
AD
203062001-01-18 Akim Demaille <akim@epita.fr>
20307
20308 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20309 * src/lex.c (maxtoken, grow_token_buffer): Static.
20310
6deb4447
AD
203112001-01-18 Akim Demaille <akim@epita.fr>
20312
20313 Since we now use obstacks, more % directives can be enabled.
20314
20315 * src/lex.c (percent_table): Also accept `%yacc',
20316 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20317 `%debug'.
20318 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20319 instead of returning a token.
20320 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20321 * src/reader.c (read_declarations): Adjust.
20322 * src/files.c (open_files): Don't call `compute_base_names', don't
20323 compute `attrsfile' since they depend upon data which might be
20324 *in* the input file now.
20325 (output_files): Do it here.
20326 * src/output.c (output_headers): Document the fact that this patch
20327 introduces a guaranteed SEGV for semantic parsers.
20328 * doc/bison.texinfo: Document them.
20329 * tests/suite.at: Exercise these %options.
20330
ff4423cc
AD
203312000-12-20 Akim Demaille <akim@epita.fr>
20332
20333 Also handle the output file (--verbose) with obstacks.
20334
20335 * files.c (foutput): Remove.
20336 (output_obstack): New.
20337 Adjust all dependencies.
20338 * src/conflicts.c: Return a string.
20339 * src/system.h (obstack_grow_string): Rename as...
20340 (obstack_sgrow): this. Be ready to work with non literals.
20341 (obstack_fgrow4): New.
20342
956dba3a
AD
203432000-12-20 Akim Demaille <akim@epita.fr>
20344
20345 * src/files.c (open_files): Fix the computation of short_base_name
20346 in the case of `-o foo.tab.c'.
20347
337bab46
AD
203482000-12-20 Akim Demaille <akim@epita.fr>
20349
20350 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20351 (copy_dollar): Now that everything uses obstacks, get rid of the
20352 FILE * parameters.
20353
5d3214b8
AD
203542000-12-20 Akim Demaille <akim@epita.fr>
20355
20356 * src/files.c (open_files): Actually the `.output' file is based
20357 on the short_base_name, not base_name.
20358 * tests/suite.at (Checking output file names): Adjust.
20359
29092a57
AD
203602000-12-20 Akim Demaille <akim@epita.fr>
20361
20362 * src/bison.s1: Remove, we now use directly...
20363 * src/bison.simple: this.
20364 * src/Makefile.am: Use pkgdata instead of data.
20365
ea5607fd
AD
203662000-12-20 Akim Demaille <akim@epita.fr>
20367
20368 * src/files.c (guard_obstack): New.
20369 (open_files): Initialize it.
20370 (output_files): Dump it...
20371 * src/files.h: Export it.
20372 * src/reader.c (copy_guard): Use it.
20373
27110317
AD
203742000-12-19 Akim Demaille <akim@epita.fr>
20375
20376 * src/files.c (outfile, defsfile, actfile): Removed as global
20377 vars.
20378 (open_files): Don't compute them.
20379 (output_files): Adjust.
20380 (base_name, short_base_name): Be global.
20381 Adjust dependencies.
20382
19c50364
AD
203832000-12-19 Akim Demaille <akim@epita.fr>
20384
20385 * src/files.c (strsuffix): New.
20386 (stringappend): Be just like strcat but allocate.
20387 (base_names): Eve out from open_files.
20388 Try to simplify the rather hairy computation of base_name and
20389 short_base_name.
20390 (open_files): Use it.
20391 * tests/suite.at (Checking output file names): New test.
20392
573c1d9f
AD
203932000-12-19 Akim Demaille <akim@epita.fr>
20394
20395 * src/system.h (obstack_grow_literal_string): Rename as...
20396 (obstack_grow_string): this.
20397 * src/output.c (output_parser): Recognize `%% actions' instead of
20398 `$'.
20399 * src/bison.s1: s/$/%% actions/.
20400 * src/bison.hairy: Likewise.
20401
ef7ddedd
AD
204022000-12-19 Akim Demaille <akim@epita.fr>
20403
20404 * src/output.c (output_parser): Compute the `#line' lines when
20405 there are.
20406 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20407 Suggested by Hans Aberg.
20408
ff61dabd
AD
204092000-12-19 Akim Demaille <akim@epita.fr>
20410
20411 Let the handling of the skeleton files be local to the procedures
20412 that use it.
20413
20414 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20415 longer static.
20416 (fparser, open_extra_files): Remove.
20417 (open_files, output_files): Don't take care of fparser.
20418 * src/files.h: Adjust.
20419 * src/output.c (output_parser): Open and close the file to the
20420 skeleton.
20421 * src/reader.c (read_declarations): When %semantic_parser, open
20422 fguard.
20423
55b96341
AD
204242000-12-19 Akim Demaille <akim@epita.fr>
20425
20426 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20427 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20428
358c15b7
AD
204292000-12-19 Akim Demaille <akim@epita.fr>
20430
20431 * src/files.c (open_files): Yipee! We no longer need all the code
20432 looking for `/tmp' since we have no tmp file.
20433
7de3329e
AD
204342000-12-19 Akim Demaille <akim@epita.fr>
20435
20436 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20437 New macros.
20438 * src/files.c (open_files): Less dependency on MSDOS etc.
20439
3abcd459
AD
204402000-12-14 Akim Demaille <akim@epita.fr>
20441
20442 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20443 Provide a default definition.
20444 Use it when executing the default @ action.
20445 * src/reader.c (reader_output_yylsp): No longer include
20446 `timestamp' and `text' in the default YYLTYPE.
20447
2a91a95e
AD
204482000-12-12 Akim Demaille <akim@epita.fr>
20449
20450 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20451 (copy_guard): Quote the file names.
20452 Reported by Laurent Mascherpa.
20453
14d3eb9b
AD
204542000-12-12 Akim Demaille <akim@epita.fr>
20455
20456 * src/output.c (output_headers, output_program, output): Be sure
20457 to escape special characters when outputting filenames.
20458 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20459 (output_headers): Don't depend on them, Use ACTSTR.
20460
d7045ec6
AD
204612000-11-17 Akim Demaille <akim@epita.fr>
20462
20463 * lib/obstack.h: Formatting changes.
20464 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20465 prevents type checking.
20466 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20467 cast the value to (void *): assigning a `foo *' to a `void *'
20468 variable is valid.
20469 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20470 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20471 append characters.
20472
6fd54b73
AD
204732000-11-17 Akim Demaille <akim@epita.fr>
20474
20475 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20476 as...
20477 (suite.m4, regression.m4, calc.m4): these.
20478 * tests/atgeneral.m4: Update from CVS Autoconf.
20479
4c50eae6
AD
204802000-11-17 Akim Demaille <akim@epita.fr>
20481
20482 * tests/regression.m4 (%union and --defines): New test,
20483 demonstrating a current bug in the obstack implementation.
20484
a35f64ea
AD
204852000-11-17 Akim Demaille <akim@epita.fr>
20486
20487 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20488 macros.
20489 Use them to declare the variables which are global or local to
20490 `yyparse'.
20491
7de23534
AD
204922000-11-17 Akim Demaille <akim@epita.fr>
20493
20494 * acconfig.h: Remove, no longer used.
20495
aa7815f5
AD
204962000-11-07 Akim Demaille <akim@epita.fr>
20497
20498 * src: s/Copyright (C)/Copyright/g.
20499
5af1f549
AD
205002000-11-07 Akim Demaille <akim@epita.fr>
20501
20502 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20503 defining.
20504 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20505
553e2b22
AD
205062000-11-07 Akim Demaille <akim@epita.fr>
20507
20508 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20509 Merge in a single CPP if/else.
20510
8a4f41d6
AD
205112000-11-07 Akim Demaille <akim@epita.fr>
20512
20513 * src/output.c (output): Remove useless variables.
20514 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20515 argument `data' for consistency with the prototypes.
20516 Qualify it `const'.
20517 (obstack_copy, obstack_copy0): Rename the second argument as
20518 `address' for consistency. Qualify it `const'.
20519 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20520 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20521 `const' their input argument (`data' or `address').
20522 Adjust the corresponding macros to include `const' in casts.
20523
095a3fb5
AD
205242000-11-03 Akim Demaille <akim@epita.fr>
20525
20526 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20527 s/PFILE1/BISON_HAIRY/.
20528 Adjust dependencies.
20529
d1cdce7c
AD
205302000-11-03 Akim Demaille <akim@epita.fr>
20531
090c5ebf 20532 For some reason, this was not applied.
d1cdce7c
AD
20533
20534 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20535 `unlink': it's no longer used.
20536
9311529b
AD
205372000-11-03 Akim Demaille <akim@epita.fr>
20538
20539 * src/files.c (skeleton_find): New function, eved out of...
20540 (open_files, open_extra_files): here.
20541
d8880f69
AD
205422000-11-03 Akim Demaille <akim@epita.fr>
20543
20544 Don't use `atexit'.
20545
20546 * src/files.c (obstack_save): New function.
20547 (done): Rename as...
20548 (output_files): this.
20549 Use `obstack_save'.
20550 * src/main.c (main): Don't use `atexit' to register `done', since
20551 it no longer has to remove tmp files, just call `output_files'
20552 when there are no errors.
20553
0dbb648e
AD
205542000-11-02 Akim Demaille <akim@epita.fr>
20555
20556 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20557 `unlink': it's no longer used.
20558 * src/files.h: Formatting changes.
20559
896fe5c1
AD
205602000-11-02 Akim Demaille <akim@epita.fr>
20561
20562 Remove the last uses of mktemp and unlink/delete.
20563
20564 * src/files.c (fdefines, ftable): Removed.
20565 (defines_ostack, table_obstack): New.
20566 Adjust dependencies of the former into uses of the latter.
20567 * src/output.c (output_short_or_char_table, output_short_table):
20568 Convert to using obstacks.
20569 * src/reader.c (copy_comment2): Accept one FILE * and two
20570 obstacks.
20571 (output_token_defines, reader_output_yylsp): Use obstacks.
20572 * src/system.h (obstack_fgrow3): New.
1f65350a 20573 * po/POTFILES.in: Adjust.
896fe5c1 20574
dd60faec
AD
205752000-11-01 Akim Demaille <akim@epita.fr>
20576
20577 Change each use of `fattrs' into a use of `attrs_obstack'.
20578
20579 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20580 * src/files.c (fattrs): Remove.
20581 (attrs_obstack): New.
20582 Adjust all dependencies.
20583 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20584
8c7ebe49
AD
205852000-11-01 Akim Demaille <akim@epita.fr>
20586
20587 Introduce obstacks.
20588 Change each use of `faction' into a use of `action_obstack'.
20589
20590 * lib/obstack.h, lib/obstack.c: New files.
20591 * src/files.c (faction): Remove.
20592 (action_obstack): New.
20593 Adjust all dependencies.
20594
77aee789
AD
205952000-10-20 Akim Demaille <akim@epita.fr>
20596
20597 * lib/quote.h (PARAMS): New macro. Use it.
20598
43591cec
AD
205992000-10-16 Akim Demaille <akim@epita.fr>
20600
20601 * src/output.c (output_short_or_char_table): New function.
20602 (output_short_table, output_token_translations): Use it.
20603 (goto_actions): Use output_short_table.
20604
1e9798d5
AD
206052000-10-16 Akim Demaille <akim@epita.fr>
20606
20607 * src/symtab.c (bucket_new): New function.
20608 (getsym): Use it.
20609
20610 * src/output.c (output_short_table): New argument to display the
20611 comment associated with the table.
20612 Adjust dependencies.
20613 (output_gram): Use it.
20614 (output_rule_data): Nicer output layout for YYTNAME.
20615
f282676b
AD
206162000-10-16 Akim Demaille <akim@epita.fr>
20617
20618 * src/lex.c (read_typename): New function.
20619 (lex): Use it.
20620 * src/reader.c (copy_dollar): Likewise.
20621
550a72a3
AD
206222000-10-16 Akim Demaille <akim@epita.fr>
20623
20624 * src/reader.c (copy_comment2): Expect the input stream to be on
20625 the `/' which is suspected to open a comment, instead of being
20626 called after `//' or `/*' was read.
20627 (copy_comment, copy_definition, parse_union_decl, copy_action)
20628 (copy_guard): Adjust.
20629
131e2fef
AD
206302000-10-16 Akim Demaille <akim@epita.fr>
20631
20632 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20633 `read_signed_integer'.
20634
79282c5a
AD
206352000-10-16 Akim Demaille <akim@epita.fr>
20636
20637 * src/reader.c (copy_dollar): New function.
20638 (copy_guard, copy_action): Use it.
20639
ff4a34be
AD
206402000-10-16 Akim Demaille <akim@epita.fr>
20641
20642 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20643 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20644 New files, from Fileutils 4.0.27.
20645 * src/main.c (printable_version): Remove.
20646 * src/lex.c, src/reader.c: Use `quote'.
20647
206482000-10-04 Akim Demaille <akim@epita.fr>
20649
20650 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20651
14ded682
AD
206522000-10-04 Akim Demaille <akim@epita.fr>
20653
20654 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20655
8e03724b
AD
206562000-10-04 Akim Demaille <akim@epita.fr>
20657
20658 When a literal string is used to define two different tokens,
20659 `bison -v' segfaults.
20660 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20661
20662 * tests/regression.m4: New file.
20663 Include the core of the sample provided by Piotr Gackiewicz.
20664 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20665 properly.
20666
a9e64249
AD
206672000-10-04 Akim Demaille <akim@epita.fr>
20668
20669 * src/reader.c (parse_expect_decl): Keep `count' within the size
20670 of `buffer'.
20671 From Neil Booth.
20672
da9abf43
AD
206732000-10-02 Paul Eggert <eggert@twinsun.com>
20674
20675 * bison.s1 (yyparse): Assign the default value
20676 unconditionally, to avoid a GCC warning and make the parser a
20677 tad smaller.
20678
c33638bb
AD
206792000-10-02 Akim Demaille <akim@epita.fr>
20680
20681 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20682 options.
20683
444c570a
AD
206842000-10-02 Akim Demaille <akim@epita.fr>
20685
20686 * src/derives.c, src/print.c, src/reduce.c: To ease the
20687 translation, move some `\n' out of the translated strings.
20688
89cab50d
AD
206892000-10-02 Akim Demaille <akim@epita.fr>
20690
20691 The location tracking mechanism is precious for parse error
20692 messages. Nevertheless, it is enabled only when `@n' is used in
20693 the grammar, which is a different issue (you can use it in error
20694 message, but not in the grammar per se). Therefore, there should
20695 be another means to enable it.
20696
20697 * src/getargs.c (getargs): Support `--locations'.
20698 (usage): Report it.
20699 * src/getargs.h (locationsflag): Export it.
20700 * src/lex.c (percent_table): Support `%locations'.
20701 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20702 with `locationsflag'.
20703 * doc/bison.texinfo: Document `--locations' and `%locations'.
20704 Sort the options.
20705 * tests/calc.m4: Test it.
20706
20707 For regularity of the names, replace each
20708 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20709 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20710 In addition replace each `flag' with `_flag'.
20711
d6c2cba0
AD
207122000-10-02 Akim Demaille <akim@epita.fr>
20713
20714 Also test parse error messages, including with YYERROR_VERBOSE.
20715
20716 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20717 associative).
20718 Use it to check the computations.
20719 Use it to check `nonassoc' is honored.
20720 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20721 `--yyerror-verbose'.
20722 (_AT_CHECK_CALC): Adjust to this option.
20723 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20724
5a35a6cb
AD
207252000-10-02 Akim Demaille <akim@epita.fr>
20726
20727 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20728 the latter demonstrates a flaw in the handling of non debugging
20729 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20730 was used in order to simplify:
20731
20732 #if YYDEBUG
20733 if (yydebug)
20734 {
20735 ...
20736 }
20737 #endif
20738
20739 into
20740
20741 if (yydebug)
20742 {
20743 ...
20744 }
20745
20746 unfortunately this leads to a CPP conflict when
20747 `--name-prefix=foo' is used since it produces `#define yydebug
20748 foodebug'.
20749
20750 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20751 (YYDPRINTF): New macro.
20752 Spread its use.
20753 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20754 the bison options.
20755 Also test `--verbose', `--defines' and `--name-prefix'.
20756
71da9eea
AD
207572000-10-02 Akim Demaille <akim@epita.fr>
20758
20759 Improve the readability of the produced parsers.
20760
20761 * src/bison.s1: Formatting changes.
20762 Improve the comment related to the `$' mark.
20763 (yydefault): Don't fall through to `yyresume': `goto' there.
20764 * src/output.c (output_parser): When the `$' is met, skip the end
20765 of its line.
20766 New variable, `number_of_dollar_signs', to check there's exactly
20767 one `$' in the parser skeleton.
20768
95e36146
AD
207692000-10-02 Akim Demaille <akim@epita.fr>
20770
20771 * lib/xstrdup.c: New file, from the fileutils.
20772 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20773 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20774 instead of strlen + xmalloc + strcpy.
20775 * src/symtab.c (copys): Remove, use xstrdup instead.
20776
d7020c20
AD
207772000-10-02 Akim Demaille <akim@epita.fr>
20778
20779 * src/gram.h (associativity): New enum type which replaces the
20780 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20781 `right_assoc', `left_assoc' and `non_assoc'.
20782 Adjust all dependencies.
20783 * src/reader.c: Formatting changes.
20784 (LTYPESTR): Don't define it, use it as a literal in
20785 `reader_output_yylsp'.
20786 * src/symtab.h (symbol_class): New enum type which replaces the
20787 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20788 `sunknown', `stoken and `snterm'.
20789
1916f98e
AD
207902000-10-02 Akim Demaille <akim@epita.fr>
20791
20792 * src/getargs.c (fixed_outfiles): Rename as...
20793 (yaccflag): for consistency and accuracy.
20794 Adjust dependencies.
20795
d7913476
AD
207962000-10-02 Akim Demaille <akim@epita.fr>
20797
20798 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20799 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20800 difficult and introduced a lot of core dump. It turns out that
20801 Bison used an implementation of `xmalloc' based on `calloc', and
20802 at various places it does depend upon the initialization to 0. I
20803 have not tried to isolate the pertinent places, and all the former
20804 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20805 someone should address this issue.
20806
20807 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20808 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20809 files.
20810 Adjust dependencies.
20811 * src/warshall.h: New file.
20812 Propagate.
20813
340ef489
AD
208142000-10-02 Akim Demaille <akim@epita.fr>
20815
20816 Various anti-`extern in *.c' changes.
20817
20818 * src/system.h: Include `assert.h'.
20819
b2ca4022
AD
208202000-10-02 Akim Demaille <akim@epita.fr>
20821
20822 * src/state.h (nstates, final_state, first_state, first_shift)
20823 (first_reduction): Move their exportation from here...
20824 * src/LR0.h: to here.
20825 Adjust dependencies.
20826 * src/getargs.c (statisticsflag): New variable.
20827 Add support for `--statistics'.
20828 Adjust dependencies.
20829
20830 Remove a lot of now useless `extern' statements in most files.
20831
403b315b
AD
208322000-10-02 Akim Demaille <akim@epita.fr>
20833
20834 * src/LR0.h: New file.
20835 Propagate its use.
20836
07a58c13
AD
208372000-10-02 Akim Demaille <akim@epita.fr>
20838
20839 * src/print.h: New file.
20840 Propagate its use.
20841 * src/print.c: Formatting and ordering changes.
20842 (verbose, terse): Replace with...
20843 (print_results): this new function.
20844 Adjust dependencies.
20845
0619caf0
AD
208462000-10-02 Akim Demaille <akim@epita.fr>
20847
20848 * src/conflicts.c (conflict_report): New function.
20849 (conflict_log, verbose_conflict_log): Replace with...
20850 (print_conflicts): this function.
20851 Adjust dependencies.
20852 * src/conflicts.h: New file.
20853 Propagate its inclusion.
20854
3519ec76
AD
208552000-10-02 Akim Demaille <akim@epita.fr>
20856
20857 * src/nullable.h: New file.
20858 Propagate its inclusion.
20859 * src/nullable.c: Formatting changes.
20860
015acc48
AD
208612000-10-02 Akim Demaille <akim@epita.fr>
20862
20863 * src/reduce.h: New file.
20864 Propagate its inclusion.
20865 * src/reduce.c: Topological sort and other formatting changes.
20866 (bool, TRUE, FALSE): Move their definition to...
20867 * src/system.h: here.
20868
8963a27b
AD
208692000-10-02 Akim Demaille <akim@epita.fr>
20870
20871 * src/files.c: Formatting changes.
20872 (tryopen, tryclose, openfiles): Rename as...
20873 (xfopen, xfclose, open_files): this.
20874 (stringappend): static.
20875 * src/files.h: Complete the list of exported symbols.
20876 Propagate its use.
20877
a70083a3
AD
208782000-10-02 Akim Demaille <akim@epita.fr>
20879
20880 * src/reader.h: New file.
20881 Propagate its use instead of tedious list of `extern' and
20882 prototypes.
20883 * src/reader.c: Formatting changes, topological sort,
20884 s/register//.
20885
abadc117
AD
208862000-10-02 Akim Demaille <akim@epita.fr>
20887
20888 * src/lex.h: Prototype `lex.c' exported functions.
20889 * src/reader.c: Adjust.
20890 * src/lex.c: Formatting changes.
20891 (safegetc): Rename as...
20892 (xgetc): this.
20893
720d742f
AD
208942000-10-02 Akim Demaille <akim@epita.fr>
20895
20896 * src/lalr.h: New file.
20897 Propagate its inclusion instead of prototypes and `extern'.
20898 * src/lalr.c: Formatting changes, topological sorting etc.
20899
f2acea59
AD
209002000-10-02 Akim Demaille <akim@epita.fr>
20901
20902 * src/output.c (token_actions): Introduce a temporary array,
20903 YYDEFACT, that makes it possible for this function to use
20904 output_short_table.
20905
d019d655
AD
209062000-10-02 Akim Demaille <akim@epita.fr>
20907
20908 `user_toknums' is output as a `short[]' in `output.c', while it is
20909 defined as a `int[]' in `reader.c'. For consistency with the
20910 other output tables, `user_toknums' is now defined as a table of
20911 shorts.
20912
20913 * src/reader.c (user_toknums): Be a short table instead of an int
20914 table.
20915 Adjust dependencies.
20916
20917 Factor the short table outputs.
20918
20919 * src/output.c (output_short_table): New function.
20920 * src/output.c (output_gram, output_stos, output_rule_data)
20921 (output_base, output_table, output_check): Use it.
20922
6c89f1c1
AD
209232000-10-02 Akim Demaille <akim@epita.fr>
20924
20925 * src/output.c (output): Topological sort of the functions, in
20926 order to get rid of the `static' prototypes.
20927 No longer use `register'.
20928 * src/output.h: New file.
20929 Propagate its inclusion in files explicitly prototyping functions
20930 from output.c.
20931
d9efd181
AD
209322000-09-21 Akim Demaille <akim@epita.fr>
20933
20934 * src/atgeneral.m4: Update from Autoconf.
20935
c29240e7 209362000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
20937
20938 * src/closure.h: New file.
20939 * src/closure.c: Formatting changes, topological sort over the
20940 functions, use of closure.h.
20941 (initialize_closure, finalize_closure): Rename as...
20942 (new_closure, free_closure): these. Adjust dependencies.
20943 * src/LR0.c: Formatting changes, topological sort, use of
20944 cloture.h.
20945 (initialize_states): Rename as...
20946 (new_states): this.
20947 * src/Makefile.am (noinst_HEADERS): Adjust.
20948
499daa50
AD
209492000-09-20 Akim Demaille <akim@epita.fr>
20950
20951 * src/acconfig.h: Don't protect config.h against multiple
20952 inclusion.
20953 Don't define PARAMS.
20954 * src/system.h: Define PARAMS.
20955 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20956 purpose of config.h. system.h must not try to fix wrong
20957 definitions in config.h.
20958
cc84fd5d
AD
209592000-09-20 Akim Demaille <akim@epita.fr>
20960
20961 * src/derives.h: New file.
20962 * src/main.c, src/derives.h: Use it.
20963 Formatting changes.
20964 * src/Makefile.am (noinst_HEADERS): Adjust.
20965
db5b3a89
AD
209662000-09-20 Akim Demaille <akim@epita.fr>
20967
20968 * tests/atgeneral.m4: Update from Autoconf.
20969 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20970 (AT_CHECK_CALC): New macros.
20971 Use these macros to test bison with options `', `--raw',
20972 `--debug', `--yacc', `--yacc --debug'.
20973
ceed8467
AD
209742000-09-19 Akim Demaille <akim@epita.fr>
20975
20976 * src/output.c: Formatting changes.
20977 * src/machine.h: Remove, leaving its contents in...
20978 * src/system.h: here.
20979 Include stdio.h.
20980 Adjust all dependencies on stdio.h and machine.h.
20981 * src/getargs.h: New file.
20982 Let all `extern' declarations about getargs.c be replaced with
20983 inclusion of `getargs.h'.
20984 * src/Makefile.am (noinst_HEADERS): Adjust.
20985
20986 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20987 scope.
20988 (yyerror): Returns void, not int.
20989 * doc/bison.texinfo: Formatting changes.
20990
05a1d24b
AD
209912000-09-19 Akim Demaille <akim@epita.fr>
20992
20993 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20994 portable.
20995
cbd25751
AD
209962000-09-18 Akim Demaille <akim@epita.fr>
20997
20998 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20999 * src/Makefile.am (INCLUDES): Don't.
21000 Be ready to fetch headers in lib/.
21001
13863333
AD
210022000-09-18 Akim Demaille <akim@epita.fr>
21003
21004 * doc/bison.texinfo: Update the copyright.
21005 ANSIfy and GNUify the examples.
21006 Remove the old menu.
21007
0d533154
AD
210082000-09-18 Akim Demaille <akim@epita.fr>
21009
21010 First set of tests: use the `calc' example from the documentation.
21011
21012 * src/bison.s1 (yyparse): Condition the code using `yytname' which
21013 is defined only when YYDEBUG is.
21014 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
21015 * src/files.c (tryopen, tryclose): Formatting changes.
21016 Move to the top and be static.
21017 * src/reader.c (read_signed_integer): Likewise.
21018 * tests/calc.m4: New file.
21019 * Makefile.am, suite.m4: Adjust.
21020 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21021
e79137ac
AD
210222000-09-18 Akim Demaille <akim@epita.fr>
21023
21024 Add support for an Autotest test suite for Bison.
21025
21026 * m4/m4.m4, m4/atconfig.m4: New files.
21027 * m4/Makefile.am (EXTRA_DIST): Adjust.
21028 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21029 files.
21030 * src/getargs.c: Display a more standard --version message.
21031 * src/reader.c (reader): Formatting changes.
21032 No longer depend upon VERSION_STRING.
21033 * configure.in: No longer use `dnl'.
21034 Set up the test suite and the new directory `tests/.
21035 (VERSION_STRING): Remove.
21036
27821bff
AD
210372000-04-14 Akim Demaille <akim@epita.fr>
21038
21039 * src/reader.c (copy_comment2): New function, same as former
21040 `copy_comment', but outputs into two FILE *.
21041 (copy_comment): Use it.
21042 (parse_union_decl): Use it.
21043 (get_type, parse_start_decl): Use the same `invalid' message.
21044 (parse_start_decl, parse_union_decl): Use the same `multiple'
21045 message.
21046 (parse_union_decl, copy_guard, copy_action): Use the same
21047 `unmatched' message.
21048 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21049
cfe5fbc0
AD
210502000-03-31 Akim Demaille <akim@epita.fr>
21051
21052 * src/files.c (tryopen, tryclose): Move to the top.
21053 Be static.
21054
cb7db13e
AD
210552000-03-31 Akim Demaille <akim@epita.fr>
21056
21057 * src/main.c (main): Don't call `done', exit does it.
21058
a0f6b076
AD
210592000-03-31 Akim Demaille <akim@epita.fr>
21060
36281465
AD
21061 * allocate.c: s/return (foo)/return foo/.
21062 * lalr.c: Likewise.
21063 * LR0.c: Likewise.
21064 * output.c: Likewise.
21065 * reader.c: Likewise.
21066 * symtab.c: Likewise.
21067 * vmsgetargs.c: Likewise.
21068
210692000-03-31 Akim Demaille <akim@epita.fr>
21070
21071 Clean up the error reporting functions.
a0f6b076
AD
21072
21073 * src/report.c: New file.
21074 * src/report.h: Likewise.
21075 * src/Makefile.am: Adjust.
21076 * m4/error.m4: New file.
21077 * m4/Makefile.am: Adjust.
21078 * configure.in (jm_PREREQ_ERROR): Call it.
21079 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21080 Remove.
21081 (fatal, fatals): Remove. All callers use complain.c::fatal.
21082 (warn, warni, warns, warnss, warnss): Remove. All callers use
21083 complain.c::complain.
21084 (toomany): Remove, use fatal instead.
21085 * src/files.c (done): No argument, use complain_message_count.
21086 * src/main.c (main): Register `done' to `atexit'.
21087
21088 * src/getargs.c (usage): More `fputs', less `fprintf'.
21089
18539825
AD
210902000-03-28 Akim Demaille <akim@epita.fr>
21091
21092 * lib/: New directory.
21093 * Makefile.am (SUBDIRS): Adjust.
21094 * configure.in: Adjust.
21095 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21096 useless.
21097 * src/alloca.c: Moved to lib/.
21098 * src/getopt.c: Likewise.
21099 * src/getopt1.c: Likewise.
21100 * src/getopt.h: Likewise.
21101 * src/ansi2knr.c: Likewise.
21102 * src/ansi2knr.1: Likewise.
21103 * src/Makefile.am: Adjust.
21104 * lib/Makefile.am: New file.
21105
9f306f2a
AD
211062000-03-28 Akim Demaille <akim@epita.fr>
21107
21108 * src/getargs.c (usage): Refresh the help message.
21109
0ba347b6
AD
211102000-03-17 Akim Demaille <akim@epita.fr>
21111
21112 * src/getopt1.c: Updated from textutils 2.0e
21113 * src/getopt.c: Likewise.
21114 * src/getopt.h: Likewise.
21115
dbe7f271
AD
211162000-03-17 Akim Demaille <akim@epita.fr>
21117
21118 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21119 the file name, not the whole `#line LINE FILE'.
21120
75bbe78d
AD
211212000-03-17 Akim Demaille <akim@epita.fr>
21122
21123 On syntax errors, report the token on which we choked.
21124
aa5fd0ee
AD
21125 * src/bison.s1 (yyparse): In the label yyerrlab, when
21126 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 21127
7b306f52
AD
211282000-03-17 Akim Demaille <akim@epita.fr>
21129
aa5fd0ee 21130 * src/reader.c (copy_at): New function.
7b306f52
AD
21131 (copy_guard): Use it.
21132 (copy_action): Use it.
21133
e87b5700
AD
211342000-03-17 Akim Demaille <akim@epita.fr>
21135
21136 Be kind to translators, save some useless translations.
21137
aa5fd0ee 21138 * src/main.c (banner): New function.
e87b5700
AD
21139 (fatal_banner): Use it.
21140 (warn_banner): Use it.
21141
ae3c3164
AD
211422000-03-17 Akim Demaille <akim@epita.fr>
21143
aa5fd0ee
AD
21144 * src/reader.c (copy_definition): Use copy_string and
21145 copy_comment. Removed now unused `match', `ended',
21146 `cplus_comment'.
ae3c3164
AD
21147 (copy_comment, copy_string): Moved, to be visible from
21148 copy_definition.
21149
4dc58e7c
AD
211502000-03-17 Akim Demaille <akim@epita.fr>
21151
aa5fd0ee
AD
21152 * src/reader.c (copy_string): Declare `static inline'. No
21153 problems with inline, since it is checked by configure.
4dc58e7c
AD
21154 (copy_comment): Likewise.
21155
0a6384c4
AD
211562000-03-17 Akim Demaille <akim@epita.fr>
21157
aa5fd0ee 21158 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 21159
3cef001a
AD
211602000-03-17 Akim Demaille <akim@epita.fr>
21161
aa5fd0ee 21162 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
21163 (copy_action): Use it. Removed now unused `match', `ended',
21164 `cplus_comment'.
21165 (copy_guard): Likewise.
21166
ca36d2ef
AD
211672000-03-17 Akim Demaille <akim@epita.fr>
21168
aa5fd0ee 21169 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
21170 (copy_action): Use it.
21171 (copy_guard): Likewise.
21172
6666f98f
AD
211732000-03-17 Akim Demaille <akim@epita.fr>
21174
21175 Change the handling of @s so that they behave exactly like $s.
21176 There is now a pseudo variable @$ (readble and writable), location
21177 of the lhs of the rule (by default ranging from the location of
21178 the first symbol of the rhs, to the location of the last symbol,
21179 or, if the rhs is empty, YYLLOC).
21180
21181 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21182 yyval.
21183 (yyparse): When providing a default semantic action, provide a
21184 default location action.
21185 (after the $): No longer change `*YYLSP', just stack YYLOC the
21186 same way you stack YYVAL.
21187 * src/reader.c (read_declarations): Use warns.
21188 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21189 (copy_action, case '@'): Likewise.
21190 Use a standard error message, to save useless work from
21191 translators.
21192
41aca2e0
AD
211932000-03-17 Akim Demaille <akim@epita.fr>
21194
aa5fd0ee
AD
21195 * src/bison.s1: Formatting and cosmetics changes.
21196 * src/reader.c: Likewise.
41aca2e0
AD
21197 Update the Copyright notice.
21198
dc08c1d5
AD
211992000-03-17 Akim Demaille <akim@epita.fr>
21200
aa5fd0ee
AD
21201 * src/bison.s1 (#line): All set to `#line' only, since the
21202 Makefile now handles them.
dc08c1d5 21203
9ee3c97b
AD
212042000-03-16 Akim Demaille <akim@epita.fr>
21205
21206 * src/output.c (output_rule_data): Output the documentation of
21207 some of the tables.
21208 (Copyright notice): Update.
21209 Formatting changes.
21210
0de741ca
AD
212112000-03-16 Akim Demaille <akim@epita.fr>
21212
21213 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21214 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21215 One `#if YYDEBUG' remains, since it uses variables which are
21216 defined only if `YYDEBUG != 0'.
21217
bb10be54
AD
212182000-03-16 Akim Demaille <akim@epita.fr>
21219
21220 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21221 and related variables so that the similarities are highlighted.
21222
b07b484a
AD
212232000-03-16 Akim Demaille <akim@epita.fr>
21224
21225 * src/bison.s1: Properly indent CPP directives.
21226
361f60b3
AD
212272000-03-16 Akim Demaille <akim@epita.fr>
21228
21229 * src/bison.s1: Properly indent the `alloca' CPP section.
21230
8c44d3ec
AD
212312000-03-16 Akim Demaille <akim@epita.fr>
21232
21233 Do not hard code values of directories in `configure.in'.
21234 Update the `configure' tool chain.
21235
21236 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21237 src/makefile.am.
21238 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21239 (AC_OUTPUT): Add m4/Makefile.
21240 Bump to bison 1.28a, 1.29 has never been released.
21241 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21242 handled via src/Makefile.am.
21243 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21244 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21245 autoheader.
21246 * Makefile.am (SUBDIRS): Add m4.
21247 (ACLOCAL_AM_FLAGS): New variable.
21248 (AUTOMAKE_OPTIONS): Add check-news.
21249 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21250 the proper line number and file name.
21251 (DEFS): Propagate the location of bison library files and of the
21252 locale files.
21253 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21254 builddir.
21255 * acinclude.m4: Remove, replaced by the directory m4.
21256 * m4/Makefile.am (EXTRA_DIST): New variable.
21257 * m4/gettext.m4: New file, from the fileutils.
21258 * m4/lcmessage.m4: Likewise
21259 * m4/progtest.m4: Likewise.
21260 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21261
f95997e7
AD
212622000-03-10 Akim Demaille <akim@epita.fr>
21263
21264 * src/closure.c:
21265 Formatting changes of various comments.
21266 Respect the GNU coding standards at various places.
21267 Don't use `_()' when no translation is needed.
21268
212691999-12-13 Jesse Thilo <jthilo@gnu.org>
21270
21271 * src/files.c:
21272 OS/2 honors TMPDIR environment variable.
21273
212741999-12-13 Jesse Thilo <jthilo@gnu.org>
21275
21276 * doc/bison.texinfo: Tweaked spelling and grammar.
21277 Updated ISBN.
21278 Removed reference to price of printed copy.
21279 Mention BISON_SIMPLE and BISON_HAIRY.
21280
212811999-12-13 Jesse Thilo <jthilo@gnu.org>
21282
21283 * configure.in, NEWS:
21284 Bison 1.29 released.
21285
212861999-10-27 Jesse Thilo <jthilo@gnu.org>
21287
21288 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21289 Added reference card.
21290
212911999-07-26 Jesse Thilo <jthilo@gnu.org>
21292
21293 * po/ru.po: Added Russian translation.
21294
212951999-07-26 Jesse Thilo <jthilo@gnu.org>
21296
21297 * configure.in: Added Russian translation.
21298
212991999-07-06 Jesse Thilo <jthilo@gnu.org>
21300
21301 * configure.in, NEWS, README:
21302 Released version 1.28.
21303
213041999-06-14 Jesse Thilo <jthilo@gnu.org>
21305
21306 * src/system.h:
21307 Squashed redefinition warning on some systems.
21308
21309 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21310 Have configure build version string instead of relying on ANSI string
21311 concatentation.
21312
213131999-06-14 Jesse Thilo <jthilo@gnu.org>
21314
21315 * po/POTFILES.in: Got rid of version.c.
21316
213171999-06-14 Jesse Thilo <jthilo@gnu.org>
21318
21319 * acconfig.h, configure.in:
21320 Have configure build version string instead of relying on ANSI string
21321 concatentation.
21322
213231999-06-08 Jesse Thilo <jthilo@gnu.org>
21324
21325 * doc/bison.1:
21326 Dropped mention of `+' for long-named options.
21327
213281999-05-30 Jesse Thilo <jthilo@gnu.org>
21329
21330 * src/files.c: Added <unistd.h> for unlink().
21331
21332 * src/Makefile.am, src/system.h:
21333 I18n fixes.
21334
213351999-05-30 Jesse Thilo <jthilo@gnu.org>
21336
21337 * README: Added a FAQ list.
21338
21339 * configure.in, acconfig.h:
21340 I18n fixes.
21341
213421999-05-30 Jesse Thilo <jthilo@gnu.org>
21343
21344 * doc/FAQ, doc/Makefile.am:
21345 Added a FAQ list.
21346
213471999-05-19 Jesse Thilo <jthilo@gnu.org>
21348
21349 * src/alloc.h, src/symtab.h, src/version.c:
21350 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21351
213521999-04-18 Jesse Thilo <jthilo@gnu.org>
21353
21354 * src/.cvsignore, src/Makefile.am:
21355 Reorganized: sources in `src', documentation in `doc'.
21356
21357 * src/lex.c (literalchar):
21358 fixed the code for escaping double quotes (thanks
21359 Jonathan Czisny.)
21360
213611999-04-18 Jesse Thilo <jthilo@gnu.org>
21362
21363 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21364 Adjusted paths to reflect directory reorganization.
21365
213661999-04-18 Jesse Thilo <jthilo@gnu.org>
21367
21368 * doc/.cvsignore, doc/Makefile.am:
21369 Reorganized: sources in `src', documentation in `doc'.
21370
213711999-04-18 Jesse Thilo <jthilo@gnu.org>
21372
21373 * configure.in:
21374 Updated AC_INIT file to reflect directory reorganization.
21375
21376 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21377 Reorganized: sources in `src', documentation in `doc'.
21378
213791999-04-13 Jesse Thilo <jthilo@gnu.org>
21380
21381 * src/allocate.c:
21382 Don't declare calloc() and realloc() if not necessary.
21383
213841999-04-13 Jesse Thilo <jthilo@gnu.org>
21385
21386 * configure.in, acconfig.h, acinclude.m4:
21387 Don't declare calloc() and realloc() if not necessary.
21388
213891999-03-23 Jesse Thilo <jthilo@gnu.org>
21390
21391 * po/.cvsignore: Added i18n support.
21392
213931999-03-23 Jesse Thilo <jthilo@gnu.org>
21394
21395 * acconfig.h, configure.in, Makefile.am:
21396 Added i18n support.
21397
213981999-03-22 Jesse Thilo <jthilo@gnu.org>
21399
21400 * src/bison.s1: Fixed #line numbers.
21401
214021999-03-15 Jesse Thilo <jthilo@gnu.org>
21403
21404 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21405 Added PO files from Translation Project.
21406
214071999-03-03 Jesse Thilo <jthilo@gnu.org>
21408
21409 * Makefile.am:
21410 Added support for non-ANSI compilers (ansi2knr).
21411
214121999-02-16 Jesse Thilo <jthilo@gnu.org>
21413
21414 * configure.in: Bumped version number to 1.27.
21415
21416 * Makefile.am:
21417 Added `bison.simple' to list of files removed by `make distclean'.
21418
214191999-02-12 Jesse Thilo <jthilo@gnu.org>
21420
21421 * src/files.c, src/files.h:
21422 Defined locations of parser files in config.h instead of Makefile.
21423
214241999-02-12 Jesse Thilo <jthilo@gnu.org>
21425
21426 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21427 Defined locations of parser files in config.h instead of Makefile.
21428
214291999-02-09 Jesse Thilo <jthilo@gnu.org>
21430
21431 * Makefile.am:
21432 Removed inappropriate use of $< macro.
21433
214341999-02-05 Jesse Thilo <jthilo@gnu.org>
21435
21436 * po/Makefile.in.in, po/POTFILES.in:
21437 Add `po' directory skeleton.
21438
214391999-01-27 Jesse Thilo <jthilo@gnu.org>
21440
21441 * README: Document help-bison list.
21442
21443 * configure.in: Add check for mkstemp().
21444
214451999-01-20 Jesse Thilo <jthilo@gnu.org>
21446
21447 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21448 Hush a few compiler warnings.
21449
21450 * src/files.c:
21451 Add tryclose(), which verifies that fclose was successful.
21452 Hush a couple of compiler warnings.
21453
214541999-01-20 Jesse Thilo <jthilo@gnu.org>
21455
21456 * Makefile.am, OChangeLog:
21457 ChangeLog is now automatically generated. Include the old version as
21458 OChangeLog.
21459
214601999-01-14 Jesse Thilo <jthilo@gnu.org>
21461
21462 * 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:
21463 Update FSF address.
21464
214651999-01-14 Jesse Thilo <jthilo@gnu.org>
21466
21467 * doc/bison.texinfo: Fix formatting glitch.
21468
21469 * doc/bison.texinfo: Update FSF address.
21470
214711999-01-14 Jesse Thilo <jthilo@gnu.org>
21472
21473 * acconfig.h: Update FSF address.
21474
214751999-01-08 Jesse Thilo <jthilo@gnu.org>
21476
21477 * src/system.h:
21478 Don't define PACKAGE here, since config.h defines it.
21479
214801998-12-30 Jesse Thilo <jthilo@gnu.org>
21481
21482 * src/reader.c: Update copyright date.
21483
21484 * src/main.c:
21485 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21486 favor of output directly to stderr (avoids buffer overruns).
21487
21488 * src/reader.c: Some checks for premature EOF.
21489
21490 * 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:
21491 Use prototypes if the compiler understands them.
21492
21493 * src/files.c: Honor TMPDIR on Unix hosts.
21494 Use prototypes if the compiler understands them.
21495
21496 * src/reader.c:
21497 Fix a couple of buffer overrun bugs.
21498 Use prototypes if the compiler understands them.
21499
21500 * src/system.h: Include unistd.h and ctype.h.
21501 Use #ifdef instead of #if for NLS symbols.
21502
215031998-12-30 Jesse Thilo <jthilo@gnu.org>
21504
21505 * doc/bison.texinfo:
21506 Delete comment "consider using @set for edition number, etc..." since
21507 we now are doing so.
21508
215091998-12-30 Jesse Thilo <jthilo@gnu.org>
21510
21511 * configure.in:
21512 Use prototypes if the compiler understands them.
21513
21514 * NEWS: Document 1.26 highlights.
21515
21516 * Makefile.am: Require Automake 1.3 or later.
21517
21518 * acconfig.h:
21519 Use prototypes if the compiler understands them.
21520
215211998-12-29 Jesse Thilo <jthilo@gnu.org>
21522
21523 * src/version.c:
21524 Use VERSION symbol from automake for version number.
21525
215261998-12-29 Jesse Thilo <jthilo@gnu.org>
21527
21528 * acconfig.h, configure.in, version.cin:
21529 Use VERSION symbol from automake for version number.
21530
215311998-11-28 Jesse Thilo <jthilo@gnu.org>
21532
21533 * Makefile.am:
21534 Distribute original version of simple parser (bison.s1), not built
21535 version (bison.simple).
21536
215371998-11-28 Jesse Thilo <jthilo@gnu.org>
21538
21539 * doc/bison.texinfo: Add info dir entry.
21540
21541 * doc/bison.texinfo:
21542 Let automake put version number into documentation.
21543
215441998-11-26 Jesse Thilo <jthilo@gnu.org>
21545
21546 * src/bison.cld, src/build.com, src/vmshlp.mar:
21547 Add non-RCS files from /gd/gnu/bison.
21548
215491998-11-26 Jesse Thilo <jthilo@gnu.org>
21550
21551 * doc/bison.1:
21552 Document the BISON_HAIRY and BISON_SIMPLE variables.
21553
215541998-11-25 Jesse Thilo <jthilo@gnu.org>
21555
21556 * src/version.c: Build version.c automatically.
21557
21558 * src/reader.c:
21559 Fix token numbering (used to start at 258, not 257).
21560
21561 * src/system.h: Include config.h.
21562
21563 * src/getargs.c: Update bug report address.
21564
21565 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21566 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21567
215681998-11-25 Jesse Thilo <jthilo@gnu.org>
21569
21570 * Makefile.am:
21571 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21572
21573 * configure.in, version.cin:
21574 Build version.c automatically.
21575
21576 * AUTHORS: Add AUTHORS file.
21577
21578 * README: Update bug report address.
21579
21580 * bison.simple:
21581 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21582
21583 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21584 Add automake stuff.
21585
215861998-11-25 Jesse Thilo <jthilo@gnu.org>
21587
21588 * doc/bison.texinfo: Clean up some formatting.
21589
215901998-05-05 Richard Stallman <rms@gnu.org>
21591
21592 * doc/bison.texinfo:
21593 Explain better why to make a pure parser.
21594
215951998-01-05 Richard Stallman <rms@gnu.org>
21596
21597 * src/files.c (openfiles):
21598 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21599 find a temporary directory, if possible. Do not unlink files while
21600 they are open.
21601
216021997-08-25 Richard Stallman <rms@gnu.org>
21603
21604 * src/reader.c (stack_offset;):
21605 Change some warni to warns.
21606
21607 * src/lex.c (literalchar): Use warns, not warni.
21608
216091997-06-28 Richard Stallman <rms@gnu.org>
21610
21611 * src/bison.s1: Add a Bison version comment.
21612
21613 * src/main.c (fatal, warn, berror):
21614 Use program_name.
21615
216161997-06-28 Richard Stallman <rms@gnu.org>
21617
21618 * Makefile.in (bison_version): New variable.
21619 (dist): Use that variable.
21620 (bison.s1): Substitute the Bison version into bison.simple.
21621
21622 * bison.simple: Add a Bison version comment.
21623
216241997-06-18 Richard Stallman <rms@gnu.org>
21625
21626 * src/main.c (fatal, warn, berror):
21627 Make error messages standard.
21628 (toomany): Improve error message text.
21629
21630 * 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:
21631 new.h renamed to alloc.h.
21632
216331997-06-18 Richard Stallman <rms@gnu.org>
21634
21635 * Makefile.in: new.h renamed to alloc.h.
21636
216371997-05-24 Richard Stallman <rms@gnu.org>
21638
21639 * src/lex.c (literalchar):
21640 Fix the code for escaping \, " and '.
21641
21642 (lex): Avoid trouble when there are many chars
21643 to discard in a char literal with just several chars in it.
21644
216451997-05-17 Richard Stallman <rms@gnu.org>
21646
21647 * src/bison.s1:
21648 Use malloc, if using alloca is troublesome.
21649 (YYSTACK_USE_ALLOCA): New flag macro.
21650 Define it for some systems and compilers.
21651 (YYSTACK_ALLOC): New macro.
21652 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21653 If it was malloc'd, free it.
21654
216551997-05-17 Richard Stallman <rms@gnu.org>
21656
21657 * bison.simple:
21658 Use malloc, if using alloca is troublesome.
21659 (YYSTACK_USE_ALLOCA): New flag macro.
21660 Define it for some systems and compilers.
21661 (YYSTACK_ALLOC): New macro.
21662 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21663 If it was malloc'd, free it.
21664
216651997-04-23 Richard Stallman <rms@gnu.org>
21666
21667 * src/bison.s1:
21668 (alloca) [__hpux]: Always define as __builtin_alloca.
21669
216701997-04-23 Richard Stallman <rms@gnu.org>
21671
21672 * bison.simple:
21673 (alloca) [__hpux]: Always define as __builtin_alloca.
21674
216751997-04-22 Richard Stallman <rms@gnu.org>
21676
21677 * src/bison.s1:
21678 [__hpux]: Include alloca.h (right for HPUX 10)
21679 instead of declaring alloca (right for HPUX 9).
21680
21681 * src/bison.s1 (__yy_memcpy):
21682 Declare arg `count' as unsigned int.
21683 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21684
216851997-04-22 Richard Stallman <rms@gnu.org>
21686
21687 * bison.simple:
21688 [__hpux]: Include alloca.h (right for HPUX 10)
21689 instead of declaring alloca (right for HPUX 9).
21690
21691 * bison.simple (__yy_memcpy):
21692 Declare arg `count' as unsigned int.
21693 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21694
216951997-01-03 Richard Stallman <rms@gnu.org>
21696
21697 * src/allocate.c: [__STDC__ or _MSC_VER]:
21698 Declare calloc and realloc to return void *.
21699
217001997-01-02 Richard Stallman <rms@gnu.org>
21701
21702 * src/system.h:
21703 [_MSC_VER]: Include stdlib.h and process.h.
21704 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21705
21706 * src/main.c (main): Return FAILURE as a value.
21707 (printable_version): Declare arg as int, not char.
21708
217091997-01-02 Richard Stallman <rms@gnu.org>
21710
21711 * Makefile.in (dist):
21712 Explicitly check for symlinks, and copy them.
21713
217141996-12-19 Richard Stallman <rms@gnu.org>
21715
21716 * src/files.c:
21717 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21718
217191996-12-18 Paul Eggert <eggert@gnu.org>
21720
21721 * src/bison.s1 (yyparse):
21722 If __GNUC__ and YYPARSE_PARAM are both defined,
21723 declare yyparse to have a void * argument.
21724
217251996-12-18 Paul Eggert <eggert@gnu.org>
21726
21727 * bison.simple (yyparse):
21728 If __GNUC__ and YYPARSE_PARAM are both defined,
21729 declare yyparse to have a void * argument.
21730
217311996-12-17 Richard Stallman <rms@gnu.org>
21732
21733 * src/reduce.c (nbits): Add some casts.
21734
217351996-08-12 Richard Stallman <rms@gnu.org>
21736
21737 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21738
217391996-08-12 Richard Stallman <rms@gnu.org>
21740
21741 * bison.simple: Test _MSDOS as well as _MSDOS_.
21742
217431996-07-31 Richard Stallman <rms@gnu.org>
21744
21745 * src/bison.s1:
21746 [__sun && __i386]: Include alloca.h.
21747
217481996-07-31 Richard Stallman <rms@gnu.org>
21749
21750 * bison.simple:
21751 [__sun && __i386]: Include alloca.h.
21752
217531996-07-30 Richard Stallman <rms@gnu.org>
21754
21755 * src/bison.s1: Comment change.
21756
21757 * src/bison.s1: Test _MSDOS_, not MSDOS.
21758
217591996-07-30 Richard Stallman <rms@gnu.org>
21760
21761 * bison.simple: Comment change.
21762
21763 * bison.simple: Test _MSDOS_, not MSDOS.
21764
217651996-06-01 Richard Stallman <rms@gnu.org>
21766
21767 * 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:
21768 Insert `_' macro around many string constants.
21769
21770 * src/main.c:
21771 Insert `_' macro around many string constants.
21772
21773 (main): Call setlocale, bindtextdomain and textdomain.
21774
21775 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21776 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21777 [ENABLE_NLS]: Include libintl.h.
21778 [ENABLE_NLS] (gettext): Define.
21779 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21780 (N_, PACKAGE, LOCALEDIR): New macros.
21781
217821996-06-01 Richard Stallman <rms@gnu.org>
21783
21784 * POTFILES.in: New file.
21785
21786 * Makefile.in (allocate.o):
21787 Define target explicitly.
21788
21789 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21790 (LDFLAGS): Set to @LDFLAGS@.
21791 (configure): Run autoconf only if preceding `cd' succeeds.
21792 (bison.s1): Redirect output to temporary file then move the
21793 temporary to the target, rather than redirecting directly to bison.s1.
21794 (clean): Remove config.status and config.log.
21795 (distclean): Don't remove config.status here.
21796
217971996-05-12 Richard Stallman <rms@gnu.org>
21798
21799 * src/bison.s1:
21800 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21801
218021996-05-12 Richard Stallman <rms@gnu.org>
21803
21804 * bison.simple:
21805 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21806
218071996-05-11 Richard Stallman <rms@gnu.org>
21808
21809 * src/bison.s1 (__yy_memcpy):
21810 Really reorder the args, as was supposedly done on Feb 14 1995.
21811 (yyparse): Calls changed accordingly.
21812
218131996-05-11 Richard Stallman <rms@gnu.org>
21814
21815 * Makefile.in (dist): Don't use $(srcdir).
21816
21817 * bison.simple (__yy_memcpy):
21818 Really reorder the args, as was supposedly done on Feb 14 1995.
21819 (yyparse): Calls changed accordingly.
21820
218211996-01-27 Richard Stallman <rms@gnu.org>
21822
21823 * src/output.c (output_rule_data):
21824 Test YYERROR_VERBOSE in the conditional
21825 around the definition of ttyname.
21826
218271995-12-29 Richard Stallman <rms@gnu.org>
21828
21829 * src/bison.s1:
21830 Fix line numbers in #line commands.
21831
218321995-12-29 Richard Stallman <rms@gnu.org>
21833
21834 * bison.simple:
21835 Fix line numbers in #line commands.
21836
218371995-12-27 Richard Stallman <rms@gnu.org>
21838
21839 * src/bison.s1 (YYPARSE_PARAM_DECL):
21840 In C++, make it always null.
21841 (YYPARSE_PARAM_ARG): New macro.
21842 (yyparse): Use YYPARSE_PARAM_ARG.
21843
218441995-12-27 Richard Stallman <rms@gnu.org>
21845
21846 * bison.simple (YYPARSE_PARAM_DECL):
21847 In C++, make it always null.
21848 (YYPARSE_PARAM_ARG): New macro.
21849 (yyparse): Use YYPARSE_PARAM_ARG.
21850
218511995-11-29 Richard Stallman <rms@gnu.org>
21852
21853 * doc/bison.texinfo:
21854 Describe literal string tokens, %raw, %no_lines, %token_table.
21855
218561995-11-29 Daniel Hagerty <hag@gnu.org>
21857
21858 * doc/bison.texinfo: Fixed update date
21859
218601995-10-16 Richard Stallman <rms@gnu.org>
21861
21862 * src/version.c: Version 1.25.
21863
218641995-10-16 Richard Stallman <rms@gnu.org>
21865
21866 * NEWS: *** empty log message ***
21867
218681995-10-16 Richard Stallman <rms@gnu.org>
21869
21870 * doc/bison.1, doc/bison.rnh:
21871 Add new options.
21872
218731995-10-15 Richard Stallman <rms@gnu.org>
21874
21875 * src/vmsgetargs.c, src/getargs.c:
21876 Added -n, -k, and -raw switches.
21877 (noparserflag, toknumflag, rawtoknumflag): New variables.
21878
21879 * src/symtab.h (SALIAS):
21880 New #define for adding aliases to %token.
21881 (struct bucket): Added `alias' field.
21882
21883 * src/reduce.c (reduce_grammar):
21884 Revise error message.
21885 (print_notices): Remove final `.' from error message.
21886
21887 * src/reader.c (reader_output_yylsp):
21888 New function.
21889 (readgram): Use `#if 0' around code that accepted %command
21890 inside grammar rules: The documentation doesn't allow it,
21891 and it will fail since the %command processors scan for the next %.
21892 (parse_token_decl): Extended the %token
21893 declaration to allow a multi-character symbol as an alias.
21894 (parse_thong_decl): New function.
21895 (read_declarations): Added %thong declarations.
21896 (read_declarations): Handle NOOP to deal with allowing
21897 % declarations as another means to specify the flags.
21898 (readgram): Allow %prec prior to semantics embedded in a rule.
21899 (skip_to_char, read_declarations, copy_definition)
21900 (parse_token_decl, parse_start_decl, parse_type_decl)
21901 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21902 (get_type_name, copy_guard, copy_action, readgram)
21903 (get_type, packsymbols): Revised most error messages.
21904 Changed `fatal' to `warnxxx' to avoid aborting for error.
21905 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21906 (read_declarations): Improve the error message for
21907 an invalid character. Do not abort.
21908 (read_declarations, copy_guard, copy_action): Use
21909 printable_version to avoid unprintable characters in printed output.
21910 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21911 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21912 Allow the type of a non-terminal can be given
21913 more than once, as long as all specifications give the same type.
21914
21915 * src/output.c:
21916 (output_headers, output_trailers, output, output_gram)
21917 (output_rule_data): Implement noparserflag variable.
21918 Implement toknumflag variable.
21919 (output): Call reader_output_yylsp to output LTYPESTR.
21920
21921 * src/main.c (main):
21922 If reader sees an error, don't process the grammar.
21923 (fatals): Updated to not use VARARGS1.
21924 (printable_version, int_to_string, warn, warni, warns, warnss)
21925 (warnsss): New error reporting functions. Avoid abort for error.
21926
21927 * src/lex.h:
21928 Added THONG and NOOP for alias processing.
21929 Added SETOPT for the new code that allows setting options with %flags.
21930
21931 * src/lex.c:
21932 Include getopt.h. Add some extern decls.
21933 (safegetc): New function to deal with EOF gracefully.
21934 (literalchar); new function to deal with reading \ escapes.
21935 (lex): Use literalchar.
21936 (lex): Implemented "..." tokens.
21937 (literalchar, lex, parse_percent_token): Made tokenbuffer
21938 always contain the token. This includes growing the token
21939 buffer while reading an integer.
21940 (parse_percent_token): Replaced if-else statement with percent_table.
21941 (parse_percent_token): Added % declarations as another
21942 way to specify the flags -n, -l, and -r. Also added hooks for
21943 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21944 major changes to files.c.
21945 (lex) Retain in the incoming stream a character following
21946 an incorrect '/'.
21947 (skip_white_space, lex): Revised most error messages
21948 and changed fatal to warn to avoid aborting.
21949 (percent_table): Added %thong declarations.
21950
21951 * src/gram.h: Comment changes.
21952
21953 * src/files.c (openfiles, open_extra_files, done):
21954 Add faction flag
21955 and actfile file. Handle noparserflag. Both for -n switch.
21956
21957 * src/conflicts.c (resolve_sr_conflict):
21958 Remove use of alloca.
21959
219601995-06-01 Jim Meyering <meyering@gnu.org>
21961
21962 * doc/bison.texinfo: *** empty log message ***
21963
219641995-05-06 Richard Stallman <rms@gnu.org>
21965
21966 * src/bison.s1: Comment change.
21967
219681995-05-06 Richard Stallman <rms@gnu.org>
21969
21970 * bison.simple: Comment change.
21971
219721995-05-03 Richard Stallman <rms@gnu.org>
21973
21974 * src/version.c: Version now 1.24.
21975
21976 * src/bison.s1: Change distribution terms.
21977
21978 * src/version.c: Version now 1.23.
21979
219801995-05-03 Richard Stallman <rms@gnu.org>
21981
21982 * doc/bison.texinfo:
21983 Rewrite "Conditions for Using Bison".
21984 Update version to 1.24.
21985
219861995-05-03 Richard Stallman <rms@gnu.org>
21987
21988 * bison.simple: Change distribution terms.
21989
219901995-02-23 Richard Stallman <rms@gnu.org>
21991
21992 * src/files.c: Test __VMS_POSIX as well as VMS.
21993
219941995-02-14 Jim Meyering <meyering@gnu.org>
21995
21996 * src/bison.s1 (__yy_memcpy):
21997 Renamed from __yy_bcopy to avoid
21998 confusion. Reverse FROM and TO arguments to be consistent with
21999 those of memcpy.
22000
220011995-02-14 Jim Meyering <meyering@gnu.org>
22002
22003 * bison.simple (__yy_memcpy):
22004 Renamed from __yy_bcopy to avoid
22005 confusion. Reverse FROM and TO arguments to be consistent with
22006 those of memcpy.
22007
220081994-11-10 David J. MacKenzie <djm@gnu.org>
22009
22010 * NEWS: reformat
22011
22012 * NEWS: New file.
22013
22014 * Makefile.in (DISTFILES): Include NEWS.
22015
22016 * Makefile.in (DISTFILES):
22017 Include install-sh, not install.sh.
22018
22019 * configure.in: Update to Autoconf v2 macro names.
22020
220211994-10-05 David J. MacKenzie <djm@gnu.org>
22022
22023 * Makefile.in: fix typo
22024
22025 * Makefile.in (prefix, exec_prefix):
22026 Let configure set them.
22027
220281994-09-28 David J. MacKenzie <djm@gnu.org>
22029
22030 * Makefile.in: Set datadir to $(prefix)/share.
22031
220321994-09-15 Richard Stallman <rms@gnu.org>
22033
22034 * src/bison.s1:
22035 Update copyright notice and GPL version.
22036
220371994-09-15 Richard Stallman <rms@gnu.org>
22038
22039 * bison.simple:
22040 Update copyright notice and GPL version.
22041
220421994-07-12 Richard Stallman <rms@gnu.org>
22043
22044 * src/reduce.c, src/reader.c:
22045 entered into RCS
22046
220471994-05-05 David J. MacKenzie <djm@gnu.org>
22048
22049 * Makefile.in: entered into RCS
22050
220511994-03-26 Richard Stallman <rms@gnu.org>
22052
22053 * src/bison.s1: entered into RCS
22054
220551994-03-26 Richard Stallman <rms@gnu.org>
22056
22057 * bison.simple: entered into RCS
22058
220591994-03-25 Richard Stallman <rms@gnu.org>
22060
22061 * src/main.c: entered into RCS
22062
220631994-03-24 Richard Stallman <rms@gnu.org>
22064
22065 * src/conflicts.c: entered into RCS
22066
220671994-01-02 Richard Stallman <rms@gnu.org>
22068
22069 * Makefile.in: *** empty log message ***
22070
220711993-11-21 Richard Stallman <rms@gnu.org>
22072
22073 * src/bison.s1: *** empty log message ***
22074
220751993-11-21 Richard Stallman <rms@gnu.org>
22076
22077 * doc/bison.texinfo: entered into RCS
22078
22079 * doc/bison.texinfo: *** empty log message ***
22080
220811993-11-21 Richard Stallman <rms@gnu.org>
22082
22083 * bison.simple: *** empty log message ***
22084
220851993-10-25 David J. MacKenzie <djm@gnu.org>
22086
22087 * doc/bison.texinfo: *** empty log message ***
22088
220891993-10-19 Richard Stallman <rms@gnu.org>
22090
22091 * src/bison.s1: *** empty log message ***
22092
220931993-10-19 Richard Stallman <rms@gnu.org>
22094
22095 * bison.simple: *** empty log message ***
22096
220971993-10-14 Richard Stallman <rms@gnu.org>
22098
22099 * src/bison.s1: *** empty log message ***
22100
221011993-10-14 Richard Stallman <rms@gnu.org>
22102
22103 * bison.simple: *** empty log message ***
22104
221051993-09-14 David J. MacKenzie <djm@gnu.org>
22106
22107 * doc/bison.texinfo: *** empty log message ***
22108
221091993-09-13 Noah Friedman <friedman@gnu.org>
22110
22111 * Makefile.in: *** empty log message ***
22112
221131993-09-10 Richard Stallman <rms@gnu.org>
22114
22115 * src/conflicts.c: *** empty log message ***
22116
22117 * src/system.h: entered into RCS
22118
221191993-09-10 Richard Stallman <rms@gnu.org>
22120
22121 * doc/bison.1: entered into RCS
22122
221231993-09-06 Noah Friedman <friedman@gnu.org>
22124
22125 * src/version.c: entered into RCS
22126
221271993-09-06 Noah Friedman <friedman@gnu.org>
22128
22129 * Makefile.in: *** empty log message ***
22130
221311993-07-30 David J. MacKenzie <djm@gnu.org>
22132
22133 * Makefile.in: *** empty log message ***
22134
221351993-07-24 Richard Stallman <rms@gnu.org>
22136
22137 * src/bison.s1: *** empty log message ***
22138
221391993-07-24 Richard Stallman <rms@gnu.org>
22140
22141 * bison.simple: *** empty log message ***
22142
221431993-07-08 David J. MacKenzie <djm@gnu.org>
22144
22145 * Makefile.in: *** empty log message ***
22146
221471993-07-04 Richard Stallman <rms@gnu.org>
22148
22149 * src/bison.s1: *** empty log message ***
22150
221511993-07-04 Richard Stallman <rms@gnu.org>
22152
22153 * bison.simple: *** empty log message ***
22154
221551993-06-26 David J. MacKenzie <djm@gnu.org>
22156
22157 * src/getargs.c: entered into RCS
22158
221591993-06-26 David J. MacKenzie <djm@gnu.org>
22160
22161 * doc/bison.texinfo: *** empty log message ***
22162
22163 * doc/bison.1: New file.
22164
221651993-06-25 Richard Stallman <rms@gnu.org>
22166
22167 * src/getargs.c: New file.
22168
221691993-06-16 Richard Stallman <rms@gnu.org>
22170
22171 * src/bison.s1: *** empty log message ***
22172
221731993-06-16 Richard Stallman <rms@gnu.org>
22174
22175 * bison.simple: *** empty log message ***
22176
221771993-06-03 Richard Stallman <rms@gnu.org>
22178
22179 * src/bison.s1: New file.
22180
221811993-06-03 Richard Stallman <rms@gnu.org>
22182
22183 * doc/bison.texinfo: *** empty log message ***
22184
221851993-06-03 Richard Stallman <rms@gnu.org>
22186
22187 * bison.simple: New file.
22188
221891993-05-19 Richard Stallman <rms@gnu.org>
22190
22191 * doc/bison.texinfo: New file.
22192
221931993-05-07 Noah Friedman <friedman@gnu.org>
22194
22195 * Makefile.in: *** empty log message ***
22196
221971993-04-28 Noah Friedman <friedman@gnu.org>
22198
22199 * src/reader.c: *** empty log message ***
22200
222011993-04-23 Noah Friedman <friedman@gnu.org>
22202
22203 * src/alloc.h: entered into RCS
22204
222051993-04-20 David J. MacKenzie <djm@gnu.org>
22206
22207 * src/version.c: *** empty log message ***
22208
22209 * src/files.c, src/allocate.c:
22210 entered into RCS
22211
22212 * src/reader.c: *** empty log message ***
22213
22214 * src/lex.c: entered into RCS
22215
22216 * src/conflicts.c: New file.
22217
22218 * src/symtab.c: entered into RCS
22219
22220 * src/alloc.h: New file.
22221
22222 * src/LR0.c: entered into RCS
22223
222241993-04-18 Noah Friedman <friedman@gnu.org>
22225
22226 * src/reader.c: New file.
22227
22228 * src/version.c: *** empty log message ***
22229
222301993-04-18 Noah Friedman <friedman@gnu.org>
22231
22232 * Makefile.in: *** empty log message ***
22233
222341993-04-17 Noah Friedman <friedman@gnu.org>
22235
22236 * Makefile.in: *** empty log message ***
22237
222381993-04-15 Richard Stallman <rms@gnu.org>
22239
22240 * src/main.c, src/files.c:
22241 New file.
22242
222431993-04-15 Noah Friedman <friedman@gnu.org>
22244
22245 * configure.in: entered into RCS
22246
22247 * configure.in: *** empty log message ***
22248
22249 * configure.in: New file.
22250
222511993-04-14 Richard Stallman <rms@gnu.org>
22252
22253 * Makefile.in: New file.
22254
222551993-04-13 Richard Stallman <rms@gnu.org>
22256
22257 * src/version.c: New file.
22258
222591993-03-25 Richard Stallman <rms@gnu.org>
22260
22261 * src/output.c: entered into RCS
22262
222631992-09-25 Richard Stallman <rms@gnu.org>
22264
22265 * configure.bat: entered into RCS
22266
222671992-06-22 Richard Stallman <rms@gnu.org>
22268
22269 * src/vmsgetargs.c: entered into RCS
22270
222711992-06-22 Richard Stallman <rms@gnu.org>
22272
22273 * doc/bison.rnh: entered into RCS
22274
222751992-04-20 David J. MacKenzie <djm@gnu.org>
22276
22277 * README: entered into RCS
22278
222791992-01-22 Richard Stallman <rms@gnu.org>
22280
22281 * src/machine.h: entered into RCS
22282
222831991-12-21 Richard Stallman <rms@gnu.org>
22284
22285 * src/lalr.c, src/closure.c:
22286 entered into RCS
22287
222881991-12-20 Richard Stallman <rms@gnu.org>
22289
22290 * src/state.h: entered into RCS
22291
222921991-12-18 Richard Stallman <rms@gnu.org>
22293
22294 * src/print.c, src/nullable.c, src/derives.c:
22295 entered into RCS
22296
222971991-11-03 David J. MacKenzie <djm@gnu.org>
22298
22299 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22300 entered into RCS
22301
223021988-09-09 Richard Stallman <rms@gnu.org>
22303
22304 * src/bison.hairy: entered into RCS
22305
223061987-12-16 Richard Stallman <rms@gnu.org>
22307
22308 * REFERENCES: entered into RCS
dc546b0f 22309
f294a2c2 22310
04098407 22311 -----
f294a2c2 22312
04098407 22313 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
f490771b
JD
22314 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
22315 2007, 2008, 2009 Free Software Foundation, Inc.
f294a2c2 22316
04098407
PE
22317 Copying and distribution of this file, with or without
22318 modification, are permitted provided the copyright notice and this
22319 notice are preserved.