]> git.saurik.com Git - bison.git/blame - ChangeLog
Import latest m4/m4.m4.
[bison.git] / ChangeLog
CommitLineData
c5196098
EB
12009-08-20 Eric Blake <ebb9@byu.net>
2
3 Import latest m4/m4.m4.
4 * submodules/autoconf: Update to autoconf 2.64.
5 * configure.ac (M4_GNU_OPTION): New define.
6 * src/output.c (output_skeleton): Use it to resolve FIXME.
7 * NEWS: Mention this.
8
39fb7e62
JD
92009-08-19 Joel E. Denny <jdenny@clemson.edu>
10
11 Fix complaints about escape sequences.
12 Discussed starting at
13 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
14 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
15 For a \0 and similar escape sequences meaning the null
16 character, report an invalid escape sequence instead of an
17 invalid null character because the latter does not actually
18 appear in the user's input.
19 In all escape sequence complaints, don't escape the initial
20 backslash, and don't quote when the sequence appears at the end
21 of the complaint line unless there's whitespace that quotearg
22 won't escape.
23 Consistently say "invalid" not "unrecognized".
24 Consistently prefer "empty character literal" over "extra
25 characters in character literal" warning for invalid escape
26 sequences; that is, consistently discard those sequences.
27 * tests/input.at (Bad escapes in literals): New.
28
c33bc800
AD
292009-08-19 Akim Demaille <demaille@gostai.com>
30
31 doc: fixes.
32 * doc/bison.texinfo: Fix minor Texinfo errors.
33
8fbbeba2
AD
342009-08-19 Akim Demaille <demaille@gostai.com>
35
36 doc: %initial-action to initialize yylloc.
37 Reported by Bill Allombert.
38 * doc/bison.texinfo: Set fill-column to 76.
39 (Location Type): Document the use of %initial-action to initialize
40 yylloc.
41
1874a474
JD
422009-08-18 Joel E. Denny <jdenny@clemson.edu>
43
44 maint: update for gnulib's recent update-copyright changes
45 * gnulib: Update.
46 * .x-update-copyright (COPYING): Add as it's no longer implied
47 when .x-update-copyright is present.
48 * cfg.mk (update-copyright-local): Remove, now ignored.
49 (update-copyright): Declare update-b4-copyright as a dependency.
50
f4bfd5a9
AD
512009-08-17 Akim Demaille <demaille@gostai.com>
52
53 build: require gettext 0.17.
54
55 Suggested by Bruno Haible.
56 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
57 * configure.ac: require gettext 0.17 to ensure compatibility with
58 gnulib.
59
2509eba6
AD
602009-08-17 Akim Demaille <demaille@gostai.com>
61
62 build: lower gettext requirements.
63
64 Bison was uselessly requiring the formatstring macros from
65 gettext, which resulted in mo files not being installed on systems
66 that perfectly supported Bison mo files. Lower the requirement.
67 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
68
69 * configure.ac: Require need-ngettext instead of
70 need-formatstring-macros.
71 Reported by Martin Jabocs.
72 Suggested by Bruno Haible.
73 * INSTALL: Restructure.
74 (Internationalization): New.
75
314542f9
JD
762009-08-14 Joel E. Denny <jdenny@clemson.edu>
77
78 maint: fix use of copyright year intervals.
79 * gnulib: Update.
80 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
81 as now recommended in gnulib/NEWS.
82 * build-aux/update-b4-copyright: Fix.
83 * cfg.mk (update-copyright-env): Configure update-copyright.
84
24985964
JD
852009-08-13 Joel E. Denny <jdenny@clemson.edu>
86
87 Make it easier to write deterministic tests.
88 Continues Akim's work from his 2009-06-10 commits.
89 * src/reader.c (check_and_convert_grammar): Don't add any
90 symbols after the first symbols_do invocation.
91 * src/symtab.c (symbols_sorted): New static global.
92 (user_token_number_redeclaration): Update comments.
93 (symbol_from_uniqstr): If a new symbol is being created, assert
94 that symbols_sorted hasn't been allocated yet.
95 (symbols_free): Free symbols_sorted.
96 (symbols_cmp, symbols_cmp_qsort): New functions.
97 (symbols_do): Sort symbol_table into symbols_sorted on first
98 invocation.
99 * tests/input.at (Numbered tokens): Recombine tests now that the
100 output should be deterministic across multiple numbers.
101
47076da5
AD
1022009-08-12 Akim Demaille <demaille@gostai.com>
103
104 distcheck: fix.
105
106 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
107
36dfe466
JD
1082009-08-10 Joel E. Denny <jdenny@clemson.edu>
109
110 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
111
07c0db18
JD
1122009-08-10 Joel E. Denny <jdenny@clemson.edu>
113
114 Miscellaneous code readability improvements.
115
116 * src/reader.c (reader): Move %define front-end variable
117 defaults and checking into...
118 (prepare_percent_define_front_end_variables): ... this new
119 function.
120
121 * src/scan-gram.l (INITIAL): For consistency with string
122 literals, don't store open quote on character literal. It's
123 discarded before returning anyway.
124 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
125 Make length test more readable, and make the character stored
126 for an empty literal more obvious while consistent with the
127 previous behavior.
128
129 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
130 USER_NUMBER_HAS_STRING_ALIAS throughout.
131 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
132 that is repeated in symtab.h. Improve argument names to make it
133 clear which side of the symbol-string alias pair is which.
134 (symbol_check_alias_consistency): Improve local variable names
135 for the same purpose.
136 * src/symtab.h (struct symbol): Make comments about aliases
137 clearer.
138 (symbol_make_alias): Improve comments and argument name.
139 * src/output.c (token_definitions_output): Update for rename to
140 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
141
1a323c2f
AR
1422009-08-08 Alex Rozenman <rozenman@gmail.com>
143
144 Convert "misleading reference" messages to warnings.
145 * src/scan-code.l: New function 'show_sub_messages', more
146 factoring.
147 * tests/named-ref.at: Adjust tests.
148
38609c34
JD
1492009-08-06 Joel E. Denny <jdenny@clemson.edu>
150
151 maint: run "make update-copyright"
152
642f240e
JD
1532009-08-06 Joel E. Denny <jdenny@clemson.edu>
154
155 maint: make update-b4-copyright easier to use
156 * build-aux/update-b4-copyright: In warnings, report line
157 numbers rather than character positions.
158 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
159 that update-copyright runs it.
160 * gnulib: Update.
161
d0caad01
JD
1622009-08-05 Joel E. Denny <jdenny@clemson.edu>
163
164 maint: clean up update-b4-copyright code
165 * build-aux/update-b4-copyright: Do not accept 2-digit
166 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
167 Don't accept a `[' in a b4_copyright argument.
168 Format code more consistently.
169 Don't assume b4*copyright never occurs.
170
ac2def56
JD
1712009-08-04 Joel E. Denny <jdenny@clemson.edu>
172
173 maint: automate b4_copyright updates.
174 * Makefile.am (update-b4-copyright): New target rule.
175 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
176 * build-aux/update-b4-copyright: New.
177 * data/yacc.c: Remove stray characters around b4_copyright
178 invocations.
179
dbbb64f0
JD
1802009-08-04 Joel E. Denny <jdenny@clemson.edu>
181
182 maint: automate annual package-wide copyright-year update.
183 * .x-update-copyright: New.
184 * Makefile.am (EXTRA_DIST): Remove maint.mk.
185 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
186 update-copyright. Remove gnumakefile, which is implied by
187 maintainer-makefile.
188 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
189 * gnulib: Update.
190 * maint.mk: Remove, now copied from gnulib.
191 * examples/extexi: Add missing "(C)" in copyright statement so
192 update-copyright can recognize it.
193 * src/LR0.h: Likewise.
194 * src/print.h: Likewise.
195 * src/print_graph.h: Likewise.
196 * src/gram.c: Add missing comma in copyright statement.
197 * src/gram.h: Likewise.
198
bfa018d4
JD
1992009-08-04 Joel E. Denny <jdenny@clemson.edu>
200
201 Fix "make distcheck".
202 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
203 of just calc.stamp.
204
4521fcdf
JD
2052009-08-01 Joel E. Denny <jdenny@clemson.edu>
206
207 Pacify "gcc -Wunused" for the input function from Flex.
208 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
209 and later.
210 * src/scan-code.l: Add "%option noinput", which I cannot find in
211 the Flex manual, but which Flex has supported since at least as
212 far back as 2.5.4. However, if any of our developers still use
213 Flex 2.5.4, they'll need to stop configuring with
214 --enable-gcc-warnings because "%option noinput" didn't work
215 correctly until Flex 2.5.6.
216 * src/scan-gram.l: Likewise.
217 * src/scan-skel.l: Likewise.
218
992e874a
AR
2192009-07-31 Alex Rozenman <rozenman@gmail.com>
220
221 Fix --enable-gcc-warnings problems.
222 * src/reader.c: Adjust variable names.
223 * src/scan-code.l: Fix prototypes and adjust names.
224 * src/named-ref.c: Remove redundant "if".
225
a1ed2b71
JD
2262009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
227
228 Fix a --enable-gcc-warnings problem.
229 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
230 variable.
231
cbc6a70e 2322009-07-24 Alex Rozenman <rozenman@gmail.com>
1e20ad11
AR
233
234 Fix some memory leaks.
235 * src/named-ref.c: Add a pointer check (named_ref_free).
236 * src/scan-code.l: New function (variant_table_free). Called in
237 code_scanner_free.
238 * src/symlist.c: Call to named_ref_free (symbol_list_free).
239
ac9b0e95
JD
2402009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
241
242 Warn about character literals not of length one.
243 * NEWS (2.5): Document.
244 * src/scan-gram.l (INITIAL): Remove comment that we don't check
245 the length.
246 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
247 * tests/input.at (Bad character literals): New test group.
248
2de160e1
JD
2492009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
250
251 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
252
cba97506
JD
2532009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
254
255 Some M4 cleanup in the testsuite.
256 Suggested by Eric Blake at
257 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
258 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
259 complicate the code by distinguishing between a missing value
260 and an empty string value for an optional argument. This fix is
261 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
262 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
263 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
264 arguments are not needed because of the following changes.
265 Fix stale comments.
266 Bison developers should use GNU M4 and should not use
267 POSIXLY_CORRECT when building the test suite, so do not
268 complicate the code by avoiding $10 and above.
269 Do not quote an empty string value for an optional argument, and
270 do not distinguish between a missing value and an empty string
271 value.
272
62eb2d1b
JD
2732009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
274
275 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
276
620b2e36
JD
2772009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
278
279 Revert unnecessary column realignment in --help output.
280 Reported by Akim Demaille at
281 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
282 * src/getargs.c (usage): Here.
283
cbc6a70e 2842009-07-04 Alex Rozenman <rozenman@gmail.com>
dad6544d
AR
285
286 Alphabetical order in src/Makefile.am.
287 * src/Makefile.am: Adjust.
288
cbc6a70e 2892009-07-04 Alex Rozenman <rozenman@gmail.com>
d5e8574b
AR
290
291 Style changes and factoring.
292 * src/named-ref.h: Add comments.
293 * src/parse-gram.y: Readability and style changes.
294 * src/reader.c: Factoring: assign_named_ref function.
295 * src/scan-code.l: Factoring and style changes. Rename
296 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
297 Use "unsigned" type for variant index. Improve readablity.
298 * src/scan-gram.l: Change error messages and add comments.
299 * src/symlist.h: symbol_list_null: New function decl.
300 * src/symlist.c: symbol_list_null: Implement here.
301 * tests/named-refs.at: Adjust for new error messages.
302
ae09ec85
EB
3032009-06-29 Eric Blake <ebb9@byu.net>
304
305 scan-code: avoid compiler warnings
306 * src/scan-code.l (parse_named_ref): Use correct specifiers.
307
80d653fd
AD
3082009-06-29 Akim Demaille <demaille@gostai.com>
309
310 build: avoid concurrent extraction of calc++.
311 * examples/calc++/Makefile.am (calc.stamp): New.
312 Depend on it to create the sources of calc++ so that concurrent
313 builds don't launch several "extexi" in parallel.
314 Not only this is inefficient, this also builds incorrect sources
315 with several extractions mixed together.
316
7685e2f7
AR
3172009-06-27 Alex Rozenman <rozenman@gmail.com>
318
319 Implement support for named symbol references.
320 * src/parse-gram.y: Add new syntax (named_ref.opt).
321 * src/reader.c: Store named refs in symbol lists.
322 * src/reader.h: New argument for symbol_append and
323 action_append functions.
324 * src/scan-code.h: Add new field (named_ref) into
325 code_props data structure. Keeps named ref of midrule
326 actions.
327 * src/scan-code.l: Support for named refs in semantic
328 action code. New function 'parse_named_ref'.
329 * src/scan-gram.l: Support bracketed id.
330 * src/symlist.c: Store named refs in symbol lists.
331 * src/symlist.h: New field in symbol list: named_ref.
332 * src/named-ref.h: New file, a struct for named_ref.
333 * src/named-ref.cp: New file, named_ref_new function.
334 * src/local.mk: Add two new files.
335 * tests/testsuite.at: Include new test group:
336 * tests/named-refs.at: this new file.
337
67f8cf51
AD
3382009-06-25 Akim Demaille <demaille@gostai.com>
339
340 hash: check insertion for memory exhaustion.
341 * src/uniqstr.c (uniqstr_new): New.
342
83b66ddd
AD
3432009-06-11 Akim Demaille <demaille@gostai.com>
344
345 style changes.
346 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
347 * src/print-xml.c: Style changes.
348 * tests/conflicts.at: Comment changes.
349
517cb0ad
AD
3502009-06-11 Akim Demaille <demaille@gostai.com>
351
352 xml: beware of user strings used to give a %prec to rules.
353 * tests/conflicts.at (%prec with user strings): New.
354 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
355 XML output.
356
75c7a52a
AD
3572009-06-11 Akim Demaille <demaille@gostai.com>
358
359 hash: check insertion for memory exhaustion.
360 * src/muscle-tab.c (muscle_insert, muscle_grow)
361 * src/state.c (state_hash_insert): Check the return value of
362 hash_insert.
363
66ed9753
AD
3642009-06-10 Akim Demaille <demaille@gostai.com>
365
366 deterministic test suite.
367 Some consistency checks on symbols are performed after all the
368 symbols were read, by an iteration over the symbol table. This
369 traversal is nondeterministic, which can be a problem for test
370 cases.
371 Avoid this.
372 Addresses another form of nondeterminism reported by Joel E. Denny.
373 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
374
375 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
376 test in two.
377 Use different file names for the three tests to make the
378 maintenance easier.
379
ed15d907
AD
3802009-06-10 Akim Demaille <demaille@gostai.com>
381
95d176ff
AD
382 deterministic user-token-number redeclaration errors.
383 Address nondeterminism reported by Joel E. Denny.
384 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
385
386 * src/uniqstr.h: Comment changes.
387 * src/location.h (boundary_cmp, location_cmp): New.
388 * src/symtab.c (user_token_number_redeclaration): New.
389 (symbol_translation): Use it.
390 * tests/input.at (Numbered tokens): Adjust the expected output.
391
3922009-05-25 Akim Demaille <demaille@gostai.com>
393
ed15d907
AD
394 gnulib: update.
395 * gnulib: Update to latest.
396 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
397 * m4/.gitignore: Regen.
398 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
399 Call xalloc_die on hash_insert failures.
400 Requested by the new __warn_unused_result__ attribute of
401 hash_insert.
402
e3a33f7c
JD
4032009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
404
405 Convert multiple variable definition warnings to complaints.
406 * NEWS (2.5): Add a new entry for that change.
407 * doc/bison.texinfo (Decl Summary): Update %define entry.
408 (Bison Options): Update -D/--define/-F/--force-define entry.
409 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
410 * src/muscle_tab.h (muscle_percent_define_insert): Update
411 comments.
412 * tests/input.at (`%define errors'): Update.
413 (`%define, --define, --force-define'): Update.
414
34d41938
JD
4152009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
416
417 -F/--force-define and relative %define/-D/--define priorities.
418 * NEWS (2.5): Add documentation to -D/--define entry.
419 * build-aux/cross-options.pl: Hard-code association of
420 --force-define with %define.
421 * doc/bison.texinfo (Decl Summary): In %define entry,
422 cross-reference command-line options.
423 (Bison Options): Add documentation to -D/--define entry.
424 (Option Cross Key): Widen column for --force-define row.
425 * src/getargs.c (usage): Document -F/--force-define. Realign
426 options in output.
427 (short_options, long_options, getargs): Parse -F/--force-define,
428 and update muscle_percent_define_insert invocation.
429 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
430 (muscle_percent_define_insert): Add argument with that type.
431 * src/muscle_tab.c (muscle_percent_define_insert): Implement
432 -F/--force-define behavior and priorities.
433 * src/parse-gram.y (prologue_declaration): Update
434 muscle_percent_define_insert invocations.
435 * tests/input.at (`%define, --define'): Rename to...
436 (`%define, --define, --force-define'): ... this and extend.
437
246c4efa
JD
4382009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
439
440 Update some comments to make sense for -D.
441 * data/bison.m4 (b4_check_user_names): In header comments, say
442 "user occurrence" instead of "grammar occurrence".
443 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
444 (muscle_percent_code_grow): Likewise just for consistency.
445
531683e7
JD
4462009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
447
448 * data/c++.m4: Update copyright year.
449
e7bfa8b7
JD
4502009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
451
452 * data/c++.m4 (b4_namespace_close): Simplify slightly.
453
8c221795
JD
4542009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
455
456 Handle a trailing `:' in a user-supplied C++ namespace better.
457 * data/c++.m4 (b4_namespace_close): Don't let it be printed
458 among the closing braces here. This fix might make the
459 generated code easier to debug, but otherwise it should be
460 insignificant because a trailing `:' is a C++ error already.
461
c8bf65f0
AD
4622009-05-19 Akim Demaille <demaille@gostai.com>
463
464 remove useless variable.
465 * src/getargs.c (skeleton_arg): Remove now useless variable.
466 Should help the compiler see that this printf-like call is sane.
467
7ac45a46
AD
4682009-05-11 Akim Demaille <demaille@gostai.com>
469
470 doc: use C++ headers.
471 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
472 headers.
473
601bdfab
AD
4742009-05-05 Akim Demaille <demaille@gostai.com>
475
476 fix hexadecimal token number support.
477 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
478
d19123e6
AD
4792009-05-05 Akim Demaille <demaille@gostai.com>
480
481 tests: check token numbers.
482 * tests/input.at (Numbered tokens): New.
483
ecdfea9a
AD
4842009-05-04 Akim Demaille <demaille@gostai.com>
485
486 bison: catch bad symbol names.
487 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
488 * tests/input.at: Adjust.
489
43e6aea5
AD
4902009-05-04 Akim Demaille <demaille@gostai.com>
491
492 space changes.
493 * src/scan-gram.l: Untabify to be robust to zealous editors.
494
c046698e
AD
4952009-05-04 Akim Demaille <demaille@gostai.com>
496
497 identifiers: dashes are letters.
498 Dashes can now start identifiers (symbols and directives).
b10dd689 499
c046698e
AD
500 * src/scan-gram.l ({letter}): Add dash.
501 ({id}): Remove it.
502 * tests/input.at (Symbols): Adjust.
503 Remove stray comment.
504 * tests/regression.at (Invalid inputs): Adjust error message.
505 * doc/bison.texinfo (Symbols): Update.
506
966aba65
JD
5072009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
508
509 Declare %code to be a permanent feature.
510 * NEWS (2.4.2): Here.
511 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
512 experimental.
513 (Decl Summary): Likewise.
514
812775a0
JD
5152009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
516
517 Convert underscores to dashes in some %define variable names.
518 For now, just api.push-pull and lr.keep-unreachable-states.
519 Maintain old names for backward compatibility.
520 * NEWS (2.5): Document.
521 * data/c.m4 (b4_identification): Update comment.
522 * data/yacc.c: Update access.
523 * doc/bison.texinfo: Update.
524 * etc/bench.pl.in (bench_grammar): Update use.
525 * src/files.c (tr): Move to...
526 * src/getargs.c, src/getargs.h (tr): ... here because I can't
527 think of a better place to expose it. My logic is that, for all
528 uses of tr so far, command-line arguments can be involved, and
529 getargs.h is already included.
530 * src/main.c (main): Update access.
531 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
532 variable names to new variable names before assigning value.
533 * src/reader.c (reader): Update setting default.
534 * tests/calc.at: Update uses.
535 * tests/conflicts.at (Unreachable States After Conflict
536 Resolution): Update use.
537 * tests/input.at (%define enum variables): Update use.
538 (%define backward compatibility): New test group.
539 * tests/push.at: Update uses.
540 * tests/reduce.at: Update uses.
541 * tests/torture.at: Update uses.
542
1c4aa81d
JD
5432009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
544
545 Set all front-end %define defaults in one place.
546 * src/main.c (main): Move lr.keep_unreachable_states default...
547 * src/reader.c (reader): ... to here.
548
1d0f55cc
JD
5492009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
550
551 Rename lr.default_reductions to lr.default-reductions.
552 * NEWS (2.5): Here.
553 * doc/bison.texinfo: Here.
554 * src/lalr.c (initialize_LA): Here.
555 * src/print.c (print_reductions): Here.
556 * src/reader.c (reader): Here.
557 * src/tables.c (action_row): Here.
558 * tests/input.at (%define enum variables): Here.
559 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
560
0b593457
JD
5612009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
562
563 Pacify ./configure --enable-gcc-warnings.
564 * tests/input.at (Symbols): Prototype yyerror and yylex.
565
0939aa2d
AD
5662009-04-21 Akim Demaille <demaille@gostai.com>
567
568 tests: check the use of dashes and periods in symbols.
569 * tests/input.at (Symbol): New test group.
570
0b593457 5712009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
ae618dcc
JD
572
573 Document how `%define "var" "value"' is not M4-friendly.
574 * src/parse-gram.y (variable): In comments here.
575
0b593457 5762009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
6789b8bd
JD
577
578 Add copyright updates missed during previous cherry pick.
579 * src/output.c: Here.
580 * src/parse-gram.y: Here.
581 * src/scan-gram.l: Here.
582
663ce7bb
AD
5832009-04-20 Akim Demaille <demaille@gostai.com>
584
585 variables: accept dashes.
586 * src/scan-gram.l ({id}): Also accept dashes after the initial
587 letter.
588 ({directive}): Use {id}.
589 * src/parse-gram.y: Comment and formatting changes.
590 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
591 symbols.
592 * src/complain.h, src/complain.c (yacc_at): New.
593 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
594 symbol names.
595 * src/output.c (token_definitions_output): Do not #define token
596 names with dashes.
597
379261b3
JD
5982009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
599
600 Clean up recent patches a little.
601 Reported by Akim Demaille.
602 * doc/bison.texinfo (Understanding): Fix typos.
603 * src/print.c (print_reductions): Don't use negated variable.
604
25029e16
JD
6052009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
606
607 List accepted values for a %define enum variable with an invalid value.
608 Suggested by Akim Demaille at
609 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
610 * data/bison.m4 (_b4_percent_define_check_values): Implement.
611 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
612 * tests/input.at (%define lr.default_reductions invalid values): Merge
613 into...
614 (%define enum variables): ... here, and update output.
615
620b5727
JD
6162009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
617
618 Rename "default rule" to "default reduction".
619 This includes changing variable names in code, changing
620 comments, and renaming %define lr.default_rules to %define
621 lr.default_reductions.
622 * NEWS (2.5): Update IELR documentation.
623 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
624 Adjust YYDEFACT and yydefact_ documentation.
625 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
626 and lr.type documentation. Make some other wording
627 improvements.
628 (Glossary): Adjust cross-references and Default Reduction
629 definition.
630 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
631 Remove a confusing comment pointed out by Akim Demaille.
632 (initialize_LA): Adjust code.
633 * src/print-xml.c (print_reductions): Adjust code.
634 * src/print.c (print_reductions): Adjust code.
635 * src/reader.c (reader): Adjust code.
636 * src/tables.c (action_row): Adjust code.
637 (token_actions): Adjust code.
638 * src/tables.h: Adjust YYDEFACT documentation.
639 * tests/input.at (%define lr.default_rules invalid values):
640 Rename test group to...
641 (%define lr.default_reductions invalid values): ... this, and
642 update grammar file and expected output.
643 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
644 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
645
34a6c2d1
JD
6462009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
647
648 Document %define lr.type and lr.default_rules.
649 * NEWS (2.5): Add an entry.
650 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
651 besides just LALR(1) and GLR(1).
652 * doc/bison.texinfo (Introduction): Likewise.
653 (Language and Grammar): Bison is no longer limited to LALR(1)
654 restrictions.
655 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
656 when trying to distinguish from GLR. Talk about LR(1) grammars
657 rather than LALR(1) grammars.
658 (Decl Summary): In %define api.push_pull entry, say it applies
659 to deterministic parsers in C rather than LALR(1) parsers in C.
660 Add lr.default_rules entry.
661 Add lr.type entry.
662 (Mystery Conflicts): Bison is no longer limited to LALR(1)
663 restrictions.
664 (Generalized LR Parsing): Same changes as for the previous GLR
665 section.
666 (Memory Management): Say deterministic rather than LALR(1).
667 (Understanding): Correct some bison output.
668 Index discussion of "accepting state".
669 Say deterministic rather than LALR(1).
670 (Bison Options): In --yacc entry, say deterministic rather than
671 LALR(1).
672 In --report, --graph, and --xml entries, just don't mention
673 LALR(1).
674 (C++ Parsers): Say deterministic rather than LALR(1).
675 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
676 (Glossary): Add Accepting State, Consistent State, Default Rule,
677 and IELR(1) definitions.
678 In Generalized LR (GLR) definition, make same changes as in
679 previous GLR sections.
680 In LALR(1) definition, say Bison uses LALR(1) by default rather
681 than implying Bison is limited to LALR(1).
682 (LocalWords): Add IELR.
683
f805dfcb
JD
6842009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
685
686 Finish implementing %define lr.type.
687 Its value can be "LALR", "IELR", or "canonical LR".
688 * lib/timevar.def (TV_IELR_PHASE1): New var.
689 (TV_IELR_PHASE2): New var.
690 (TV_IELR_PHASE3): New var.
691 (TV_IELR_PHASE4): New var.
692 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
693 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
694 Sbitset.h, ielr.h, and ielr.c.
695 * src/getargs.h, src/getargs.c (enum trace, trace_args,
696 trace_types): Add trace_ielr.
697 * src/lalr.h, src/lalr.c (ngotos): Export it.
698 (F): Rename to...
699 (goto_follows): ... this, update all uses, and export it.
700 (set_goto_map): Export it.
701 (map_goto): Export it.
702 (compute_lookahead_tokens): Don't free goto_follows yet. Now
703 handled in ielr.
704 (initialize_LA): Export it. Move lookback allocation to...
705 (lalr): ... here because, for canonical LR, initialize_LA must
706 be invoked but lookback and much of the rest of LALR isn't
707 needed.
708 * main.c (main): Instead of lalr, invoke ielr, which invokes
709 lalr.
710 * src/reader.c (reader): Default lr.type to "LALR".
711 Default lr.default_rules to "accepting" if lr.type is "canonical
712 LR". Leave the default as "all" otherwise.
713 Check for a valid lr.type value.
714 * src/state.h, src/state.c (struct state_list): Add state_list
715 member.
716 (state_new): Initialize state_list member to NULL.
717 (state_new_isocore): New function, exported.
718 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
719 exercises all values of lr.type.
720 (GNU AWK Grammar): Rename test group to...
721 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
722 AT_TEST_EXISTING_GRAMMAR.
723 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
724 (GNU pic Grammar): Rename test group to...
725 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
726 AT_TEST_EXISTING_GRAMMAR.
727 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
728 all values of lr.type.
729 (Single State Split): New test groups using AT_TEST_LR_TYPE.
730 (Lane Split): Likewise.
731 (Complex Lane Split): Likewise.
732 (Split During Added Lookahead Propagation): Likewise.
733
166366b2
JD
7342009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
735
736 Add new files for IELR and canonical LR implementation.
737 * src/AnnotationList.c: New.
738 * src/AnnotationList.h: New.
739 * src/InadequacyList.c: New.
740 * src/InadequacyList.h: New.
741 * src/Sbitset.c: New.
742 * src/Sbitset.h: New.
743 * src/ielr.c: New.
744 * src/ielr.h: New.
745
03c07b03
JD
7462009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
747
748 Implement %define lr.default_rules.
749 Its value describes the states that are permitted to contain
750 default rules: "all", "consistent", or "accepting".
751 * src/reader.c (reader): Default lr.default_rules to "all".
752 Check for a valid lr.default_rules value.
753 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
754 is "accepting", then only mark the accepting state as
755 consistent.
756 (initialize_LA): Tell state_lookahead_tokens_count whether
757 lr.default_rules is "accepting".
758 * src/tables.c (action_row): If lr.default_rules is not "all",
759 then disable default rules in inconsistent states.
760 * src/print.c (print_reductions): Use this opportunity to
761 perform some assertions about whether lr.default_rules was
762 obeyed correctly.
763 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
764 helps with checking the parser tables for a grammar.
765 * tests/input.at (%define lr.default_rules invalid values): New
766 test group.
767 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
768 AT_TEST_TABLES_AND_PARSE.
769 (`no %define lr.default_rules'): New test group generated by
770 AT_TEST_LR_DEFAULT_RULES.
771 (`%define lr.default_rules "all"'): Likewise.
772 (`%define lr.default_rules "consistent"'): Likewise.
773 (`%define lr.default_rules "accepting"'): Likewise.
774
44c124a3
AD
7752009-04-20 Akim Demaille <demaille@gostai.com>
776
777 Consistently refer to Yacc, not YACC.
778 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
779
42660736
JD
7802009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
781
782 Pacify make maintainer-check-posix.
783 * tests/input.at (%define, --define): Move bison command-line
784 options before grammar file name.
785
a2d05674
JD
7862009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
787
788 Document semicolon warnings.
789 * NEWS (2.5): Here.
790
c4fae1ef
AD
7912008-12-08 Akim Demaille <demaille@gostai.com>
792
793 Fix portability issue in the test suite.
794 * tests/local.at (AT_MATCHES_CHECK): New.
795 Based on Perl instead of Sed. Sed has too many portability
796 pitfalls, not ever Sed is GNU Sed.
797 * tests/actions.at (Fix user actions without a trailing semicolon):
798 Use it.
799
42f4393a
DJ
8002008-12-07 Di-an Jan <dianj@freeshell.org>
801
802 Implement the FIXME that ends an user action with a semicolon
803 if it seems necessary.
804 * src/scan-code.l (flex rules section): Flag cpp directive from
805 any `#' to the first unescaped end-of-line. Semicolon is not
806 needed after `;', `{', '}', or cpp directives and is needed after
807 any other token (whitespaces and comments have no effect).
808 * tests/actions.at (Fix user actions without a trailing semicolon):
809 New test.
810 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
811 to make user actions complete statements.
812 Adjust column numbers in error messages.
813 * tests/regression.at (Fix user actions without a trailing semicolon):
814 Remove. Covered by new test.
815
bd5df716
AD
8162009-04-14 Akim Demaille <demaille@gostai.com>
817
818 doc: minor fixes.
819 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
820 (Table of Symbols): Remove duplicate entry for %debug.
821
7ba0d59d
EB
8222009-04-10 Eric Blake <ebb9@byu.net>
823
824 submodules: update to latest
825 * submodules/autoconf: Use latest upstream Autoconf.
826
b4d71a96
EB
8272009-04-06 Eric Blake <ebb9@byu.net>
828
829 Work around autoconf 2.63b bug in testsuite.
830 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
831 autoconf bug related to # in test.
832
4ecd3681
JD
8332009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
834
835 * NEWS (2.5): Describe new -D/--define feature.
836
c65e5292
AD
8372008-11-10 Akim Demaille <demaille@gostai.com>
838
839 --trace=muscles
840 * src/getargs.h, src/getargs.c (trace_muscle): New.
841 (trace_types, trace_args): Support it.
842 * src/output.c (output_skeleton): Use it.
843
96002de2
AD
8442008-11-10 Akim Demaille <demaille@gostai.com>
845
846 muscles_output.
847 * src/output.c (muscles_output): New, extracted from...
848 (output_skeleton): here.
849 Adjust.
850
fadb13b5
AD
8512008-11-21 Akim Demaille <demaille@gostai.com>
852
853 Display the changes in cross-options.texi.
854 * build-aux/cross-options.pl ($sep): New, to separate items.
855 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
856 the changes.
857
72183df4
DJ
8582008-11-20 Di-an Jan <dianj@freeshell.org>
859
860 Improves options in the manual.
861 * doc/bison.texinfo (-g, -x): Add space before argument.
862 (Option Cross Key): Implement FIXME: listing directives also.
863 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
864 (Short Option): Special case -d. Put arguments inside @option.
fadb13b5 865 (Bison Directive): Add column, automatically extracted from
72183df4
DJ
866 src/scan-gram.l (actual name passed as the first argument)
867 with special case for %define.
868 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
869 to build-aux/cross-options.pl.
870 * src/getargs.c (usage): Document limitations of cross-options.pl.
871 * src/scan-gram.l: Likewise.
872
e80b068c
AD
8732009-02-25 Akim Demaille <demaille@gostai.com>
874
875 Copyright years.
876 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
877
e3ee30b8
AD
8782008-12-08 Akim Demaille <demaille@gostai.com>
879
880 Install autoconf as a submodule to get m4sugar.
881 * .gitmodules: Add submodules/autoconf.
882 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
883 submodules/autoconf.
884
c4eb1e84
JD
8852008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
886
887 Simplify last patch slightly.
888 * src/getargs.c (getargs): Here.
889
10fa0146
JD
8902008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
891
892 Fix last warning from --enable-gcc-warnings.
893 * src/getargs.c (getargs): Don't assign const address to non-const
894 pointer.
895
6f5be1ab
DJ
8962008-11-17 Di-an Jan <dianj@freeshell.org>
897
898 Handle --enable-gcc-warnings.
899 * src/getargs.c (command_line_location): Set parameters to void.
900
11c4e57d
AD
9012008-11-11 Akim Demaille <demaille@gostai.com>
902
903 AT_FULL_COMPILE.
904 * tests/actions.at, tests/regression.at: Use it.
905
e186a284
AD
9062008-11-07 Akim Demaille <demaille@gostai.com>
907
908 Pass command line location to skeleton_arg and language_argmatch.
909 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
910 The location argument is now mandatory.
911 Adjust all dependencies.
912 (getargs): Use command_line_location.
913
e14c6831
AD
9142008-11-07 Akim Demaille <demaille@gostai.com>
915
916 -D, --define.
917 * src/getargs.c (usage): Document -D.
918 Fix help string for --locations.
919 (command_line_location): New.
920 (short_options, long_options, getargs): Support -D, --define.
921 (getargs): Move -d support at the right place.
922 * doc/bison.texinfo (Bison Options): Update.
923 * tests/input.at (%define, --define): New.
924
75c21b61
AD
9252008-11-07 Akim Demaille <demaille@gostai.com>
926
927 Initialize the muscle table before parsing the command line.
928 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
929 (getargs): Define file_name.
930 * src/main.c (main): Initialize muscle_tab before calling
931 getargs.
932 * src/muscle_tab.c (muscle_init): No longer define file_name, as
933 its value is not available yet.
934
33d2a860
AD
9352008-11-09 Akim Demaille <demaille@gostai.com>
936
937 Require the generation of parse-gram.output.
938 * src/Makefile.am (YACC): Pass --report=all.
939
006faedf
JD
9402009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
941
942 * NEWS (2.5): New stub.
943
ecd1b61c
JD
9442009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
945
946 Fix options documentation.
947 * build-aux/cross-options.pl: As in --help output, write optional
948 arguments as [=ARG] not =[ARG].
949 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
950
f67c4037
AD
9512008-11-07 Akim Demaille <demaille@gostai.com>
952
953 Fix --help.
954 * src/getargs.c (usage): Fix help string for -W.
955
0213d651
AD
9562008-11-07 Akim Demaille <demaille@gostai.com>
957
958 Handle more general types of option arguments.
959 * build-aux/cross-options.pl: The argument ends at the first
960 space, not the first non-symbol character.
961 Use @var for each word appearing the argument description.
962
c19178bf
JD
9632009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
964
965 Remove spurious initial empty lines.
966 * data/location.cc: End the @output lines with an @.
967
0d2b2ab0
AD
9682008-11-04 Akim Demaille <demaille@gostai.com>
969
970 Remove spurious initial empty lines.
971 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
972 * data/yacc.c: End the @output lines with an @.
973
8ba62e3e
JD
9742009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
975
976 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
977 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
978 requirements for a correct m4 are stricter.
979 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
980 * configure.ac: Update to use AC_PROG_GNU_M4.
981 Reported by Eric Blake.
982
5bc993d9
JD
9832009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
984
985 Help with updating web manual.
986 * HACKING: Incorporate instructions from gnulib/doc/README.
987 * bootstrap.conf (gnulib_modules): Add gendocs.
988
580c075d
JD
9892009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
990
991 Fix strange %define locations for default values.
992 Reported by Akim Demaille at
993 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
994 and discussed again starting at
995 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
996 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
997 because location information is bogus.
998 Use angle brackets to delimit fake file name because square brackets
999 look like underexpanded m4. Choose a better fake file name.
1000 Use negative line numbers.
1001 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1002 * src/location.c (location_print): If line for a boundary is negative,
1003 only print that boundary's file name.
1004 * src/location.h: Document that.
1005 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1006 defaults): Update output.
1007
5d3a1ecb
AD
10082008-11-07 Akim Demaille <demaille@gostai.com>
1009
1010 Locations without columns for command line arguments.
1011 * src/location.c (location_print): Don't display negative columns.
1012 * src/location.h: Document this.
1013
015e86a7
JD
10142009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1015
1016 Add reminder about uploading public key to keys.gnupg.net.
1017 * HACKING (Release Procedure): Here.
1018
c1455bab
AD
10192009-03-31 Akim Demaille <demaille@gostai.com>
1020
1021 bootstrap: --help to stdout.
1022 * bootstrap (usage): Don't send --help to stderr.
1023 Use a here doc instead of a long string.
1024
2075a82a
AD
10252009-03-31 Akim Demaille <demaille@gostai.com>
1026
1027 bootstrap: README-hacking no longer exists
1028 * bootstrap (checkout_only_file): Set to HACKING.
1029
26fccd4d
AD
10302009-03-26 Akim Demaille <demaille@gostai.com>
1031
1032 doc: merge HACKING and README-hacking.
1033 Two files is confusing.
1034 Reported by Alexandre Duret-Lutz.
5bc993d9 1035
26fccd4d
AD
1036 * README-hacking: Merge into...
1037 * HACKING (Working from the repository): here.
1038
6469c4d7
AD
10392009-03-26 Akim Demaille <demaille@gostai.com>
1040
1041 doc: update README-hacking.
1042 * README-hacking: We now use git and git submodules.
1043 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1044
b328890a
AD
10452009-03-26 Akim Demaille <demaille@gostai.com>
1046
1047 lalr1.cc: avoid GCC 4.3 warnings.
1048 GCC 4.3 now warns about "a || b && c" and asks for explicit
1049 parentheses.
1050 Reported by Alexandre Duret-Lutz.
1051 * data/location.cc: Update copyright years.
1052 (Position::operator==): Use parens to make precedence explicit.
1053 Compare lines and columns first, as they are more likely to be
1054 different, and they are faster to compare.
1055
f3079439
AD
10562009-03-26 Akim Demaille <demaille@gostai.com>
1057
1058 gnulib: update.
1059 * gnulib: Update to latest.
1060 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
1061 use +=.
1062
8defe11b
AD
10632009-01-08 Akim Demaille <demaille@gostai.com>
1064
1065 Fix grep portability issues.
1066 Grep on Solaris does not support -q.
1067 Reported by Summum Bonum.
5bc993d9 1068
8defe11b
AD
1069 * NEWS: Add a stub for 2.4.2.
1070 * THANKS: Add Summum Bonum.
1071 * tests/atlocal.in (EGREP): New.
1072 (CC, CXX, XSLTPROC): Make it possible to override them via
1073 envvars.
1074 * tests/java.at: Use $EGREP instead of egrep.
1075 Use AT_CHECK's ignore instead of grep's -q.
1076
41930e7a
JD
10772008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1078
1079 Version 2.4.1.
1080 * NEWS: Set version and date.
1081 * lib/Makefile.am: Update copyright year.
1082 * tests/atlocal.in: Update copyright year.
1083
d07932ef
JD
10842008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1085
1086 Semicolon feature removal is not about future language support.
1087 * NEWS: The semicolon feature is no longer active for newer languages,
1088 so don't claim that it causes trouble for them.
1089
0364b334
JD
10902008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1091
1092 * gnulib: Update submodule to HEAD.
1093
876fd835
AD
10942008-12-09 Akim Demaille <demaille@gostai.com>
1095
1096 Update data/README.
1097 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1098
bee1df15
EB
10992008-12-05 Eric Blake <ebb9@byu.net>
1100
1101 Build testsuite with newer autoconf.
1102 * tests/output.at (m4_expand): Don't override in newer autoconf,
1103 where the underlying implementation changed.
1104 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1105 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1106 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1107 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1108 since some of them contain unbalanced ')'.
1109
7e6d1e22
JD
11102008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1111
1112 * NEWS: Clarify a little.
1113
a957d06c
JD
11142008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1115
1116 * NEWS: Update for recent changes.
1117
462503f8
JD
11182008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1119
1120 Fix unexpanded macros in GLR defines file.
1121 Reported by Csaba Raduly at
1122 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1123 * THANKS (Csaba Raduly): Add.
1124 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1125 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1126 lexer in a separate module that includes the defines file.
1127 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
1128 source.
1129 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1130 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1131 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1132 (AT_DATA_SOURCE_PROLOGUE): New.
1133 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1134 (AT_DATA_SOURCE): New.
1135 (AT_FULL_COMPILE): New, copied from master branch and extended to
1136 support an additional source file.
1137
bf151b75
JD
11382008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1139
1140 Don't let maintainer-*-check targets force a version update.
1141 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1142 handled.
1143
f56274a8
DJ
11442008-11-17 Di-an Jan <dianj@freeshell.org>
1145
1146 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1147 Align menus. Adjust word wrapping. Use node names for menu names.
1148 (Examples): Don't abbreviate node names.
1149 (LocalWords): Remove abbreviations.
1150 (Copying): Make description a sentence.
bf151b75 1151 (Java Action Features): Remove period to match the rest of menu.
f56274a8 1152
b5775a81
PB
11532008-11-11 Paolo Bonzini <bonzini@gnu.org>
1154
1155 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1156 * configure.ac: Adjust usage.
1157 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1158 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1159 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1160
7ed73f82
JD
11612008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1162
1163 Don't add a semicolon to actions for %skeleton or %language.
1164 It breaks Java test cases as reported by Akim Demaille.
1165 * src/scan-code.l: Implement.
1166
4b1ebc49
JD
11672008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1168
1169 Clean up %skeleton and %language priority implementation.
1170 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1171 remove static qualifier because others will soon need to see it.
1172 (language_prio): Likewise.
1173 (getargs): Use command_line_prio rather than 0.
1174 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1175 enum fields.
1176 (skeleton_prio): Extern it.
1177 (language_prio): Extern it.
1178 * src/parse-gram.y: Use grammar_prio rather than 1.
1179
738cde3e
AD
11802008-11-04 Akim Demaille <demaille@gostai.com>
1181
1182 * NEWS: Mention the trailing semicolon in action.
1183
d6fb461d
AD
11842008-11-04 Akim Demaille <demaille@gostai.com>
1185
1186 Reformat NEWS.
1187 * NEWS: Use more outline-mode markup.
1188 Suggested by Jim Meyering.
1189
14da0cdd
JD
11902008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1191
1192 Fix user actions without a trailing semicolon.
1193 Reported by Sergei Steshenko at
1194 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1195 * THANKS (Sergei Steshenko): Add.
1196 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1197 * tests/regression.at (Fix user actions without a trailing semicolon):
1198 New test case.
1199
c9ba9e59
JD
12002008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1201
1202 Initiate further development.
1203 * NEWS: Create an empty section for new entries.
1204 * gnulib: Update submodule to HEAD.
1205
bfb40910
JD
12062008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1207
1208 * NEWS: Version 2.4.
1209
241fda7a
JD
12102008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1211
1212 Prepare for next release.
1213 * NEWS: Briefly mention changes since 2.3b.
1214 * README: Say GNU m4 1.4.6, which we've been requiring in release
1215 announcements already, not 1.4.3, which breaks the build.
1216
ed4d67dc
JD
12172008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1218
1219 Say %language is experimental.
1220 We're thinking of extending it's effect on output file naming. See the
1221 thread at
1222 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1223 * NEWS: Say it's experimental.
1224 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1225 recommend it over %skeleton for now.
1226 (Bison Options): Likewise.
1227 (C++ Bison Interface): Use %skeleton not %language.
1228 (Calc++ Parser): Use %skeleton not %language.
1229 * src/getargs.c (usage): Say it's experimental.
1230
e254a580
DJ
12312008-11-01 Di-an Jan <dianj@freeshell.org>
1232 Paolo Bonzini <bonzini@gnu.org>
1233
1234 Support all Java parser class modifiers.
1235 * data/java.m4 (b4_percent_define_get3): New.
1236 (b4_final_if, b4_strictfp_if): New.
1237 * data/lalr1.java (final, strictfp, extends, implements): Support.
1238 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1239 documentation.
1240 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1241 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1242 (AT_CHECK_JAVA_GREP): New.
1243 (Java parser class modifiers): New test.
1244 (Java parser class extends and implements): New test.
1245
1246 Model exception propagation better with throws and lex_throws.
1247 * data/java.m4 (b4_list2): New.
1248 (throws): Change default.
1249 * data/lalr1.java (yyaction): Add throws.
1250 (parse): Add lex_throws in addition to throws.
1251 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1252 * tests/java.at (Java throws specifications): New test.
1253
1254 Improve documentation for Java parsers.
1255 * doc/bison.texinfo (Java Parsers): Add subsections.
1256 Don't quote first argument of %define.
1257 (Java Bison Interface): Document output files. Move documentation
1258 of parser class and merge into Java Parser Interface. Document
1259 features that error out. Document directives with no effect.
1260 Move note about Javadoc higher.
1261 (Java Semantic Values): Explicitly mention stype.
1262 Document that generic types cannot be used.
1263 (Java Location Values): Use @deftypeivar. Document constructors.
1264 Correct return value for toString.
1265 (Java Parser Interface): List undocumented constants/fields.
1266 Move documentation of fields added by %parse-param closer to list
1267 of members. Document that token names are added as fields.
1268 Document constructors accurately. Remove error method.
1269 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1270 Interface. Describe %code lexer and yylex accutately.
1271 Remove documentation that does not match the code.
1272 (Java Action Features): New.
1273 (Java Differences): Add reference. Add item on semantic values.
1274 Add note about @{ ... @}. Clarify %% epilogue placement.
1275 (Java Declarations Summary): New.
1276
1277 Fix Java skeleton.
1278 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1279 (b4_remove_comma): Quote test argument.
1280 (b4_identification): Remove "bison" field.
1281 * tests/java.at (Java parser class and package names): New test.
1282 (Java %parse-param and %lex-param): New test.
1283 (Java stype, position_class and location_class): New test.
1284
f259e4e6
PB
12852008-10-31 Di-an Jan <dianj@freeshell.org>
1286
1287 * data/lalr1.jave: Update copyright years.
1288 (YYParser): Correct name of "generated from" file in Javadoc:
1289 use b4_file_name instead of @ofile@.
1290 (Location constructor): Correct Javadoc parameter name.
1291 (yylloc): Add missing opening m4 quote after b4_location_if.
1292 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1293 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1294 (YYParser constructor): Correct Javadoc parameter name.
1295
cae5057f
JD
12962008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1297
1298 Always put auxiliary code files in the same dir as other output files.
1299 * src/files.c (compute_file_name_parts): When the user specifies
1300 --output but not --file-prefix, extract the directory prefix from the
1301 file prefix not from the grammar file name. This affects the location
1302 of files like location.hh generated by the C++ skeleton. The includes
1303 in the other output files require this fix.
1304 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1305 for expected output files.
1306 (Output files): Add a test for the above.
1307
4af432ba
JD
13082008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1309
1310 * gnulib: Update submodule to HEAD.
1311
e26d4e43
JD
13122008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1313
1314 Update copyright year.
1315 * src/files.c: Here.
1316
c0ee9e21
DJ
13172008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1318
1319 Don't overwrite the input file.
1320 * src/files.c (output_file_name_check): Fatal error if using input file
1321 for output.
1322 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1323 argument.
1324 (Conflicting output files): Add test.
1325
482dc52f
AD
13262008-10-28 Akim Demaille <demaille@gostai.com>
1327
1328 Space changes.
1329 * data/lalr1.cc: Formatting changes.
1330
52cbbe84
AD
13312008-10-28 Akim Demaille <demaille@gostai.com>
1332
1333 Don't define debugging functions when !YYDEBUG.
1334 * data/lalr1.cc (debug_stream, set_debug_stream)
1335 (debug_level_type, debug_level, set_debug_level): Don't
1336 declare them when YYDEBUG is not defined.
1337 The implementation are already YYDEBUG-aware.
1338
0925d5bf
AD
13392008-10-28 Akim Demaille <demaille@gostai.com>
1340
1341 Prefer "continue" for empty loop bodies.
1342 * etc/bench.pl.in: Use "continue" instead of {}.
1343
cf98343c
AD
13442008-10-28 Akim Demaille <demaille@gostai.com>
1345
1346 Space and comments changes.
1347 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1348 * data/c.m4, data/lalr1.cc: Space changes.
1349
9f467b7d
AD
13502008-10-28 Akim Demaille <demaille@gostai.com>
1351
1352 Make gnulib a submodule.
1353 * gnulib: New.
1354 * .gitmodules (gnulib): New.
1355
0f0e1ace
JD
13562008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1357
1358 Fix yyerror_range for user-defined location type in C++. Reported by
1359 Georg Sauthoff at
1360 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1361 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1362 * THANKS (Georg Sauthoff): Add.
1363
548e2104
JD
13642008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1365
1366 Update several administrative files mainly to facilitate releasing.
1367 * HACKING (Administrivia): Make the git-merge-changelog notes more
1368 helpful.
1369 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1370 (Release Procedure): Update for git and add numerous details that were
1371 previously missing.
1372 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1373 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1374 that announcements don't claim we bootstrapped with whatever bison
1375 happened to be in PATH. Add flex as a bootstrap tool.
1376 * Makefile.maint: Remove, previously replaced by maint.mk.
1377 * Makefile.cfg: Remove, and migrate settings to...
1378 * cfg.mk: ... here for the sake of `make announcement'.
1379 * bootstrap.conf (gnulib_modules): Add announce-gen.
1380 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1381 Berry.
1382
ddf17a6e
PB
13832008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1384
1385 Small but important bugfixes for the Java skeleton.
1386 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1387 (yy_symbol_print): Call toString on yyvaluep.
1388
e1145ad8
AD
13892008-08-29 Akim Demaille <demaille@gostai.com>
1390
1391 Clarify UPDATED use.
bee1df15 1392 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 1393 not to the release date of Bison.
bee1df15 1394 Reported by Joel E. Denny.
e1145ad8 1395
0df72d78
AD
13962008-08-29 Akim Demaille <demaille@gostai.com>
1397
1398 * README: Update FAQ pointer.
1399 Reported by Joel E. Denny.
1400
9a90b6bb
EB
14012008-08-27 Eric Blake <ebb9@byu.net>
1402
1403 Resync m4sugar from autoconf.
1404 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1405 (m4_init): Adjust to latest m4.git changes.
1406 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1407 effects.
1408 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1409 (_m4_list_cmp): Reduce side effects.
1410
65015668
AD
14112008-08-27 Akim Demaille <demaille@gostai.com>
1412
1413 Check yyerrok in calc.at.
bee1df15
EB
1414 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1415 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1416 expected.
65015668 1417
98e26a92
AD
14182008-08-27 Akim Demaille <demaille@gostai.com>
1419
1420 Support yyerrok in lalr1.cc.
1421 YYBACKUP is still to import back into lalr1.cc.
bee1df15 1422 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 1423
86c0e784
JD
14242008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1425
1426 For maintainer-check*, don't recompile for a $(VERSION) update.
1427 * cfg.mk: New file.
1428 (_is-dist-target): Override the one in GNUmakefile.
1429 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1430
88511166
JD
14312008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1432
1433 Update for recent change to gnulib.
1434 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1435 string.h now.
1436
6bbb2ed5
EB
14372008-08-15 Eric Blake <ebb9@byu.net>
1438
d67c52e8
EB
1439 Remaining m4sugar merge from autoconf.
1440 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1441 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1442 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1443 * src/output.c (output_skeleton): Tell m4 how to find it.
1444
6bbb2ed5
EB
1445 Partial m4sugar merge from autoconf: m4_map.
1446 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1447 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1448 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1449 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1450 for empty list.
1451 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1452 Likewise.
1453 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1454 declares it.
1455
8dce3875
JD
14562008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1457
1458 Keep .version and PACKAGE_VERSION in sync.
1459 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1460 dependency, and add comments justifying this in more detail. Discussed
1461 starting at
1462 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1463
882a1fbf
EB
14642008-08-06 Eric Blake <ebb9@byu.net>
1465
a3764451
EB
1466 Partial m4sugar merge from autoconf: m4_shiftn.
1467 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1468 (m4_shift2, m4_shift3): New macros.
1469 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1470 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1471 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1472 * data/java.m4 (b4_remove_comma): Likewise.
1473
882a1fbf
EB
1474 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1475 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1476 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1477 (m4_init): Consolidate wrapped text into single m4_wrap.
1478 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1479 in wrapped text.
1480
a30e920d
EB
14812008-08-05 Eric Blake <ebb9@byu.net>
1482
dfcc5959
EB
1483 Partial m4sugar merge from autoconf: builtins, version.m4.
1484 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1485 (m4_prepend): Remove, as it is unused and inherently quadratic,
1486 whereas m4_append is linear in newer m4.
1487 (m4_mkstemp): New builtin.
1488 (m4_symbols): Make rename conditional.
1489 (m4_version_prereq): Ensure fatal error if used in bison, which
1490 intentionally lacks version.m4.
1491
a30e920d
EB
1492 Fix comments in m4sugar.
1493 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1494
445b7470
JD
14952008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1496
1497 Update for recent .gitignore fix in Gnulib.
1498 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1499 anchored .gitignore entries.
1500
a1e50014
JD
15012008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1502
1503 Set gnu or gnits strictness.
1504 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1505 development and gnits strictness for releases. Based on Eric Blake's
1506 suggestion at
1507 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1508
d43f77e7
PB
15092008-07-31 Paolo Bonzini <bonzini@gnu.org>
1510
1511 * NEWS: Clarify documentation of %language.
1512
fee2ed87
PB
15132008-07-31 Paolo Bonzini <bonzini@gnu.org>
1514
1515 Support usage of git-merge-changelog.
1516 * .gitattributes: New.
1517 * HACKING: Document usage of git-merge-changelog.
1518 * bootstrap: Install git-merge-changelog entries in .git/config
1519 if appropriate.
1520
78029cd5
JD
15212008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1522
1523 Remove remaining dependence on CVS Id keyword.
1524 * ChangeLog: For the sake of people still using CVS, don't use dollars
1525 when mentioning Id.
1526 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1527 unusual anyway.
1528 * data/xslt/xml2dot.xsl: Likewise.
1529 * data/xslt/xml2text.xsl: Likewise.
1530 * data/xslt/xml2xhtml.xsl: Likewise.
1531 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1532 * doc/Makefile.am (neutralize): Remove, no longer needed.
1533 (.x.1): Don't use neutralize.
1534 (edit): Don't substitute for ID.
1535 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1536
c53d18b1
JD
15372008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1538
1539 Fix dependence on computed configure variables.
1540 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1541 $(top_srcdir)/configure.ac so that changes to computed variables, such
1542 as PACKAGE_VERSION, are seen.
1543 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1544
5523ac79
JD
15452008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1546
1547 Update copyright dates for recent changes.
1548 * Makefile.am: Here.
1549 * src/Makefile.am: Here.
1550 * src/reduce.c: Here.
1551 * tests/reduce.at: Here.
1552
8fa36911
JD
15532008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1554
1555 Use git-version-gen for version names between releases.
1556 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1557 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1558 * .prev-version: New.
1559 * .version.in: Remove.
78029cd5 1560 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
1561 revision.
1562 * GNUmakefile: Remove, now copied from Gnulib.
1563 * Makefile.am: Add code suggested by comments in
1564 build-aux/git-version-gen.
1565 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1566 .prev-version, and .version.
1567 * NEWS (2.3b+): Rename to...
1568 (?.?): ... this because we're dropping the "+" version naming scheme,
1569 but, in general, we still can't be sure of our next release name.
1570 * bootstrap: Add a quick hack to remove from .gitignore the
1571 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1572 entry. This should really be fixed in gnulib instead.
1573 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1574 * configure.ac (AC_INIT): Set version name by invoking
1575 build-aux/git-version-gen.
1576 (AC_CONFIG_FILES): Remove .version, now generated by
1577 build-aux/git-version-gen.
1578 * maint.mk: New, copied from coreutils.
1579 * doc/.cvsignore (bison.1): Add.
1580 * doc/.gitignore (/bison.1): Add.
1581 * doc/bison.1: Remove, generated.
1582 * src/.cvsignore (revision.c): Remove.
1583 * src/.gitignore (/revision.c): Remove.
1584 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1585 (BUILT_SOURCES): Remove revision.c.
1586 (revision.c): Remove.
1587 * src/getargs.c (version): Don't print revision after the VERSION.
1588 * src/revision.h: Remove.
1589
bcf07cb7
JD
15902008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1591
1592 Fix untranslatable composition of sentences. Reported by Goran
1593 Uddeborg at
1594 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1595 * THANKS (Goran Uddeborg): Add.
1596 * src/reduce.c (reduce_print): Report the number of nonterminals and
1597 rules useless in the grammar in separate sentences.
1598 * tests/reduce.at (Useless Rules): Update output.
1599 (Reduced Automaton): Likewise.
1600 (Underivable Rules): Likewise.
1601 (Empty Language): Likewise.
1602
9aacab9a
JD
16032008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1604
1605 Fix some .gitignore and .cvsignore problems.
1606 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1607 (insert_vc_ignore): ... this new function, which prepends `/' to all
1608 .gitignore entries before passing them to insert_sorted_if_absent.
1609 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1610 .cvsignore files are maintained even though Bison developers run
1611 bootstrap while using Git.
1612 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1613 unneeded by Bison.
1614 (gnulib): Add.
1615 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1616 unneeded. Reported by Eric Blake.
1617 * lib/.gitignore (/*~): Add.
1618 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1619 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1620 Blake.
1621 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1622
a9fc7990
JD
16232008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1624
1625 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1626 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1627 * bootstrap.conf (gnulib_modules): Add unsetenv.
1628 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1629 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1630 (/setenv.m4): Add.
1631 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1632 the first argument because it may become position-dependent, and unset
1633 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1634 Add comments explaining these issues in more detail.
1635
0f1d6f10
JD
16362008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1637
1638 Add .gitignore everywhere based on .cvsignore.
1639 * .gitignore: New.
1640 * build-aux/.gitignore: New.
1641 * data/.gitignore: New.
1642 * doc/.gitignore: New.
1643 * etc/.gitignore: New.
1644 * examples/.gitignore: New.
1645 * examples/calc++/.gitignore: New.
1646 * lib/.gitignore: New.
1647 * m4/.gitignore: New.
1648 * po/.gitignore: New.
1649 * runtime-po/.gitignore: New.
1650 * src/.gitignore: New.
1651 * tests/.gitignore: New.
1652
7bd1665a
JD
16532008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1654
1655 * NEWS (2.3b+): New section, empty for now.
1656 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1657
72c5b982
JD
16582008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1659
1660 * NEWS (2.3b): Update release date since there has been a delay in
1661 getting the announcements and tarballs out.
1662
bd02cd5d
JD
16632008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1664
1665 * NEWS: Version 2.3b.
1666 * configure.ac (AC_INIT): Likewise.
1667 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1668
9126263e
JD
16692008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1670
1671 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1672 been doing it for years.
1673 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1674 (Release Procedure): Add FIXME about make alpha being unmaintained.
1675
fa6aa7b3
JD
16762008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1677
1678 * data/yacc.c: Reformat m4 a little for readability.
1679 * src/lalr.c (build_relations): Correct comment.
1680
d30b312d
JMG
16812008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1682
1683 DJGPP specific issue.
1684 * djgpp/config.sed: Fixes required to run configure scripts generated
1685 by autoconf 2.62.
1686
138d4cd9
JD
16872008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1688
1689 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1690 coordinator@translationproject.org.
1691
8f7e2e1f
JD
16922008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1693
1694 * THANKS: Add Eric Blake.
1695
f55efa38
JD
16962008-04-23 Eric Blake <ebb9@byu.net>
1697
1698 Revert prior patch, by working around autoconf regression.
1699 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1700 ("Output file name: ("): Uncomment test.
1701 ("Output file name: )"): Likewise.
1702 Based on an idea from Noah Misch.
1703
096c9f9d
JD
17042008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1705
1706 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1707 2.61. Reported by Juan Manuel Guerrero at
1708 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1709 * tests/output.at ("Output file name: ("): Comment out test case for
1710 now.
1711 ("Output file name: )"): Likewise.
1712
0f664b89
JD
17132008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1714
1715 * GNUmakefile: Update git-version-gen invocation so make dist
1716 succeeds.
1717
1cfe6375
JD
17182008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1719
1720 Update to the current gnulib CVS repository, and fix trigraph handling
1721 in Bison.
1722 * bootstrap: Update gnulib CVS repository URL.
1723 (symlink_to_dir): Encapsulate the code that guarantees the destination
1724 directory exists into...
1725 (check_dst_dir): ... this new function, and...
1726 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1727 fail when copying files into lib/uniwidth/.
1728 * src/output.c (prepare_symbols): When writing yytname muscles, where
1729 symbol names will be encoded in C-string literals, tell quotearg to
1730 escape trigraphs. This used to be the default in gnulib.
1731 * tests/regression.at (Token definitions): Because of the change in
1732 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1733 escapes trigraphs in symbol names. Thus, yytname no longer has
1734 trigraphs unnecessarily doubly escaped. Update test case output.
1735 Extend test case to be sure Bison's own error messages will no longer
1736 have trigraphs in symbol names unnecessarily escaped once.
1737
74c52fc8
JD
17382008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1739
1740 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1741 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1742 * .cvsignore: Add .version.
1743 * .version.in: New.
1744 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1745 * configure.ac (AC_CONFIG_FILES): Add .version.
1746 * build-aux/.cvsignore: Add git-version-gen.
1747
8e55b3aa
JD
17482008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1749
1750 * NEWS (2.3a+): Mention that -g now takes an argument.
1751 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1752 consistency. Update the -g and -x entries now that they take
1753 arguments. Use brackets to indicate optional arguments.
1754 * src/getargs.c (usage): Explain the relationship between arguments of
1755 long and short options more completely. Document --defines and -d
1756 separately since the former takes an argument but, for POSIX Yacc, the
1757 latter does not.
1758 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 1759 (getargs): Sort cases.
8e55b3aa 1760
59c5ac72
AD
17612008-02-28 Akim Demaille <demaille@gostai.com>
1762
1763 * doc/bison.texinfo: Fix a few typos.
1764
118d4978
AD
17652008-02-28 Akim Demaille <akim@epita.fr>
1766
1767 * doc/bison.texinfo (Bison Options): Document -W.
1768 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1769
7020f1e9
AD
17702008-02-28 Akim Demaille <akim@epita.fr>
1771
1772 * src/getargs.c (short_options): Split and sort for readability.
1773 -g and -x take optional arguments, just like their long options.
1774 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1775 understand.
1776 Fix the handling of $opt which resulted in all the argument to be
1777 considered as optional.
1778
59da312b
JD
17792008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1780
1781 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1782 say its interface is experimental.
1783 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1784 Java.
1785 (Bison Options): In the -L and --language entry, mention Java.
1786 (Java Bison Interface): Say the interface is experimental.
1787 * src/getargs.c (usage): Mention -L and --language.
1788
1789 * NEWS (2.3a+): Say the push parsing interface is experimental.
1790 * doc/bison.texinfo (Push Decl): Likewise.
1791 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1792 (Push Parser Function): Likewise.
1793 (Pull Parser Function): Likewise.
1794 (Parser Create Function): Likewise.
1795 (Parser Delete Function): Likewise.
1796 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1797 yypull_parse, and yypush_parse entries.
1798
1799 * NEWS (2.3a+): Mention XML support, and say the schema is
1800 experimental.
1801 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1802 * src/getargs.c (usage): Say the XML schema is experimental.
1803
1804 * NEWS (2.3a+): Say option instead of flag.
1805
2bb3ebec
WP
18062008-02-21 Wojciech Polak <polak@gnu.org>
1807
1808 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1809 text.
1810
333e670c
JD
18112008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1812
1813 Fix impure push parser compile error reported by Bob Rossi at
1814 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1815 * data/yacc.c: Clean up whitespace in the output a little.
1816 (yypstate_allocated): Define for impure push parsers regardless of
1817 whether the pull interface is also requested.
1818 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1819 check impure push parsers without the pull interface.
1820
1821 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1822 yyerror takes arguments specified by %parse-param while yypstate_new
1823 does not.
1824 * doc/bison.texinfo (Parser Create Function): Document that
1825 yypstate_new returns 0 for multiple impure parser instances.
1826 * tests/push.at (Push Parsing: Multiple impure instances): Update
1827 expected stderr output.
1828
798096e1
JD
18292008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1830
1831 * runtime-po/POTFILES.in (push.c): Remove.
1832
9ca7f077
JD
18332008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1834
1835 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1836 * data/push.c: Rename to...
1837 * data/yacc.c: ... this, overwriting it.
1838 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1839 `%push-pull-parser' -> `%define api.push_pull "both"'.
1840 Remove old yacc.c tests, and update push.c tests to yacc.c.
1841
42ee26bb
JD
18422008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1843
1844 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1845 `"%code top" blocks' instead of `%code "top" blocks'.
1846 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1847 Clean up whitespace in the output a little.
1848
b1cc23c4
JD
18492008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1850
1851 Fix documentation problems reported by Tim Josling at
1852 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1853 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1854 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1855 integers. Explain the effect of literal string aliases on error
1856 messages. Copy token 0 documentation from the C++ skeleton
1857 documentation.
1858
ab7f29f8
JD
18592008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1860
1861 Accept a token number in a %left, %right, or %nonassoc for POSIX
1862 conformance. Reported by Tim Josling at
1863 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1864 * NEWS (2.3a+): Mention.
1865 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1866 and code numbers are treated by precedence declarations.
1867 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1868 of symbols.1.
1869 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1870 of symbol.
1871 (symbol.prec): New, just like symbol but allows INT.
1872 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1873 longer holds.
1874 * tests/regression.at (Token number in precedence declaration): New
1875 test case.
1876
a924ef36
JMG
18772008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1878
1879 DJGPP specific issues.
1880 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1881 be changed. Copyright timestamp adjusted.
1882 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1883 be changed. Copyright timestamp adjusted.
1884 * djgpp/config.site: Copyright timestamp adjusted.
1885 * djgpp/config_h.sed: Copyright timestamp adjusted.
1886 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1887 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1888 filename translation list.
1889 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1890 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1891 files shall be created. Before trying to use the temp dir where the
1892 environment variable points to check that the dir really exists. If
1893 not default to the cwd as temp dir. Copyright timestamp adjusted.
1894 * djgpp/subpipe.h: Copyright timestamp adjusted.
1895 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1896
389c8cfd
PE
18972008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1898
1899 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
1900
5d1cfef4
PE
19012008-01-09 Paul Eggert <eggert@cs.ucla.edu>
1902
1903 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
1904 Problem reported by Claudio Saavedra in
1905 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
1906
e2dcf996
WP
19072008-01-05 Wojciech Polak <polak@gnu.org>
1908
1909 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
1910 document's title with the input grammar file name.
1911
da730230
JD
19122007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
1913
1914 Automate regression testing of the XML/XSLT implementation. Discussed
1915 starting at
1916 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
1917 * configure.ac (XSLTPROC): New substitution.
1918 * Makefile.am (maintainer-xml-check): New phony target invoking...
1919 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
1920 invoking make maintainer-check with BISON_TEST_XML=1.
1921 * tests/atlocal.in (XSLTPROC): New.
1922 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
1923 not to report reachable memory when Bison is expected to have a
1924 non-zero exit status and (2) to compare XML/XSLT output with --graph
1925 and --report=all output for every working grammar when
1926 BISON_TEST_XML=1.
1927 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
1928 (AT_BISON_CHECK_XML): New.
1929 (AT_QUELL_VALGRIND): New.
1930 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
1931 (AT_CHECK): ... don't redefine this since this was the old way to
1932 quell Valgrind.
1933 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
1934 AT_BISON_CHECK invocations.
1935 * tests/c++.at: Likewise.
1936 * tests/calc.at: Likewise.
1937 * tests/conflicts.at: Likewise.
1938 * tests/cxx-type.at: Likewise.
1939 * tests/existing.at: Likewise.
1940 * tests/glr-regression.at: Likewise.
1941 * tests/headers.at: Likewise.
1942 * tests/input.at: Likewise.
1943 * tests/java.at: Likewise.
1944 * tests/output.at: Likewise.
1945 * tests/push.at: Likewise.
1946 * tests/reduce.at: Likewise.
1947 * tests/regression.at: Likewise.
1948 * tests/sets.at: Likewise.
1949 * tests/skeletons.at: Likewise.
1950 * tests/synclines.at: Likewise.
1951 * tests/torture.at: Likewise.
1952 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
1953 tends to hang xsltproc.
1954 (Big horizontal): Likewise.
1955
408476bc
JD
19562007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1957
1958 In XML output, remove redundant class attribute on symbol element.
1959 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
1960 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
1961 look up a symbol to determine whether it's a nonterminal or terminal.
1962 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
1963 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
1964
1965 Add prec/assoc information to XML output.
1966 * src/gram.c (grammar_rules_print_xml): For each rule that has a
1967 %prec, add a percent_prec attribute.
1968 * src/print-xml.c (print_grammar): For each terminal that has a
1969 precedence or associativity, add a prec or assoc attribute.
1970 (xml_indent): New.
1971 (xml_puts): Use xml_indent.
1972 (xml_printf): Use xml_indent.
1973 * src/print-xml.h (xml_indent): Prototype.
1974
1975 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
1976 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
1977
d4a26c48
JD
19782007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1979
1980 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
1981 (bison:ruleByNumber): ... this for clarity.
1982 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
1983 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
1984 (xsl:template match="reduction"): Update.
1985 (xsl:template match="item"): Update.
1986 (xsl:template match="reduction"): Update.
1987
1988 In the XML output, don't print the list of rules where symbols appear.
1989 Compute it in XSLT instead. Discussed at
1990 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
1991 * data/xslt/bison.xsl (bison:ruleByLhs): New.
1992 (bison:ruleByRhs): New.
1993 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
1994 bison:ruleByRhs.
1995 (xsl:template match="terminal/rule"): Remove.
1996 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1997 bison:ruleByRhs.
1998 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1999 Remove.
2000 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2001 bison:ruleByRhs and mode="number-link" for rule template.
2002 (xsl:template match="terminal/rule"): Remove.
2003 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2004 bison:ruleByRhs and mode="number-link" for rule template.
2005 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2006 Rewrite as...
2007 (xsl:template match="rule" mode="number-link"): ... this.
2008 * src/print-xml.c (print_grammar): Don't print the list of rules.
2009
ef1b4273
JD
20102007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2011
2012 Don't let --report affect XML output; always print all information.
2013 Discussed at
2014 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2015 * src/conflicts.c (log_resolution): Implement.
2016 * src/print-xml.c (print_core): Implement.
2017 (print_state): Implement.
2018 (print_xml): Implement.
2019
2020 * NEWS (2.3a+): Fix quotes.
2021 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2022 don't let %verbose clear the list specified by --report.
2023
0f6cd9e3
AD
20242007-11-26 Akim Demaille <akim@epita.fr>
2025
2026 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2027
d80fb37a
JD
20282007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2029
2030 In the XML output, list useless and unused symbols and rules with the
2031 useful ones and add a "usefulness" attribute. Discussed starting at
2032 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2033 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2034 (grammar_rules_print_xml): Print all rules instead of just those
2035 useful in the grammar, and add a "usefulness" attribute.
2036 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2037 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2038 (print_grammar): Print all nonterminals instead of just useful ones,
2039 and add a "usefulness" attribute to nonterminals and terminals.
2040 (print_xml): Don't print a separate "reductions" or
2041 "rules-useless-in-parser" element.
2042 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2043 (reduce_xml): Remove.
2044 (reduce_token_unused_in_grammar): New.
2045 (reduce_nonterminal_useless_in_grammar): New.
2046 * src/reduce.h (reduce_xml): Remove prototype.
2047 (reduce_token_unused_in_grammar): Add prototype.
2048 (reduce_nonterminal_useless_in_grammar): Add prototype.
2049 * data/xslt/xml2text.xsl: Update for XML changes.
2050 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2051 * tests/reduce.at (Useless Terminals): Update output.
2052 (Useless Rules): Update output.
2053 (Reduced Automaton): Update output.
2054
2055 Say "Terminals unused in grammar" instead of "Unused terminals".
2056 * NEWS (2.3a+): Update.
2057 * doc/bison.texinfo (Understanding): Update example output.
2058 * src/reduce.c (reduce_output): Implement.
2059 * data/xslt/xml2text.xsl: Implement.
2060 * data/xslt/xml2xhtml.xsl: Implement.
2061
1bb2bd75
JD
20622007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2063
2064 Accept --report-file=FILE to override the default `.output' filename.
2065 * NEWS (2.3a+): Mention.
2066 * doc/bison.texinfo (Bison Options): Add an entry.
2067 * src/files.c (compute_output_file_names): Don't override
2068 spec_verbose_file if already set.
2069 * src/getargs.c (usage): Document --report-file.
2070 (REPORT_FILE_OPTION): New anonymous enum member.
2071 (long_options): Add entry for it.
2072 (getargs): Add case for it setting spec_verbose_file.
2073
2074 * build-aux/cross-options.pl: Don't record a short option just because
2075 there's an arg.
2076 * doc/.cvsignore: Add yacc.1.
2077
a005a9c4
AD
20782007-11-14 Akim Demaille <akim@epita.fr>
2079
2080 * doc/yacc.1.in: New.
2081 * configure.ac, doc/Makefile.am: Adjust.
2082 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2083 config.h symbol.
2084 Use AC_SUBST for assignments too.
2085 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2086
cff03fb2
JD
20872007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2088
2089 * src/gram.c: Remove comments that duplicate comments in gram.h.
2090
2091 When reporting useless rules and nonterminals, say "useless in grammar"
2092 instead of "useless", and say "useless in parser" instead of "never
2093 reduced". Discussed starting at
2094 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2095 * NEWS (2.3a+): Mention this change.
2096 * data/xslt/xml2text.xsl: Update output text and expected input XML
2097 element names to match changes below.
2098 * data/xslt/xml2xhtml.xsl: Likewise.
2099 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2100 Contents: "Rules useless in parser due to conflicts".
2101 * doc/bison.texinfo (Decl Summary): Reword a little.
2102 (Understanding): Update example output for changes below.
2103 * src/gram.c: (rule_useful_p): Rename to...
2104 (rule_useful_in_grammar_p): ... this.
2105 (rule_useless_p): Rename to...
2106 (rule_useless_in_grammar_p): ... this.
2107 (rule_never_reduced_p): Rename to...
2108 (rule_useless_in_parser_p): ... this.
2109 (grammar_rules_print): Update for renames.
2110 (grammar_rules_print_xml): Update for renames.
2111 (grammar_rules_never_reduced_report): Rename to...
2112 (grammar_rules_useless_report): ... this since it is used for either
2113 kind of useless rule.
2114 * src/gram.h: Reword comments and update function names in prototypes.
2115 * src/main.c (main): Say "rule useless in parser due to conflicts".
2116 * src/print-xml.c (print_rules_never_reduced): Rename to...
2117 (print_rules_useless_in_parser): ... this, and rename output XML
2118 element "rules-never-reduced" to "rules-useless-in-parser".
2119 (print_xml): Update for rename.
2120 * src/print.c (print_results): Say "Rules useless in parser due to
2121 conflicts".
2122 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2123 (nonterminals_reduce): Say "nonterminal useless in grammar".
2124 (reduce_output): Say "Nonterminals useless in grammar".
2125 Say "Rules useless in grammar".
2126 (reduce_xml): Rename output XML element "useless" to
2127 "useless-in-grammar".
2128 (reduce_print): Don't report the count of grammatically useless rules
2129 as "rules never reduced" just because %yacc is specified.
2130 In the correct report of this count, say nonterminal(s) and rule(s)
2131 "useless in grammar".
2132 * tests/conflicts.at (S/R in initial): Update expected output.
2133 (Defaulted Conflicted Reduction): Likewise.
2134 (Unreachable States After Conflict Resolution): Likewise.
2135 * tests/existing.at (GNU pic Grammar): Likewise.
2136 * tests/reduce.at (Useless Nonterminals): Likewise.
2137 (Useless Rules): Likewise.
2138 (Reduced Automaton): Likewise.
2139 (Underivable Rules): Likewise.
2140 (Empty Language): Likewise.
2141
66f0441d
JD
21422007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2143
2144 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2145 here document and before the EOF so that BSD's implementation of Bourne
2146 shell doesn't parse the delimiter as part of the here document.
2147 * doc/.cvsignore: Add cross-options.texi.
2148 * src/getargs.c (usage): Add a blank line after the warning categories.
2149
d0ee4105
PB
21502007-11-08 Paolo Bonzini <bonzini@gnu.org>
2151
2152 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2153
e8b1fb9b
AD
21542007-11-05 Akim Demaille <akim@epita.fr>
2155
2156 Remove Id: from bison.1.
2157 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2158 (perl -0777 -pi -e 's/\.PP\nId): New.
2159 (.x.1): Use it to ignore the version control revision.
2160
2f7a96b5
AD
21612007-11-05 Akim Demaille <demaille@gostai.com>
2162
2163 * build-aux/Makefile.am: Ship cross-options.pl.
2164 * doc/Makefile.am: Always refer to cross-options.texi with
2165 $(srcdir).
2166 (MAINTAINERCLEANFILES): Add it.
2167
f4101aa6
AD
21682007-11-04 Akim Demaille <demaille@gostai.com>
2169
2170 Generate the long/short option cross-table.
2171 * build-aux/cross-options.pl: New.
2172 * doc/Makefile.am (cross-options.texi): New.
2173 * doc/bison.texinfo: Use it.
2174
727a1401
AD
21752007-11-04 Akim Demaille <demaille@gostai.com>
2176
2177 Generate bison.1 using help2man.
2178 * doc/common.x, doc/bison.x: New.
2179 * doc/Makefile.am (bison.1, .x.1): New.
2180 The code is taken from autoconf-2.61/man/Makefile.am.
2181 * configure.ac: Look for help2man.
2182
6aeb9c57
AD
21832007-11-04 Akim Demaille <demaille@gostai.com>
2184
2185 Complete --help.
2186 * src/getargs.c (usage): Document -W, make it clear that -d,
2187 -g and -x have optional arguments.
2188
d7be4085
AD
21892007-11-04 Akim Demaille <demaille@gostai.com>
2190
2191 Find sha1sum when named gsha1sum.
2192 * bootstrap (find_tool): New.
2193 ($SHA1SUM): New.
2194
d9df47b6
JD
21952007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2196
2197 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2198 at
2199 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2200 * NEWS (2.3a+): Mention.
2201 * data/bison.m4 (b4_pure_if): Don't define it here.
2202 * data/c.m4 (b4_identification): Depend on individual skeletons to
2203 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2204 values of the %define variables api.pure or api.push_pull. Define
2205 YYPURE, YYPUSH, and YYPULL accordingly.
2206 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2207 glr.cc has already defined b4_pure_flag.
2208 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2209 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 2210 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
2211 * doc/bison.texinfo (Pure Decl): Update.
2212 (Push Decl): Update.
2213 (Decl Summary): Add api.pure to %define entry.
2214 In %pure-parser entry, say it's deprecated and reference %define.
2215 (Pure Calling): Update.
2216 (Error Reporting): Update.
2217 (C++ Scanner Interface): Update.
2218 (How Can I Reset the Parser): Update.
2219 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2220 reference %define.
2221 * src/getargs.c (pure_parser): Remove global variable.
2222 * src/getargs.h (pure_parser): Remove extern.
2223 * src/output.c (prepare): Don't define pure_flag muscle.
2224 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2225 wrapper around `%define api.pure'.
2226 * tests/calc.at (Simple LALR Calculator): Update.
2227 (Simple GLR Calculator): Update.
2228 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2229 Update.
2230 (GLR: Resolve ambiguity, pure, locations): Update.
2231 (GLR: Merge conflicting parses, pure, no locations): Update.
2232 (GLR: Merge conflicting parses, pure, locations): Update.
2233 * tests/glr-regression.at (Uninitialized location when reporting
2234 ambiguity): Update
2235 * tests/input.at (Unused %define api.pure): New test case.
2236 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2237 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2238 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2239
c373bf8b
JD
22402007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2241
2242 %define push_pull -> %define api.push_pull. Discussed starting at
2243 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2244 * data/push.c: Expect the new name.
2245 * data/yacc.c: Likewise.
2246 * doc/bison.texinfo (Push Decl): Update.
2247 (Decl Summary): Update %define entry.
2248 (Push Parser Function): Update.
2249 (Pull Parser Function): Update.
2250 (Parser Create Function): Update.
2251 (Parser Delete Function): Update.
2252 * tests/calc.at (Simple LALR Calculator): Update.
2253 * tests/input.at (%define enum variables): Update.
2254 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2255 (Push Parsing: Multiple impure instances): Update.
2256 (Push Parsing: Unsupported Skeletons): Update.
2257 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2258 (Exploding the Stack Size with Malloc): Update.
2259
2260 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2261 other entries some.
2262
32f19b6b
JD
22632007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2264
2265 For the XML output's terminal element, rename @number to @token-number,
2266 and add @symbol-number. In the nonterminal element, rename @number to
2267 @symbol-number. Discussed starting at
2268 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2269 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2270 renames.
2271 (xsl:template match="nonterminal"): Likewise.
2272 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2273 (xsl:template match="nonterminal"): Likewise.
2274 * src/print-xml.c (print_grammar): Implement.
2275
255a6b90
JD
22762007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2277
2278 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2279 2007-10-11 change, the child elements here are items not rules.
408476bc 2280 (xsl:template match="item"): New.
255a6b90
JD
2281 (xsl:template match="rule"): Update for new reduced itemset.
2282 (xsl:template match="point"): Remove.
2283 (xsl:template match="empty"): For consistency with --graph, don't
2284 output "/* empty */".
2285 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2286 line-wrap, don't pass a negative value as first-line-length since this
2287 won't work with the following changes.
2288 (xsl:template name="line-wrap"): Simplify slightly.
2289 (xsl:template name="ws-search"): Eliminate recursion.
2290 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2291 set next to an item whose dot is not at the end of the RHS even if it
2292 happens to be associated with the same rule.
2293
88c78747
JD
22942007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2295
31984206
JD
2296 Add %define lr.keep_unreachable_states.
2297 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2298 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2299 * src/main.c (main): Implement it.
2300 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2301 Extend to test it, and fix a typo.
2302
23032007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2304
2305 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
2306 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2307 the example .output text.
2308 * tests/regression.at (Extra lookahead sets in report): Improve wording
2309 of comments.
2310
b7a70162
WP
23112007-10-17 Wojciech Polak <polak@gnu.org>
2312
2313 * src/print-xml.c (print_grammar): Renamed
2314 <terminal> and <nonterminal> attributes:
2315 "type" to "number" and "symbol" to "name".
2316 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2317 Use new attribute names.
2318 (xsl:template match="nonterminal"): Likewise.
2319 * data/xslt/xml2xhtml.xsl: Likewise.
2320
a0de5091
JD
23212007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2322
2323 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2324 (Option Cross Key): Likewise.
2325
2326 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2327 next to an item whose dot is not at the end of the RHS even if it
2328 happens to be associated with the same rule.
2329 * src/print.c (print_core): Likewise.
2330 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2331 (Resolved SR Conflicts): Update output.
2332 * tests/regression.at (Extra lookahead sets in report): New test case.
2333
4c20d18d
WP
23342007-10-11 Wojciech Polak <polak@gnu.org>
2335
2336 * src/print-xml.c (print_core): Remove item set
2337 redundancy.
2338 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2339 Improve processing time. Suggested by Joel E. Denny.
2340 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2341 Write xsl:param "required" attribute as comment.
2342 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2343 (xsl:template match="rule"): Support new reduced itemset.
2344 (xsl:template match="point"): Remove.
2345 * data/xslt/xml2xhtml.xsl: Likewise.
2346
f506ad1c
JD
23472007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2348
2349 * src/getargs.c (version): Update copyright year.
2350
21f1b063
JD
23512007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2352
2353 Make xml2dot.xsl and --graph produce the same output.
2354 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2355 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2356 escaped later.
2357 (xsl:template name="output-node"): Use the new escape template instead
2358 of the string-replace template directly.
2359 (xsl:template name="output-edge"): Likewise.
2360 (xsl:template name="escape"): New, escapes backslashes and newlines in
2361 addition to quotation marks.
2362 * src/graphviz.c (start_graph, output_node, output_edge): Add
2363 whitespace to output for legibility.
2364
2365 Make xml2text.xsl and --report produce the same output, and remove the
2366 XML "conflicts" element since a conflict summary is easily extracted
2367 from the automaton.
2368 * data/xslt/bison.xsl: New.
2369 (xsl:template match="state" mode="bison:count-conflicts): New.
2370 * data/xslt/xml2text.xsl: Import bison.xsl.
2371 (xsl:template match="bison-xml-report"): Instead of styling the
2372 "conflicts" element, style the "automaton" element with mode
2373 "conflicts". Unlike the former, the latter lists S/R and R/R
2374 conflicts for a state on the same line.
2375 (xsl:template match="conflicts"): Remove.
2376 (xsl:template match="conflict"): Remove.
2377 (xsl:template match="terminal"): Line-wrap the list of rules in which
2378 the terminal is used.
2379 (xsl:template match="nonterminal"): Likewise for nonterminals.
2380 (xsl:template match="automaton" mode="conflicts"): New.
2381 (xsl:template match="state" mode="conflicts"): New.
2382 (xsl:template name="line-wrap"): New.
2383 (xsl:template name="ws-search"): New.
2384 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2385 (xsl:template match="bison-xml-report"): Instead of styling the
2386 "conflicts" element, style the "automaton" element with mode
2387 "conflicts."
2388 (xsl:template match="conflicts"): Remove.
2389 (xsl:template match="conflict"): Remove.
2390 (xsl:template match="automaton" mode="conflicts"): New.
2391 (xsl:template match="state" mode="conflicts): New.
2392 * src/conflicts.c (conflicts_output_xml): Remove.
2393 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2394 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2395 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2396 the corresponding XSLT is easier. Also, never wrap between a word and
2397 the comma that follows it.
2398
793fbca5
JD
23992007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2400
2401 Improve C++ namespace support. Discussed starting at
2402 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2403 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2404 b4_namespace_close): New macros that interpret the %define variable
2405 "namespace" so its value can contain "::" to indicate nested
2406 namespaces.
2407 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2408 the above macros.
2409 * data/lalr1.cc (b4_namespace): Likewise.
2410 * data/location.cc (b4_namespace): Likewise.
2411 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2412 inside a new table in the general %define entry. Document `%define
2413 namespace' there as well. Point the %name-prefix entry to it since it
2414 explains it more completely in the case of C++.
2415 (C++ Bison Interface): Mention `%define namespace' instead of
2416 %name-prefix.
2417 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2418 entry suffices.
2419 * tests/c++.at (Relative namespace references): New test case.
2420 (Absolute namespace references): New test case.
2421 (Syntactically invalid namespace references): New test case.
2422 * tests/input.at (C++ namespace reference errors): New test case.
2423
35b8730d
JD
24242007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2425
2426 Add syncline support and location accessor to internal %define
2427 interfaces.
2428 * data/bison.m4 (b4_percent_define_get_loc): New.
2429 (b4_percent_define_get_syncline): New.
2430 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2431 (b4_percent_define_default): Record defining location as line 1 rather
2432 than 0 for the sake of synchronizing #line's, and define
2433 b4_percent_define_syncline(VARIABLE).
2434 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2435 * src/muscle_tab.c (muscle_syncline_grow): New.
2436 (muscle_code_grow): Use muscle_syncline_grow.
2437 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2438 define b4_percent_define_syncline(VARIABLE).
2439 (muscle_percent_define_get_loc): New.
2440 (muscle_percent_define_get_syncline): New.
2441 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2442 remove some unused variables.
2443 (muscle_percent_define_default): Record defining location as line 1
2444 rather than 0 for the sake of synchronizing #line's, and define
2445 b4_percent_define_syncline(VARIABLE).
2446 (muscle_percent_define_check_values): Use
2447 muscle_percent_define_get_loc.
2448 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2449 (muscle_percent_define_get_syncline): Prototype.
2450 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2451 defaults): Update output for location change.
2452 (Complaining during macro argument expansion): Extend to test
2453 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2454
7dc4a694
JD
24552007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2456
2457 Fix some error-reporting macro bugs.
2458 * data/bison.m4 (b4_cat): New.
2459 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2460 to stdout so they don't become arguments to other macros. Update
2461 comments and add examples.
2462 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2463 add examples.
2464 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2465 after printing the error directive so that M4 doesn't report subsequent
2466 problems that are induced by this problem.
2467 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2468 instead of just in them. Recognize @\n in both places. Both expand to
2469 the empty string. Needed by b4_cat.
2470 * tests/skeletons.at (Complaining during macro argument expansion):
2471 New test case.
2472 (Fatal errors make M4 exit immediately): New test case.
2473
d4bd2295
JD
24742007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2475
2476 Implement --print-datadir.
2477 * src/getargs.c (usage): Mention.
2478 (PRINT_DATADIR_OPTION): New anonymous enum member.
2479 (long_options): Add entry for it.
2480 (getargs): Add case for it calling compute_pkgdatadir.
2481 * src/output.c (output_skeleton): Encapsulate data directory
2482 computation from here...
2483 (prepare): ... and from here...
2484 (compute_pkgdatadir): ... into this new function.
2485 * src/output.h (compute_pkgdatadir): Prototype.
2486
34cdeddf
JD
24872007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2488
2489 * src/print-xml.c (escape_bufs): New static global variable
2490 replacing...
2491 (xml_escape_n): ... the static local variable buf here.
2492 (print_xml): Free memory for escape_bufs.
2493 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2494
d782395d
JD
24952007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2496
2497 Replace `%push-parser' and `%push-pull-parser' with
2498 `%define push_pull "push"' and `%define push_pull "both"'.
2499 `%define push_pull "pull"' is the default.
2500 * doc/bison.texinfo (Push Decl, Push Parser Function,
2501 Pull Parser Function, Parser Create Function, Parser Delete Function):
2502 Update declarations.
2503 (Decl Summary, Table of Symbols): Replace %push-parser and
2504 %push-pull-parser entries with a %define push_pull entry.
2505 * data/bison.m4 (b4_percent_define_check_values): New macro.
2506 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2507 definitions...
2508 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2509 definitions...
2510 * data/push.c: ... to here and compute them from the value of the
2511 %define variable push_pull.
2512 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2513 parsing requests here...
2514 * data/yacc.c: ... hack this to switch to push.c any time
2515 b4_use_push_pull_flag or the %define variable push_pull is set. This
2516 will go away when we mv push.c yacc.c.
2517 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2518 push parsing is not supported since unused %define variables are
2519 reported anyway.
2520 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2521 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2522 comments for consistency with b4_percent_define_check_values.
2523 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2524 muscles.
2525 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2526 Remove.
2527 (prologue_declaration): Remove %push-parser and %push-pull-parser
2528 rules.
2529 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2530 * tests/calc.at: Update declarations.
2531 * tests/input.at (%define enum variables): New test case.
2532 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2533 declaration.
2534 (Push Parsing: Multiple impure instances): Update declaration.
2535 (Push Parsing: Unsupported Skeletons): New test case.
2536 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2537 declaration.
2538 (Exploding the Stack Size with Malloc): Update declaration.
2539
3f999f78
WP
25402007-09-24 Wojciech Polak <polak@gnu.org>
2541
2542 Add XSLT transformations.
2543
2544 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2545 * data/xslt/xml2text.xsl: Transform XML into plain text.
2546 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2547 * data/Makefile.am (xsltdir): New variable.
2548 (dist_xslt_DATA): Add xslt/*.xsl files.
2549
a4f75309
PE
25502007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2551
2552 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2553 Problem reported by Wojciech Polak.
2554 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2555 (xml_printf): Undo change I made on 21 September; that is,
2556 indent 2 spaces, not 1.
2557
ad5feac4
JD
25582007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2559
2560 Pacify ./configure --enable-gcc-warnings.
2561 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2562 `char const *' instead of `char *'.
2563 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2564 local variable `sep'.
2565
41d7a5f2
PE
25662007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2567
2568 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2569 elsewhere.
2570 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2571 (xml_printf): Indent just 1 space for level.
2572 (e_char, xlate_char): Remove.
2573 (xml_escape_string): Rewrite to avoid undefined behavior (used
2574 storage that was freed from the stack).
2575 (xml_escape_n): Don't bother checking for subscript error.
2576
3f999f78
WP
25772007-09-21 Wojciech Polak <polak@gnu.org>
2578
2579 Add Bison XML Automaton Report.
41d7a5f2
PE
2580
2581 Add support for an -x option to generate an XML report.
2582 It is not documented yet.
2583 * src/print-xml.c: New file.
2584 * src/print-xml.h: Likewise.
2585 * lib/timevar.def (TV_XML): New var.
2586 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2587 * src/conflicts.c: Include print-xml.h.
2588 (solved_conflicts_xml_obstack): New var.
2589 (log_resolution, conflicts_solve, conflicts_free):
2590 Add support for XML report.
2591 (conflicts_output_val): New function.
2592 * src/conflicts.h (conflicts_output_val): New decl.
2593 * src/files.c (spec_xml_file): New var.
2594 (compute_output_file_names, output_file_names_free): Add XML support.
2595 * src/files.h (spec_xml_file): New decl.
2596 * src/getargs.c (xml_flag): New var.
2597 (usage, short_options, long_options, getargs): Add XML support.
2598 * src/getargs.h (xml_flag): New decl.
2599 * src/gram.c: Include print-xml.h.
2600 (rule_lhs_print_xml, rule_rhs_print_xml):
2601 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2602 New functions.
2603 * src/gram.h: Declare external ones.
2604 * src/main.c: Include print-xml.h.
2605 (main): Add XML support.
2606 * src/reduce.c: Include print-xml.h.
2607 (reduce_xml): New function.
2608 * src/reduce.h: Declare it.
2609 * src/state.c: Include print-xml.h.
2610 (state_new): Add XML support.
2611 (state_rule_lookahead_tokens_print_xml): New function.
2612 * src/state.h: Declare it.
2613 (struct state): New member solved_conflicts_xml.
2614 * src/symtab.c (symbol_class_get_string): New function.
2615 * src/symtab.h: Declare it.
2616
6d8e724d
PE
26172007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2618
2619 * GNUmakefile: Switch to coreutils's version.
2620 * bootstrap: Likewise.
2621 * Makefile.cfg: Adjust to new GNUmakefile.
2622 * README-hacking: Likewise.
2623
2624 Import from gnulib:
2625
2626 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2627 Bruno Haible <bruno@clisp.org>
2628
2629 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2630 and is a script that invokes bison. Tighten the code. Add comments.
2631
922bdd7f
JD
26322007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2633
2634 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2635 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2636 * doc/bison.texinfo (Decl Summary): Fix.
2637 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2638 * tests/input.at (Boolean %define variables): Update output.
2639 * tests/skeletons.at (%define boolean variables: invalid skeleton
2640 defaults): Rename to...
2641 (%define Boolean variables: invalid skeleton defaults): ... this and
2642 update output.
2643
1b17b01d
JD
26442007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2645
2646 In impure push mode, don't allow more than one yypstate to be allocated
2647 since multiple impure parsers would corrupt yynerrs.
2648 * data/push.c (yypstate_allocated): New static global variable
2649 initialized to 0.
2650 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2651 exhaustion if yypstate_allocated is 1, but still return 2.
2652 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2653 already 1. Otherwise, set it to 1.
2654 (yypstate_delete): Set it to 0.
2655 * tests/push.at (Push Parsing: Multiple impure instances): New test
2656 case.
2657
9987d1b3
JD
26582007-08-17 Bob Rossi <bob@brasko.net>
2659
2660 * doc/bison.texinfo (Push Decl): Document the push parser.
2661 (Table of Symbols): Ditto.
2662 (Pure Decl): Ditto.
2663 (Decl Summary): Ditto.
2664 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2665 Parser Create Function, Parser Delete Function):
2666 Add new push parser symbols.
2667 (Table of Symbols): Document push-parser, push-pull-parser,
2668 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2669
f16b0819
PE
26702007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2671
2672 Update to GPLv3.
2673 * doc/gpl-3.0.texi: New file.
2674 * doc/gpl.texi: Remove.
2675 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2676 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2677 * README-hacking, TODO, bootstrap, bootstrap.conf:
2678 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2679 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2680 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2681 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2682 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2683 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2684 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2685 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2686 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2687 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2688 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2689 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2690 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2691 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2692 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2693 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2694 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2695 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2696 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2697 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2698 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2699 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2700 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2701 * src/complain.c, src/complain.h, src/conflicts.c:
2702 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2703 * src/files.h, src/flex-scanner.h, src/getargs.c:
2704 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2705 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2706 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2707 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2708 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2709 * src/print.c, src/print.h, src/print_graph.c:
2710 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2711 * src/reduce.h, src/relation.c, src/relation.h:
2712 * src/revision.h, src/scan-code.h, src/scan-code.l:
2713 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2714 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2715 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2716 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2717 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2718 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2719 * tests/existing.at, tests/glr-regression.at:
2720 * tests/headers.at, tests/input.at, tests/java.at:
2721 * tests/local.at, tests/output.at, tests/push.at:
2722 * tests/reduce.at, tests/regression.at, tests/sets.at:
2723 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2724 * tests/torture.at:
2725 Update to GPLv3.
2726
728c4be2
JD
27272007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2728
2729 Get rid of broken %no-parser, -n, and --no-parser implementation and
2730 documentation.
2731 * TODO: Don't mention them.
2732 * doc/bison.1: Likewise.
2733 * doc/bison.texinfo (Decl Summary): Likewise.
2734 (Bison Options): Likewise.
2735 (Option Cross Key): Likewise.
2736 * src/getargs.c (no_parser_flag): Remove global variable.
2737 (usage): Don't print description of -n and --no-parser.
2738 (long_options): Remove --no-parser entry here.
2739 (getargs): Remove -n case in the switch here.
2740 * src/getargs.h (no_parser_flag): Remove extern.
2741 * tests/regression.at (Web2c Actions): Remove comment that mentions
2742 --no-parser.
2743
5d31a216
JD
27442007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2745
2746 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2747 name user variables starting with `yy'. Just pass NULL instead of a
2748 dummy local &yylval to yypush_parse.
2749 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2750 starting with `yy'.
2751
a2ea208d
JD
27522007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2753
2754 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2755 true since it's then always used regardless of whether yyoverflow is
2756 defined. Reported by Christian Burger at
2757 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2758 * THANKS: Add Christian Burger.
2759
91661ebb
JD
2760 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2761 node names: say "Decl Summary" not "Bison Declaration Summary".
2762
cbd50549
JD
27632007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2764
2765 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2766 determine whether this function has already complained about an invalid
2767 value for a %define boolean variable, don't check whether Bison has
2768 ever examined the value. As written, the check was a tautology.
2769 Instead, record and check for this complaint using a separate muscle.
2770
eb1b0740
JD
27712007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2772
2773 Fix push parsing memory leak reported by Brandon Lucia at
2774 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2775 * THANKS: Add Brandon Lucia.
2776 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2777 but the parse never completed and thus freed it.
2778 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2779 * tests/testsuite.at: Include push.at.
2780 * test/push.at: New.
2781 (Push Parsing: Memory Leak for Early Deletion): New test case.
2782
9d774aff
JD
27832007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2784
2785 Improve handling of multiple S/R conflicts in the same state and of S/R
2786 conflicts involving multiple reductions.
2787 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2788 set for a state here or Bison will abort if it is reassigned on a
2789 later conflicted reduction in the same state.
2790 Similarly, don't finalize and assign the solved conflicts report here
2791 or it will be lost if it is reassigned on a later conflicted reduction
2792 in the same state.
2793 (set_conflicts): Instead, assign them both here after all S/R conflicts
2794 in the state have been fully examined.
2795 * src/print.c (shift_set): Rename to...
2796 (no_reduce_set): ... this.
2797 (print_reductions): Update for rename, and add %nonassoc error action
2798 tokens to no_reduce_set so that, when printing the first remaining
2799 reduction on an error action token, the reduction is enclosed in
2800 brackets.
2801 (print_results): Update for rename.
2802 * tests/conflicts.at (Solved conflicts report for multiple reductions
2803 in a state): New test case.
2804 (%nonassoc error actions for multiple reductions in a state): New test
2805 case.
2806
2807 * src/main.c (main): Don't depend on C99 features.
2808
10159d2a
JD
28092007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2810
2811 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
2812 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2813 uniwidth.
10159d2a 2814
953b3935
JD
28152007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2816
2817 * bootstrap (slurp): Create target directories that don't exist.
2818 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2819
6ce2d93a
JD
28202007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2821
2822 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2823 than item number.
2824 * closure.c (closure): Likewise.
2825 * state.h (reductions): Comment sorting of rules.
2826 (state): Comment sorting of items.
2827
ce3448d5
JD
28282007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2829
2830 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2831 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2832 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2833 definition in order to avoid Gnulib headers since we don't use config.h
2834 here.
2835 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2836 rather than AT_DATA so that config.h is included.
2837
8a86eef0
JD
28382007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2839
2840 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2841 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2842 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2843 and so that YYFPRINTF is guaranteed to be defined here.
2844
b1a81613
JD
28452007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2846
2847 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2848 with...
2849 (muscle_percent_define_check_values): ... this more helpful function.
2850 Again, it's not used yet, but it will be.
2851 * src/muscle_tab.h: Likewise.
2852
71b61d4d
JD
2853 Improve some comments in parser table construction.
2854 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2855 (generate_states): Don't mention ruleset, which is internal to closure.
2856 * src/closure.c (closure): Explain sorting of core and itemset, which
2857 is required for this function to behave correctly.
2858 * src/closure.h (closure): Mention sorting.
2859
2a6b783d
JD
28602007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2861
2862 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2863 move the check for disabled transitions to an aver since conflict
2864 resolution hasn't happened yet.
2865
2866 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2867 labels a state as inconsistent just because it has error transitions.
2868 The original form of this check appeared in revision 1.1 of lalr.c,
2869 which was committed on 1991-12-21. Now (at least), changing the
2870 consistency label on such a state appears to have no useful effect in
2871 any of the places it is examined, which I enumerate below. The key
2872 point to understanding each item in this enumeration is that a state
2873 with an error transition is labelled consistent in the first place only
2874 if it has no rules, so the check cannot matter for states that have
2875 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2876 to try to identify its conflicts, and a state must have *rules* to have
2877 conflicts. (2) Labelling a state as inconsistent will affect how
2878 action_row sets the default *rule* for the state. (3) Labelling a
2879 state as inconsistent will cause build_relations to add lookback edges
2880 to *rules* in that state.
2881 * src/state.h (struct state): Word the comment for member consistent
2882 more carefully.
2883
14462c2b
JD
28842007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2885
2886 Don't depend on C99 features.
2887 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2888 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2889 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2890 * src/state.c (state_mark_reachable_states): Fix for-loop.
2891 (state_remove_unreachable_states): Fix for-loop.
2892
2893 Don't widen struct state with member reachable just to temporarily
2894 record reachability. Instead, use a local bitset.
2895 * src/state.h (struct state): Remove member.
2896 * src/state.c (state_new): Don't initialize it.
2897 (state_mark_reachable_states): Rename to...
2898 (state_record_reachable_states): ... this, and use bitset.
2899 (state_remove_unreachable_states): Use bitset.
2900
5a43d418
JD
29012007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2902
2903 * src/Makefile.am (yacc): Quote target action commands properly so
2904 that the yacc script isn't corrupt. Reported by Hans Aberg at
2905 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
2906
0c650a20
JD
2907 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
2908 the case of pure parsers. Reported by Frans Englich at
2909 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
2910 * THANKS: Add Frans Englich.
2911
61fee93e
JD
2912 * NEWS (2.3a+): In the %code entry, reference section `Bison
2913 Declaration Summary' from the manual now since the %code summary has
2914 moved there.
2915 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
2916 in the rules section must be terminated by semicolons.
2917
f124d423
JD
29182007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2919
2920 Extend the front-end API for %define variables to more completely
2921 mirror the back-end. This will be useful in the future.
2922 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
2923 Update comments to mention the new front-end counterparts of these
2924 macros.
2925 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
2926 for muscle_string_decode and muscle_location_decode.
2927 (muscle_string_decode): New static function.
2928 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
2929 (muscle_percent_define_get, muscle_percent_define_ifdef): New
2930 functions.
2931 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
2932 muscle_percent_define_get to mimic the b4_percent_define_flag_if
2933 implementation more closely.
2934 (muscle_percent_define_invalid_value): New function.
2935 * src/muscle_tab.h (muscle_percent_define_get,
2936 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
2937 Prototype.
2938
75ad86ee
JD
29392007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2940
2941 * NEWS (2.3a+): Mention yesterday's state-removal change.
2942 (2.3a): Remove the %language entry, which was added after 2.3a.
2943 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
2944 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
2945 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
2946 tests/existing.at: Update copyright date.
2947
5967f0cf
JD
29482007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2949
2950 If conflict resolution makes states unreachable, remove those states,
2951 report rules that are then unused, and don't report conflicts in those
2952 states.
2953 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
2954 New global function.
2955 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
2956 function.
2957 * src/main.c (main): After conflict resolution, remove the unreachable
2958 states and update all data structures that reference states by number.
2959 * src/state.c (state_new): Initialize each state's reachable member to
2960 false.
2961 (state_mark_reachable_states): New static function.
2962 (state_remove_unreachable_states): New global function.
2963 * src/state.h (struct state): Add member bool reachable.
2964 (state_remove_unreachable_states): Prototype.
2965 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2966 New test case.
2967 * tests/existing.at (GNU pic Grammar): Update test case output now that
2968 an unused rule is discovered.
2969
b09f4f48
JD
29702007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2971
2972 Minor code cleanup in parser table construction.
2973 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
2974 (new_itemsets, save_reductions): Update for rename to nitemset.
2975 * src/closure.c (nritemset): Rename to...
2976 (nitemset): ... this since the "r" appears to meaningless and isn't
2977 used in the comments.
2978 (closure): Update for rename.
2979 * src/closure.h (nritemset): Update extern to...
2980 (nitemset): ... this.
2981 * src/lalr.c (LA): Fix a typo in comments.
2982 * src/print.c (print_core): Update for rename to nitemset.
2983 * src/print_graph.c (print_graph): Likewise.
2984 * src/state.h: Fix some typos in header comments.
2985
bbb44d83
PE
29862007-04-04 Paul Eggert <eggert@cs.ucla.edu>
2987
9b33de72
PE
2988 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
2989 still sticks to ASCII. Sorry!
2990
bbb44d83
PE
2991 * README-hacking: New file, taken mostly from coreutils, with changes
2992 for Bison. Contains much of the contents of:
2993 * README-cvs: Remove.
2994 * bootstrap: Sync from gnulib.
2995 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
2996 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
2997
29553547
JD
29982007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
2999
3000 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3001 Setzer.
3002 (Java Differences): Fix some typos.
3003 * THANKS: Add Sebastian Setzer.
3004
01b477c6
PB
30052007-03-07 Paolo Bonzini <bonzini@gnu.org>
3006
730739e4
AD
3007 * data/java.m4 (b4_single_class_if): Remove.
3008 (b4_abstract_if): Look at "%define abstract".
3009 (b4_lexer_if): New.
3010 (b4_union_name): Rename...
3011 (b4_yystype): ... to this. Map to "%define stype".
3012 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3013 b4_maybe_throws): Fix quoting.
3014 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3015 * data/lalr1.java (Lexer interface): Always define.
3016 (Lexer interface within parser class): Remove.
3017 (YYLexer class): New, used when "%code lexer" is present.
3018 (constructor): When "%code lexer" is used, pass %lex-param
3019 to the lexer constructor.
3020 (yylex, yyparse): Remove %lex-param from method invocations
3021 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3022
3023 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3024 abstract". Rename "%define union_name" to "%define stype".
3025 Rename method names according to previous patch.
3026 (Java Scanner Interface): Describe "%code lexer" instead of
3027 "%pure-parser" and "%define single_class".
3028 (Java Differences): Mention "%code lexer".
3029
3030 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3031 Include scanner here, using macros from tests/local.at.
3032 (AT_DATA_CALC_Y): Remove final argument.
3033 (_AT_CHECK_JAVA_CALC): Likewise.
3034 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3035 of %locations and %error-verbose.
3036 (main): Test with and without %lex-param.
3037 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3038 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 3039
122bea3a
JMG
30402007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3041
3042 DJGPP spefic issue. Inhibit the use of disallowed characters for
3043 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3044 and concern testsuite case 46.
3045 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3046 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3047 * djgpp/config.bat: Inhibit the use of disallowed characters.
3048
9611cfa2
JD
30492007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3050
3051 Miscellaneous %define and %code cleanup.
3052 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3053 values are interpreted.
3054 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3055 documentation a little more.
3056 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3057 muscle_percent_define_insert, muscle_percent_code_grow): New
3058 functions/macros.
3059 * src/muscle_tab.h (muscle_percent_define_insert,
3060 muscle_percent_code_grow): Prototype.
3061 * src/parse-gram.y (prologue_declaration): Use
3062 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3063 %define and %code directives.
3064
3065 Make it easy to share %define boolean variables between the front-end
3066 and back-end. Though not used yet, this will be useful in the future.
3067 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3068 Bison uses of names rather than just skeleton uses of names.
3069 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3070 b4_percent_define_skeleton_variables(VARIABLE) to
3071 b4_percent_define_bison_variables(VARIABLE).
3072 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3073 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3074 b4_percent_code_bison_qualifiers(QUALIFIER).
3075 (b4_check_user_names_wrap): Update for renames.
3076 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3077 muscle_percent_define_default): New functions mimicking
3078 b4_percent_define_flag_if and b4_percent_define_default.
3079
3080 For %define variables, report locations for invalid values and
bbb44d83 3081 redefinitions.
9611cfa2
JD
3082 * data/bison.m4 (b4_percent_define_flag_if): Read
3083 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3084 value for VARIABLE.
3085 (b4_percent_define_default): Save a special location in
3086 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3087 must later be reported as invalid.
3088 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3089 functions.
3090 (muscle_percent_define_insert): Record the location of VARIABLE in
3091 muscle percent_define_loc(VARIABLE), and use it to report the previous
3092 location for a redefinition.
3093 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3094 (muscle_percent_define_default): Update like b4_percent_define_default.
3095 (muscle_grow_user_name_list): Rename to...
3096 (muscle_user_name_list_grow): ... this for consistency and use
3097 muscle_location_grow.
3098 * src/muscle_tab.h (muscle_location_grow): Prototype.
3099 * tests/input.at (%define errors): Update expected output.
3100 * tests/skeletons.at (%define boolean variables: invalid skeleton
3101 defaults): New test case.
3102
0bf92491
JD
31032007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3104
3105 * src/print.c (lookahead_set, state_default_rule): Remove.
3106 (print_reductions): Replace state_default_rule invocation with
3107 equivalent use of yydefact, which was computed in token_actions in
3108 tables.c.
3109 (print_results): Don't allocate lookahead_set.
3110
d3b12988
PB
31112007-02-27 Paolo Bonzini <bonzini@gnu.org>
3112
3113 * data/lalr1.java: Prefix all private members with yy.
3114
f57a7536
JD
31152007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3116
3117 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 3118 Sebastien Fricker at
f57a7536 3119 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 3120 * THANKS: Add Sebastien Fricker.
f57a7536
JD
3121 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3122 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3123 accept a variable number of arguments.
3124
6404a5bf
JD
31252007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3126
3127 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3128
e4e09639
JMG
31292007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3130
3131 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3132 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3133 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3134
d7e0a1a7
PE
31352007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3136
3137 Undo my 2007-02-07 change, switching back to the c-strcase module
3138 introduced in the 2007-02-03 change. Bruno Haible reported that
3139 the 2007-02-07 change would be dangerous in Turkish if we add a
3140 language whose name contains "i", since "i" is not lowercase "I"
3141 in Turkish.
3142 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3143 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3144 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3145 * m4/.cvsignore: Remove strcase.m4.
3146 * src/getargs.c: Revert 2007-02-07 change, as follows.
3147 Include c-strcase.h.
3148 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3149
deee93a1
JD
31502007-02-11 Bruno Haible <bruno@clisp.org>
3151
3152 Enable the Java related testsuite tests when the only Java compiler
3153 found is a gcj < 4.3. Discussed at
3154 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3155 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3156
574add85
JD
31572007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3158
3159 * data/Makefile.am: Update copyright date.
3160 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3161 yypstate_new returns NULL.
3162 (yypstate_new): Return NULL if malloc does.
3163 * src/reader.c (packgram): Move translation of rule actions from the
3164 beginning of packgram to...
3165 (check_and_convert_grammar): ... here right before packgram is invoked
3166 so it's easier to write more complete comments, and remove redundant
3167 code.
3168
e785ccf7
JD
31692007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3170
3171 As in semantic actions, make @$ in %initial-action, %destructor, and
3172 %printer imply %locations.
3173 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3174 scanning @$.
3175 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3176 (@$ in %initial-action implies %locations,
3177 @$ in %destructor implies %locations,
3178 @$ in %printer implies %locations): ... these new test cases.
3179
1cfe1ed7
PE
31802007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3181
3182 Undo most of the 2007-02-03 change, switching to the strcase module
3183 now that gnulib strcase has been fixed.
3184 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3185 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3186 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3187 * m4/.cvsignore: Add strcase.m4.
3188 * src/getargs.c: Revert 2007-02-03 change, as follows.
3189 Don't include c-strcase.h.
3190 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3191 strcasecmp has "unspecified behavior" outside the POSIX locale,
3192 but it works fine in practice if at least one argument is ASCII,
3193 as is the case in Bison.
3194
0049ec86
PB
31952007-02-07 Paolo Bonzini <bonzini@gnu.org>
3196
3197 * tests/java.at: Skip tests if only one of javac/java is present.
3198 Reported by Joel E. Denny.
3199 * tests/atlocal.in: Adjust copyright years.
3200
32012007-02-05 Paolo Bonzini <bonzini@gnu.org>
3202
3203 * data/lalr1.java (Stack): Work around old verifiers that disallow
3204 access to the private fields of an inner class, from the outer class.
3205 We can make Stack's fields public because user code doesn't have access
3206 to the instance of Stack used by parse(). Reported by Paul Eggert.
3207
2c2b7220
PE
32082007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3209
3210 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3211 the right spot for these files?
3212 * bootstrap.conf (gnulib_modules): Add c-strcase.
3213 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3214 c-strncasecmp.c.
3215 * src/getargs.c: Include c-strcase.h.
3216 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3217 to avoid unspecified behavior.
3218
b2b81dae
JD
32192007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3220
3221 * doc/bison.texinfo (Decl Summary): Correct typo.
3222
c1d19e10
PB
32232007-01-30 Paolo Bonzini <bonzini@gnu.org>
3224
3225 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3226 Complain if the value does not match empty, "true" or "false".
3227 * data/c++.m4: Adjust default definitions of %define variables.
3228 * data/java.m4: Adjust default definitions of %define variables.
3229 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3230 to above behavior.
3231 * tests/input.at (Boolean %define variables): Test new behavior.
3232
8405b70c
PB
32332007-01-29 Paolo Bonzini <bonzini@gnu.org>
3234
3235 * NEWS: Mention java.
3236 * TODO: Remove things that are done.
3237 * bootstrap.conf: Add javacomp-script and javaexec-script.
3238 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3239
3240 * data/Makefile.am: Add new files.
3241 * data/java-skel.m4: New.
3242 * data/java.m4: New.
3243 * data/lalr1.java: New.
3244
3245 * doc/bison.texinfo: Put "A Complete C++ Example" under
3246 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3247 under Other Languages.
3248
3249 * src/getargs.c (valid_languages): Add Java.
3250 * src/getargs.h (struct bison_language): Update size of string fields.
3251
3252 * tests/Makefile.am: Add java.at.
3253 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3254 * tests/java.at: New.
3255 * tests/testsuite.at: Include it.
3256
3eb82471
JD
32572007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3258
3259 Clean up.
3260 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3261 at_directive_argv arguments so these no longer have to be global
3262 variables. Also, update the implementation for the following changes.
3263 (fail_for_at_directive_too_many_args,
3264 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3265 (at_directive_name): Remove as at_directive_argv[0] will be used for
3266 this now.
3267 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3268 for the directive name.
3269 (at_directive_argc, at_directive_argv): Make these local within
3270 skel_lex instead of global.
3271 (INITIAL): Update directive start action for above changes.
3272 (SC_AT_DIRECTIVE_ARG): Rename to...
3273 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3274 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3275 (scan_skel): Move yylex_destroy to...
3276 (skel_scanner_free): ... here.
3277 * tests/skeletons.at (installed skeleton file name): Rename to...
3278 (installed skeleton file names): ... this.
3279
148d66d8
JD
32802007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3281
3282 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3283 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3284 Summary" not "Directives".
3285 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3286 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3287 since the former is now the more complete one.
3288 (Prologue Alternatives): Likewise and do the same for %defines.
3289 (Table of Symbols): Add summary of %code, add summary of %define, and
3290 move full %code documentation to...
3291 (Decl Summary): ... here for consistency with other entries in these
3292 sections.
3293 Move %define entry in order to keep this list alphabetized.
3294 Reword %define entry a little to put less emphasis on the skeleton
3295 concept, which most users shouldn't have to think about.
3296
665f0c24
PE
32972007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3298
3299 Adjust to recent gnulib changes.
3300 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3301 Add string.h, string_.h, unistd_.h, wchar_.h.
3302 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3303 * src/system.h: Don't include <stpcpy.h>; this is now done by
3304 <string.h>.
3305
592d0b1e
PB
33062007-01-23 Paolo Bonzini <bonzini@gnu.org>
3307
3308 Simplify implementation of unqualified %code, implement macros for
3309 uniform treatment of boolean %define flags. Document %define.
3310 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3311 b4_percent_code_ifdef): New.
3312 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3313 * data/c++.m4: Define default value for global_tokens_and_yystype.
3314 * data/glr.cc: Likewise.
3315 * data/location.cc: Use b4_percent_define_flag_if.
3316
148d66d8 3317 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
3318
3319 * src/parse-gram.y (Unqualified %code): Change muscle name to
3320 b4_percent_code().
3321 (content.opt): Default to empty.
3322
a7867f53
JD
33232007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3324
3325 Implement support for relative and absolute skeleton file names.
3326 Discussed starting at
3327 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3328 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3329 (Bison Options): Document in --skeleton entry.
3330 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3331 full_skeleton can't necessarily hold all of pkgdatadir.
3332 If the specified skeleton file name contains a `/', don't prepend
3333 pkgdatadir.
3334 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3335 file name contains a `/', prepend the grammar file directory.
3336 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3337 * skeletons.at: New file.
3338 (relative skeleton file names): New test case.
3339 (installed skeleton file names): New test case.
3340 * tests/testsuite.at: Include skeletons.at.
3341
3342 * bootstrap: Update copyright to 2007.
3343
830c9b18
PB
33442007-01-17 Paolo Bonzini <bonzini@gnu.org>
3345
3346 * bootstrap: Remove occurrences of .#bootmp from the files.
3347
a8c2e813
AD
33482007-01-17 Akim Demaille <akim@epita.fr>
3349
3350 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3351 nonterminals.
3352 Use per-type %printer.
3353
279cabb6
JD
33542007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3355
3356 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3357 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3358 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3359 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3360 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3361 tests/glr-regression.at, tests/input.at, tests/local.at,
3362 tests/output.at, tests/torture.at: Update copyright to 2007.
3363
bb32f4f2
AD
33642007-01-16 Akim Demaille <akim@epita.fr>
3365
3366 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3367 error code.
3368 (Calc++ Scanner): Exit with failure if we can't open the input
3369 file.
3370 Accept "-" standing for stdin.
3371 (Calc++ Top Level): Print the result only if the parsing was
3372 successful.
3373
7cff04b5
AD
33742007-01-16 Akim Demaille <akim@epita.fr>
3375
3376 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3377
a4e25e1d
JD
33782007-01-15 Paolo Bonzini <bonzini@gnu.org>
3379 and Joel E. Denny <jdenny@ces.clemson.edu>
3380
3381 Clean up %define and %code implementation in M4 some. Most
3382 importantly, rename all related macros to be in the b4_percent_define
3383 and b4_percent_code namespaces. Also, complete support for `.' in
3384 %define variable names and %code qualifiers.
3385 * data/bison.m4 (b4_check_user_names): Check for special
3386 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3387 m4_foreach loops.
3388 (b4_get_percent_define, b4_get_percent_code): Rename to...
3389 (b4_percent_define_get, b4_percent_code_get): ... these.
3390 Extend documentation with examples.
3391 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3392 b4_percent_define_skeleton_variables and
3393 b4_percent_code_skeleton_qualifiers.
3394 Expect any value for the %define variable `foo' to be stored in the
3395 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3396 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3397 expect any unqualified %code blocks to be stored in a macro named
3398 `b4_percent_code_unqualified'.
3399 Use m4_indir so that %define variable names and %code qualifiers can
3400 contain `.', which is allowed by the grammar parser.
3401 (b4_percent_define_default): New macro to set a default value for a
3402 %define variable.
3403 (m4_wrap): Update wrapped code, and fix some underquoting.
3404 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3405 Expect grammar uses of %define variables and %code qualifiers to be
3406 defined in b4_percent_define_user_variables and
3407 b4_percent_code_user_qualifiers.
3408 * data/c++.m4: Use b4_percent_define_default rather than
3409 m4_define_default. Fix some underquoting. Skeleton usage of %define
3410 variable define_location_comparison now implies skeleton usage of
3411 %define variable filename_type.
3412 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3413 data/push.c, data/yacc.c: Update macro names.
3414 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3415 muscle names.
3416
e37c665c
JMG
34172007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3418
3419 DJGPP specific issues.
3420
3421 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3422 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3423
7d2d521f
JD
34242007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3425
3426 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3427 run parsers in all tests so that Valgrind is invoked during
3428 maintainer-check-valgrind.
3429 (Duplicate representation of merged trees): Free all semantic values.
3430 (Duplicated user destructor for lookahead): Likewise.
3431
e0ac9b4b
JD
34322007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3433
3434 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3435 command-line prefix.
3436 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3437 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3438 miss Valgrind messages.
3439 (Exploding the Stack Size with Malloc): Likewise.
3440
78143faa
JD
34412007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3442
3443 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3444 locals. Reported by Juan Manuel Guerrero at
3445 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3446 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3447 Fix some indentation also.
3448 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3449 explaining this issue.
3450
7ecec4dd
JD
34512007-01-09 Paolo Bonzini <bonzini@gnu.org>
3452 and Joel E. Denny <jdenny@ces.clemson.edu>
3453
3454 Simplify union and prologue handling, and escape union and lex/parse
3455 params with digraphs.
3456 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3457 values to the empty string since these are no longer guaranteed
3458 initialized by the front-end.
3459 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3460 braces around b4_user_stype since this is no longer done by the
3461 front-end.
3462 * src/files.c, src/files.h (pre_prologue_obstack,
3463 post_prologue_obstack): Remove.
3464 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3465 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3466 with digraphs. This fixes lex params and parse params.
3467 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3468 * src/output.c (prepare): Remove muscle insertion of the prologues.
3469 (output): Remove freeing of pre_prologue_obstack and
3470 post_prologue_obstack.
3471 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3472 than prologue_augment for prologue parsing so you don't need prologue
3473 obstacks.
5c80250c
JD
3474 (grammar_declaration): For %union RHS, use `braceless' instead of
3475 "{...}" so that braces are already stripped and code is escaped with
3476 digraphs.
7ecec4dd
JD
3477 * src/reader.c (prologue_augment): Remove.
3478 (reader): Remove initialization of pre_prologue_obstack and
3479 post_prologue_obstack.
3480 * src/reader.h (prologue_augment): Remove.
3481
3482 * data/c.m4: Remove stray parenthesis.
3483
16dc6a9e
JD
34842007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3485
3486 Remove quotes from variables names in %define directives and from
3487 qualifiers in %code directives, and restrict the characters that are
3488 allowed in them to M4-friendly ones. For %define, continue to support
3489 the quoted form as a deprecated feature. Discussed starting at
3490 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3491 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3492 %code.
3493 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
3494 (Decl Summary): In %defines entry, update mention of `%code requires'
3495 and `%code provides'.
16dc6a9e
JD
3496 (C++ Location Values): Update %define uses.
3497 (Calc++ Parser Interface): Likewise.
3498 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 3499 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
3500 * src/parse-gram.y (prologue_declaration): For %define variables, use
3501 `variable' instead of `STRING'.
3502 (grammar_declaration): For %code qualifiers, use `ID' instead of
3503 `STRING'.
3504 (variable): New nonterminal that takes an `ID' or a `STRING'.
3505 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3506 and %define uses.
3507 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3508 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3509 (%define errors): Update %define uses.
3510
e9813cd4
JD
35112007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3512
3513 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3514 instead of muscle_insert for %define values so that M4-special
3515 characters are replaced with digraphs.
3516 * tests/input.at (%define errors): Extend to check weird values.
3517
6afc30cc
JD
35182007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3519
3520 Instead of having skeletons declare all valid %define variables and
3521 %code qualifiers, provide macros that retrieve the associated values
3522 and build these lists automatically. Thus Bison will now warn when a
3523 variable or qualifier is not used by the skeleton in the current
3524 invocation regardless of whether it might sometimes be used by that
3525 skeleton in other invocations. Also, move all %define value macros to
3526 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3527 form, which is replaced by %code.
3528 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3529 (b4_check_user_names): ... this, and change the series of valid name
3530 arguments to a single list argument for names used in the skeleton
3531 similar to the existing list argument for names used in the grammar.
3532 Warn instead of complaining.
3533 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3534 values and %code code, to format %code code properly, and to build
3535 lists of all %define variables and %code qualifiers used in the
3536 skeleton: b4_skeleton_percent_define_variables and
3537 b4_skeleton_percent_code_qualifiers.
3538 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3539 Remove, and...
3540 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3541 the skeleton names lists can finish building first. In place of
3542 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3543 expect the lists b4_user_percent_define_variables and
3544 b4_user_percent_code_qualifiers.
3545 * data/c++.m4: Where setting default values for b4_parser_class_name,
3546 b4_location_type, b4_filename_type, b4_namespace, and
3547 b4_define_location_comparison, update their names to the
3548 b4_percent_define_ namespace.
3549 * data/glr.c: Don't use b4_check_percent_define_variables and
3550 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3551 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3552 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 3553 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
3554 * data/location.cc: Use b4_get_percent_define.
3555 * data/push.c: Don't use b4_check_percent_define_variables and
3556 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3557 * data/yacc.c: Likewise, and don't call m4_exit in
3558 b4_use_push_for_pull_if or m4_wrap code will never execute.
3559 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3560 Rename to...
3561 (muscle_grow_user_name_list): ... this for consistency with the
3562 terminology used in bison.m4.
3563 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3564 %define variable names, and rename muscle used_percent_define_variables
3565 to user_percent_define_variables.
3566 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3567 user_percent_code_qualifiers.
3568 (content): Remove.
3569 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3570 {CODE} form is no longer accepted.
3571 * tests/input.at (Reject bad %code qualifiers): Rename to...
3572 (Reject unused %code qualifiers): ... this, and update test output.
3573 (%define error): Update test output.
3574
7eb8a0bc
JD
35752007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3576
3577 Check for unrecognized %define variables similar to checking for
3578 unrecognized %code qualifiers. Check for redefined %define variables.
3579 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3580 generalizes...
3581 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3582 (b4_check_percent_define_variables): New, also wraps it.
3583 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3584 variables using b4_check_percent_define_variables.
3585 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3586 all those exercised in the test suite and all those listed in the
3587 `Default values' section of c++.m4. Are there others?
3588 * data/push.c, data/yacc.c: Declare no valid %define variables.
3589 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3590 similar to muscle_find, but it works even when the muscle stores a
3591 const value.
3592 (muscle_grow_used_name_list): New function for constructing the used
3593 name list muscles that b4_check_for_unrecognized_names requires.
3594 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3595 %define'd more than once. Define the b4_used_percent_define_variables
3596 muscle with muscle_grow_used_name_list.
3597 (grammar_declaration): Abbreviate %code code with
3598 muscle_grow_used_name_list.
3599 * tests/input.at (%define errors): New.
3600
3fc65ead
JD
36012007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3602
3603 Provide warn_at, complain_at, and fatal_at function callbacks to the
3604 skeletons, and use this for %code qualifier complaints.
3605 * data/bison.m4 (b4_error_at): New, invoked by...
3606 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3607 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3608 @fatal_at(...@) directives.
3609 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3610 qualifiers in b4_used_percent_code_qualifiers and to use
3611 b4_complain_at.
3612 * src/location.c, src/location.h (boundary_set_from_string): New global
3613 function.
3614 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3615 function.
3616 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3617 to b4_used_percent_code_qualifiers.
3618 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3619 function.
3620 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3621 (lineno): Rename to...
3622 (out_lineno): ... this so I don't misunderstand it again.
3623 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3624 here; these newlines are in the input but not the output file.
3625 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3626 (at_directive_perform): ... this new static function, and add handling
3627 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3628 directives.
3629 * tests/input.at (Reject bad %code qualifiers): Update test output with
3630 locations and extend.
3631
3632 * tests/output.at (Output file name: [, Output file name: ]): Remove
3633 bogus comment about these tests failing.
3634
1c7b7e1d
JD
36352007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3636
3637 Clean up b4_check_percent_code_qualifiers a little.
3638 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3639 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3640 documentation and add examples.
3641 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3642 qualifiers here.
3643
08af01c2
JD
36442007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3645
3646 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3647 unreliable -- especially when they're hidden inside another macro.
3648 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3649 data/c.m4: Remove m4_divert(-1).
3650 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3651 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3652 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 3653 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
3654 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3655 pushed and popped by m4sugar, should be first on the stack.
3656
3657 Provide warn, complain, and fatal function callbacks to the skeletons.
3658 This provides more flexibility than m4_fatal, improves the error
3659 message format, and captures messages for translation. Discussed
3660 starting at
3661 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3662 * data/bison.m4 (b4_error): New, invoked by...
3663 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3664 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3665 directives. Because these M4 macros might be called when the current
3666 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3667 the previous removal of uses of m4_divert, which caused trouble.
3668 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3669 m4_fatal to report unrecognized %code qualifiers.
3670 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3671 push parser requests.
3672 * data/glr.c: Use b4_complain instead of m4_fatal to report
3673 non-deterministic push parser requests.
3674 Update @output usage to @output(...@) form.
3675 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3676 report missing %defines. Update @output usage to @output(...@) form.
3677 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3678 @output(...@) form.
3679 * src/main.c (main): Invoke skel_scanner_free.
3680 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3681 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3682 obstack_for_string from flex-scanner.h.
3683 (YY_DECL): Use to declare skel_lex static.
3684 (decode_at_digraphs): Remove; now handled in the new
3685 SC_AT_DIRECTIVE_ARG start condition.
3686 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3687 functions.
3688 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3689 at_directive_argv): New static globals.
3690 (INITIAL): Use fail_for_invalid_at.
3691 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3692 recognize the start of a generalized `@directive(...@)' form and
3693 start...
3694 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3695 directive args (using the new obstack_for_string), to decode the
3696 contained @ diagraphs, and to perform the directive. It recognizes
3697 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3698 @output(...@).
3699 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3700 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3701 `@,'.
3702 (scan_skel): Initialize obstack_for_string on the first call.
3703 (skel_scanner_free): New function to free obstack_for_string.
3704 * tests/input.at (Reject bad %code qualifiers): Update test output.
3705
8e0a5e9e
JD
37062007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3707
3708 Consolidate the 4 prologue alternative directives (%code, %requires,
3709 %provides, and %code-top) into a single %code directive with an
3710 optional qualifier field. Discussed at
3711 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3712 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3713 alternatives.
3714 * doc/bison.texinfo (Prologue Alternatives): Update.
3715 (Decl Summary): Update to %code "requires" and %code "provides".
3716 (Calc++ Parser): Update to %code "requires".
148d66d8 3717 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
3718 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3719 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3720 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3721 which are skeleton-specific.
3722 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3723 declare what %code qualifiers it supports and to complain if any other
3724 qualifiers were used in the grammar.
3725 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3726 and b4_user_code([b4_percent_code_provides]) in place of
3727 b4_user_requires and b4_user_provides.
3728 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3729 Add b4_user_code([b4_percent_code_top]) and
3730 b4_user_code([b4_percent_code]).
3731 Invoke b4_check_percent_code_qualifiers.
3732 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3733 PERCENT_REQUIRES): Remove.
3734 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3735 %requires. Rewrite the %code RHS as the unqualified form defining the
3736 muscle b4_percent_code. Add another RHS for the qualified %code form,
3737 which defines muscles of the form b4_percent_code_QUALIFIER and the
3738 b4_used_percent_code_qualifiers muscle.
3739 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3740 PERCENT_REQUIRES): Remove.
3741 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3742 %code "requires" and %code "provides".
3743 * tests/input.at (Reject bad %code qualifiers): New.
3744
95021767
JD
37452007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3746
3747 Use the new code_props interface for destructors and printers.
3748 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3749 printer_location members, and change the type of the destructor and
3750 printer members to code_props.
3751 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3752 symbol_printer_get, semantic_type_destructor_set,
3753 semantic_type_printer_set, default_tagged_destructor_set,
3754 default_tagless_destructor_set, default_tagged_printer_set,
3755 default_tagless_printer_set): Use code_props in arguments and return
3756 types in place of char const * and location.
3757 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3758 since the locations are now contained in the return of
3759 symbol_destructor_get and symbol_printer_get.
3760 * src/output.c (symbol_destructors_output, symbol_printers_output):
3761 Replace with...
3762 (symbol_code_props_output): ... this to eliminate duplicate code.
3763 (output_skeleton): Update to use symbol_code_props_output.
3764 * src/reader.c (symbol_should_be_used): Update use of
3765 symbol_destructor_get.
3766 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3767 Update uses of the various _destructor_set and _printer_set functions.
3768 * src/symtab.c: (default_tagged_destructor_location,
3769 default_tagless_destructor_location, default_tagged_printer_location,
3770 default_tagless_printer_location): Remove since we...
3771 (default_tagged_destructor, default_tagless_destructor,
3772 default_tagged_printer, default_tagless_printer): ... change the type
3773 of these to code_props.
3774 (symbol_new, semantic_type_new, symbol_destructor_set,
3775 semantic_type_destructor_set, symbol_destructor_get,
3776 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3777 symbol_check_alias_consistency, default_tagged_destructor_set,
3778 default_tagless_destructor_set, default_tagged_printer_set,
3779 default_tagless_printer_set): Update.
3780 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3781 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3782 code_props members.
3783 (symbol_print): Use SYMBOL_CODE_PRINT.
3784
f6857bbf
JD
37852007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3786
3787 Use the new code_props interface for rule actions.
3788 * src/symlist.h (symbol_list): Replace action, action_location, and
3789 used members with a code_props action_props member.
3790 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3791 grammar_midrule_action, grammar_current_rule_merge_set,
3792 grammar_current_rule_symbol_append, packgram): Update.
3793 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3794 * src/scan-code.l (handle_action_dollar): Update.
3795 (translate_rule_action): Remove, no longer used.
3796 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3797
7c0c6181
JD
37982007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3799
3800 Use the new code_props interface in parse-gram.y.
3801 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3802 Update all uses of translate_* functions to use the new code_props
3803 interface and to use gram_scanner_last_string_free and
3804 code_scanner_last_string_free where possible.
3805 (grammar_declaration): symbol_list_destructor_set and
3806 symbol_list_printer_set now perform the translation, so don't do it
3807 here. Use gram_scanner_last_string_free where possible.
3808 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3809 translate_code): Remove, no longer used.
3810 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3811 symbol_list_printer_set): Perform code translation here rather than
3812 depending on the caller to do so.
3813
3814 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3815 * src/scan-gram.h (gram_last_string): Remove declaration.
3816 * src/scan-gram.l (last_string): Declare it static.
3817
28e52c0d
JD
38182007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3819
3820 Encapsulate code properties and related functionality for the various
3821 destructors, printers, and actions into a code_props structure and
3822 interface. This patch merely implements code_props in scan-code.h and
3823 scan-code.l. Future patches will rewrite other modules to use it.
3824 Discussed starting at
3825 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3826 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3827 consistently initialize const structs that have an empty location
3828 field.
3829 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3830 to ensure consistency.
3831 * src/scan-code.h (code_props): New structure.
3832 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3833 function, macro, and const global variable for initializing a
3834 code_props with no code.
3835 (code_props_plain_init, code_props_symbol_action_init,
3836 code_props_rule_action_init, code_props_translate_code): The rest of
3837 the new code_props functional interface. Among other things, the init
3838 functions set the code_props kind field so that
3839 code_props_translate_code will know whether to behave like
3840 translate_symbol_action, translate_rule_action, or translate_code.
3841 These old translate functions must remain until all other modules are
3842 updated to use the new code_props interface.
3843 (code_scanner_last_string_free): New function similar to
3844 gram_scanner_last_string_free.
3845 (code_scanner_free): Add documentation.
3846 * src/scan-code.l: Implement the new interface.
3847 (code_lex): Make it static, add a code_props* argument, and remove the
3848 rule argument.
3849 (last_string): New static global similar to the one in scan-gram.l.
3850 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3851 instead of rule.
3852 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3853 code_props since Bison may one day use this information for destructors
3854 and printers.
3855 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3856 (handle_action_dollar): Use symbol_list_n_get and set used flag
3857 directly since symbol_list_n_used_set is removed.
3858 (translate_action): Add a code_props* argument and remove the rule,
3859 action, and location arguments. Pass the code_props* on to code_lex.
3860 (translate_rule_action, translate_symbol_action, translate_code):
3861 Rewrite as wrappers around the new code_props interface.
3862 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3863 it would eventually need to break the encapsulation of code_props.
3864
96034983
JD
38652007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3866
3867 * etc/.cvsignore: New.
3868
945e396c
JD
38692007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3870
3871 Add maintainer-push-check to run maintainer-check using push parsing in
3872 place of pull parsing where available.
3873 * Makefile.am (maintainer-push-check): New.
3874 * data/bison.m4 (b4_use_push_for_pull_if): New.
3875 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3876 appropriately based on their existing values.
3877 (yypush_parse): Don't print push-parser-specific diagnostics if push
3878 parsing is being used in place of pull parsing.
3879 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3880 push.c.
3881 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3882 variable, and insert b4_use_push_for_pull_flag into muscles.
3883 * tests/Makefile.am (maintainer-push-check): New.
3884
7d596384
JD
38852006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3886
3887 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3888 (whether successful or failed) so that yypush_parse can be invoked
3889 again to start a new parse using the same yypstate.
3890 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3891 check multiple yypull_parse invocations on the same yypstate. For pull
3892 mode, extend to check multiple yyparse invocations.
3893 (Exploding the Stack Size with Alloca): Extend to try with
3894 %push-pull-parser.
3895 (Exploding the Stack Size with Malloc): Likewise.
3896
3897 * tests/calc.at (Simple LALR Calculator): Don't specify
3898 %skeleton "push.c" since %push-pull-parser implies that now.
3899 * tests/headers.at (export YYLTYPE): Don't check for the push
3900 declarations. Otherwise, this test case can't be used to see if push
3901 mode can truly emulate pull mode.
3902 * tests/input.at (Torturing the Scanner): Likewise.
3903 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
3904 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
3905 AT_YACC_IF, which now includes the case of push mode since %skeleton
3906 need not be used for push mode. This will be more intuitive once
3907 push.c is renamed to yacc.c.
3908
7172e23e
JD
39092006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3910
3911 For push mode, convert yyparse from a macro to a function, invoke yylex
3912 instead of passing a yylexp argument to yypull_parse, and don't
3913 generate yypull_parse or yyparse unless %push-pull-parser is declared.
3914 Discussed starting at
3915 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
3916 * data/bison.m4 (b4_pull_if): New.
3917 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
3918 * data/push.c: Improve M4 quoting a little.
3919 (b4_generate_macro_args, b4_parenthesize): Remove.
3920 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
3921 any time a pull parser is requested.
3922 Don't #define this as a wrapper around yypull_parse. Instead, when
3923 both push and pull are requested, make it a function that does that
3924 same thing.
3925 (yypull_parse): If there's a b4_prefix, #define this to
3926 b4_prefix[pull_parse] when both push and pull are requested.
3927 Don't define this as a function unless both push and pull are
3928 requested.
3929 Remove the yylexp argument and hard-code yylex invocation instead.
3930 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
3931 %push-parser.
3932 * src/getargs.c (pull_parser): New global initialized to true.
3933 * getargs.h (pull_parser): extern it.
3934 * src/output.c (prepare): Insert pull_flag muscle.
3935 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
3936 (prologue_declaration): Set both push_parser and pull_parser = true for
3937 %push-pull-parser. Set push_parser = true and pull_parser = false for
3938 %push-parser.
3939 * src/scan-gram.l: Don't accept %push_parser as an alternative to
3940 %push-parser since there's no backward-compatibility concern here.
3941 Scan %push-pull-parser.
3942 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
3943 instead of %push-parser.
3944 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
3945 prototype it in the module that calls yyparse.
3946 * tests/input.at (Torturing the Scanner): Likewise.
3947 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
3948
2e7944cb
JD
39492006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
3950
3951 Update etc/bench.pl. Optimize push mode a little (the yyn change
3952 deserves most of the credit).
3953 * Makefile.am (SUBDIRS): Add etc subdirectory.
3954 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
3955 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
3956 yytoken, yyval, and yyloc declarations to...
3957 (yyparse or yypush_parse): ... here to improve performance. For
3958 yypush_parse invocations after the first, be sure to assign yyn its old
3959 value again.
3960 (yypstate_new): Don't bother initializing the yyresult field since the
3961 initial value isn't used.
3962 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
3963 remove the #define that, in push mode, set it to yyps->NAME.
3964 * etc/Makefile.am: New.
3965 * etc/bench.pl: Remove and build it instead from...
3966 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
3967 "tests/bison" from the build directory by default rather than just
3968 invoking "bison" from $PATH.
3969 (calc_grammar): Update push parser code: don't declare yylval globally,
3970 don't define yyparse_wrapper, and don't #define yyparse.
3971 (bench_grammar): Update to check all working combinations of yacc.c,
3972 push.c, impure, pure, pull, and push.
3973
c3d50342
JD
39742006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3975
3976 For push mode, add pull wrappers around yypush_parse.
3977 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
3978 (yypull_parse): New function wrapping yypush_parse.
3979 (yyparse): New #define wrapping yypull_parse.
3980 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
3981 is declared.
3982 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
3983 prototype yylex in the module that calls yyparse, and don't prototype
3984 yyparse there. Otherwise, the yyparse expansion won't compile.
3985 * tests/input.at (Torturing the Scanner): Likewise.
3986
94ebeba5
JD
39872006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3988
3989 Enable push parsers to operate in impure mode. Thus, %push-parser no
3990 longer implies %pure-parser. The point of this change is to move
3991 towards being able to test the push parser code by running the entire
3992 test suite as if %push-parser had been declared.
3993 * data/push.c (yypush_parse): For impure mode, remove the
3994 yypushed_char, yypushed_val, and yypushed_loc arguments.
3995 Instead, declare these as local variables initialized to the global
3996 yychar, yylval, and yylloc.
3997 For the first yypush_parse invocation only, restore the initial values
3998 of these global variables when it's time to read a token since they
3999 have been overwritten.
4000 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4001 %push-parser.
4002 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4003 %pure-parser along with %push-parser since this test case was designed
4004 for pure push parsers.
4005 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4006 (AT_YACC_OR_PUSH_IF): New.
4007 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4008 add a note that it's still wrong for some cases (as it has been for a
4009 while).
4010 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4011 %push-parser no longer implies %pure-parser.
4012
a0633178
JD
40132006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4014
4015 Remove some unnecessary differences between the pull parser code and
4016 the push parser code. This patch enables yynerrs in push mode.
4017 * data/push.c: Reformat M4 a little.
4018 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4019 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4020 because push mode is on. Instead, if pure mode is on, move yynerrs
4021 to...
4022 (b4_declare_parser_state_variables): ... here.
4023 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4024 to yyps->NAME so it can be used in yypush_parse.
4025 (yypush_parse): Don't omit uses of yynerrs in push mode.
4026
8646b6a3
JD
40272006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4028
4029 Fix bug such that the first pushed token's value and location are
4030 sometimes overwritten (sometimes by %initial-action) before being used.
4031 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4032 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4033 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4034 more closely mimic the pull parser logic.
4035 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4036 time to read a token, which is after any initialization of yylval and
4037 yylloc.
4038 (gottoken): Rename label to...
4039 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4040 user namespace.
4041
9baf4d74
JD
40422006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4043
4044 Rearrange initialization of the parser state variables so that the
4045 skeleton doesn't have to have a copy for pull mode and another for push
4046 mode. This patch also fixes at least a bug such that yylloc was not
4047 initialized (with b4_location_initial_line and
4048 b4_location_initial_column) upon calling yypush_parse. However, that
4049 initialization now overwrites the first token's location;
4050 %initial-action assigning @$ already did the same thing, and both bugs
4051 will be fixed in a later patch.
4052 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4053 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4054 yyss, yyvs, yyls, and yystacksize.
4055 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4056 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4057 yylsp.
4058 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4059 yyps->NAME so it can be used in yypush_parse.
4060 (yyparse or yypush_parse): For yypush_parse, don't print the
4061 "Starting parse" diagnostic for invocations after the first.
4062 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4063 yypush_parse, only do it for the first invocation.
4064 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4065 initialization to occur in yypush_parse but only on the first
4066 invocation.
4067
23522164
JD
40682006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4069
4070 * data/push.c: Add CPP guards around push parser declarations in both
4071 the header and the code file.
4072 In the code file, move the push parser declarations to the same place
4073 they appear in the header file.
4074 Clean up the M4 some, especially the inconsistent underquoting in
4075 some b4_c_function_def and b4_c_function_decl uses.
4076
bb010fe5
JD
40772006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4078
4079 Encapsulate the push parser state variables into an M4 macro so the
4080 push skeleton doesn't have to list them again for pull mode's yyparse.
4081 For push mode, remove yypush_parse's local equivalents of these
4082 variables to eliminate unnecessary copying between the two sets at
4083 run-time. This patch also fixes at least a bug related to multiple
4084 %initial-action invocations in push mode.
4085 * data/push.c (b4_declare_parser_variables): Rename to...
4086 (b4_declare_scanner_communication_variables): ... this for clarity and
4087 update both uses.
4088 (b4_declare_yyparse_variables): Remove and move its contents to the one
4089 spot where it was invoked.
4090 (b4_declare_parser_state_variables): New macro containing the parser
4091 state variables required by push mode.
4092 (struct yypstate): Replace all fields but yynew with
4093 b4_declare_parser_state_variables.
4094 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4095 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4096 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4097 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4098 parser state variable declarations with
4099 b4_declare_parser_state_variables.
4100 Don't initialize parser state variables when calling yypush_parse since
4101 yypstate_new already does that.
4102 Invoke the user's initial action only upon the first yypush_parse
4103 invocation.
4104 Remove all code that copies between the local parser state variables
4105 and the yypstate.
4106
2d212f8c
JD
41072006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4108
4109 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4110 prevent a name collision in a future patch where these names will
4111 sometimes be #define'd.
4112 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4113 since it no longer has the same name as the existing argument.
4114 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4115
e6e704dc
JD
41162006-12-19 Paolo Bonzini <bonzini@gnu.org>
4117 and Joel E. Denny <jdenny@ces.clemson.edu>
4118
4119 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4120 that the argument is case-insensitive, and there's no `=' here.
4121 For the %skeleton entry, mention that %language is better.
4122 (Bison Options): Likewise for --language and --skeleton. Move the
4123 --skeleton entry so that the `Tuning the parser' section is sorted
4124 alphabetically on long options.
4125 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4126 %language directive in detail here; cross-reference the %language
4127 documentation instead.
4128 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4129 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 4130 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
4131 * examples/extexi (normalize): Instead of replacing every %require
4132 argument with the current Bison version, just substitute for
4133 `@value{VERSION}'. This guarantees that we're testing what actually
4134 appears in the documentation.
4135 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4136 rather than `@VERSION@'.
4137
0e021770
PE
41382006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4139
fd575f05
PE
4140 * NEWS: Reword the %language news a bit, and put it earlier.
4141
0e021770
PE
4142 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4143 Rewrite to simplify the logic.
4144 (language_argmatch): Likewise.
fd575f05
PE
4145 (program_name): We now own this var.
4146 * src/getargs.h (struct bison_language): Use char[] rather than
4147 const char *.
0e021770
PE
4148
4149 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4150 Java is supported.
4151 * src/complain.c (program_name): Remove decl; no longer needed.
4152 * src/main.c (program_name): Remove; now belongs to getargs.
4153
41542006-12-18 Paolo Bonzini <bonzini@gnu.org>
4155
4156 * NEWS: Document %language.
4157
4158 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4159
4160 * data/c-skel.m4, data/c++-skel.m4: New files.
4161 * data/glr.c: Complain on push parsers.
4162
4163 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4164 over %skeleton.
148d66d8 4165 (Decl Summary): Document %language and %skeleton.
0e021770
PE
4166 (Command line): Document -L.
4167
4168 * examples/extexi: Rewrite %require directive.
4169 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4170
4171 * src/files.c (compute_exts_from_gc): Look in language structure
4172 for .y extension.
4173 (compute_file_name_parts): Check whether .tab should be added.
4174 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4175 (language, skeleton_arg, language_argmatch): New.
4176 (long_options): Add --language.
4177 (getargs): Use skeleton_arg, add -L/--language.
4178 * src/getargs.h: Include location.h.
4179 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4180 * src/output.c (prepare): Pick default skeleton from struct language.
4181 Don't dispatch C skeletons here.
4182 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4183 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4184 * src/scan-gram.l ("%language"): New rule.
4185
4186 * tests/calc.at: Test %skeleton and %language.
4187 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4188 (AT_GLR_IF): Look for %skeleton "glr.cc".
4189 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4190 (AT_YACC_IF): Reject %language.
4191
5691bf57
PE
41922006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4193
db06f0ce
PE
4194 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4195 since it wasn't used; only the typedef name 'semantic_type' is needed.
4196 Also, omit trailing white space.
4197
5691bf57
PE
4198 * bootstrap: Sync from coreutils.
4199 (gnulib_extra_files): Add build-aux/announce.gen.
4200 (slurp): Adjust .gitignore files like .cvsignore files.
4201 * build-aux/announce-gen: Remove from CVS, since bootstrap
4202 now creates this.
4203
791934e4
JD
42042006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4205
4206 Make %push-parser imply %pure-parser. This fixes several bugs; see
4207 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4208 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4209 pure_parser = true.
4210 * data/push.c: Don't bother testing b4_push_if when deciding whether
4211 to expand b4_declare_parser_variables globally.
4212 (yypush_parse): Likewise in here.
4213
4214 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4215 (yy_reduce_print): Reformat M4 for readability.
4216
ee5abb37
JD
42172006-12-15 Bob Rossi <bob@brasko.net>
4218 and Joel Denny <jdenny@ces.clemson.edu>
4219
4220 * data/push.c (yypstate): Add typedef, and update all uses of
4221 struct yypstate to just yypstate.
4222 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4223
16ca01f9
JD
42242006-12-14 Bob Rossi <bob@brasko.net>
4225
4226 * data/push.c (yypush_parse): Declare prototype regardless of
4227 %locations option.
4228
ab8e7e1a
JD
42292006-12-14 Bob Rossi <bob@brasko.net>
4230
4231 * data/push.c (yyparse): Remove the prototype and the #define when in
4232 push-parser mode.
4233
9bf32be3
JD
42342006-12-13 Bob Rossi <bob@brasko.net>
4235
4236 * data/push.c (yypstate_init): Rename to...
4237 (yypstate_new): ... this and use b4_c_function_def.
4238 (yypstate_delete): New.
4239 (yypush_parse): Change parameters yynval and yynlloc to be const.
4240 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4241 yypstate_delete functions.
4242
f02e2948
JD
42432006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4244
4245 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4246 strange test case titles. Reported by Bob Rossi.
4247
38eb7751
PE
42482006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4249
4250 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4251 of potential ambiguities in GLR grammers.
4252
bd9d212b
JD
42532006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4254
4255 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4256 `bison ', use m4_index instead of m4_substr since chopping up a string
4257 containing M4-special characters causes problems here.
4258
4259 Fix a couple of bugs related to special characters in user-specified
4260 file names, and make it easier for skeletons to compute output file
4261 names with the same file name prefix as Bison-computed output file
4262 names.
4263 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4264 b4_parser_file_name and b4_spec_defines_file instead of
4265 @output_parser_name@ and @output_header_name@, which are now redundant.
4266 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4267 b4_parser_file_name, b4_spec_defines_file, and the new
4268 @basename(FILENAME@) instead of @output_parser_name@ and
4269 @output_header_name@, which inappropriately escaped the file names as
4270 C string literals.
4271 * src/files.c (all_but_ext): Remove static qualifier.
4272 (compute_output_file_names): Move `free (all_but_ext)' to...
4273 (output_file_names_free): ... here since all_but_ext is needed later.
4274 * src/files.h (all_but_ext): Extern.
4275 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4276 exactly what MUSCLE_INSERT_STRING used to do.
4277 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4278 characters are escaped properly.
4279 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4280 all_but_ext.
4281 For pkgdatadir muscle, maintain previous functionality by using
4282 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4283 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4284 digraphs would never be expanded. Hopefully no one has M4-special
4285 characters in his Bison installation path.
4286 * src/scan-skel.l: Don't parse @output_header_name@ and
4287 @output_parser_name@ anymore since they're now redundant.
4288 In @output, use decode_at_digraphs.
4289 Parse a new @basename command that invokes last_component.
4290 (decode_at_digraphs): New.
4291 (BASE_QPUTS): Remove unused.
4292 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4293 (Output file name): New tests.
4294
3f7ca628
JD
42952006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4296
4297 Warn about output files that are generated by the skeletons and that
4298 conflict with other output files.
4299 * data/glr.c: Don't generate the header file here when glr.cc does.
4300 * src/files.c (file_names, file_names_count): New static globals.
4301 (compute_output_file_names): Invoke output_file_name_check for files
4302 not generated by the skeletons and remove existing checks.
4303 (output_file_name_check): New function that warns about conflicting
4304 output file names.
4305 (output_file_names_free): Free file_names.
4306 * src/files.h (output_file_name_check): Declare.
4307 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4308 the skeletons.
4309 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4310 (Conflicting output files): New tests.
4311
178e123e
PE
43122006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4313
4314 * doc/bison.texinfo: Fix a couple of typos.
4315
43162006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
4317
4318 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4319 Rename to...
4320 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4321 update all uses.
4322 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4323 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4324 local pv.
4325 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4326 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4327
ea17f233
JD
43282006-12-07 Bob Rossi <bob@brasko.net>
4329 and Joel Denny <jdenny@ces.clemson.edu>
4330
4331 * data/push.c (yypvarsinit): Change return type from void* to struct
4332 yypvars*. No longer cast to void* on return.
4333 (struct yypvars): Remove yylen since it need not be remembered between
4334 yypushparse invocations.
4335 (yypushparse): Don't copy between yylen and pv->yylen.
4336
55a30bda
JD
43372006-12-05 Bob Rossi <bob@brasko.net>
4338
4339 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4340 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4341 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4342 (struct yypvars): Remove b4_declare_parser_variables.
4343 (yypvarsinit): Remove init code for removed variables.
4344 (global scope): Do not declare b4_declare_parser_variables if
4345 push or pure mode.
4346 (yypushparse): Add b4_declare_parser_variables.
4347 Init new local variables, and remove init code for removed
4348 yypvars variables.
4349 (yyparse): Delete.
4350 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4351 and yyparse for other modes.
4352 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4353 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4354 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4355 (AT_PURE_LEX_IF): True if pure or push parser.
4356
85894313
JD
43572006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4358
4359 Document Yacc prologue alternatives and default %destructor's and
4360 %printer's as experimental. Don't mention Java yet. Discussed at
4361 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4362 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4363 (2.3a): Annotate this entry to say the old forms of these features were
4364 also experimental.
4365 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 4366 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
4367 of Java (we'll want this back eventually).
4368
02975b9a
JD
43692006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4370
4371 Support a file name argument to %defines. Deprecate `=' in
4372 %file-prefix, %name-prefix, and %output. Discussed at
4373 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4374 * NEWS (2.3a+): Mention.
148d66d8 4375 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
4376 form of %defines, and remove `=' from entries for %file-prefix,
4377 %name-prefix, and %output.
4378 * src/parse-gram.y (prologue_declaration): Implement.
4379 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4380 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4381 all but one occurrence of %name-prefix.
4382 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4383 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4384 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4385 occurrence of each of %file-prefix and %output. Add check for %defines
4386 with argument.
4387 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4388 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4389 Remove the `=' from %output.
4390
287b314e
JD
43912006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4392
4393 Don't escape $ in test case titles since Autoconf 2.61 now does that
4394 correctly.
4395 * tests/actions.at (Default %printer and %destructor are not for error
4396 or $undefined): Here.
4397 (Default %printer and %destructor are not for $accept): Here.
4398 * tests/input.at (Invalid $n and @n): Here.
4399
3ebecc24
JD
44002006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4401
4402 Rename <!> to <>. Discussed starting at
4403 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4404 * NEWS (2.3a+): Update.
148d66d8 4405 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
4406 Update.
4407 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4408 * src/scan-gram.l (INITIAL): Implement.
4409 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4410 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4411 comment.
4412 * tests/actions.at (Default tagless %printer and %destructor,
4413 Default tagged and per-type %printer and %destructor,
4414 Default %printer and %destructor are not for error or $undefined,
4415 Default %printer and %destructor are not for $accept,
4416 Default %printer and %destructor for mid-rule values): Update.
4417 * tests/input.at (Default %printer and %destructor redeclared,
4418 Unused values with default %destructor): Update.
4419
26b8a438
JD
44202006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4421
4422 Don't let %prec take a nonterminal.
4423 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4424 token.
4425 * tests/input.at (%prec takes a token): New test checking that %prec
4426 won't take a nonterminal.
4427
07c39ae9
JD
44282006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4429
405d53b7
JD
4430 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4431 it was double-quoted.
07c39ae9
JD
4432 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4433 grammar is maintained with Bison's highest standards.
4434 * src/getargs.c: Fix some typos in Doxygen comments.
4435
580b8926
JD
44362006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4437
4438 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4439 later. Reported by Paul Eggert in
4440 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4441 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4442 * src/scan-code.l (translate_action): Don't bother invoking
4443 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4444 (code_scanner_free): Instead of invoking
4445 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4446 which frees more.
4447 * src/scan-gram.l (gram_scanner_free): Likewise.
4448 * src/scan-skel.l (scan_skel): Likewise.
4449
4502eadc
JD
44502006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4451
4452 * src/files.c (tr): Change return type to void.
4453 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4454 has been called previously for the same key.
4455 (muscle_find): Return storage instead of value so that
4456 --enable-gcc-warnings doesn't produce warnings that the return discards
4457 const. aver that the value and storage are the same since storage
4458 could potentially be NULL when value is not.
4459 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4460 same as 0.
4461
7746c8f6
PE
44622006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4463
4464 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4465 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4466 us a slightly cleaner distribution, and also works.
4467 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4468 gnulib changes.
4469
eb095650
PE
44702006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4471 and Paul Eggert <eggert@cs.ucla.edu>
4472
4473 Don't let Bison leak memory except when it complains.
4474 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4475 (spec_defines_file, dir_prefix): Now char *, not const char *,
4476 since they are freed.
4477 * src/files.c: Likewise.
4478 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4479 Likewise.
4480 (tr): Now operates in-place. All uses changed.
4481 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4482 values.
4483 (compute_file_name_parts, compute_output_file_names): Don't store
4484 read-only data in variables that will be freed.
4485 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4486 src_extension, and header_extension.
4487 (output_file_names_free): New public function to free
4488 spec_verbose_file, spec_graph_file, spec_defines_file,
4489 parser_file_name, and dir_prefix.
4490 * src/getargs.c (getargs): Don't store read-only data in variables that
4491 will be freed.
4492 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4493 (which previously existed but was unused), and quotearg_free.
4494 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4495 * src/muscle_tab.c: Likewise.
4496 (muscle_entry): Make the value char const *,
4497 and add a new storage member that is char * and can be freed.
4498 (muscle_entry_free): New private function.
4499 (muscle_init): Use it instead of free.
4500 (muscle_insert, muscle_grow): Update and use new storage member.
4501 (muscle_code_grow): Free the string passed to muscle_grow
4502 since it's not needed anymore.
4503 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4504 add a new `char *code' member.
4505 ("{...}"): Declare semantic type as code.
4506 * src/scan-code.h (translate_rule_action):
4507 (translate_symbol_action, translate_code, translate_action): Return
4508 `char const *' rather than `char *' since external code should not free
4509 these strings.
4510 * src/scan-code.l: Likewise.
4511 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4512 which is "{...}" in the parser.
4513 * tests/Makefile.am (maintainer-check-valgrind): Set
4514 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4515 Valgrind.
4516 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4517 complain.
4518 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4519 expecting a non-zero exit status sets --leak-check=summary and
4520 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4521 this case, and we don't want to hear about it.
4522
ac564be4
PE
45232006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4524
4525 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4526 instead of from the template, to simplify configuration a bit.
4527 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4528 and m4/wint_t.m4, as they are needed with the latest gnulib.
4529
17bd8a73
JD
45302006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4531
4532 Disable unset/unused mid-rule value warnings by default, and recognize
4533 --warnings=midrule-values to enable them. Discussed starting at
4534 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4535 * NEWS (2.3a+): Mention.
4536 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4537 warnings): Add entry for midrule-values subargument.
4538 * src/reader.c (symbol_should_be_used): Don't return true just because
4539 the value is a set/used mid-rule value unless
4540 --warnings=midrule-values was specified.
4541 * tests/input.at (Unused values, Unused values before symbol
4542 declarations): Run tests with and without --warnings=midrule-values.
4543
4544 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4545 than LIST_FREE directly.
4546
89eb3c76
JD
45472006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4548
4549 Finish implementing --warnings=error, which should not be implied by
4550 --warnings=all (or by its synonyms -W and --warnings without
4551 subarguments).
4552 * src/complain.c (set_warning_issued): New function to report that
4553 warnings are being treated as errors and to record an error if so.
4554 Invoke...
4555 (warn_at, warn): ... here.
4556 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4557 "error - warnings are errors" does not appear above "all - all of the
4558 above".
4559 (getargs): For -W and --warnings without subarguments, don't let
4560 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4561 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4562
ba7560e2
JD
45632006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4564
4565 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4566 empty subargument list. For example: `bison --warnings= parser.y'.
4567
31283fc3
JD
45682006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4569
4570 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4571 the parser header file so that gcc doesn't warn.
4572
12e35840
JD
45732006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4574
4575 Split the default %destructor/%printer into two kinds: <*> and <!>.
4576 Discussed starting at
4577 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4578 * NEWS (2.3a+): Mention.
4579 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4580 previous change today related to mid-rules.
148d66d8 4581 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 4582 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
4583 (TYPE_TAG_ANY): Add as <*>.
4584 (TYPE_TAG_NONE): Add as <!>.
4585 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4586 for <*> and <!>.
4587 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4588 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4589 * src/symlist.c (symbol_list_default_new): Split into tagged and
4590 tagless versions.
4591 (symbol_list_destructor_set, symbol_list_printer_set): Split
4592 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4593 SYMLIST_DEFAULT_TAGLESS.
4594 * src/symlist.h: Update symbol_list_default*_new prototypes.
4595 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4596 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4597 * src/symtab.c (default_destructor, default_destructor_location,
4598 default_printer, default_printer_location): Split each into tagged and
4599 tagless versions.
4600 (symbol_destructor_get, symbol_destructor_location_get,
4601 symbol_printer_get, symbol_printer_location_get): Implement tagged
4602 default and tagless default cases.
4603 (default_destructor_set, default_printer_set): Split each into tagged
4604 and tagless versions.
4605 * src/symtab.h: Update prototypes.
4606 * tests/actions.at (Default %printer and %destructor): Rename to...
4607 (Default tagless %printer and %destructor): ... this, and extend.
4608 (Per-type %printer and %destructor): Rename to...
4609 (Default tagged and per-type %printer and %destructor): ... this, and
4610 extend.
4611 (Default %printer and %destructor for user-defined end token): Extend.
4612 (Default %printer and %destructor are not for error or $undefined):
4613 Update.
4614 (Default %printer and %destructor are not for $accept): Update.
4615 (Default %printer and %destructor for mid-rule values): Extend.
4616 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4617 (Unused values with default %destructor): Extend.
4618
f91b1629
JD
46192006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4620
4621 Don't apply the default %destructor/%printer to an unreferenced midrule
4622 value. Mentioned at
4623 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4624 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4625 like $@n instead of just @n so that the default %destructor/%printer
4626 logic doesn't see them as user-defined symbols.
4627 (symbol_is_dummy): Check for both forms of the name.
4628 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4629 name for which the midrule value is referenced in any action.
4630 * tests/actions.at (Default %printer and %destructor for mid-rule
4631 values): New test.
4632 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4633 for change to dummy symbol names.
4634
519d0004
JD
46352006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4636
4637 Warn about unset midrule $$ if the corresponding $n is used.
4638 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4639 $n usage.
4640 (packgram): Before invoking grammar_rule_check on any rule, make sure
4641 all actions have already been scanned in order to set `used' flags.
4642 Otherwise, checking that a midrule's $$ is set will not always work
4643 properly because the midrule check must forward-reference the midrule's
4644 parent rule.
4645 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4646 warning.
4647
a501eca9
JD
46482006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4649
4650 More improvements to the documentation of the prologue alternatives:
4651 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4652 Bison manual.
4653 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4654 some text to clarify the relative importance of the new directives and
4655 to show how these directives may be viewed as code labels.
4656
2cbe6b7f
JD
46572006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4658
4659 Similar to the recently removed %before-header, add %code-top as the
4660 alternative to the pre-prologue. Mentioned at
4661 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4662 Also, let the prologue alternatives appear in the grammar section.
4663 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4664 (prologue_declaration): Move the existing prologue alternatives to...
4665 (grammar_declaration): ... here and add %code-top.
4666 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4667
4668 Clean up and extend documentation for the prologue alternatives.
4669 * NEWS (2.3a+): Describe prologue alternatives.
4670 * doc/bison.texinfo (Prologue): Move discussion of prologue
4671 alternatives to...
4672 (Prologue Alternatives): ... this new section, and extend it to discuss
4673 all 4 directives in detail.
148d66d8
JD
4674 (Table of Symbols): Clean up discussion of prologue alternatives and
4675 add %code-top.
2cbe6b7f 4676
e557d3ea
JMG
46772006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4678
4679 DJGPP specific issues.
4680
4681 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4682 config.bat accordingly.
4683 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4684 * djgpp/config.site: Likewise.
4685
136a0f76
PB
46862006-10-16 Paolo Bonzini <bonzini@gnu.org>
4687
27bd5d67
PB
4688 Replace %*-header with %provides, %requires, %code. See discussion at
4689 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4690
136a0f76
PB
4691 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4692 (b4_user_start_header): Remove.
4693 * data/glr.c: Use new macros instead of b4_*start_header
4694 and b4_*end_header.
4695 * data/glr.cc: Likewise.
4696 * data/lalr1.cc: Likewise.
4697 * data/push.c: Likewise.
4698 * data/yacc.c: Likewise.
4699
4700 * doc/bison.texinfo: Remove %before-header, rename
4701 %{start,end,after}-header to %requires, %provides, %code.
4702
4703 * src/parse-gram.y: Likewise (also rename token names accordingly).
4704 * src/scan-gram.l: Likewise.
4705 * tests/actions.at: Likewise.
4706
10f429ef
PE
47072006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4708
4709 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4710 Problem reported by Joel E. Denny.
4711
47122006-10-14 Jim Meyering <jim@meyering.net>
4713
4714 (Sync from coreutils.)
4715 Work also when the working directory (with e.g. coreutils sources)
4716 is version controlled with git, rather than CVS.
4717 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4718 rather than CVS.
4719 In messages and comments, say e.g., "checked-out sources",
4720 rather than "CVS sources".
4721 (version_controlled_file): New function. Work for git as well as
4722 for CVS. Don't use grep's -q option.
4723 (slurp): Call it here, in place of CVS-specific code.
4724
c4bd5bf7
JD
47252006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4726
4727 Fix testsuite for ./configure --enable-gcc-warnings:
4728 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4729 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4730 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4731 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4732 * test/regression.at (Diagnostic that expects two alternatives):
4733 Likewise.
4734
46356ea4
PE
47352006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4736
231ed89a
PE
4737 * bootstrap.conf (gnulib_modules): Add config-h.
4738 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4739 worry about HAVE_CONFIG_H.
4740 * lib/abitset.c: Likewise.
4741 * lib/bitset.c: Likewise.
4742 * lib/bitset_stats.c: Likewise.
4743 * lib/bitsetv-print.c: Likewise.
4744 * lib/bitsetv.c: Likewise.
4745 * lib/ebitset.c: Likewise.
4746 * lib/get-errno.c: Likewise.
4747 * lib/lbitset.c: Likewise.
4748 * lib/subpipe.c: Likewise.
4749 * lib/timevar.c: Likewise.
4750 * lib/vbitset.c: Likewise.
4751 * lib/bitset.c: Include "bitset.h" first, to test interface.
4752 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4753 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4754 * lib/bitsetv.c: Include "bitsetv.h" first.
4755 * lib/get-errno.c: Include "get-errno.h" first.
4756 * m4/.cvsignore: Add config-h.m4.
4757 * tests/actions.at (Default %printer and %destructor for ...):
4758 Adjust expected line numbers in output to reflect removal of #if
4759 HAVE_CONFIG_H lines.
4760 * tests/glr-regression.at (Missed %merge type warnings when ...):
4761 Likewise.
4762 * tests/regression.at (Braced code in declaration in rules section):
4763 Likewise.
4764 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4765 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4766 Include <config.h> unconditionally.
4767
46356ea4
PE
4768 * bootstrap: Sync from coreutils, as follows:
4769
4770 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4771
4772 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4773 variable was sometimes used without being initialized. This
4774 messed up the installation of the INSTALL file in some cases.
4775
4776 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4777
4778 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4779 --copy. Inspired by a suggestion from Bruno Haible.
4780
4781 2006-10-03 Jim Meyering <jim@meyering.net>
4782
4783 * bootstrap: Undo last change to this file, since now gnulib-tool
4784 sticks with the automake default in generating dependencies.
4785
dd4bf078
PE
47862006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4787
cf2a5f7c
PE
4788 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4789 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4790
4791 * doc/bison.1: Add copyright notice.
4792
4793 * data/glr.c: Don't include <stdarg.h>; not used.
4794
35fe0834
PE
4795 * NEWS: The -g and --graph options now output graphs in Graphviz
4796 DOT format, not VCG format.
4797 * doc/bison.1: Likewise.
4798 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
4799 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4800 of this change in
4801 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
4802 * TODO: Remove Graphviz entry.
4803 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4804 remove vcg.c, vcg.h, vcg_defaults.h.
4805 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4806 * src/graphviz.c, src/graphviz.h: New files.
4807 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4808 * src/files.h: Make comment more generic.
4809 * src/main.c (main): Likewise.
4810 * src/print_graph.h: Likewise.
4811 * src/getargs.c (usage): Make usage description more generic.
4812 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4813 (static_graph, fgraph): Remove. All uses changed to pass
4814 arguments instead of sharing a static var.
4815 (print_core, print_actions, print_state, print_graph):
4816 Output graphviz format rather than VCG format.
4817 * tests/.cvsignore: Remove *.vcg; add *.dot.
4818 * tests/output.at: Expect *.dot files, not *.vcg files.
4819
dd4bf078
PE
4820 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4821 accommodates the 2006-10-08 change.
4822
efdd7421
PE
48232006-10-11 Bob Rossi <bob@brasko.net>
4824
4825 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4826 (b4_yyssa, b4_yyerror_range): New macros.
4827 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4828 (yypvarsinit): Remove init of removed fields.
4829 (yypushparse): Remove use of removed fields; use new macros instead.
4830
96a1981a
PE
48312006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4832
4833 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4834 in a push parser. Reindent slightly to match yacc.c better.
4835
48362006-10-11 Bob Rossi <bob@brasko.net>
4837
46356ea4
PE
4838 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4839 yymsg_alloc fields.
4840 (yypvarsinit, yypushparse): Remove init of removed fields.
4841 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 4842
c1630a8b
PE
48432006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4844
4845 * THANKS: Add Paolo Bonzini and Bob Rossi.
4846
90b9908d
PB
48472006-10-08 Paolo Bonzini <bonzini@gnu.org>
4848
4849 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4850 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4851 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4852 b4_define_user_cde and uses): Remove.
4853 (b4_comment, b4_prefix, b4_sync_start): New.
4854 * data/bison.m4: New file, with most of the content removed from c.m4.
4855 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4856 * src/output.c (output_skeleton): Pass bison.m4.
4857 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4858 only if specified.
4859
cf806753
PE
48602006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4861
4862 Fix test failure reported by Tom Lane in
4863 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4864 and try to make such failures easier to catch in the future.
4865 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4866 that's now the caller's responsibility.
4867 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4868 Set yychar = YYEOF if it's negative.
4869 * tests/actions.at (yylex): Abort if asked to read past EOF.
4870 * tests/conflicts.at (yylex): Likewise.
4871 * tests/cxx-type.at (yylex): Likewise.
4872 * tests/glr-regression.at (yylex): Likewise.
4873 * tests/input.at (yylex): Likewise.
4874 * tests/regression.at (yylex): Likewise.
4875 * tests/torture.at (yylex): Likewise.
4876
0e2f006a
PE
48772006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4878
4879 Fix problems with translating English-language diagnostics.
4880 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4881 respect to bison-runtime pot generation. The YY_ stuff
4882 wasn't being captured.
4883 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4884 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4885 * runtime-po/POTFILES.in: Add data/push.c.
4886
e3ddc1e3
PE
48872006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4888
4889 Merge bootstrap changes from coreutils.
4890
4891 2006-09-28 Jim Meyering <jim@meyering.net>
4892
4893 Automatically generated dependencies are important even
4894 when all of the sources in a directory come from gnulib.
4895 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4896 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4897
4898 2006-09-23 Jim Meyering <jim@meyering.net>
4899
4900 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
4901
4902 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4903
4904 * bootstrap: Add support for --force.
4905 (usage): New function. Describe usage less tersely.
4906 (CVS_only_file): New var.
4907
01e972b3
PE
49082006-09-21 Paul Eggert <eggert@cs.ucla.edu>
4909
4910 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4911 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
4912 Adjust white space and comments to match GNU style better.
4913
c63d3e90
PE
49142006-09-20 Bob Rossi <bob@brasko.net>
4915
4916 * data/push.c (yyresult_get): Remove function.
4917 (YYPUSH_MORE): Add #define.
4918 (yypushparse): Modify return value.
4919
e70f46d1
PE
49202006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4921
4922 * stamp-h.in: Remove; no longer needed.
4923 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
4924 Remove config.h, config.hin, intl (no longer created).
4925 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
4926 stamp-h1.
4927
4928 Sync bootstrap from coreutils, as follows:
4929
4930 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
4931
4932 * bootstrap (symlink_to_gnulib): New function.
4933 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
4934 to copies-of-gnulib.
4935 (cp_mark_as_generated, slurp, gnulib_files):
4936 Avoid making a copy if it's the same as the old version.
4937 (gnulib_files): Add support for this variable (used by Bison).
4938
a92be413
PE
49392006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4940
4941 * src/getargs.c (usage): Rework to use conventions similar to
4942 coreutils, to make translation a bit easier and the code a bit
4943 smaller. Problem reported by Tim Van Holder.
4944
4f82b42a
PE
49452006-09-15 Paul Eggert <eggert@cs.ucla.edu>
4946
3b2942e6
PE
4947 Use some of gnulib's new modules, taken from coreutils.
4948
4949 * bootstrap: Sync from coreutils, except add support for gnulib_files.
4950 * bootstrap.conf: New file.
4951 (gnulib_modules): Add configmake, inttypes, unistd.
4952 (XGETTEXT_OPTIONS): Add complain, complain_at,
4953 fatal, fatal_at, warn, warn_at, unexpected_end.
4954 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
4955 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
4956 (gl_EARLY): Add.
4957 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
4958 (gl_INIT): Add
4959 (GNULIB_AUTOCONF_SNIPPET): Remove.
4960 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
4961 the pickiest.
4962 * lib/.cvsignore: Add inttypes_.h.
4963 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
4964 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
4965 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
4966 no-longer-necessary initializations.
4967 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
4968 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
4969 use the unistd module.
4970 * src/system.h: Likewise.
4971 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
4972 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
4973 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
4974 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
4975 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
4976 * src/system.h: Include inttypes.h unconditionally, now that we
4977 use the inttypes module. Don't bother to include stdint.h, since
4978 inttypes.h now does that for us.
4979 (LOCALEDIR): Remove, now that we use the configmake module.
4980 * src/getargs.c: Include configmake.h.
4981 * src/main.c: Likewise.
4982 * src/output.c: Likewise.
4983 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
4984 not from $abs_top_builddir, since config.h moved.
4985
4986
4f82b42a
PE
4987 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
4988 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
4989
4990 * src/parse-gram.y (symbol_declaration): Don't put statements
4991 before declarations; it's not portable to C89.
4992 * src/scan-code.l (handle_action_at): Likewise.
4993
4994 * src/scan-code.l: Always initialize braces_level; the old code
4995 left it uninitialized and therefore had undefined behavior.
4996
4997 Don't attempt to redefine 'assert', since it runs afoul of
4998 systems where standard headers (mistakenly) include <assert.h>.
4999 Instead, define and use our own alternative, called 'aver'.
5000 * src/reader.c: Don't include assert.h, since we no longer
5001 use assert.
5002 * src/scan-code.l: Likewise.
5003 * src/system.h (assert): Remove, replacing with....
5004 (aver): New function, taking a bool arg. All uses changed.
5005 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5006 not merely an integer.
5007
31c10e38
PE
50082006-09-15 Bob Rossi <bob@brasko.net>
5009
5010 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5011 * data/c.m4 (YYPUSH): New.
5012 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5013 * src/getargs.c (push_parser): New var.
5014 * src/getargs.h (push_parser): New declaration.
5015 * src/output.c (prepare): Add macro insertion of `push_flag'.
5016 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5017 (prologue_declaration): Parse %push-parser.
5018 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5019 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5020 list of removed lines from the traces observed.
5021 (AT_CHECK_CALC_LALR): Added push parser tests.
5022
fa7b79c0
PE
50232006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5024
21fe08ca
PE
5025 * NEWS: Version 2.3a.
5026 * configure.ac (AC_INIT): Likewise.
5027
e8ec4d9b
PE
5028 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5029 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5030 due to header ordering dependencies. I don't know why the #define
5031 was there.
5032
fa7b79c0
PE
5033 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5034 runtime cost when YYDEBUG is not defined, and so that some tests
5035 that used to fail now work. Problem and initial suggestion by
5036 Paolo Bonzini.
5037 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5038 * data/glr.cc (b4_parser_class_name):
5039 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5040 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5041 (yydebug_) [YYDEBUG]: New member.
5042 (yycdebug_): Now defined only if YYDEBUG.
5043 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5044 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5045 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5046 if YYYDEBUG.
5047 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5048 Define only if YYDEBUG.
5049 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5050 set_debug_level.
5051 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5052 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5053 AT_CHECK_CALC_GLR_CC that are working now.
5054
4ec13d60
PE
50552006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5056
5057 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5058 We don't need them in glr.cc, and glr.c defines them.
5059 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5060 assumes that defining it to anything is the same as defining
5061 it to 1. Problem reported by Paolo Bonzini.
5062
8e1687ae
PE
50632006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5064
5065 * data/c.m4 (b4_null, b4_case): Define.
5066 * src/output.c (prepare_symbols): Use b4_null.
5067 (user_actions_output): Use b4_case.
5068
3dc5e96b
PE
50692006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5070
aef3da86
PE
5071 * data/glr.c (b4_shared_declarations): Put start-header first,
5072 before any #includes that we generate, so that feature-test
5073 macros work. Problem reported by Michael Deutschmann in
5074 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5075 * data/lalr1.cc: Likewise.
5076 * doc/bison.texinfo (Prologue): Document that feature-test macros
5077 should be defined before any Bison declarations.
5078 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5079 that depend on location.hh after, not before, Bison decls, since
5080 we now include location.hh after the first user prologue.
5081
3dc5e96b
PE
5082 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5083 Sander Brandenburg in
5084 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5085 Also, fix minor white space and comment issues.
aef3da86
PE
5086 (Prologue): Mention that it's better to define feature-test macros
5087 before Bison declarations. Problem reported by Michael Deutschmann.
5088
5089 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5090 by Jim Meyering.
5091 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5092 This adjusts to recent gnulib changes.
3dc5e96b 5093
b2a0b7ca
JD
50942006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5095
5096 Finish implementation of per-type %destructor/%printer. Discussed
5097 starting at
5098 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5099 and
5100 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5101 * NEWS (2.3+): Add a description of this feature to the default
5102 %destructor/%printer description.
5103 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5104 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5105 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5106 list node contains a semantic type.
5107 * src/symtab.c, src/symtab.h: Extend with a table that associates
5108 semantic types with their %destructor's and %printer's.
5109 (semantic_type_from_uniqstr, semantic_type_get,
5110 semantic_type_destructor_set, semantic_type_printer_set): New functions
5111 composing the public interface of that table.
5112 (symbol_destructor_get, symbol_destructor_location_get,
5113 symbol_printer_get, symbol_printer_location_get): If there's no
5114 per-symbol %destructor/%printer, look up the per-type before trying
5115 the default.
5116 * tests/actions.at (Per-type %printer and %destructor): New test case.
5117 * tests/input.at (Default %printer and %destructor redeclared):
5118 Extend to check that multiple occurrences of %symbol-default in a
5119 single %destructor/%printer declaration is an error.
5120 (Per-type %printer and %destructor redeclared, Unused values with
5121 per-type %destructor): New test cases.
5122
3be03b13
JD
51232006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5124
5125 Require default %destructor/%printer to be declared using
5126 %symbol-default instead of an empty symbol list, and start working on
5127 new per-type %destructor/%printer. Discussed at
5128 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5129 * NEWS (2.3+): Add %symbol-default to example.
5130 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 5131 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
5132 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5133 (generic_symlist, generic_symlist_item): New nonterminals for creating
5134 a list in which each item is a symbol, semantic type, or
5135 %symbol-default.
5136 (grammar_declaration): Use generic_symlist in %destructor and %printer
5137 declarations instead of symbols.1 or an empty list.
5138 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5139 for changes to symbol_list.
5140 * src/reader.c: Update for changes to symbol_list.
5141 * src/scan-code.l: Likewise.
5142 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5143 * src/symlist.c, src/symlist.h: Extend such that a list node may
5144 represent a semantic type or a %symbol-default in addition to just an
5145 ordinary symbol. Add switched functions for setting %destructor's and
5146 %printer's.
5147 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5148 %destructor/%printer declarations.
5149
3508ce36
JD
51502006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5151
5152 Whether the default %destructor/%printer applies to a particular symbol
5153 isn't a question of whether the user *declares* that symbol (in %token,
5154 for example). It's a question of whether the user by any means
5155 *defines* the symbol at all (by simply using a char token, for
5156 example). $end is defined by Bison whereas any other token with token
5157 number 0 is defined by the user. The error token is always defined by
5158 Bison regardless of whether the user declares it with %token, but we
5159 may one day let the user define error as a nonterminal instead.
5160 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5161 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5162 the meaning of "user-defined".
5163 * tests/actions.at (Default %printer and %destructor for user-declared
5164 end token): Rename to...
5165 (Default %printer and %destructor for user-defined end token): ...
5166 this.
5167
5168 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5169 computation of whether to apply the default, don't maintain a list of
5170 every Bison-defined symbol. Instead, just check for a first character
5171 of '$', which a user symbol cannot have, and check for the error token.
5172
9350499c
JD
51732006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5174
5175 Don't apply the default %destructor or %printer to the error token,
5176 $undefined, or $accept. This change fits the general rule that the
5177 default %destructor and %printer are only for user-declared symbols,
5178 and it solves several difficulties that are described in the new test
5179 cases listed below.
5180 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5181 * tests/actions.at (Default %printer and %destructor are not for error
5182 or $undefined, Default %printer and %destructor are not for $accept):
5183 New test cases.
5184
4d7370cb
JD
51852006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5186
5187 Allow %start after the first rule.
5188 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5189 when parsing the first rule.
5190 (check_and_convert_grammar): Search for it here after all grammar
5191 declarations have been parsed. Skip midrules, which have dummy LHS
5192 nonterminals.
5193 * src/symtab.c (symbol_is_dummy): New function.
5194 * src/symtab.h (symbol_is_dummy): Declare it.
5195 * tests/input.at (%start after first rule): New test.
5196
6d0ef4ec
JD
51972006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5198
5199 Redo some of the previous commit: add back the ability to use
5200 non-aliased/undeclared string literals since it might be useful to
5201 those declaring %token-table.
5202 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5203 commit: don't worry about complaints from symbols_pack.
5204 * src/symtab.c (symbol_new, symbol_class_set,
5205 symbol_check_alias_consistency): Undo changes in previous commit: count
5206 each string literal as a new symbol and token, assign it a symbol
5207 number, and don't complain about non-aliased string literals.
5208 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5209 and token counts but does still set aliased tokens to the same number,
5210 symbol_pack_processor now leaves empty slots in the symbols array.
5211 Remove those slots.
5212 * tests/regression.at (Undeclared string literal): Remove test case
5213 added in previous commit since non-aliased string literals are allowed
5214 again.
5215 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5216 remove unnecessary string literal declarations.
5217 * tests/sets.at (Firsts): Likewise.
5218
965537bc
JD
52192006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5220
5221 Don't allow an undeclared string literal, but allow a string literal to
5222 be used before its declaration.
5223 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5224 symbols_pack complained.
5225 * src/symtab.c (symbol_new): Don't count a string literal as a new
5226 symbol.
5227 (symbol_class_set): Don't count a string literal as a new token, and
5228 don't assign it a symbol number since symbol_make_alias does that.
5229 (symbol_make_alias): It's not necessary to decrement the symbol and
5230 token counts anymore. Don't assume that an alias declaration occurs
5231 before any uses of the identifier or string, and thus don't assert that
5232 one of them has the highest symbol number so far.
5233 (symbol_check_alias_consistency): Complain if there's a string literal
5234 that wasn't declared as an alias.
5235 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5236 symbol_pack asserts that every token has been assigned a symbol number
5237 although undeclared string literals have not.
5238 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 5239 string literal): New test cases.
965537bc
JD
5240 (Characters Escapes, Web2c Actions): Declare string literals as
5241 aliases.
5242 * tests/sets.at (Firsts): Likewise.
5243
47aee066
JD
52442006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5245
5246 In the grammar scanner, STRING_FINISH unclosed constructs and return
5247 them to the parser in order to improve error messages.
5248 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5249 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5250 * tests/input.at (Unclosed constructs): New test case.
5251 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5252 seen.
5253
5254 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5255 unused global.
5256
1f6b3679
JD
52572006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5258
5259 Handle string aliases for character tokens correctly.
5260 * src/symtab.c (symbol_user_token_number_set): If the token has an
5261 alias, check and set its alias's user token number instead of its own,
5262 which is set to indicate the alias. Previously, every occurrence of
5263 the character token in the grammar overwrote that alias indicator with
5264 the character code.
5265 * tests/input.at (String aliases for character tokens): New test.
5266
219741d8
JD
52672006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5268
5269 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5270
11daa4e7
PE
52712006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5272
5273 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5274 to prevent failures when building on older platforms.
5275 Check for autopoint failure.
5276 Set XGETTEXT_OPTIONS to values that check for C format strings,
5277 so that translators are warned about them (this also helps
5278 prevent core dumps).
5279
5280 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5281 function, since it simplifies our code a bit.
5282
5283 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5284 rather than -W, so we don't get bogus warnings about sign comparisons.
5285 Add -Wpointer-arith, since that warning is useful (it reports code
5286 that does not conform to C89 and that some compilers reject).
5287 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5288 since it's no longer needed.
5289
f9bfc42a
JD
52902006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5291
5292 Clean up scanners a bit.
5293 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5294 definitions so gcc won't warn when obstack_for_string is unused.
5295 * src/scan-code.l: config.h and system.h are already #include'd by
5296 scan-code-c.c, so get rid of them here.
5297 * src/scan-gram.l: Likewise.
5298 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5299 definitions rather than duplicating the rest of it.
5300 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5301
06e8700a
JD
53022006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5303
5304 Suppress signed/unsigned comparison warnings for yycheck.
5305 * data/c.m4 (b4_safest_int_type): New macro.
5306 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5307 a signed int type, cast it to b4_safest_int_type first.
5308 * data/yacc.c: Likewise.
5309 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5310 also overwritten.
5311
9c437126
PE
53122006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5313
5314 * doc/bison.texinfo: Fix some typos.
5315
284d8a13
PE
53162006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5317
5318 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5319 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5320
5321 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5322 the latest gnulib does this a different way.
5323 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5324 translation was patched, so stop omitting it.
5325
ec5479ce
JD
53262006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5327
5328 Enable declaration of default %printer/%destructor. Make the parser
5329 use these for all user-declared grammar symbols for which the user does
5330 not declare a specific %printer/%destructor. Thus, the parser uses it
5331 for token 0 if the user declares it but not if Bison generates it as
5332 $end. Discussed starting at
5333 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5334 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5335 and
5336 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5337 * NEWS (2.3+): Mention.
5338 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5339 declare a %destructor for a mid-rule's semantic value. It's just
5340 impossible to declare one specific to it.
5341 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5342 code. Describe default %destructor form.
5343 * src/parse-gram.y (grammar_declaration): Parse default
5344 %printer/%destructor declarations.
5345 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5346 and symbol_destructor_location_get rather than accessing the destructor
5347 and destructor_location members of struct symbol.
5348 (symbol_printers_output): Likewise but for %printer's.
5349 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5350 again.
5351 * src/symtab.c (default_destructor, default_destructor_location,
5352 default_printer, default_printer_location): New static global
5353 variables to record the default %destructor and %printer.
5354 (symbol_destructor_get, symbol_destructor_location_get,
5355 symbol_printer_get, symbol_printer_location_get): New functions to
5356 compute the appropriate %destructor and %printer for a symbol.
5357 (default_destructor_set, default_printer_set): New functions to set the
5358 default %destructor and %printer.
5359 * src/symtab.h: Prototype all those new functions.
5360 * tests/actions.at (Default %printer and %destructor): New test to
5361 check that the right %printer and %destructor are called, that they're
5362 not called for $end, and that $$ and @$ work correctly.
5363 (Default %printer and %destructor for user-declared end token): New
5364 test to check that the default %printer and %destructor are called for
5365 a user-declared end token.
5366 * tests/input.at (Default %printer and %destructor redeclared, Unused
5367 values with default %destructor): New tests to check related grammar
5368 warnings and errors.
5369
868d2d96
JD
53702006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5371
5372 Clean up handling of %destructor for the end token (token 0).
5373 Discussed starting at
5374 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5375 and
5376 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5377
5378 Make the skeletons consistent in how they pop the end token and invoke
5379 its %destructor.
5380 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5381 state, which has token number 0, since this would invoke the
5382 %destructor for the end token.
5383 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5384 until after shifting the end token, or else it won't be popped.
5385 * data/yacc.c (yyparse): Likewise.
5386
5387 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5388 it's the end token. Upon termination, destroy an unshifted lookahead
5389 even when it's the end token.
5390 * data/lalr1.cc (yy::parser::parse): Likewise.
5391 * data/yacc.c (yyparse): Likewise.
5392
5393 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5394 value warnings for the end token when the user gives the end token a
5395 %destructor.
5396
5397 * tests/actions.at (Printers and Destructors): Test all the above.
5398
62a9592d
PE
53992006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5400
5401 Update to latest gnulib and gettext versions.
5402 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5403 Add fopen-safer.
5404 (gnulib_files): Add m4/warning.m4. Don't worry about files
5405 overwritten by autopoint.
5406 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5407 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5408 rejects them.
5409 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5410 so that we can remove the intl files at a better time.
5411 (intl_files_to_remove): Remove aclocal.m4, since it gets
5412 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5413 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5414 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5415 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5416 Remove datarootdir hack; no longer needed.
5417 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5418 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5419 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5420 strdup.h.
5421 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5422 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5423
10d6970f
PE
54242006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5425
5426 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5427 it with --assume-autoconf='latest-stable'.
5428
50a33993
JD
54292006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5430
5431 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5432 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5433 YYSTYPE' and `{'.
5434 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5435 those from muscle_tab.c since the old ones are misleading.
5436
2ce4ed68
AD
54372006-07-13 Akim Demaille <akim@epita.fr>
5438
5439 Support %define "KEY" {VALUE}.
5440 * src/scan-code.h, src/scan-code.l (translate_action)
5441 (translate_rule_action, translate_symbol_action, translate_code):
5442 Return char *, not const char *.
5443 * src/parse-gram.y (declaration): Rename as...
5444 (prologue_declaration): this.
5445 (string_content): Remove this nonterminal, use STRING.
5446 (braceless, content, content.opt): New nonterminal.
5447 Use them.
5448 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5449 as value.
5450 * src/scan-gram.l (getargs.h): Don't include it.
5451
db7e5eb5
PE
54522006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5453
5454 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5455 rather than a for-loop that declares a local bool variable. This
5456 should work around a compatibility problem with a Cray x1e C++
5457 compiler reported by Hung Nguyen in
5458 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5459 The for-loop was introduced in the 2004-11-17 change but I don't
5460 know why it was needed.
5461
a5d80ba5
AD
54622006-07-12 Akim Demaille <akim@epita.fr>
5463
5464 * data/c.m4: Comment changes.
5465
23eb2a69
AD
54662006-07-10 Akim Demaille <akim@lrde.epita.fr>
5467
5468 * src/complain.c (error_message, ERROR_MESSAGE): New.
5469 To factor...
5470 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5471 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5472
ddc8ede1
PE
54732006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5474
5475 * NEWS: Instead of %union, you can define and use your own union type
5476 YYSTYPE if your grammar contains at least one <type> tag.
5477 Your YYSTYPE need not be a macro; it can be a typedef.
5478 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5479 (Union Decl, Decl Summary): Document this.
5480 * data/glr.c (YYSTYPE): Implement this.
5481 * data/glr.cc (YYSTYPE): Likewise.
5482 * data/lalr1.cc (YYSTYPE): Likewise.
5483 * data/yacc.c (YYSTYPE): Likewise.
5484 * src/output.c (prepare): Output tag_seen_flag.
5485 * src/parse-gram.y (declaration, grammar_declaration):
5486 Use 'union_seen' rather than 'typed' to determine whether
5487 %union has been seen, since grammars can now be typed without
5488 %union.
5489 (symbol_declaration, type.opt, symbol_def):
5490 Keep track of whether a tag has been seen.
5491 * src/reader.c (union_seen, tag_seen): New vars.
5492 (typed): remove.
5493 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5494 * src/scan-code.l (untyped_var_seen): New variable.
5495 (handle_action_dollar): Adjust to above changes.
5496 (handle_action_dollar, handle_action_at):
5497 Improve overflow checking for outlandish numbers.
5498 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5499 avoid new diagnostics generated by above changes.
5500 * tests/regression.at (YYSTYPE typedef): Add test to check
5501 for type tags without %union.
5502
5503 * src/symlist.c (symbol_list_length): Return int, not unsigned
5504 int, since callers expect int. This may need to get revisited
5505 once we have proper integer overflow checking.
5506
5507 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5508 object is now static.
5509
5510 * src/getargs.c (flags_argmatch): Return void, not int,
5511 to pacify ./configure --enable-gcc-warnings.
5512
5513 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5514 since last_string is already defined to FLEX_PREFIX (last_string).
5515
7b42569e
AD
55162006-07-09 Akim Demaille <akim@lrde.epita.fr>
5517
5518 Implement --warnings/-W.
5519 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5520 replaced by...
5521 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5522 Adjust callers.
5523 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5524 (warnings_args, warnings_types): New.
5525 (getargs, short_options, long_options): Accept -W/--warnings.
5526 Sort the options by alphabetical order, upper case letter right
5527 before its lower case.
5528
3b452f4e
JD
55292006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5530
5531 Change %merge result type clash warnings to errors. Discussed at
5532 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5533 * src/reader.c (record_merge_function_type): Use complain_at.
5534 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5535 declared later): Update test case results.
5536
b8a41559
AD
55372006-07-09 Akim Demaille <akim@lrde.epita.fr>
5538
5539 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5540 to be in alphabetical order.
5541 (trace_args): Spelling fixes.
5542
cd9e1ba2
PE
55432006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5544
5545 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5546 so they don't collide with user-defined macros.
5547 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5548 this was never guaranteed, and now that we're using gnulib stdint,
5549 which defines int_fast16_t to long int, the problem is exposed.
5550
cb48f191
PE
55512006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5552
b8445a15
PE
5553 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5554 need the full POSIX semantics (and weren't implementing them
5555 anyway).
5556
cb48f191
PE
5557 Adjust to Autoconf 2.60 and today's gnulib.
5558 * bootstrap (gnulib_modules): Add stdint.
5559 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5560 no longer copies it.
5561 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5562 since stdint needs the former and wcwidth (which is now required
5563 by mbswidth) needs the latter.
5564 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5565 work around a compatibility glitch between gettext 0.14.6 and
5566 Autoconf 2.60.
5567 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5568 Do not check for uintptr_t, since new stdint module does the right
5569 thing.
5570 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5571 Add stdint.h, stdint_.h, wcwidth.h.
5572 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5573 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5574 stdint.m4, wchar_t.m4, wcwidth.m4.
5575 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5576 usual order for ../lib/*.h files.
5577 (file_name_split): Use last_component, not base_name, to adjust
5578 to gnulib changes.
5579 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5580 for ../lib/*.h files.
5581 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5582 Define unconditionally, since we now assume the stdint module.
5583 * src/scan-skel.l: Include <dirname.h>.
5584 (BASE_QPUTS): Use last_component, not base_name.
5585 * src/system.h: Include <unlocked-io.h> in the usual order
5586 for ../lib/*.h files. Include <stdint.h> unconditionally,
5587 since we now use the stdint module.
5588 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5589 HAVE_UINTPTR_T, since we now use the stdint module.
5590 (base_name): Remove decl, since files now include <dirname.h>
5591 to get the decl.
5592
cd48d21d
AD
55932006-07-08 Akim Demaille <akim@lrde.epita.fr>
5594
5595 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5596 New, default to 1.
5597 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5598 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5599 default.
5600 * tests/calc.at: Adjust.
5601
8ec0a172
AD
56022006-07-08 Akim Demaille <akim@lrde.epita.fr>
5603
b8445a15 5604 * data/c.m4 (b4_basename): New.
8ec0a172
AD
5605 (b4_syncline): Also output the location of its invocation (from
5606 the skeleton).
5607 (b4_user_action, b4_define_user_action, b4_user_actions)
5608 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5609 (b4_user_stype): New.
5610 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5611
4a678af8
JD
56122006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5613
5614 In the grammar file, the first column is 1 not 0 on the first line as
5615 on every other line.
5616 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5617 * tests/input.at (Torturing the Scanner): Update output.
5618
5619 * src/scan-gram.l (scanner_cursor): Declare it static.
5620
dd60572a
JD
56212006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5622
5623 In warnings, say "previous declaration" rather than "first
5624 declaration".
5625 * src/symtab.c (redeclaration): Do that here.
5626 * src/reader.c (record_merge_function_type): In the case of a result
5627 type clash, report the previous declaration rather than the very first
5628 one in the grammar file.
5629 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5630 declared later): Add a third declaration to check this behavior.
5631 * tests/input.at (Incompatible Aliases): Update output.
5632
2073e1b6
AD
56332006-06-27 Akim Demaille <akim@epita.fr>
5634
5635 * doc/Doxyfile.in: New.
5636 * doc/Makefile.am: Use it.
5637 * src/lalr.h, src/symtab.h: Initial doxygenation.
5638
8ee5b538
JD
56392006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5640
5641 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
5642 declared after the %merge. This continues the effort of the previous
5643 patch.
8ee5b538
JD
5644 * src/reader.c (get_merge_function): Don't set the merger type yet.
5645 (record_merge_function_type): New function for setting the merger type
5646 and checking for clashes.
5647 (grammar_current_rule_merge_set): Set the location of the %merge for
5648 the current rule.
5649 (packgram): Invoke record_merge_function_type for each rule now that
5650 all symbol type declarations have been parsed.
5651 * src/reader.h (merger_list.type_declaration_location): New member
5652 storing the location of the first %merge from which the type for this
5653 merging function was derived.
5654 * src/symlist.h (symbol_list.merger_declaration_location): New member
5655 storing the location of a rule's %merge, if any.
5656 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5657 declared later): New test to catch the error fixed by the above patch.
5658
ffa4ba3a
JD
56592006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5660
5661 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
5662 declarations appear after the rules. Discussed at
5663 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5664 and
5665 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5666 Don't mistake the type of $$ in a midrule to be that of its parent
5667 rule's $$.
ffa4ba3a
JD
5668 * src/reader.c (grammar_current_rule_end): Don't invoke
5669 grammar_rule_check yet since not all symbol declarations may have been
5670 parsed yet.
5671 (grammar_midrule_action): Likewise.
5672 Don't record whether the midrule's $$ has been used yet since actions
5673 haven't been translated yet.
5674 Record the midrule's parent rule and its RHS index within the parent
5675 rule.
5676 (grammar_current_rule_action_append): Don't translate the action yet
5677 since not all symbol declarations may have been parsed yet and, thus,
5678 warnings about types for $$, $n, @$, and @n can't be reported yet.
5679 (packgram): Translate the action and invoke grammar_rule_check now that
5680 all symbol declarations have been parsed.
5681 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5682 after parsing the entire grammar file, the symbol list here in the case
5683 of a midrule is actually the midrule's empty RHS, so reference its
5684 parent rule's RHS where necessary.
5685 On the other hand, now that you can already know it's a midrule, you
5686 aren't forced to think $$ has the same type as its parent rule's $$.
5687 (handle_action_at): In the case of a midrule, reference the parent rule
5688 where necessary.
5689 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5690 members.
5691 (symbol_list_length): Now that this is invoked after all rules have
5692 been parsed, a NULL symbol (rather than a NULL symbol list node)
5693 terminates a rule. symbol_list_print already does this correctly.
5694 * src/symlist.h (symbol_list.midrule_parent_rule,
5695 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5696 remember their relationships with their parents.
5697 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5698 fixed by the above patch.
5699 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5700 implementing...
5701 (Unused values): ... this old test case and...
5702 (Unused values before symbol declarations): ... this new test case.
5703 This one is the same as `Unused values' except that all symbol
5704 declarations appear after the rules in order to catch the rest of the
5705 errors fixed by the above patch.
5706
e256e17f
JD
57072006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5708
300a1930
JD
5709 More cleanup.
5710 * src/reader.c (current_rule): Declare it static since it's no longer
5711 used outside this file.
5712 (grammar_current_rule_action_append): Remove redundant arguments from
5713 translate_rule_action invocation.
5714 * src/reader.h (current_rule): Remove this unused extern.
5715 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5716 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 5717
381ecb06
JD
57182006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5719
5720 Clean up yesterday's patch.
5721 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5722 to...
5723 * src/reader.c (grammar_current_rule_action_append): ... here for
5724 consistency with grammar_current_rule_symbol_append.
5725 * tests/regression.at (Braced code in declaration in rules section):
5726 Make yyerror and yylex static as usual.
5727
4210cd0b
JD
57282006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5729
5730 Fix bug that mistakes braced code in a declaration in the rules section
5731 to be a rule action. Mentioned at
5732 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5733 * src/scan-gram.l: Move midrule action detection from the start of the
5734 scanning of any braced code to...
5735 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5736 action. For readability, use $2 and @2 rather than the equivalent
5737 global variables.
5738 * tests/regression.at (Braced code in declaration in rules section):
5739 New test to catch the error fixed by the above patch.
5740
5741 Work on code readability some.
5742 * src/scan-code.l (current_rule): Get rid of this misleading and
5743 redundant declaration: it's actually extern'ed in reader.h.
5744 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5745 translate_action): Add a rule argument and use it instead of the global
5746 current_rule.
5747 (translate_rule_action): This already receives current_rule through an
5748 argument, so pass it on to translate_action instead of assigning
5749 current_rule to current_rule.
5750 (translate_symbol_action, translate_code): Pass rule = NULL to
5751 translate_action.
5752
34f98f46
JD
57532006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5754
5755 Rename %before-definitions to %start-header and %after-definitions to
5756 %end-header. Don't use these declarations to separate pre-prologue
5757 blocks from post-prologue blocks. Add new order-independent
5758 declarations %before-header and %after-header as alternatives to the
5759 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5760 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5761 * NEWS (2.3+): Update for these changes.
5762 * data/glr.c (b4_before_definitions): Update to...
5763 (b4_start_header): ... this.
5764 (b4_after_definitions): Update to...
5765 (b4_end_header): ... this.
5766 * data/glr.cc: Likewise.
5767 * data/lalr1.cc: Likewise.
5768 * data/yacc.c: Likewise.
5769 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5770 prologue blocks with %*-header declarations.
5771 (Calc++ Parser): Likewise.
91661ebb 5772 (Decl Summary): Update names.
148d66d8 5773 (Table of Symbols): Update description.
34f98f46
JD
5774 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5775 (PERCENT_END_HEADER): ... this.
5776 (PERCENT_BEFORE_DEFINITIONS): Update to...
5777 (PERCENT_START_HEADER): ... this.
5778 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5779 (declaration): Update token names and m4 macro names.
5780 When parsing %end-header and %start-header, invoke translate_code
5781 before muscle_code_grow, and no longer set global booleans to remember
5782 whether these declarations have been seen.
5783 Parse new %after-header and %before-header.
5784 * src/reader.c (before_definitions, after_definitions): Remove.
5785 (prologue_augment): Accept a new bool argument to specify whether to
5786 augment the pre-prologue or post-prologue.
5787 * src/reader.h (before_definitions, after_definitions): Remove these
5788 extern's.
5789 (prologue_augment): Add new bool argument.
5790 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5791 (PERCENT_END_HEADER): ... this.
5792 (PERCENT_BEFORE_DEFINITIONS): Update to...
5793 (PERCENT_START_HEADER): ... this.
5794 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5795 * tests/actions.at (Printers and Destructors): Update names.
5796
31b2b07e
JD
57972006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5798
5799 Add comparison operators for C++ location classes. Discussed at
5800 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5801 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5802 declaration indicating whether filename_type has an operator==. If
5803 filename_type is `std::string', it defaults to `1', `0' otherwise.
5804 * data/location.cc: Iff b4_define_location_comparison is `1', add
5805 operator== and operator!= for class position and for class location.
5806
5807 Some minor fixes.
5808 * src/scan-action.l: Remove unused file.
5809 * src/symtab.c (symbol_printer_set): Use printer_location not
5810 destructor_location.
5811 * src/symtab.h (struct symbol): Replace incorrect source comment for
5812 printer members.
5813 * tests/input.at (Incompatible Aliases): Update output with correct
5814 printer location.
5815
9bc0dd67
JD
58162006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5817
5818 Don't put the pre-prologue in the header file. For the yacc.c code
5819 file and the glr.c header and code files, move the pre-prologue before
5820 the token definitions. Add new %before-definitions and
5821 %after-definitions to declare code that will go in both the header file
5822 and code file. Discussed at
5823 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5824 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5825 and
5826 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5827 * NEWS (2.3+): Describe these changes.
5828 * data/glr.c (b4_pre_prologue): Move from within to before...
5829 (b4_shared_declarations): ... this.
5830 Add new b4_before_definitions before b4_token_enums.
5831 Add new b4_after_definitions at the end.
5832 * data/glr.cc (b4_pre_prologue): Replace with...
5833 (b4_before_definitions): ... this in the header file.
5834 (b4_after_definitions): New near the end of the header file.
5835 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5836 code file right before including the header file.
5837 (b4_before_definitions): New in the previous position of
5838 b4_pre_prologue in the header file.
5839 (b4_after_definitions): New near the end of the header file.
5840 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5841 (b4_token_enums_defines): In the code file, move to right before
5842 YYSTYPE for consistency with the header file.
5843 (b4_before_definitions): New right before b4_token_enums_defines in
5844 both the header and code file.
5845 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5846 header and code file.
5847 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5848 of prologues for %union dependencies.
91661ebb
JD
5849 (Decl Summary): In %defines description, mention the effect of
5850 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
5851 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5852 than in the pre-prologue so that make check succeeds.
148d66d8 5853 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
5854 %after-definitions.
5855 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5856 %before-definitions.
5857 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5858 (declaration): Parse those declarations and append to
5859 b4_before_definitions and b4_after_definitions, respectively.
5860 * src/reader.c (before_definitions, after_definitions): New bools to
5861 track whether those declarations have been seen.
5862 (prologue_augment): Add to the post-prologue if %union,
5863 %before-definitions, or %after-definitions has been seen.
5864 * src/reader.h (before_definitions, after_definitions): New extern's.
5865 * src/scan-gram.l: Scan the new declarations.
5866 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5867 prologue block in a %before-definitions or a %after-definitions based
5868 on whether the %union is declared.
5869 * tests/regression.at (Early token definitions with --yacc, Early token
5870 definitions without --yacc): Move tests for token definitions into the
5871 post-prologue since token names are no longer defined in the
5872 pre-prologue.
5873
203b9274
AD
58742006-06-20 Akim Demaille <akim@epita.fr>
5875
5876 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5877 (symbol_get): Use it.
5878 * src/parse-gram.y: Use it.
5879
a7ee59cf
JD
58802006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5881
5882 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5883 build succeeds when configured with --enable-gcc-warnings.
5884
5a2baae7
PE
58852006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5886
33ad1a9c
PE
5887 * src/parse-gram.y (char_name): New function.
5888 (CHAR, STRING, string_content): For %printer, properly escape.
5889 (ID): Prefer fputs to fprintf.
5890 (id): Reindent to be consistent with other rules.
5891 Properly quote char.
5892
5a2baae7
PE
5893 The Translation Project changed its way of publishing translations
5894 to maintainers. I haven't received any responses to my request
5895 for supporting the old way, or for documenting the new way. I
5896 have modified 'bootstrap' to use screen scraping
5897 (in this case, HTML scraping). This is unreliable and inelegant,
5898 but I don't see any better way. Yuck.
5899 * bootstrap (TP_URL, WGET_COMMAND): New vars.
5900 (get_translations): New function, which uses HTML scraping to
5901 deduce locations of latest translations.
5902 Use this function to grab both bison and bison-runtime .po files.
5903 Don't bother priming the pump for the runtime-po domain any more,
5904 as it's now translated better than bison is.
5905
58d7a1a1
AD
59062006-06-19 Akim Demaille <akim@epita.fr>
5907
5908 * src/scan-gram.l: No longer "parse" things after `%union' until
5909 `{'. Rather, return a single "%union" token.
5910 No longer make symbols: return strings, and leave the conversion
5911 to symbols to the parser.
5912 (SC_PRE_CODE, token_type): Remove.
5913 * src/parse-gram.y (%union): New field `character'.
5914 Sort tokens.
5915 (CHAR): New token.
5916 (ID, ID_COLON): Now that the scanner no longer makes them
5917 identifiers, adjust all uses to invoke symbol_get.
5918 (id_colon): New, wraps the conversion from string to symbol.
5919 (%union): Accept a possible union_name.
5920 (symbol): Now can be a char.
5921 * data/c.m4 (b4_union_name): Leave a default value.
5922 * data/glr.c, data/yacc.c: Use it.
5923
b931235e
JD
59242006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
5925
5926 For associating token numbers with token names for "yacc.c", don't use
5927 #define statements unless `--yacc' is specified; always use enum
5928 yytokentype. Most important discussions start at:
5929 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
5930 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
5931 and
5932 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
5933 * NEWS (2.3+): Mention.
5934 * data/c.m4 (b4_yacc_if): New.
5935 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
5936 token #define's.
5937 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
5938 on token name definitions.
5939 * src/getargs.c (usage): Capitalize `Yacc' in English.
5940 * src/output.c (prepare): Define b4_yacc_flag.
5941 * tests/regression.at (Early token definitions): Test that tokens names
5942 are defined before the pre-prologue not just before the post-prologue.
5943 Remove this test case and copy to...
5944 (Early token definitions with --yacc): ... this to test #define's.
5945 (Early token definitions without --yacc): ... and this to test enums.
5946
9e6e7ed2
PE
59472006-06-11 Paul Eggert <eggert@cs.ucla.edu>
5948
5949 * NEWS: Reword the post-2.3 change to not be so optimistic about
5950 removing the old "look-ahead" spelling.
5951 Update previous look-ahead/lookahead change reports.
5952 * REFERENCES: look-ahead -> lookahead (since that's
5953 what he actually wrote).
5954 * doc/refcard.tex: look ahead -> lookahead,
5955 look-ahead -> lookahead
5956
742e4900
JD
59572006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
5958
5959 For consistency, use `lookahead' instead of `look-ahead' or
5960 `look_ahead'. Discussed starting at
5961 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
5962 and then at
5963 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
5964 * NEWS: For the next release, note the change to `--report'.
5965 * TODO, doc/bison.1: Update English.
5966 * doc/bison.texinfo: Update English.
5967 (Understanding Your Parser, Bison Options): Document as
5968 `--report=lookahead' rather than `--report=look-ahead'.
5969 * src/conflicts.c: Update English in comments.
5970 (lookahead_set): Rename from look_ahead_set.
5971 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
5972 (resolve_sr_conflict): Rename local look_ahead_tokens to
5973 lookahead_tokens, and update other uses.
5974 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
5975 count_rr_conflicts, conflicts_free): Update uses.
5976 * src/getargs.c (report_args): Move "lookahead" before alternate
5977 spellings.
5978 (report_types): Update uses.
5979 (usage): For `--report' usage description, state `lookahead' spelling
5980 rather than `look-ahead'.
5981 * src/getargs.h (report.report_lookahead_tokens): Rename from
5982 report_look_ahead_tokens.
5983 * src/lalr.c: Update English in comments.
5984 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
5985 (state_lookahead_tokens_count): Rename from
5986 state_look_ahead_tokens_count.
5987 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5988 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
5989 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5990 Update other uses.
5991 Update English in output.
5992 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
5993 * src/print.c: Update English in comments.
5994 (lookahead_set): Rename from look_ahead_set.
5995 (print_reduction): Rename argument lookahead_token from
5996 look_ahead_token.
5997 (print_core, state_default_rule, print_reductions, print_results):
5998 Update uses.
5999 * src/print_graph.c: Update English in comments.
6000 (print_core): Update uses.
6001 * src/state.c: Update English in comments.
6002 (reductions_new): Update uses.
6003 (state_rule_lookahead_tokens_print): Rename from
6004 state_rule_look_ahead_tokens_print, and update other uses.
6005 * src/state.h: Update English in comments.
6006 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6007 (state_rule_lookahead_tokens_print): Rename from
6008 state_rule_look_ahead_tokens_print.
6009 * src/tables.c: Update English in comments.
6010 (conflict_row, action_row): Update uses.
6011 * tests/glr-regression.at
6012 (Incorrect lookahead during deterministic GLR,
6013 Incorrect lookahead during nondeterministic GLR): Rename
6014 print_look_ahead to print_lookahead.
6015 * tests/torture.at: Update English in comments.
6016 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6017 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6018 (Many lookahead tokens): Update uses.
6019 * data/glr.c: Update English in comments.
6020 * lalr1.cc: Likewise.
6021 * yacc.c: Likewise.
6022 * src/conflicts.h: Likewise.
6023 * src/lalr.h: Likewise.
6024 * src/main.c: Likewise.
6025 * src/output.c: Likewise.
6026 * src/parse-gram.c: Likewise.
6027 * src/tables.h: Likewise.
6028 * tests/calc.at: Likewise.
6029
3c40d0b5
JD
60302006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6031
6032 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6033
5d278082
PE
60342006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6035
6036 * TODO: Add request from Nelson H. F. Beebe to be able to install
6037 Bison without installing the yacc script.
6038
9e668899
JD
60392006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6040
6041 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6042 and yytext if they're already #define'd.
6043 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6044 * src/scan-code-c.c: ... here.
6045 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6046 <config.h>.
6047
0c8e079f
JD
60482006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6049
6050 Get Bison to build again when configured with --enable-gcc-warnings.
6051 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6052 missing #include's.
6053 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6054 loc argument as it shadows a global.
6055 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6056 invocation.
6057
6058 * src/.cvsignore: Add scan-code.c.
6059
2346344a
AD
60602006-06-07 Akim Demaille <akim@epita.fr>
6061
6062 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6063 to...
6064 * src/scan-code.l: here.
6065 * tests/input.at (Torturing the Scanner): Fix another location
6066 error.
6067
4862bdfd
AD
60682006-06-07 Akim Demaille <akim@epita.fr>
6069
6070 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6071
e9071366
AD
60722006-06-06 Akim Demaille <akim@epita.fr>
6073
6074 Extract the parsing of user actions from the grammar scanner.
6075 As a consequence, the relation between the grammar scanner and
6076 parser is much simpler. We can also split "composite tokens" back
6077 into simple tokens.
6078 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6079 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6080 rename as...
6081 * src/location.h, src/location.c (add_column_width)
6082 (location_compute): these.
6083 Fix the column count: the initial column is 0.
6084 (location_print): Be robust to ending column being 0.
6085 * src/location.h (boundary_set): New.
6086 * src/main.c: Adjust to scanner_free being renamed as
6087 gram_scanner_free.
6088 * src/output.c: Include scan-code.h.
6089 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6090 Use boundary_set.
6091 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6092 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6093 which is now, again, a separate token.
6094 Adjust all dependencies.
6095 Whereever actions with $ and @ are used, use translate_code.
6096 (action): Remove this nonterminal which is now useless.
6097 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6098 (grammar_current_rule_action_append): Use translate_code.
6099 (packgram): Bound check ruleno, itemno, and rule_length.
6100 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6101 (last_string, last_braced_code_loc, max_left_semantic_context)
6102 (scanner_initialize, scanner_free, scanner_last_string_free)
6103 (gram_out, gram_lineno, YY_DECL_): Move to...
6104 * src/scan-gram.h: this new file.
6105 (YY_DECL): Rename as...
6106 (GRAM_DECL): this.
6107 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6108 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6109 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6110 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6111 Move these declarations, and...
6112 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6113 these to...
6114 * src/flex-scanner.h: this new file.
6115 * src/scan-gram.l (rule_length, rule_length_overflow)
6116 (increment_rule_length): Remove.
6117 (last_braced_code_loc): Rename as...
6118 (gram_last_braced_code_loc): this.
6119 Adjust to the changes of the parser.
6120 Move all the handling of $ and @ into...
6121 * src/scan-code.l: here.
6122 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6123 (handle_action_dollar, handle_action_at): Move to...
6124 * src/scan-code.l: here.
6125 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6126 scan-code.h, scan-code-c.c, scan-gram.h.
6127 (EXTRA_bison_SOURCES): Add scan-code.l.
6128 (BUILT_SOURCES): Add scan-code.c.
6129 (yacc): Be robust to white spaces.
6130
6131 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6132 * tests/regression.at: Adjust the column numbers.
6133 * tests/regression.at: Adjust the error message.
7891a7c4 6134
184e42f0
JD
61352006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6136
6137 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6138 Use Akim's wording from
6139 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6140
7891a7c4
JD
61412006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6142
6143 Between Bison releases, manually append `+' to the previous Bison
6144 release number, and use that as a signal to automatically print the
6145 ChangeLog's CVS Id keyword from --version. Discussed starting at
6146 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6147 * ChangeLog: Add Id header.
6148 * configure.ac (AC_INIT): Append `+' to `2.3'.
6149 * src/.cvsignore: Add revision.c.
6150 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6151 (BUILT_SOURCES): Add revision.c.
6152 (revision.c): New target rule. This file defines a new global variable
6153 named revision. It initializes it with either the Id from ChangeLog
6154 or, if VERSION doesn't contain `+', with the empty string.
6155 * src/getargs.c (version): Print the value of revision.
6156 * src/revision.h: Extern revision.
6157
4ad3ed84
PE
61582006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6159
6160 * NEWS: Version 2.3.
6161 * configure.ac (AC_INIT): Likewise.
6162
02103984
PE
61632006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6164
6165 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6166 with no arguments, not as an object-like macro. This is for
6167 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6168 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6169 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6170 Document this.
6171
2c08afa5
JD
61722006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6173
6174 * src/getargs.c (usage): Back out yesterday's modification of the
6175 --help output so that we don't have to wait for translation before
6176 releasing 2.3.
6177
6077da58
PE
61782006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6179
6180 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6181 Problem reported by Akim Demaille.
6182
2a26b6c2
JD
61832006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6184
6185 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6186
aefef0d6
PE
61872006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6188
6189 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6190 generated source code. Problem reported by Frans Englich in
6191 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6192
fcd8e201
PE
61932006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6194
6195 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6196 shell, not within 'make', so that 'make' by an ordinary builder
6197 (using GNU make) does not worry about configuring gzip. This also
6198 works around a bug reported independently by Keith Thompson and by
6199 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6200 stderr rather than stdout, messing up the build logs.
6201
7b5cdcbd
JD
62022006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6203
6204 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6205 to make sure that YYID will never be unused. This fixes a 'make
6206 maintainer-check' failure caused by the recent changes to the 'Trivial
6207 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6208 not used.
6209 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6210
5ad0a449
JD
62112006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6212
6213 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6214 state before an empty RHS is always resolved here. Only the location
6215 of that state is guaranteed to be resolved, and that's enough. This
6216 fixes the remaining bug reported by Derek M. Jones in
6217 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6218 * tests/glr-regression.at (Uninitialized location when reporting
6219 ambiguity): Test the above case.
6220 Also, the embedded comments in this test case claim it checks the case
6221 of an empty RHS that has inherited the initial location. However, the
6222 corresponding LHS was already resolved, so yyresolveLocations didn't
6223 actually have reason to modify it. Fix this by forcing
6224 nondeterministic operation at the beginning of the parse.
6225
50cce58e
PE
62262006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6227
6228 * data/c.m4 (b4_yy_symbol_print_generate):
6229 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6230 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6231 of the bugs reported today by Derek M Jones in
6232 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6233 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6234 defined to be a type name without parens or brackets.
6235 (Location Type): Similarly for YYLTYPE.
6236 * tests/regression.at (Trivial grammars): Put in a test for this
6237 bug that will be caught by 'make maintainer-check' (though not,
6238 alas, by 'make check' unless your compiler is picky).
6239
ab8d9dc5
PE
62402006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6241
0d2c8934 6242 * NEWS: Version 2.2.
ab8d9dc5
PE
6243 * configure.ac (AC_INIT): Likewise.
6244
9138c575
JD
62452006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6246
6247 * data/glr.c (yyreportTree): Make room in yystates for the state
6248 preceding the RHS. This fixes the segmentation fault reported by Derek
6249 M. Jones in
6250 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6251 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6252 to the user. Reported for yyreportTree by Derek M. Jones later in the
6253 same thread.
6254 * THANKS: Add Derek M. Jones.
6255 Update my email address.
6256 Fix typo in Steve Murphy's name.
6257
276f48df
PE
62582006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6259
d6645148
PE
6260 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6261 checking against YYLAST that caused the parser to miss a potential
6262 alternative in its diagnostic.
6263 Problem reported by Maria Jose Moron Fernandez in
6264 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6265 * data/lalr1.cc (yysyntax_error_): Likewise.
6266 * data/yacc.c (yysyntax_error): Likewise.
6267 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6268 tokens, in case we run into an older C compiler.
6269 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6270 Use them to check for the off-by-one error fixed above.
6271
276f48df
PE
6272 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6273 YYSIZE_T, not size_t.
6274 * tests/regression.at (Trivial grammars): New test, to catch
6275 the error fixed by the above patch.
6276
cd8b5791
AD
62772006-05-14 Akim Demaille <akim@lrde.epita.fr>
6278
6279 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6280 scheme.
6281 Reported by Steve Murphy.
6282
34376418
AD
62832006-05-14 Akim Demaille <akim@lrde.epita.fr>
6284
6285 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6286 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6287
327afc7c
AD
62882006-05-14 Akim Demaille <akim@lrde.epita.fr>
6289
6290 Implement --trace=m4.
6291 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6292 * src/output.c (output_skeleton): When set, pass -dV to m4.
6293
6294 Factor the handling of flags in m4.
6295 * src/output.c (prepare): Rename the muscle names debug, defines,
6296 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6297 * data/c.m4: Adjust.
6298 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6299 Use b4_define_flag_if to define other b4_FLAG_if macros.
6300 (b4_location_if): As a consequence, rename as...
6301 (b4_locations_if): this, for consistency.
6302 Adjust all the skeletons.
6303
ba9ecd19
AD
63042006-05-14 Akim Demaille <akim@lrde.epita.fr>
6305
6306 * etc/bench.pm: Shorten bench names.
6307
4e83ea15
AD
63082006-05-14 Akim Demaille <akim@lrde.epita.fr>
6309
6310 * src/output.h, src/output.c (error_verbose): Move to...
6311 * src/getargs.h, src/getargs.c: here.
6312 Sort the flags.
6313 Adjust dependencies.
6314
6e93d810
PE
63152006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6316
6317 * data/c.m4 (b4_copyright): Put the special exception for Bison
6318 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
6319 uses changed. Suggested by Akim Demaille. Also, wrap the
6320 copyright notice, in case it is longer than 80 columns. Replace
6321 comma by newline after title.
6e93d810 6322
eaea13f5
PE
63232006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6324
6325 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6326 incompatibility, not a bug. Mention that it wasn't fixed as of
6327 flex 2.5.33.
6328
3cf084ec
AD
63292006-05-11 Akim Demaille <akim@lrde.epita.fr>
6330
6331 * examples/extexi: Enforce the precedence of concatenation over
6332 >>.
0a9f1c7d 6333 Reported by Tommy Nordgren.
3cf084ec 6334
32c96bd7
AD
63352006-05-11 Akim Demaille <akim@lrde.epita.fr>
6336
6337 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6338 with the member "token".
f94705b2 6339 Reported by Martin Nylin.
32c96bd7 6340
eaea13f5
PE
63412006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6342
6343 * data/glr.c: Switch to Bison 2.2 special-exception language in
6344 the copyright notice. Use more-regular format for titles and
6345 copyright notices.
6346 * data/glr.cc: Likewise.
6347 * data/location.cc: Likewise.
6348 * data/yacc.cc: Likewise.
6349 * doc/bison.texinfo (Conditions): Document this.
6350 * NEWS: likewise. Upgrade version to 2.2.
6351
6e2d1146
AD
63522006-04-27 Akim Demaille <akim@lrde.epita.fr>
6353
6354 * data/glr.cc: Remove dead code.
6355
47671055
PE
63562006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6357
6358 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6359 that variable and the line breaks the bootstrap. Problem reported
6360 by Juan M. Guerrero.
6361
ed2e6384
AD
63622006-04-24 Akim Demaille <akim@lrde.epita.fr>
6363
6364 * doc/bison.texinfo (Multiple start-symbols): New.
6365
3cedc2dc
AD
63662006-04-24 Akim Demaille <akim@lrde.epita.fr>
6367
6368 * etc/README, etc/bench.pl: New.
6369
b2ddc3f3
AD
63702006-04-03 Akim Demaille <akim@lrde.epita.fr>
6371
6372 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6373 rule.
6374 Reported by Mickael Labau.
6375 * tests/input.at (Torturing the Scanner): Test it.
6376
91e3ac9a
PE
63772006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6378
6379 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6380 Problem reported by Bob Rossi.
6381
63822006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6383
6384 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6385 and didn't really work.
6386 For the index, use @ifnotinfo, not @iftex.
6387 Minor cleanups of spacing and terminology.
6388
5cf61e93
AD
63892006-03-12 Akim Demaille <akim@lrde.epita.fr>
6390
6391 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6392 of AT_NAME_PREFIX when %name-prefix is not used.
6393
aa08666d
AD
63942006-03-12 Akim Demaille <akim@lrde.epita.fr>
6395
6396 Apply --prefix to C++ skeletons too: they change the namespace.
6397 The test suite already exercize these cases.
6398 * data/c++.m4 (b4_namespace): New.
6399 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6400 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6401 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6402 * doc/bison.texinfo: Document it.
6403 (Option Cross Key): Use @multitable in all formats. It looks
6404 nicer, even in TeX outputs.
6405 (Rules): Use the same code whatever the output type is.
6406 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6407 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6408 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 6409
45567173
AD
64102006-03-10 Akim Demaille <akim@lrde.epita.fr>
6411
6412 * TODO: Remove dead items.
6413
e9d8f881 64142006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
6415
6416 * doc/FAQ: Remove, merged into...
6417 * doc/bison.texinfo (FAQ): this.
6418 * doc/Makefile.am (EXTRA_DIST): Adjust.
6419
c095d689
AD
64202006-03-10 Akim Demaille <akim@lrde.epita.fr>
6421
6422 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6423 even if empty.
6424 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6425 * doc/bison.texinfo (Calc++ Scanner): Use it.
6426
6e0f8287
PE
64272006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6428
6429 Fix two nits reported by twlevo, plus one more that I discovered.
6430
6431 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6432 this is the usual Bison style.
6433 * src/location.h (location_print): Likewise.
6434
6435 * src/reader.h (token_name): Likewise.
6436
d6b771c3
PE
64372006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6438
6439 Fix some nits reported by twlevo.
6440 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6441 and "POSIX". Use more-modern syntax for URLs. Mention C++
6442 and ask for Java. Don't hardwire OS version numbers. Add
6443 copyright notice.
6444 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6445 * src/conflicts.c (solved_conflicts_obstack): Now static.
6446
1e137b71
JD
64472006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6448
6449 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6450 page. Say "you can use it" not "you may use it" as on the web page;
6451 we're describing capabilities not granting permission.
6452
73f2e47e
PE
64532006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6454
6d05403d
PE
6455 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6456 shadowing warnings. Use usual patter for iterating through RHS.
6457 * tests/glr-regression.at
6458 (Uninitialized location when reporting ambiguity):
6459 Modify yylex so that it uses its argument, rather than trying
6460 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6461 const char -> char const.
6462
73f2e47e
PE
6463 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6464 Don't use tabs inside commands; it messes up 'ps'.
6465 Problem reported by twlevo.
6466
8710fc41
JD
64672006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6468
6469 * tests/glr-regression.at (Uninitialized location when reporting
6470 ambiguity): New test case.
6471 * data/glr.c (yyresolveLocations): New function, which uses
6472 YYLLOC_DEFAULT.
6473 (yyresolveValue): Invoke yyresolveLocations before reporting an
6474 ambiguity.
6475 * doc/bison.texinfo (Default Action for Locations): Note
6476 YYLLOC_DEFAULT's usage for ambiguity locations.
6477 (GLR Semantic Actions): Cross-reference those notes.
6478
ae952af2
JD
64792006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6480
6481 * tests/glr-regression.at (Leaked semantic values when reporting
6482 ambiguity): Remove unnecessary union and type declarations.
6483 (Leaked lookahead after nondeterministic parse syntax error): New test
6484 case.
6485 * data/glr.c (yyparse): Check for zero stacks remaining before
6486 attempting to shift the lookahead so that you don't lose it.
6487
35ee866a
JD
64882006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6489
6490 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6491 * tests/glr-regression.at (Leaked semantic values when reporting
6492 ambiguity): New test case.
6493 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6494 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6495 now unnecessary yystackp parameter.
6496 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6497 destructors can be called.
6498
6499 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6500 in existing testcases.
6501
520181ab
JD
65022006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6503
6504 Don't leak semantic values for parent RHS when a user action cuts the
6505 parser, and clean up related code a bit.
6506 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
6507 cuts parse): Rename to...
6508 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
6509 for leaked parent RHS values.
6510 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6511 between an unresolved state (non-empty chain of semantic options) and
6512 an incomplete one (signaled by an empty chain).
ae952af2 6513 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
6514 successfully or unsuccessfully resolved yyGLRState to...
6515 (yyresolveValue): ... here so that yyresolveValue always leaves a
6516 yyGLRState with consistent data and thus is easier to understand.
6517 Remove the yyvalp and yylocp parameters since they are always just
6518 taken from the yys parameter. When reporting a discarded merged value
6519 in debugging output, note that it is incompletely merged. Document the
6520 interface.
6521 (yyresolveAction): If resolving any of the RHS states fails, destroy
6522 them all rather than leaking them. Thus, as long as user actions are
6523 written to clean up the RHS correctly, yyresolveAction always cleans up
6524 the RHS of a semantic option. Document the interface.
6525
18d9185c
PE
65262006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6527
6528 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6529 led to a segmentation fault in GNU Pascal. Problem reported
6530 by Waldek Hebisch.
6531
841a7737
JD
65322006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6533
6534 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6535 mid-rule action inside a nonterminal symbol in order to declare a
6536 destructor for its semantic value.
6537
fc3f467f
PE
65382006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6539
6540 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6541 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6542 __cplusplus && ! defined _STDLIB_H && !
6543 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6544 defined free))]: Include <stdlib.h> rather than rolling our own
6545 declarations of malloc and free, to avoid problems with
6546 incompatible declarations (using 'throw') C++'s stdlib.h. This
6547 should fix Debian bug 340012
6548 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6549 reported by Guillaume Melquiond.
6550
a3af26dd
PE
65512006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6552
4d7bc38c
PE
6553 * NEWS: Clarify symbols versus types in unused-value warnings.
6554
a3af26dd
PE
6555 * configure.ac (AC_INIT): Bump version number.
6556
4e26c69e
PE
65572006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6558
6559 * NEWS: Version 2.1a.
6560 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6561 since C99 requires this.
6562
498e897c
PE
65632006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6564
6565 * m4/c-working.m4: New file.
6566 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6567
57bb17ca
PE
65682006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6569
6570 * Makefile.maint: Merge from coreutils.
6571
0be105dc
PE
65722006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6573
6574 More portability fixes for problems summarized by Nelson H. F. Beebe.
6575
6576 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6577 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6578 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6579 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6580 messes up because C++ code is compiled in 32-bit mode but linked
6581 in 64-bit mode.
6582
6fc0c024
PE
65832006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6584
6585 More portability fixes for problems summarized by Nelson H. F. Beebe.
6586
7870f699
PE
6587 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6588 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6589
6fc0c024
PE
6590 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6591 nodist_PROGRAMS, since we don't need to actually compile the
6592 example if we're just doing a plain 'make'. This avoids bothering
6593 the installer unnecessarily about problems due to weird C++
6594 compilers.
6595
fe6c2fde
PE
65962006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6597
6598 More portability fixes for problems summarized by Nelson H. F. Beebe.
6599
6600 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6601 than #include "...", and compile with -I'.'. The old method was
6602 not portable, according to Posix and the C standard, and it does
6603 not work with Sun C 5.7, where previous #line directives affect
6604 the working directory used in later #include "..." directives.
6605
927b425b
JMG
66062006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6607
6608 Various DJGGP specific issues in /djgpp
6609
d9735e9e
PE
66102006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6611
6612 More portability fixes for problems summarized by Nelson H. F. Beebe.
6613
6614 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6615 '#include <map>' works and that you can apply ++ to iterators.
6616
5a6755af
PE
66172006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6618
67a0dc4f
PE
6619 Work around portability problems summarized by Nelson H. F. Beebe in
6620 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6621
8c86f0ef
PE
6622 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6623 that '#include <string>' works.
6624
de35dd59
PE
6625 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6626 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6627 "warning: sorry: semantics of inline function static data `const
6628 unsigned char translate_table[262]' are wrong (you'll wind up with
6629 multiple copies)".
6630
67a0dc4f
PE
6631 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6632 or, xor to not_, and_, or_, and xor_, respectively. This works
6633 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6634 random system header somewhere that includes the equivalent of
6635 <iso646.h>.
6636
5a6755af
PE
6637 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6638 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 6639 Suite Version 2.0.
5a6755af 6640
3f001415
JD
66412006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6642
6643 During deterministic GLR operation, user actions should be able to
6644 influence the parse by changing yychar. To make this easier to fix and
6645 to make glr.c easier to evolve in general, don't maintain yytoken in
6646 parallel with yychar; just compute yytoken when needed.
6647 * tests/glr-regression.at (Incorrect lookahead during deterministic
6648 GLR): Check that setting yychar in a user action has the intended
6649 effect.
6650 * data/glr.c (yyGLRStack): Remove yytokenp member.
6651 (yyclearin): Don't set *yytokenp.
6652 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6653 yychar rather than *yytokenp to determine the current lookahead.
6654 Compute yytoken locally when needed.
6655 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6656 point to.
6657
6658 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6659 after `--report' documentation.
6660
e2a8c0f5
PE
66612006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6662
6663 * src/parse-gram.y (grammar_declaration): Location of printer
6664 symbol is @1, not list->location. Bug reported by twlevo.
6665 * tests/input.at (Incompatible Aliases): Adjust to above change.
6666
6b702268
PE
66672006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6668
27622431
PE
6669 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6670 all the test at once. This makes the output easier to read in the
6671 normal case.
6672
6b702268
PE
6673 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6674 got from <http://bro-ids.org/download.html>. The bug is that
6675 when two actions appeared in succession, the second one was
6676 scanned before the first one was added to the grammar rule
6677 as a midrule action. Bison then output the incorrect warning
6678 "parse.y:905.17-906.36: warning: unused value: $3".
6679 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6680 associated with a value.
6681 (rhs): Don't invoke grammar_current_rule_action_append.
6682 (action): Invoke it here instead.
6683 * src/reader.c (grammar_midrule_action): Now extern.
6684 (grammar_current_rule_action_append): Don't invoke
6685 grammar_midrule_action; that is now the scanner's job.
6686 * src/reader.h (last_string, last_braced_code_loc):
6687 (grammar_midrule_action): New decls.
6688 * src/scan-gram.l (last_string): Now extern, sigh.
6689 (last_braced_code_loc): New extern variable.
6690 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6691 rule already has an action.
6692 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6693 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6694 Add some tests to check that the above changes fixed the bug.
6695
d40ba6c2
PE
66962006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6697
6698 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6699 All used changed. Check whether the symbol has a destructor,
6700 not whether it is typed.
6701 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6702 that the values are still reported as unused. All line numbers
6703 adjusted.
6704
401aace6
PE
67052006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6706
6707 Work around a bug in bro 0.8, which underparenthesizes its
6708 definition of YYLLOC_DEFAULT.
6709 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6710 their arguments.
6711 * data/lalr1.cc: Likewise.
6712 * data/yacc.cc: Likewise.
6713
06f01bc4
PE
67142006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6715
401aace6
PE
6716 Work around a bug in Pike 7.0, and give the Pike folks a
6717 better way to override the usual int widths.
6718 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6719 user can override the types.
6720 (short): #undef, to work around a bug in Pike 7.0.
6721 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6722 (union yyalloc.yyss): Use yytype_int16 rather than short.
6723 All uses changed.
6724 (yysigned_char): Remove.
6725 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6726 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6727 * tests/regression.at (Web2c Actions): Adjust to above changes.
6728
6729 * src/reader.c (check_and_convert_grammar): New function.
6730 (reader): Close the input file even if something went wrong during
6731 parsing. Minor file descriptor leak reported by twlevo.
6732
06f01bc4
PE
6733 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6734 to pacify gcc -Wswitch-default.
6735 * src/scan-gram.l (adjust_location): Use a default: break; case
6736 to pacify gcc -Wswitch-default.
6737 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6738 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6739 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6740 Move these decls to scan-skel.l, since they don't need to be
6741 visible elsewhere.
6742 * src/scan-skel.l: Accept the above decls.
6743 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6744 is used.
6745
02650b7f
PE
67462006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6747
6748 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6749 since we don't want to insist on a version number at the start
6750 of the changelog every time.
6751 * Makefile.maint: Sync from coreutils a bit better.
6752 (sc_trailing_blank): Renamed from sc_trailing_space.
6753 All uses changed.
6754 (sc_no_if_have_config_h, sc_require_config_h):
6755 (sc_prohibit_assert_without_use): New rules.
6756 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6757 (sc_dd_max_sym_length): Fix leading spaces in rule.
6758 (sc_system_h_headers): Prefix with @.
6759 (sc_useless_cpp_parens, m4-check): Output line numbers.
6760 (changelog-check): Allow version only in head.
6761 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6762 satisfy new Makefile.maint rule.
6763 * data/glr.c: Likewise.
6764 * data/glr.cc: Likewise.
6765 * data/lalr1.cc: Likewise.
6766 * data/yacc.c: Likewise.
6767 * lib/ebitsetv.c: Likewise.
6768 * lib/lbitset.c: Likewise.
6769 * lib/subpipe.c: Likewise.
6770 * lib/timevar.c: Likewise.
6771 * src/system.h: Likewise.
6772 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6773 * djgpp/Makefile.maint: Add copyright notice.
6774 * djgpp/README.in: Likewise.
6775 * djgpp/config.bat: Likewise.
6776 * djgpp/config.site: Likewise.
6777 * djgpp/config_h.sed: Likewise.
6778 * djgpp/djunpack.bat: Likewise.
6779 * djgpp/config.sed: Fix copyright notice to match standard format.
6780 * djgpp/subpipe.h: Likewise.
6781 * lib/bitsetv-print.c: Likewise.
6782 * lib/bitsetv.c: Likewise.
6783 * lib/subpipe.h: Likewise.
6784 * lib/timevar.c: Likewise.
6785 * lib/timevar.h: Likewise.
6786 * djgpp/subpipe.c: Use standard recipe for config.h.
6787 * lib/abitset.c: Likewise.
6788 * lib/bitset.c: Likewise.
6789 * lib/bitset_stats.c: Likewise.
6790 * lib/bitsetv-print.c: Likewise.
6791 * lib/bitsetv.c: Likewise.
6792 * lib/ebitsetv.c: Likewise.
6793 * lib/get-errno.c: Likewise.
6794 * lib/lbitset.c: Likewise.
6795 * lib/subpipe.c: Likewise.
6796 * lib/timevar.c: Likewise.
6797 * lib/vbitset.c: Likewise.
6798 * tests/local.at: Likewise.
6799 * src/scan-gram.l: Don't include verify.h, since system.h does
6800 that for us.
6801 * .x-sc_require_config_h: New file.
6802 * .x-sc_unmarked_diagnostics: New file.
6803
287c78f6
PE
68042006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6805
287c78f6
PE
6806 Be a bit more systematic about using 'abort'.
6807 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6808 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6809 Put 'default: abort ();' before some other case, to satisfy older
6810 pedantic compilers.
6811 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6812 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6813 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6814 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
6815 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6816 (get_decision_str, get_orientation_str, get_node_alignment_str):
6817 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6818 (get_linestyle_str, get_arrowstyle_str): Likewise.
6819 * src/conflicts.c (resolve_sr_conflict):
6820 Use a default case rather than one for the one remaining enum
6821 value, to catch invalid enum values as well.
6822 * src/lalr.c (set_goto_map, map_goto):
6823 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6824 * src/nullable.c (nullable_compute, token_definitions_output):
6825 Likewise.
6826 * src/reader.c (packgram, reader): Likewise.
6827 * src/state.c (transitions_to, state_new, state_reduction_find):
6828 Likewise.
6829 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6830 (symbol_pack): Likewise.
6831 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
6832 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6833 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
6834 * src/system.h: Don't include <assert.h>.
6835 (assert): New macro.
6836
6837 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6838 (Destructor Decl, Parser Function, Pure Calling):
6839 Describe rules for braces inside C code more carefully.
287c78f6 6840
c66dfadd
PE
68412006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6842
c21493b8
PE
6843 Fix some porting glitches found by Nelson H. F. Beebe.
6844 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6845 compilers that don't understand that abort () does not return.
6846 * src/state.c (transitions_to): Likewise.
6847 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6848 that '#include <cstdlib>' works.
6849 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6850 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6851 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6852 for the benefit of some pre-C99 compilers.
6853
b6e3facf
PE
6854 * bootstrap: Undo changes to gnulib files that autoreconf made.
6855
c66dfadd
PE
6856 Minor fixups to get 'make maintainer-check' to work.
6857 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6858 with the new verify.h implementation.
6859 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6860 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6861 * data/yacc.c (YYUSE): Likewise.
6862 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6863 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6864 * src/parse-gram.y (declaration): Don't pass a string constant
6865 to a function that expects char *, since GCC might complain
6866 about the constant value.
6867 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6868 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6869 before #defining them.
6870 * tests/glr-regression.at
6871 (Incorrectly initialized location for empty right-hand side in GLR):
6872 In yyerror, use the msg arg.
6873 (Corrupted semantic options if user action cuts parse):
6874 (Incorrect lookahead during deterministic GLR):
6875 (Incorrect lookahead during nondeterministic GLR):
6876 Don't name a local var 'index'; it shadows string.h's 'index'.
6877
ed94ef2a
AD
68782006-01-19 Akim Demaille <akim@epita.fr>
6879
6880 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6881 location, not just parts of it.
6882
e9ad4aec
PE
68832006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6884
d6ca7905
PE
6885 * NEWS: Document the fact that multiple %unions are now allowed.
6886 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
6887 * TODO: This feature is now implemented, so remove it from
6888 the wishlist.
d6ca7905 6889
ef1b70e0
PE
6890 * Makefile.maint: Merge with coreutils Makefile.maint.
6891 (CVS_LIST): Use build-aux version if available.
6892 (VERSION_REGEXP): New macro.
6893 (syntax-check-rules): Add sc_no_if_have_config_h,
6894 sc_prohibit_assert_without_use, sc_require_config_h,
6895 sc_useless_cpp_parens.
6896 (sc_obsolete_symbols): Check for O_NDELAY.
6897 (sc_dd_max_sym_length): Track coreutils.
6898 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6899 (sc_useless_cpp_parens): New rule.
6900 (news-date-check): Look for version or today's date.
6901 (changelog-check): Don't require version number near head.
6902 (copyright-check): Use current year instead of hardwiring 2005.
6903 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
6904 (announcement): Add --gpg-key-ID.
6905
6906 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
6907 with "file system".
6908
2073ce56 6909 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
6910 array. Problem reported by twlevo.
6911 * src/reader.c (packgram): Prepend a new sentinel before ritem.
6912 * src/lalr.c (build_relations): Rely on new sentinel.
6913 * src/gram.c (gram_free): Adjust to new sentinel.
6914
b7691f15
JD
69152006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
6916
6917 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
6918 yylookaheadNeeds. All uses updated.
6919 (yysplitStack): Rename local yynewLookaheadStatuses to
6920 yynewLookaheadNeeds.
6921 * data/glr-regression.at (Incorrect lookahead during nondeterministic
6922 GLR): In comments, change `lookahead status' to `lookahead need'.
6923
ddee1b06
PH
69242006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6925
6926 * data/glr.c (yysplitStack): A little stylistic rewrite.
6927
12f4614d
PH
69282006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6929
6930 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
6931
32c29292
JD
69322006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
6933
6934 * doc/bison.texinfo: Fix some typos.
6935 (GLR Semantic Actions): New subsection discussing special
6936 considerations because GLR semantic actions might be deferred.
6937 (Actions): Mention look-ahead usage of yylval.
6938 (Actions and Locations): Mention look-ahead usage of yylloc.
6939 (Special Features for Use in Actions): Add YYEOF entry and mention it
6940 in the yychar entry.
6941 In the yychar entry, remove mention of the local yychar case (pure
6942 parser) since this is irrelevant information when writing semantic
148d66d8 6943 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
6944 yychar is otherwise described as an external variable.
6945 In the yychar entry, don't call it the `current' look-ahead since it
6946 isn't when semantic actions are deferred.
6947 In the yychar and yyclearin entries, add note about deferred semantic
6948 actions.
6949 Add yylloc and yylval entries discussing look-ahead usage.
6950 (Look-Ahead Tokens): When discussing yychar, don't call it the
6951 `current' look-ahead, and do mention yylval and yylloc.
6952 (Error Recovery): Cross-reference `Action Features' when mentioning
6953 yyclearin.
148d66d8 6954 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
6955 look-ahead.
6956 In the yylloc and yylval entries, mention look-ahead usage.
6957
de366a2f 69582006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
6959
6960 * tests/glr-regression.at: Update copyright year to 2006.
6961
bf70fa87
JD
69622006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6963
6964 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
6965 use during nondeterministic operation to track which stacks have
6966 actually needed the current lookahead.
6967 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
6968 Allocate, deallocate, resize, and otherwise shuffle space for
6969 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
6970 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
6971 appropriately during nondeterministic operation.
6972 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
6973 members to store the current lookahead to be used by the deferred
6974 user action.
6975 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
6976 from which the RHS is taken. Set the lookahead members of the new
6977 yySemanticOption according to the lookahead status for stack yyk.
6978 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
6979 yyaddDeferredAction.
6980 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
6981 members of yySemanticOption before invoking yyuserAction, and then set
6982 them back to their current values afterward.
6983 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
6984 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
6985 * tests/glr-regression.at: Remove `.' from the ends of recent test case
6986 titles for consistency.
6987 (Leaked merged semantic value if user action cuts parse): In order to
6988 suppress lint warnings, use arguments in merge function, and assign
6989 char value < 128 in main.
6990 (Incorrect lookahead during deterministic GLR): New test case.
6991 (Incorrect lookahead during nondeterministic GLR): New test case.
6992
05449a2c
JD
69932006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6994
de366a2f 6995 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
6996 !yyvaluep as signal that no semantic value is available to print.
6997 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
6998 to print a semantic value.
6999
4158e0a1 70002006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 7001
4158e0a1
JD
7002 * tests/glr-regression.at: For consistency with my newer test cases,
7003 don't thank myself.
7004
d659304d
JD
70052006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7006
7007 * data/glr.c (yyresolveValue): When merging semantic options, if at
7008 least one user action succeeds but a later one cuts the parse, then
7009 destroy the semantic value before returning rather than leaking it.
7010 (yyresolveStates): If a user action cuts the parse and thus
7011 yyresolveValue fails, ignore the (unset) semantic value rather than
7012 corrupting the yyGLRState, and empty the semantic options list since
7013 the user actions should have called all necessary destructors.
7014 Simplify code with YYCHK.
7015 * tests/glr-regression.at (Corrupted semantic options if user action
7016 cuts parse): New test case.
7017 (Undesirable destructors if user action cuts parse): New test case.
7018 Before applying any of this patch, this test case never actually failed
7019 for me... but only because the corrupted semantic options usually
7020 masked this bug.
7021 (Leaked merged semantic value if user action cuts parse): New test
7022 case.
7023
6ec2c0f2
AD
70242006-01-05 Akim Demaille <akim@epita.fr>
7025
7026 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7027
1b9c21fb
PE
70282006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7029
7030 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7031 _MSC_VER. Problem reported by Cenzato Marco.
7032 (b4_c_function_def): Use it.
7033 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7034 b4_c_modern.
7035 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7036 than rolling our own.
7037
84866159
AD
70382006-01-04 Akim Demaille <akim@epita.fr>
7039
7040 Also warn about non-used mid-rule values.
7041 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7042 member.
7043 (symbol_list_new): Adjust.
7044 * src/reader.c (symbol_typed_p): New.
7045 (grammar_rule_check): Use it.
7046 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7047 Check its rule.
7048 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7049 Use it.
7050 * tests/actions.at (Exotic Dollars): Adjust.
7051
378f4bd8
AD
70522006-01-04 Akim Demaille <akim@epita.fr>
7053
7054 * src/reader.c (grammar_midrule_action): If $$ is set in a
7055 mid-rule, move the `used' bit to its lhs.
7056 * tests/input.at (Unused values): New.
7057 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7058
e2a21b6f
PE
70592006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7060
54662697
PE
7061 * doc/bison.texinfo (Bison Options): Say more accurately what
7062 --yacc does.
7063 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7064 about declarations in the grammar when in Yacc mode, as POSIX does
7065 not require a diagnostic when the grammar uses extensions.
7066
7067 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7068
073f9288
PE
7069 Warn about dubious constructions like "%token T T".
7070 Reported by twlevo.
7071 * src/symtab.h (struct symbol.declared): New member.
7072 * src/symtab.c (symbol_new): Initialize it to false.
7073 (symbol_class_set): New arg DECLARING, specifying whether
7074 this is a declaration that we want to warn about, if there
7075 is more than one of them. All uses changed.
7076
1221b78a
PE
7077 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7078 Allow multiple %union directives, whose contents concatenate.
7079 * src/parse-gram.y (grammar_declaration): Likewise.
7080 Use muscle_code_grow, so that we don't need stype_line any more.
7081 All uses changed.
7082
7083 * src/muscle_tab.c (muscle_grow): Fix comment.
7084
e2a21b6f
PE
7085 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7086 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7087 Update copyright year to 2006.
7088
8f7e3cf9
AD
70892006-01-03 Akim Demaille <akim@epita.fr>
7090
7091 Have glr.cc pass (some of) the calc.at tests.
7092 * data/glr.cc (b4_parse_param_orig): New.
7093 (b4_parse_param): Improve its definition, and bound it more
7094 clearly in the skeleton.
7095 (b4_epilogue): Append, instead of prepending, in order to keep
7096 #line consistency.
7097 Simplify the generation of auxiliary functions: locations and
7098 purity are mandated.
7099 (b4_global_tokens_and_yystype): Honor it.
7100 * data/location.cc (c++.m4): Don't include it.
7101 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7102 and AT_SKEL_CC_IF.
7103 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7104 AT_LALR1_CC_IF.
7105 Be sure to initialize the first position's filename.
7106 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7107 mandated anyway.
7108 (AT_CHECK_CALC_GLR_CC): New.
7109 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7110
3953ed88
AD
71112006-01-02 Akim Demaille <akim@epita.fr>
7112
7113 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7114 c.m4.
0a96ba81 7115 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
7116 * data/glr.cc: Do not include stack.hh.
7117
9ecafbbf
AD
71182006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7119
7120 * data/glr.c: Reformat whitespace with tabs.
7121 (b4_lpure_formals): Remove this unused m4 macro.
7122 * tests/cxx-type.at: Reformat whitespace with tabs.
7123 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7124 since it's a member. Rename type to isNterm for clarity.
7125
c4d497a0
AD
71262005-12-29 Akim <akim@sulaco.local>
7127
7128 Let glr.cc catch up with symbol_value_print.
7129 * data/glr.cc (b4_yysymprint_generate): Replace by...
7130 (b4_yy_symbol_print_generate): this.
7131 (yy_symbol_print, yy_symbol_value_print): Declare them.
7132
4517da37
PE
71332005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7134
7135 * src/location.h (boundary): Note that a line or column equal
7136 to INT_MAX indicates an overflow.
7137 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7138 (rule_length_overflow, increment_rule_length, add_column_width):
7139 New functions.
7140 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7141 (<SC_BRACED_CODE>"}"):
7142 Use increment_rule_length rather than incrementing it by hand.
7143 (adjust_location, handle_syncline): Diagnose overflow.
7144 (handle_action_dollar, handle_action_at):
7145 Fix bug with monstrosities like $-2147483648.
7146 Remove now-unnecessary checks.
7147 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7148 (convert_ucn_to_byte): Verify assumptions.
7149 (handle_syncline): New arg LOC. All callers changed.
7150 Don't store through a value derived from char const * pointer.
7151
7152 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7153 GCC warnings.
7154
e3233bf6
PE
71552005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7156
7157 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7158 Remove unnecessary forward static decls.
7159
8f3596a6
AD
71602005-12-27 Akim Demaille <akim@epita.fr>
7161
7162 * src/reader.c (grammar_current_rule_check): Also check that $$
7163 is used.
7164 Take the rule to check as argument, hence rename as...
7165 (grammar_rule_check): this.
7166 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7167 Rename as...
7168 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7169 (grammar_midrule_action, grammar_symbol_append): Now static.
7170 * tests/torture.at (input): Don't rely on the default action
7171 being always performed.
7172 * tests/calc.at: "Set" $$ even when the action is "cut" with
7173 YYERROR or other.
7174 * tests/actions.at (Exotic Dollars): Instead of using unused
7175 values, check that the warning is issued.
7176
721be13c
PE
71772005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7178
7179 * NEWS: Improve wording for unused-value warnings.
7180
a0af42fc
AD
71812005-12-22 Akim Demaille <akim@epita.fr>
7182
7183 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7184 (b4_yysymprint_generate): Rename as...
7185 (b4_yy_symbol_print_generate): this.
7186 Generate yy_symbol_print instead of yysymprint.
7187 Generate also yy_symbol_value_print, and use it.
7188
affac613
AD
71892005-12-22 Akim Demaille <akim@epita.fr>
7190
721be13c 7191 * NEWS: Warn about unused values.
affac613
AD
7192 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7193 a `used' member.
7194 (symbol_list_n_get, symbol_list_n_used_set): New.
7195 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7196 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7197 * src/reader.c (grammar_current_rule_check): Check that values are
7198 used.
7199 * src/symtab.c (symbol_print): Accept 0.
7200 * tests/existing.at: Remove the type information.
7201 Empty the actions.
7202 Remove useless actions (beware of mid-rule actions: perl -000
7203 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7204 * tests/actions.at (Exotic Dollars): Use unused values.
7205 * tests/calc.at: Likewise.
7206 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7207 Likewise.
7208
7209 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7210 rule_useful_p.
7211
9d9b8b70
PE
72122005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7213
8bb4c753
PE
7214 Undo 2005-12-01 tentative license wording change. The wording is
7215 still being reviewed by the lawyers, and we don't want to wait for
7216 them before publishing a test release. For now, revert to the
7217 previous wording.
7218 * NEWS: Undo 2005-12-01 change.
7219 * data/glr.c: Revert to previous license wording.
7220 * data/glr.cc: Likewise.
7221 * data/lalr1.cc: Likewise.
7222 * data/location.cc: Likewise.
7223 * data/yacc.c: Likewise.
7224
9d9b8b70
PE
7225 * NEWS: Reword %destructor vs YYABORT etc.
7226 * data/glr.c: Use American spacing, for consistency.
7227 * data/glr.cc: Likewise.
7228 * data/lalr1.cc: Likewise.
7229 * data/yacc.c: Likewise.
7230 * data/yacc.c: Reformat comments slightly.
7231 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7232 for consistency. Fix some spelling errors and reword recently-included
7233 text slightly.
7234 * tests/cxx-type.at: Cast results of malloc, for C++.
7235
2c3b392a
AD
72362005-12-21 Joel E. Denny <address@hidden>
7237
7238 * tests/cxx-type.at: Construct a tree, count the parents of shared
7239 nodes, and free each node once and only once. Previously, the memory
7240 for semantic values was leaked instead.
7241
d6cff4dc
AD
72422005-12-21 Joel E. Denny <address@hidden>
7243
7244 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7245 (yylval, yylloc): If pure, #define to yystackp->yyval and
7246 yystackp->yyloc similar to yychar and yynerrs.
7247 (yyparse): If pure, remove local yylval and yylloc. Add local
7248 yystackp to accommodate pure definitions of yylval and yylloc.
7249 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7250 yylvalp and yyllocp to &yylval and &yylloc.
7251 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7252 namespace. Previously, nerrs and char were missing, but lval and lloc
7253 weren't necessary.
7254 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7255 yylvalp and yyllocp parameters since, if pure, these are now always
7256 accessible through yystackp. If not pure, they are still accessible
7257 globally.
7258 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7259 `if (YYID (N))' to pacify lint.
7260
a85284cf
AD
72612005-12-21 Akim Demaille <akim@epita.fr>
7262
7263 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7264 destroy the RHS symbols of a rule.
7265 * data/yacc.c (yylen): Initialize to 0.
7266 Keep its value to the number of items to possibly shift.
7267 In particular, a regular successful parse that ends on YYFINAL by
7268 a (internal) YYACCEPT must not have yylen != 0.
7269 (yyerrorlab, yyreturn): Pop the RHS.
7270 Reorder a bit to emphasize the `shifting' bits of code.
7271 (YYPOPSTACK): Now accept a number of items to pop.
7272 * data/lalr1.cc: Likewise.
7273 * data/glr.c: Formatting changes.
7274 Use goto instead of fall through.
7275 * doc/bison.texinfo (Destructor Decl): Complete.
7276
d508c281
JMG
72772005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7278
7279 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7280 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7281 * djgpp/config.bat: Replace every occurence of the file name
7282 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7283 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7284 * djgpp/config.sed: Replace every occurence of the file name
7285 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7286 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7287 * djgpp/djunpack.bat: DJGPP specific file.
7288 * djgpp/fnchange.lst: DJGPP specific file.
7289 * djgpp/README.in: Add new information about how to unpack the bison
7290 source on MSDOS and other systems which have 8.3 file name restrictions
7291 using djunpack.bat and fnchange.lst.
7292
3e7a2cd9
PE
72932005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7294
7295 * bootstrap (build_cvs_prefix): Remove; unused.
7296 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7297 when getting gnulib.
7298
72992005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7300
7301 * data/glr.c: Reorder typedef declarations for structs to match order
7302 of struct declarations.
7303 Rename yystack everywhere to yystackp except in yyparse where it's not
7304 a pointer.
7305 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7306 consistency.
7307 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7308 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7309 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7310 lint.
7311
877519f8
PE
73122005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7313
0eca5a39
PE
7314 * tests/sets.at (Accept): Fix typos in regular expression used to
7315 sed out the final state number.
7316
2cec9080
PE
7317 Work around portability problem on Solaris 10: flex-generated
7318 files include <stdio.h> before <config.h>, which messes up
7319 because the latter defines __EXTENSIONS__. Address the problem
7320 by creating two new little files that include <config.h> first,
7321 then include the flex-generated files. Rewrite everyone else
7322 to include <config.h> first, as well.
7323 * lib/timevar.c: Always include "config.h".
7324 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7325 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7326 (EXTRA_bison_SOURCES): New macro.
7327 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7328 * src/system.h: Don't include config.h.
7329 * src/LR0.c: Include <config.h> first.
7330 * src/assoc.c: Likewise.
7331 * src/closure.c: Likewise.
7332 * src/complain.c: Likewise.
7333 * src/conflicts.c: Likewise.
7334 * src/derives.c: Likewise.
7335 * src/files.c: Likewise.
7336 * src/getargs.c: Likewise.
7337 * src/gram.c: Likewise.
7338 * src/lalr.c: Likewise.
7339 * src/location.c: Likewise.
7340 * src/main.c: Likewise.
7341 * src/muscle_tab.c: Likewise.
7342 * src/nullable.c: Likewise.
7343 * src/output.c: Likewise.
7344 * src/parse-gram.y: Likewise.
7345 * src/print.c: Likewise.
7346 * src/print_graph.c: Likewise.
7347 * src/reader.c: Likewise.
7348 * src/reduce.c: Likewise.
7349 * src/relation.c: Likewise.
7350 * src/state.c: Likewise.
7351 * src/symlist.c: Likewise.
7352 * src/symtab.c: Likewise.
7353 * src/tables.c: Likewise.
7354 * src/uniqstr.c: Likewise.
7355 * src/vcg.c: Likewise.
7356
877519f8
PE
7357 * src/parse-gram.y: Fix minor problems uncovered by lint.
7358 (current_lhs, current_lhs_location): Now static.
7359 (current_assoc): Remove unused variable.
7360
7361 Cleanups so that Bison-generated parsers have less lint.
7362 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7363 Prepend /*ARGSUSED*/, for lint's sake.
7364 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7365 definition if 'lint' is defined.
7366 (YYID): New macro (or function, if lint).
7367 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7368 * data/yacc.c: Likewise.
7369 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7370 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7371 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7372 is C++ only.
7373 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7374 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7375 Use YYID(0) rather than 0, for lint.
7376 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7377 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7378
f5228370
PE
73792005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7380
7381 * tests/glr-regression.at
7382 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7383 Close memory leak reported by twlevo.
7384
69ce078b
PE
73852005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7386
6ff99711
PE
7387 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7388 all stacks.
7389 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
7390 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7391 New test case.
7392 (Duplicated user destructor for lookahead): This test now is expected
7393 to succeed.
7394
af3412cd
PE
73952005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7396
32b5b719 7397 * NEWS: Document the following change.
af3412cd
PE
7398 * data/yacc.c: Say "parser skeleton" rather than "file", since
7399 it's no longer just a file.
7400 * data/glr.c: Grant a special exception for C GLR parsers, that
7401 reads like the already-existing exception for C LALR(1) parsers.
7402 * data/glr.cc: Likewise.
7403 * data/lalr1.cc: Likewise.
7404 * data/location.cc: Likewise.
7405 * data/yacc.c: Reword the "written by" statement to clarify that
7406 it was the parser skeleton, not the entire output file.
7407 * data/glr.c: Written by Paul Hilfinger.
7408 * data/glr.cc: Written by Akim Demaille.
7409 * data/lalr1.cc: Likewise.
7410
035aa4a0
PE
74112005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7412
d9963c85
PE
7413 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7414 Fix typos in previous change that broke 'make check'.
7415 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7416 supported in C.
7417 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7418 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7419 We can revert this once things settle down.
7420
035aa4a0
PE
7421 * src/conflicts.c (conflicts_print): Don't print file name twice
7422 when %expect fails because there were no conflicts.
7423 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7424 change.
7425 * tests/conflicts.at (%expect not enough, %expect too much):
7426 (%expect with reduce conflicts): Adjust to new behavior.
7427
74282005-11-18 Akim Demaille <akim@epita.fr>
7429
7430 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7431 errors.
7432 * NEWS: Document this.
7433 * doc/bison.texinfo (Expect Decl): Likewise.
7434
d1ff7a7c
AD
74352005-11-16 Akim Demaille <akim@epita.fr>
7436
7437 Generalize the display of semantic values and locations in traces.
7438 * data/glr.c (yy_reduce_print): Fix indices (again).
7439 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7440 literal integers.
7441 * data/lalr1.cc (yyreduce_print): Rename as...
7442 (yy_reduce_print): this.
7443 Display values and locations.
7444 * data/yacc.c (yy_reduce_print): Likewise.
7445 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7446 (yysymprint): Move higher to be visible from yy_reduce_print).
7447 (yyparse): Adjust.
7448 * tests/calc.at: Adjust the expected length of the traces.
7449
6de5398d
AD
74502005-11-14 Akim Demaille <akim@epita.fr>
7451
7452 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7453 from 1 to N, while values and location start at 0.
7454 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7455
a1373f55
AD
74562005-11-14 Akim Demaille <akim@epita.fr>
7457
7458 * data/glr.c (yy_reduce_print): Fix the $ number.
7459
613d8952
AD
74602005-11-14 Akim Demaille <akim@epita.fr>
7461
7462 "Use" parse parameters.
7463 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7464 * data/glr.c, data/glr.cc: Use them.
7465 * data/glr.c (YYUSE): Have a C++ definition that supports
7466 non-pointer types.
7467
b2741627
AD
74682005-11-14 Akim Demaille <akim@epita.fr>
7469
7470 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7471
5059b5c8
AD
74722005-11-14 Akim Demaille <akim@epita.fr>
7473
42249483
AD
7474 * data/glr.cc: New.
7475 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 7476
4626a15d
AD
74772005-11-12 Akim Demaille <akim@epita.fr>
7478
7479 Let position and location be PODs.
7480 * data/location.cc (position::initialize, location::initialize): New.
7481 (position::position, location::location): Define only if
7482 b4_location_constructors is defined.
7483 * data/lalr1.cc (b4_location_constructors): Define it for backward
7484 compatibility.
7485 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7486
74872005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
7488
7489 * data/lalr1.cc: Move the body of the ctor and dtor into the
7490 parser file (instead of the header).
7491 Wrap the implementations in a "namespace yy".
7492
74932005-11-12 Akim Demaille <akim@epita.fr>
7494
7495 Have glr.c include its header file when created.
7496 * data/glr.c (b4_shared_declarations): New.
7497 Output them verbatim in the parser if !%defines, otherwise
7498 output then in the header file, and include it instead.
7499
1989d947
AD
75002005-11-11 Akim Demaille <akim@epita.fr>
7501
7502 * data/glr.c: Comment changes.
7503
75042005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
7505
7506 When yydebug, report semantic and location values for reductions.
7507 * data/glr.c (yy_reduce_print): Report the semantic values and the
7508 locations.
7509 (YY_REDUCE_PRINT): Adjust.
7510 (yyglrReduce): Use them.
7511 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7512 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7513 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7514 traces.
7515
02998094
AD
75162005-11-10 Akim Demaille <akim@epita.fr>
7517
7518 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7519 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7520 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7521
5210672f
PE
75222005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7523
7524 * m4/cxx.m4, examples/Makefile.am: Don't build
7525 examples/calc++ if no C++ compiler is available. (trivial change)
7526
a8991a1d
AD
75272005-11-09 Akim Demaille <akim@epita.fr>
7528
7529 * src/scan-skel.l: Use a couple of asserts.
7530
36b5e963
AD
75312005-11-03 Akim Demaille <akim@epita.fr>
7532
7533 In some (weird) cases, the final state number is incorrect.
7534 Reported by Alexandre Duret-Lutz.
7535 * src/LR0.c (state_list_append): Remove the computation of
7536 final_state.
7537 (save_reductions): Do it here.
7538 (get_state): Alpha conversion.
7539 (generate_states): Use a for loop.
7540 * src/gram.h (item_number_is_rule_number)
7541 (item_number_is_symbol_number): New.
7542 * src/state.c: Use assert.
7543 * src/system.h: Include assert.h.
7544 * tests/sets.at (Accept): New.
7545
44e7ead1
PH
75462005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7547
7548 * data/glr.c (yyfill): Adjust comment.
36b5e963 7549 (yyresolveAction): Initialize default location properly
44e7ead1
PH
7550 for empty right-hand sides.
7551 (yydoAction): Ditto.
7552 Add comment explaining apparently dead code.
36b5e963
AD
7553 * tests/glr-regression.at
7554 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 7555 New test.
36b5e963 7556
e10a80ee
PE
75572005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7558
7559 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7560 gnulib when interrupted. This fixes some race conditions and
7561 works around some portability problems (one noted by Paul
7562 Hilfinger).
7563
067b32ee
AD
75642005-10-22 Akim <akim@epita.fr>
7565
7566 * Makefile.cfg: Adjust to config -> build-aux.
7567 Reported by twledo.
7568
4b367315
AD
75692005-10-21 Akim Demaille <akim@epita.fr>
7570
7571 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7572 the %parse-params.
7573 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7574 * data/yacc.c (b4_Pure_if): Rename as...
7575 (b4_yacc_pure_if): this.
7576 (YY_SYMBOL_PRINT, yyparse): Adjust.
7577 * doc/bison.texinfo: Formatting changes.
7578
24cc23d9
AD
75792005-10-21 Akim Demaille <akim@epita.fr>
7580
7581 Finish the transition config -> build-aux.
7582 * configure.ac, Makefile.am: Use build-aux.
7583 * config/prev-version, config/announce-gen, config/Makefile.am:
7584 Move to...
7585 * build-aux/prev-version, build-aux/announce-gen,
7586 * build-aux/Makefile.am: here.
7587
d4476375
AD
75882005-10-14 Akim Demaille <akim@epita.fr>
7589
7590 * examples/calc++/test: Use set -x only when VERBOSE.
7591
302c0aee
PE
75922005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7593
7594 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7595 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7596
7625ec2c
AD
75972005-10-13 Akim Demaille <akim@epita.fr>
7598
7599 * src/scan-skel.l: Output the base name parts of the parser and
7600 header file names.
302c0aee 7601 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
7602 additional checks.
7603 Use this to exercise C++ outputs in subdirs.
7604 Reported by Oleg Smolsky.
7605
ba0fe3c7
PE
76062005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7607
7608 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7609 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7610 Problem reported by John P. Hartmann.
7611 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7612 already defined it.
7613
9b8a5ce0
AD
76142005-10-12 Akim Demaille <akim@epita.fr>
7615
7616 * src/parse-gram.y (version_check): Exit 63 to please missing
7617 (stands for "version mismatch).
7618 * tests/input.at, doc/bison.texinfo: Adjust.
7619
4f6e011e
PE
76202005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7621
7622 Work around portability problems with Visual Age C compiler
7623 (xlc and xlC_r) reported by John P. Hartmann.
7624 * data/location.cc (initial_column, initial_line): Remove.
7625 All uses replaced by 0 and 1.
7626 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7627 that xlc complains about.
7628 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 7629 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 7630 as __STDC__.
4d7aa45e
PE
7631 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7632 __STDC_VERSION__. Use it everywhere instead of looking at
7633 __STDC__ and __cplusplus.
4f6e011e 7634
a1b3bf8c
AD
76352005-10-10 Akim Demaille <akim@epita.fr>
7636
7637 * examples/calc++/test: Be quiet unless VERBOSE.
7638
412e44aa
PE
76392005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7640
2a4647a3
PE
7641 * data/c.m4 (yydestruct, yysymprint):
7642 Use YYUSE instead of casting to void.
7643 * data/glr.c (YYUSE): New macro.
7644 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7645 Use it instead of rolling our own.
7646 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7647 (YYCHK1):
7648 Use /*CONSTCOND*/ to suppress lint warnings.
7649 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7650 (YY_STACK_PRINT): Use 'false' not '0'.
7651 (YYUSE): New macro.
7652 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7653 * data/yacc.c (YYUSE): New macro.
7654 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7655 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7656 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7657
7658
412e44aa
PE
7659 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7660 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7661
88c6637f
PE
76622005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7663
2f4f028d
PE
7664 Undo the parts of the unlocked-I/O change that substituted
7665 putc or puts for printf. This might hurt performance a bit,
7666 but some people prefer the printf style.
7667 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7668 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7669 All uses replaced by YYFPRINTF and YYDPRINTF.
7670 * data/yacc.c: Likewise.
7671 * lib/bitset.c (bitset_print): Likewise.
7672 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7673 putc and puts.
7674 * lib/lbitset.c (debug_lbitset): Likewise.
7675 * src/closure.c (print_firsts, print_fderives): Likewise.
7676 * src/gram.c (grammar_dump): Likewise.
7677 * src/lalr.c (look_ahead_tokens_print): Likewise.
7678 * src/output.c (escaped_output): Likewise.
7679 (user_actions_output): Break apart two printfs.
7680 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7681 * src/reduce.c (reduce_print): Likewise.
7682 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7683 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7684
88c6637f
PE
7685 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7686 Use assignments rather than casts-to-void to suppress
7687 unused-variable warnings. This pacifies 'lint'.
7688 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7689 unused-variable warnings.
7690
fb32e373
JMG
76912005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7692
7693 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7694
edb8f44f
PE
76952005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7696
fb9c0b33
PE
7697 Use unlocked I/O for a minor performance improvement on hosts like
7698 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7699 is to use the gnlib unlocked-io module, and to prefer putc and
7700 puts to printf when either will work (since the latter doesn't
7701 come in an unlocked flavor).
7702 * bootstrap (gnulib_modules): Add unlocked-io.
7703 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7704 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7705 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7706 and similarly for puts and putc and printf.
7707 * data/yacc.c: Likewise.
7708 * lib/bitset.c (bitset_print): Likewise.
7709 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7710 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7711 to printf.
7712 * lib/lbitset.c (debug_lbitset): Likewise.
7713 * src/closure.c (print_firsts, print_fderives): Likewise.
7714 * src/gram.c (grammar_dump): Likewise.
7715 * src/lalr.c (look_ahead_tokens_print): Likewise.
7716 * src/output.c (escaped_output): Likewise.
7717 (user_actions_output): Coalesce two printfs.
2f4f028d 7718 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
7719 * src/reduce.c (reduce_print): Likewise.
7720 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 7721 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 7722
edb8f44f
PE
7723 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7724 this confuses xgettext.
7725
b50d2359
AD
77262005-10-02 Akim Demaille <akim@epita.fr>
7727
7728 * bootstrap (gnulib_modules): Add strverscmp.
7729 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7730 * m4/.cvsignore: Add strverscmp.m4.
7731 * src/parse-gram.y (%require): New token, new rule.
7732 (version_check): New.
7733 * src/scan-gram.l (%require): Adjust.
7734 * tests/input.at (AT_REQUIRE): New.
7735 Use it.
7736 * doc/bison.texinfo (Require Decl): New.
7737 (Calc++ Parser): Use %require.
7738
21667f64
AD
77392005-10-02 Akim Demaille <akim@epita.fr>
7740
7741 * data/location.cc: New.
7742
2b81e969
AD
77432005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7744 Akim Demaille <akim@epita.fr>
7745
7746 Make sure -odir/foo.cc creates dir/location.hh etc.
7747 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7748 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7749 (spec_defines_file): Now const.
7750 (dir_prefix): New.
7751 (short_base_name): Remove.
7752 * src/files.c: Adjust.
7753 (dirname.h): Include.
7754 (base_name): Don't prototype it.
7755 (finput): Remove, duplicates gram_in.
7756 (full_base_name, short_base_name): Replace by...
7757 (all_but_ext, all_but_tab_ext): these.
7758 (compute_base_names): Rename as...
7759 (compute_file_name_parts): this.
7760 Update to compute the new variables, including dir_prefix.
7761 Adjust dependencies.
7762 * src/output.c (prepare): Output them.
7763 * src/reader.c: Adjust to use gram_in, not finput.
7764 * src/scan-skel.l (@dir_prefix@): New.
7765
ad6a9b97
JMG
77662005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7767
7768 * lib/subpipe.c: New function end_of_output_subpipe() added
7769 to allow support for non-posix systems. This is a no-op function
7770 for posix systems.
7771
7772 * lib/subpipe.h: New function end_of_output_subpipe() added
7773 to allow support for non-posix systems. This is a no-op function
7774 for posix systems.
7775
7776 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7777 handle the lack of pipe/fork functionality on non-posix systems.
7778
7779 * djgpp/Makefile.maint: DJGPP specific file.
7780
7781 * djgpp/README.in: DJGPP specific file.
7782
7783 * djgpp/config.bat: DJGPP specific configuration file.
7784
7785 * djgpp/config.sed: DJGPP specific configuration file.
7786
7787 * djgpp/config.site: DJGPP specific configuration file.
7788
7789 * djgpp/config_h.sed: DJGPP specific configuration file.
7790
7791 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7792
7793 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7794
fc695704
AD
77952005-10-02 Akim Demaille <akim@epita.fr>
7796
7797 * data/location.cc: New, extract from...
7798 * data/lalr1.cc: here.
7799 (location.hh): Include it after the user prologue, in case the
7800 filename type is defined by the user.
7801 Forward declation location and position before the pre-prologue.
7802 (yyresult_): Rename as...
7803 (yyresult): this, it's a local variable, not an attribute.
7804 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7805
78062005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
7807
7808 * examples/extexi: Restore the #line generation.
7809
fb9712a9
AD
78102005-09-30 Akim Demaille <akim@epita.fr>,
7811 Alexandre Duret-Lutz <adl@gnu.org>
7812
7813 Move the token type and YYSTYPE in the parser class.
7814 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7815 (parser::token): New, from the moved free definition of tokens.
7816 (parser::semantic_value): Now a full definition instead of an
7817 indirection to YYSTYPE.
7818 (b4_post_prologue): No longer included in the header file, but
7819 in the implementation file.
7820 * doc/bison.texi (C+ Language Interface): Update.
7821 * src/parse-gram.y: Support unary %define.
7822 * tests/actions.at: Define global_tokens_and_yystype for backward
7823 compatibility until we update the tests.
7824 * tests/calc.at: Idem.
7825 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7826 to simplify the code.
7827
55f0c7b1
PE
78282005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7829
7830 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7831 Ah, the good old days! Problem reported by Peter Klein.
7832 * bootstrap (gnulib_modules): Add strerror, strtoul.
7833 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7834 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7835
fb9712a9 78362005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
7837
7838 * data/c.m4 (b4_error_verbose_if): New.
7839 * data/lalr1.cc: Use it.
7840 (YYERROR_VERBOSE_IF): Remove.
7841 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7842 parser members, replaced by...
7843 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7844 local variables.
7845 (yysyntax_error_): Takes the state number as argument.
7846 (yyreduce_print_): Use the argument yyrule, not the former
7847 attribute yyn_.
7848
8a6f72f3
PE
78492005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7850
7851 * bootstrap (gnulib_modules): Add verify.
7852 * lib/.cvsignore: Add verify.h.
7853 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7854 * src/system.h (verify): Remove.
7855 Include verify.h instead.
7856 * src/tables.c (tables_generate): Use new API for 'verify'.
7857
0d50976f
PE
78582005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7859
ebc3737e
PE
7860 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7861 local variables whose names begin with 'yy'.
7862 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7863 Trivial changes from Joel E. Denny.
7864
0d50976f
PE
7865 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7866 it itself.
7867 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7868 don't use alloca any more.
7869
7870 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7871 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 7872 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
7873 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7874 to match yacc.c, to test more hosts.
7875
a05b79df
PE
78762005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7877
55289366
PE
7878 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7879 doesn't affect behavior.
7880 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7881 Solaris, AIX, MSC.
7882 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7883 This works a bit better with glibc, if user code has already included
7884 stdlib.h.
7885 * doc/bison.texinfo (Bison Parser): Document that users can't
7886 arbitrarily use malloc and free for other purposes. Document
7887 that <alloca.h> and <malloc.h> might be included.
7888 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7889 user must declare alloca.
7890
a05b79df
PE
7891 * HACKING (release): Forwarn the Translation Project about
7892 stable releses.
7893
3ab2ca22
AD
78942005-09-20 Akim Demaille <akim@epita.fr>
7895
7896 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7897
a9739e7c
PE
78982005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7899
a702593e
PE
7900 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
7901 (YYSTACK_ALLOC_MAXIMUM): Use it.
7902 (yysyntax_error): New function.
7903 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
7904 multiple syntax errors are reported, and alloca is being used.
7905 Instead, reallocate buffers twice as big each time, so that
7906 we waste at most half the allocated memory. Start with a small
7907 (128-byte) buffer that will suffice in most cases anyway.
7908 Use yysyntax_error to do most of the work.
7909
7910 * doc/bison.texinfo (Error Reporting, Table of Symbols):
7911 yynerrs is the number of errors reported, not the number of
7912 errors encountered.
7913
a9739e7c
PE
7914 * tests/glr-regression.at (Duplicated user destructor for lookahead):
7915 Mark it as expected to fail.
7916 Cast result of malloc; problem reported by twlevo@xs4all.nl.
7917 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
7918 Don't start user-code symbols with "yy", to avoid name space problems.
7919
f479c6c6
AD
79202005-09-19 Akim Demaille <akim@epita.fr>
7921
7922 Remove the traits, failed experiment.
7923 It never proved useful, and anyway because of the current
7924 definition, it was not possible to have several specialization of
7925 this traits, making it useless.
7926 * data/lalr1.cc (yy:traits): Remove.
7927 Inline its definitions in the parser class.
7928
e2586f82
AD
79292005-09-19 Akim Demaille <akim@epita.fr>
7930
7931 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
7932 least Mac OSX with a /usr/local install of gettext.
7933
2e8cf949
AD
79342005-09-19 Akim Demaille <akim@epita.fr>
7935
7936 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
7937 and yytoken for similarity with the other skeletons.
7938
c7fb0b90
AD
79392005-09-19 Akim Demaille <akim@epita.fr>
7940
4e26c69e 7941 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 7942
1bd0deda
PE
79432005-09-16 Paul Eggert <eggert@cs.ucla.edu>
7944
7945 * NEWS: Version 2.1.
7946
7947 * NEWS: Remove notice of yytname change, since it was never in an
7948 official release.
7949 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
7950 diagnostic.
7951 * src/output.c (prepare): Likewise.
7952 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
7953 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
7954 is not defined. This is an awful hack, but it's enough for now.
7955 All callers changed.
7956 * tests/glr-regression-at (make_value): Args are const pointers now,
7957 to avoid GCC warning.
7958 (Duplicated user destructor for lookahead): New test. Currently
7959 skipped. It fails on my host but I'm not sure it'll always fail.
7960
79612005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
7962
7963 * src/symtab.h (struct symbol): Declare the printer and destructor
7964 as const, to avoid accidental calls to free.
7965 (symbol_destructor_set, symbol_printer_set): Adjust.
7966 * src/symtab.c: Adjust.
7967
1bd0deda 79682005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
7969
7970 * data/c.m4 (b4_token_enums): New.
7971 (b4_token_defines): Rename as...
7972 (b4_token_enums_defines): this.
7973 (b4_token_defines): New, output only the #defines.
7974 * data/yacc.c, data/glr.c: Adjust.
7975 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
7976 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
7977 as default values.
7978
dbcdae2d
AD
79792005-09-16 Akim Demaille <akim@epita.fr>
7980
7981 * data/lalr1.cc (yylex_): Remove, inline its code.
7982 (yyreport_syntax_error_): Remove, replaced by...
7983 (yysyntax_error_): this which returns a string and leaves to the
7984 caller the call to the users' error function.
7985 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
7986 Move from members of the parser object...
7987 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
7988 to local variables of the parse function.
7989
70d8f291
AD
79902005-09-16 Akim Demaille <akim@epita.fr>
7991
7992 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
7993 since it's in Bison's name space.
7994
b47dbebe
PE
79952005-09-15 Paul Eggert <eggert@cs.ucla.edu>
7996
ae199bf1
PE
7997 * data/glr.c (yyresolveValue): Add default case to pacify
7998 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
7999
b47dbebe
PE
8000 * NEWS: Document when yyparse started to return 2.
8001 * doc/bison.texinfo (Parser Function): Document when yyparse
8002 returns 2.
8003
8004 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8005 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8006 changed.
8007 (class position): file_name -> filename (reverting). All uses changed.
8008
80092005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8010
8011 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8012 do anything if $@ exists. This reverts part of the 2005-07-07
8013 patch.
8014
00292f66
PE
80152005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8016
8017 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8018 contains obsolete information and isn't worth distributing as a
8019 separate file anyway.
8020 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8021 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8022 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8023 (yyparse): Abort if user code uses longjmp to throw an unexpected
8024 value.
8025
a420f962
PE
80262005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8027
00292f66
PE
8028 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8029 Suggested by twlevo@xs4all.nl.
8030
127287e9
PE
8031 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8032 This avoids a diagnostic from gcc -Wswitch-enum.
8033 Problem reported by twlevo@xs4all.nl.
8034
a420f962
PE
8035 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8036 standards. Use "file name" or "file" or "name", depending on
8037 the context.
8038 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8039 not to hack/foo.tab.c.
8040 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
8041 * data/glr.c: b4_filename -> b4_file_name.
8042 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8043 All uses changed.
8044 (class position): filename -> file_name. All uses changed.
8045 * data/yacc.c: b4_filename -> b4_file_name.
8046 * lib/bitset.h: filename -> file_name in local vars.
8047 * lib/bitset_stats.c: Likewise.
8048 * src/files.c: Likewise.
8049 * src/scan-skel.l ("@output ".*\n): Likewise.
8050 * src/files.c (file_name_split): Renamed from filename_split.
8051 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
8052
80532005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8054
8055 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8056 to accommodate latest gnulib.
8057
8058 * tests/glr-regression.at (Duplicate representation of merged trees):
8059 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8060
8061 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8062 needed.
8063
42a6501d
PE
80642005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8065
8066 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8067 All uses changed. Invoke user destructor after an error during a
8068 split parse (trivial change from Joel E. Denny).
8069
8070 * tests/glr-regression.at
8071 (User destructor after an error during a split parse): New test case.
8072 Problem reported by Joel E. Denny in:
8073 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8074
ef9a1faf
PE
80752005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8076
5b4aaf78
PE
8077 * README-cvs: Give URLs for recommended tools.
8078 Mention Gzip version problem, and bootstrapping issues.
8079 Remove troubleshooting section, as it's somewhat obsolete.
8080
b5240ba5
PE
8081 * bootstrap (no_cache): New var, to accommodate different wget
8082 variants. Use it instead of '-C off'. Problem reported by
8083 twlevo@xs4all.nl.
8084
ef9a1faf
PE
8085 * data/glr.c (yydestroyStackItem): New function.
8086 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8087 debugging information. Problem reported by Joel E. Denny.
8088
e6efa9da
AD
80892005-08-25 Akim Demaille <akim@epita.fr>
8090
8091 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8092
adc90f13
PE
80932005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8094
8095 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8096 Don't invoke destructor on unresolved entries.
8097 * tests/glr-regression.at
8098 (User destructor for unresolved GLR semantic value): New test case.
8099 Problem reported by Joel E. Denny in:
8100 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8101
f9315de5
PE
81022005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8103
15d29c1f
PE
8104 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8105 Add strnlen.c.
8106 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8107 lib-prefix.m4, po.m4.
8108
dd5f2af2
PE
8109 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8110 in yydestruct diagnostic, since it might not be an error.
8111 Problem reported by Joel Denny near end of
8112 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 8113 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
8114 * data/yacc.c (yyreturn): Likewise.
8115 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8116
8117 * src/files.c: Remove obsolete FIXME comment.
8118
8119 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8120 with the other templates, and to fix bogus run-on messages such
8121 as the one reported at the end of
8122 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8123 All callers changed to avoid the newline.
8124 (yyprocessOneStack): Output two lines rather than one, to accommodate
8125 the above change. This changes the debug output format slightly.
8126
f9315de5
PE
8127 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8128 reported by Joel E. Denny in
8129 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8130 (trivial change).
8131 * tests/glr-regression.at (Duplicate representation of merged trees):
8132 New test, from Joel E. Denny in:
8133 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8134 * THANKS: Add Joel E. Denny.
8135
8136 * configure.ac (AC_INIT): Bump to 2.0c.
8137
04098407
PE
81382005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8139
8140 * NEWS: Version 2.0b.
8141
ca5d2013
PE
8142 * Makefile.am (SUBDIRS): Put examples before tests, so that
8143 "make check" doesn't finish with "All 1 tests passed".
8144
3d54b576
PE
8145 * tests/regression.at (Token definitions): Don't rely on
8146 AT_PARSER_CHECK for data that contains backslashes. It currently
8147 uses 'echo', and 'echo' isn't portable if its argument contains
8148 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8149 that the byte '\0xff' is not printable in the C locale; it is,
8150 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8151 not printable, so use '\0x81' to test.
8152
d53ae497
PE
8153 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8154 version of GCC, since the macro is used with non-GCC compilers.
8155
fc01665e
PE
8156 Fix core dump reported by Pablo De Napoli in
8157 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8158 * tests/regression.at (Invalid inputs with {}): New test.
8159 * src/parse-gram.y (token_name): Translate type before using
8160 it as an index.
8161
04098407
PE
8162 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8163 the user's name space. All uses changed to __attribute__
8164 ((__unused__)).
8165 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8166 Add __attribute__ ((__noreturn__)).
8167
8168 * etc/clcommit: Remove. We weren't using it, and it failed
8169 "make maintainer-distcheck".
8170 * Makefile.maint: Merge from coreutils.
8171 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8172 (syntax-check-rules): Change list of rules as described below.
8173 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8174 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8175 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8176 (sc_trailing_space): New rules.
8177 (sc_xalloc_h_in_src): Remove.
8178 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8179 (sc_space_tab, sc_error_exit_success, sc_changelog):
8180 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8181 (makefile-check, po-check, author_mark_check):
8182 (makefile_path_separator_check, copyright-check):
8183 Use grep -n, to make it easier to find violations.
8184 Use CVS_LIST and CVS_LIST_EXCEPT.
8185 (header_regexp, h_re): Remove.
8186 (dd_c): New macro.
8187 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8188 (my-distcheck): Use more-modern GCC flags.
8189 (signatures, %.asc): Remove.
8190 (rel-files, announcement): Remove signatures.
8191 Restore old updating code, even though we don't use it, so
8192 that we're the same as coreutils.
8193 (alpha, beta, major): Depend on news-date-check.
8194 Make the upload commands.
8195
8196 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8197 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8198 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8199 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8200 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8201 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8202 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8203 * tests/sets.at: Likewise.
8204
8205 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8206 we comment out the Autoconf version number.
8207 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8208 it's error-prone and "make maintainer-distcheck" rejects it.
8209
8210 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8211 Indent calls to "error" to pacify "make maintainer-distcheck",
8212 when the calls are not intended to be translated.
8213 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8214
8215 * src/Makefile.am (DEFS): Use +=, to pacify
8216 "make maintainer-distcheck".
8217 (bison_SOURCES): Add scan-skel.h.
8218 (sc_tight_scope): New rule, from coreutils.
8219
8220 * src/files.c (src_extension, header_extension):
8221 Now static, not extern.
8222 * src/getargs.c (short_options): Likewise.
8223 * src/muscle_tab.c (muscle_table): Likewise.
8224 * src/parse-gram.y (current_class, current_type, current_prec):
8225 Likewise.
8226 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8227 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8228 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8229 void, to avoid warning when NLS is disabled.
8230 * src/output.c: Include scan-skel.h.
8231 (scan_skel): Remove decl, since scan-skel.h does this.
8232 (output_skeleton):
8233 Indent calls to "error" to pacify "make maintainer-distcheck".
8234 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8235 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8236 "make maintainer-distcheck".
8237 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8238 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8239 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8240 (skel_lex_destroy, scan_skel): Move these decls to...
8241 * src/scan-skel.h: New file.
8242 * src/uniqstr.c (uniqstr_assert):
8243 Indent calls to "error" to pacify "make maintainer-distcheck".
8244
8245 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8246 not @VAR@.
8247
8248 * tests/torture.at: Revamp to avoid misuse of atoi that
8249 "make maintainer-distcheck" complained about.
8250
8251 * examples/extexi (message): Don't print a message more than once,
8252 and omit line-number decoration that makes Emacs compile think
8253 that informative messages are worth worrying about.
8254
82552005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8256
8257 * configure.ac: Update version number.
8258
8259 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8260 accidentally.
8261 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8262 autogenerated by the maintainer.
8263 * examples/calc++/.cvsignore: Add *.yy.
8264
8265 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8266 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8267 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8268
8269 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8270
8271 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8272 from maintainer-distcheck about casting the argument of 'free'.
8273
8274 * NEWS: Mention recent yytname changes.
8275 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8276
8277 * bootstrap: For translations that have not yet been upgraded to
8278 the new runtime-po domain, prime the pump by extracting the
8279 relevant strings from the obsolete translations. This code can be
8280 removed once the bison-runtime domain has been translated by each
8281 team.
8282
8283 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8284 now that token names are already quoted.
8285
8286 Fix problem reported by Anthony Heading.
8287 * data/glr.c (YYTOKEN_TABLE): New macro.
8288 (yytname): Define if YYTOKEN_TABLE.
8289 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8290 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8291 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8292 * src/output.c (prepare_symbols): Output token_table_flag.
8293
0ffda363
PE
82942005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8295
8296 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8297 again if the first call fails.
8298
8299 * data/glr.c (yytnamerr): New function.
8300 (yyreportSyntaxError): Use it to dequote most string literals.
8301 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8302 with other skeletons. All uses changed.
8303 (yytnameerr_): New function.
8304 (yyreport_syntax_error): Use it to dequote most string literals.
8305 * data/yacc.c (yytnamerr): New function.
8306 (yyerrlab): Use it to decode most string literals.
8307 * doc/bison.texinfo (Decl Summary, Calling Convention):
8308 Clarify quoting convention of yytname.
8309 * src/output.c (prepare_symbols): Quote all names. This undoes
8310 the 2005-04-17 change, which is now accomplished (mostly) via
8311 changes in the parsers as described above.
8312 * tests/regression.at (Token definitions, Web2c Actions):
8313 Undo most 2005-04-17 change here, too.
8314
83152005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8316
8317 Fix more problems reported by twlevo@xs4all.nl.
8318 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8319 remove trailing spaces. This loses the exit status of ./types,
8320 and isn't needed since ./types shouldn't be emitting trailing
8321 spaces.
8322 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8323 as the stack isn't valid in that case.
8324
8325 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8326 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8327 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8328 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8329 is used.
8330 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8331 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8332 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8333 Likewise.
8334
8335 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8336 overly-picky compilers that reject 'char *foo = "bar";'.
8337
8338 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8339 to FILE * parameter, not to stderr. This fixes a typo introduced
8340 in the 2005-07-12 change.
8341
8342 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8343 warnings from GCC 4.
8344
8345 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8346 (yyglrShiftDefer, yysplitStack):
8347 Remove unused parameters b4_pure_formals. All uses changed.
8348 (yyglrShift): Remove unused parameters b4_user_formals.
8349 All uses changed.
8350 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8351
6100a9aa
PE
83522005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8353
258b75ca
PE
8354 Destructor cleanups and regularization among the three skeletons.
8355 * NEWS: Document the behavior changes.
8356 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8357 stack before failing, as the cleanup code will do it for us now.
8358 * data/lalr1.cc (yyerrlab): Likewise.
8359 * data/glr.c (yyparse): Pop everything off the stack before
8360 freeing it, so that destructors get called properly.
8361 * data/lalr1.cc (yyreturn): Likewise.
8362 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8363 This is more consistent.
8364 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8365 why destructors might be called. 1.875 -> 2.1.
8366 (Destructor Decl, Decl Summary, Table of Symbols):
8367 Some English-language cleanups for %destructor.
8368 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8369 Add output line for destructor of start symbol.
8370 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8371 because of that same extra output line.
8372
1a059451
PE
8373 * NEWS: Document minor wording changes in diagnostics of
8374 Bison-generated parsers.
8375 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8376 Remove unused formals. All uses changed.
8377 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8378 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8379 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8380 Rename yyoverflowab to yyexhaustedlab.
8381 When memory exhaustion occurs during syntax-error reporting,
8382 report it separately rather than in a single diagnostic; this
8383 eases translation.
8384 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8385 (Memory Exhausted): Renamed from Parser Stack Overflow.
8386 Revamp wording slightly to prefer "memory exhaustion".
8387 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8388
97460c78
PE
8389 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8390
30757c8c
PE
8391 Add i18n support to the GLR skeleton. Partially fix the C++
8392 skeleton; a C++ expert needs to finish this. Remove debugging
8393 msgids; there's little point to having them translated, since they
8394 can be understood only by someone who can read the
8395 (English-language) source code.
8396
8397 Generate runtime-po/bison-runtime.pot automatically, so that we
8398 don't have to worry about garbage getting in that file. We'll
8399 make sure after the next official release that old msgids don't
8400 get lost. See
8401 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8402
8403 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8404 Now auto-generated.
8405 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8406 Fix typos in explanations of the runtime file.
8407 * bootstrap: Change gettext keyword from YYI18N to YY_.
8408 Use standard Makefile.in.in in runtime-po, since we'll arrange
8409 for backward-compatible bison-runtime.po files in a different way.
8410 * data/glr.c (YY_): New macro, from yacc.c.
8411 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8412 Translate messages intended for users.
8413 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8414 the wording in the other skeletons. We don't know that the memory
8415 is virtual.
8416 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8417 Use same method that yacc.c uses.
8418 Don't translate debugging messages.
8419 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8420 it doesn't work (yet), and requires C++ expertise to fix.
8421 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8422 Move defn to a more logical place, to be consistent with other
8423 skeletons.
8424 Don't translate debugging messages.
8425 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8426 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8427 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8428 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8429
ac8c5689
PE
8430 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8431 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8432 void, not int.
8433 * tests/glr-regression.at (Badly Collapsed GLR States):
8434 Likewise.
8435 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8436 yylex should return 0 at EOF rather than aborting.
8437
6100a9aa
PE
8438 Improve tests for stack overflow in GLR parser.
8439 Problem reported by twlevo@xs4all.nl.
8440 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8441 All uses removed.
8442 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8443 can handle the problem.
8444 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8445 (yyparse): New local variable yyresult to record the result.
8446 Use result of setjmp to set it, rather than storing itinto
8447 struct.
8448 (yyDone): Remove label.
8449 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8450 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8451 if YYABORT is used).
8452 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8453 yyparse status; put status > 1 into diagnostic.
8454 Check that status==2 works.
8455 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8456 Use exit status 3 for failure to open (which shouldn't happen).
8457
15f40952
PE
84582005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8459
67fd79c4
PE
8460 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8461 1 on syntax error; just let yyparse do its thing.
8462 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8463 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8464 (Exploding the Stack Size with Alloca):
8465 (Exploding the Stack Size with Malloc):
8466 Expect exit status 2, not 1, since the parser is supposed to blow
8467 its stack. Problem reported by twlevo@xs4all.nl.
8468
15f40952
PE
8469 * data/glr.c (yyparse): Don't assume that the initial calls
8470 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8471 Print a stack-overflow message and fail instead.
8472 Initialize the line-number information before creating the stack,
8473 so that the stack-overflow message can report line zero safely.
8474
f32c66b5
PE
84752005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8476
a22ff96f 8477 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
8478 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8479 (yyuserMerge): Provide a default case if b4_mergers is empty.
8480 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8481 * tests/glr-regression.at
8482 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 8483 Add casts to pacify C++ compilers.
1beb0b24
PE
8484 * tests/glr-regression.at (Improper merging of GLR delayed action
8485 sets): Declare yylex before using it.
f32c66b5 8486 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
8487 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8488 test for valgrind; valgrind is independent of g++.
8489 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8490 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8491 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8492 Use a destructor, so that we can expand the stack. Change
8493 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 8494
d741bd1b
PE
84952005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8496
8497 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8498 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8499
0410a6e0
PE
85002005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8501
8502 * PACKAGING: New file, suggested by Bruno Haible and taken from
8503 similar wording in gettext's PACKAGING file.
8504 * NEWS: Mention PACKAGING.
8505 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8506
f7ab6a50
PE
85072005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8508
baf785db 8509 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
8510 * bootstrap: Get runtime translations into runtime-po.
8511 Create runtime-po files automatically, if possible.
8512 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8513 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8514 does not infringe on the user's name space.
8515 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8516 * doc/bison.texinfo (Internationalization): Revamp the English
8517 and Texinfo syntax a bit, to try to make it clearer.
8518 (Bison Options, Option Cross Key): Mention --print-localedir.
8519 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8520 YYENABLE_NLS. Quote a bit more.
8521 * runtime-po/.cvsignore: New file.
8522 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8523 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8524 * runtime-po/quot.sed: Likewise.
8525 * runtime-po/boldquot.sed: Likewise.
8526 * runtime-po/en@quot.header: Likewise.
8527 * runtime-po/en@boldquot.header: Likewise.
8528 * runtime-po/insert-header.sin: Likewise.
8529 * runtime-po/remove-potcdate.sin: Likewise.
8530 * runtime-po/Makevars: Likewise.
8531 * runtime-po/LINGUAS: Likewise.
8532 * runtime-po/de.po: Likewise; we will rely on the translation project
8533 to maintain this, so "bootstrap" should get it.
0410a6e0 8534 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
8535 its value.
8536 * src/main.c (main): Bind the bison-runtime domain, too.
8537
85382005-07-12 Bruno Haible <bruno@clisp.org>
8539
8540 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8541 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8542 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8543 * runtime-po: New directory.
8544 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8545 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8546 * runtime-po/Rules-quot: New file, copied from po/.
8547 * runtime-po/quot.sed: Likewise.
8548 * runtime-po/boldquot.sed: Likewise.
8549 * runtime-po/en@quot.header: Likewise.
8550 * runtime-po/en@boldquot.header: Likewise.
8551 * runtime-po/insert-header.sin: Likewise.
8552 * runtime-po/remove-potcdate.sin: Likewise.
8553 * runtime-po/Makevars: New file.
8554 * runtime-po/POTFILES.in: New file.
8555 * runtime-po/LINGUAS: New file.
8556 * runtime-po/bison-runtime.pot: New file.
8557 * runtime-po/de.po: New file.
8558 * m4/bison.m4: New file.
8559 * Makefile.am (SUBDIRS): Add runtime-po.
8560 (aclocaldir, aclocal_DATA): New variables.
8561 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8562 Define aclocaldir.
8563 * src/getargs.c (usage): Document --print-localedir option.
8564 (PRINT_LOCALEDIR_OPTION): New enum item.
8565 (long_options): Add --print-localedir option.
8566 (getargs): Handle --print-localedir option.
8567 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8568 (Internationalization): New section.
8569
22dda0f0
AD
85702005-07-12 Akim Demaille <akim@epita.fr>
8571
8572 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8573 for consistency with the rest of the code.
8574 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8575 Add separators.
8576
82b248ad
AD
85772005-07-12 Akim Demaille <akim@epita.fr>
8578
8579 * src/parse-gram.y: Use %printer instead of YYPRINT.
8580
fa0e9314
AD
85812005-07-12 Akim Demaille <akim@epita.fr>
8582
867a3e00
AD
8583 * src/symtab.h, src/symtab.c (symbol_print): New.
8584 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8585 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8586
85872005-07-12 Akim Demaille <akim@epita.fr>
8588
8589 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
8590 b4_at_dollar and b4_dollar_dollar.
8591
e054b190
PE
85922005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8593
8594 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8595 and Pennello's paper.
8596
34160ec4
PE
85972005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8598
407d4a75
PE
8599 * data/yacc.c (yyparse): Undo previous patch. Instead,
8600 set yylsp[0] and yyvsp[0] only if the initial action
8601 sets yylloc and yylval, respectively.
8602
34160ec4
PE
8603 * data/yacc.c (yyparse): In the initial action, set
8604 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8605 This avoids the use of undefined variables if the initial
8606 action does not set yylloc and/or yylval.
8607
c3d5a4a7
PE
86082005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8609
b34d96c1
PE
8610 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8611 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8612 Remove from CVS. These files are automatically generated.
8613 * examples/extexi: Clarify that this file is now part of Bison,
8614 not GNU M4, and that it works with any POSIX-compatible Awk.
8615 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8616 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8617 so that we also get calc++-parser.yy. Geneate it.
8618 Use $(AWK), not gawk, since any conforming Awk will do.
8619 Put comment before action, since older 'make' can't handle comment
8620 in action.
8621 $(BUILT_SOURCES): List all built sources, not just some of them.
8622 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8623 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8624 $($(calc_sources_generated)): Remove unnecessary test for existence
8625 of target. (This had a shell syntax error anyway; a stray "x".)
8626 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8627 calc++-parser.yy.
8628 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8629
c3d5a4a7
PE
8630 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8631 implied by the other modules.
8632
828c373b
AD
86332005-07-06 Akim Demaille <akim@epita.fr>
8634
8635 Bind examples/calc++ to the package.
8636 * examples/calc++/Makefile: Remove, replaced by...
8637 * examples/calc++/Makefile.am: ... this new file.
8638 * examples/calc++/test: Remove input.
8639 * examples/calc++/compile: Remove.
8640 * examples/Makefile.am: New.
8641 * configure.ac, Makefile.am: Adjust.
8642 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8643
63cb01d6
PE
86442005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8645
fd2df2ed
PE
8646 * data/glr.c (yyFail): Drastically simplify; since the format argument
8647 never had any % directives, we can simply pass it to yyerror.
8648 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8649 be modified later, as that is the usual style in glr.c.
8650 Problems reported by Paul Hilfinger.
8651
63cb01d6
PE
8652 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8653 and size overflow errors.
8654 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8655 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8656 (YYSIZEMAX): New macro.
8657 (yystpcpy): New function, taken from yacc.c.
8658 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8659 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8660 so that we don't have to maintain their signatures.
8661 (yyFail): Check for buffer overflow, by using vsnprintf rather
8662 than vsprintf. Allocate a bigger buffer if possible.
8663 Report an error if buffer allocation fails.
8664 (yyStackOverflow): New function.
8665 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8666 the initialization was successful. It might fail if storage was
8667 exhausted.
8668 (yyexpandGLRStack): Add more checks for storage allocation failure.
8669 Use yyStackOverflow to report failures.
8670 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8671 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8672 Don't assume stack number fits in int.
8673 (yysplitStack): Check for storage allocation failure.
8674 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8675 can print diagnostics on storage allocation failure. All callers
8676 changed.
8677 (yyresolveValue): Use yybool for boolean.
8678 (yyreportSyntaxError): Check for size-calculation overflow.
8679 This code is taken from yacc.c.
8680 (yyparse): Check for storage allocation errors when allocating
8681 the initial stack.
8682
1c59e0a1
AD
86832005-07-05 Akim Demaille <akim@epita.fr>
8684
8685 Extract calc++ from the documentation.
8686 * doc/bison.texinfo (Calc++): Add the extraction marks.
8687 * examples/extexi: New, from the aborted GNU Programming 2E.
8688 Separate the different paragraph of a file with empty lines.
8689 * examples/Makefile: Use it to extract the whole calc++ example.
8690
8a0adb01
AD
86912005-06-24 Akim Demaille <akim@epita.fr>
8692
8693 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8694 class typedefs.
8695
12545799
AD
86962005-06-22 Akim Demaille <akim@epita.fr>
8697
8698 * doc/bison.texinfo (C++ Language Interface): First stab.
8699 (C++ Parsers): Remove.
8700
99be0235
AD
87012005-06-22 Akim Demaille <akim@epita.fr>
8702
8703 * data/lalr1.cc (yylex_): Honor %lex-param.
8704
0ffd4fd1
AD
87052005-06-22 Akim Demaille <akim@epita.fr>
8706
8707 Start a set of simple examples.
8708 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8709 * examples/calc++/calc++-driver.hh,
8710 * examples/calc++/calc++-parser.yy,
8711 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8712 * examples/calc++/compile, examples/calc++/test: New.
8713
0925ebb4
PE
87142005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8715
8716 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8717 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8718 which stems from the 2005-05-27 patch.
8719
43d3b664
PH
87202005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8721
8722 * data/glr.c: Modify treatment of unused parameters to permit use
8723 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8724
3062864d
PE
87252005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8726
8727 Fix infringement on user name space reported by Janos Zoltan Szabo.
8728 * data/yacc.c (yyparse): strlen -> yystrlen.
8729
989b5b8e
AD
87302005-05-30 Akim Demaille <akim@epita.fr>
8731
8732 * data/lalr1.cc (_): New.
8733 Translate the various messages.
8734
bedf57f5
PE
87352005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8736
8737 Fix infringement on user name space reported by Bruno Haible.
8738 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8739 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8740 the user's name space.
8741 (alloca): Include <stdlib.h> to get it, if it's not built in.
8742 (YYMALLOC, YYFREE): Define only if needed.
8743 (malloc, free): Declare, but only if needed, as this infringes on
8744 the user name space.
8745
4d1801f1
PE
87462005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8747
8748 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8749 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8750 with %d format.
8751 * lib/ebitset.c (min, max): Undef before defining.
8752 * lib/vbitset.c (min, max): Likewise.
8753 * lib/subpipe.c (create_subpipe): Save local variables in case
8754 vfork clobbers them.
8755
87562005-05-24 Bruno Haible <bruno@clisp.org>
8757
8758 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8759 error message syntax used by gcc-4.0.
8760
b94a9e1e
PE
87612005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8762
85ac3861
PE
8763 * README: Mention m4 1.4.3. Remove obsolete advice about
8764 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8765
b94a9e1e
PE
8766 * bootstrap: Remove workaround for problem I encountered with
8767 gettext 0.14.1; it seems to be fixed now.
8768
51c30d21
PE
87692005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8770
009ce67d
PE
8771 * NEWS: Version 2.0a.
8772
f2a97c62
PE
8773 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8774 the previous change.
8775
c8775f93
PE
8776 Various maintainer cleanups.
8777 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8778 conftest*, for benefit of CVS commands run at the same time as
8779 "configure". Add build-aux, since "bootstrap" now creates it and
8780 its subfiles.
8781 * Makefile.cfg (move_if_change): Remove.
8782 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8783 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8784 (po_repo, do-po-update, po-update, wget_files, get-targets):
8785 (config.guess-url_prefix, config.sub-url_prefix):
8786 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8787 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8788 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8789 Remove.
8790 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8791 this is now the recommended name.
8792 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8793 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8794 ylwrap. These files now go into build-aux.
8795 * config/move-if-change: Remove.
8796 * config/prev-version.txt: Bump from 1.75 to 2.0.
8797
3ea5f0ec
PE
8798 * bootstrap: Add stdio-safer, unistd-safer modules.
8799 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8800 we don't need it).
8801 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8802 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8803 * lib/subpipe.c: Include "unistd-safer.h".
8804 (create_subpipe): Make sure all the newly-created
8805 file descriptors are > 2, so that diagnostics don't
8806 get sent down them (which might cause Bison to hang, in theory).
8807 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8808 * src/files.c (xfopen): Use fopen_safer, not fopen.
8809
51c30d21
PE
8810 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8811 yesterday's yacc.c fix.
8812
cea1469d
PE
88132005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8814
3ea5f0ec
PE
8815 * data/glr.c, data/lalr1.cc: Update copyright date.
8816
cea1469d
PE
8817 Fix a destructor bug reported by Wolfgang Spraul in
8818 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8819 * data/yacc.c (yyabortlab): Don't call destructor, and
8820 don't set yychar to EMPTY.
8821 (yyoverflowlab): Don't call destructor.
8822 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8823 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8824 since we no longer output the message "discarding lookahead token
8825 end of input ()".
8826
5e6f62f2
PH
88272005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8828
8829 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8830 fix a small glitch in debugging output.
8831 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8832 after YY_SYMBOL_PRINT where needed.
8833
8834 (struct yyGLRState): Add some comments.
8835 (struct yySemanticOption): Add some comments.
8836 (union yyGLRStackItem): Add comment.
8837
8838 (yymergeOptionSets): Correct this to properly perform the union,
8839 avoiding infinite reported by Michael Rosien.
8840 Update comment.
8841
8842 * tests/glr-regression.at: Add test for GLR merging error reported
8843 by M. Rosien.
cea1469d 8844
0fb669f9
PE
88452005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8846
8847 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8848 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8849 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8850 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8851 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8852 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8853 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8854 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8855 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8856 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8857 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8858 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8859 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8860 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8861 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8862 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8863 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8864 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8865 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8866 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8867 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8868 src/output.h, src/parse-gram.c, src/parse-gram.h,
8869 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8870 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8871 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8872 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8873 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8874 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8875 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8876 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8877 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8878 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8879 tests/reduce.at, tests/regression.at, tests/sets.at,
8880 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8881 Update FSF postal mail address.
8882
51f4735e
PE
88832005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8884
8885 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8886 Problem reported by Ralf Menzel.
8887
80ce3401
PE
88882005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8889
8890 * tests/actions.at: Test that stack overflow invokes destructors.
8891 From Marcus Holland-Moritz.
8892 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8893 from here....
8894 (yyreturn): to here. That way, destructors are called properly
8895 even if the stack overflows, or the user calls YYACCEPT or
8896 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8897 (yyoverflowlab): Destroy the lookahead.
8898
88992005-04-24 Paul Eggert <eggert@cs.ucla.edu>
8900
8901 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
8902
72f000b0
PE
89032005-04-17 Paul Eggert <eggert@cs.ucla.edu>
8904
8905 * NEWS: Bison-generated C parsers no longer quote literal strings
8906 associated with tokens.
8907 * src/output.c (prepare_symbols): Don't escape strings,
8908 since users don't want to see C escapes.
8909 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
8910 in diagnostics.
c19683bb 8911 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
8912 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
8913
1094323f
PE
89142005-04-16 Paul Eggert <eggert@cs.ucla.edu>
8915
8916 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
8917 the data size is known to be too small and we can't increase it.
8918 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
8919
ca407bdf
PE
89202005-04-15 Paul Eggert <eggert@cs.ucla.edu>
8921
8922 * src/parse-gram.y: Include quotearg.h.
8923 (string_as_id): Quote $1 before using it as a key, since the
8924 lexer no longer quotes it for us.
8925 (string_content): Don't strip quotes, since lexer no longer
8926 quotes it for us.
8927 * src/scan-gram.l: Include quotearg.h.
8928 ("\""): Omit quote.
8929 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
8930 a key, since the rest of the lexer doesn't quote it.
8931 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
8932 * tests/regression.at (Token definitions): Check for backslashes
8933 in token strings.
8934
8935 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
8936 (YYSIZE_T): Define to unsigned long int when using an older compiler.
8937 (yyparse): Revamp code to generate long syntax error message, to
8938 make it easier to translate, and to avoid problems with arithmetic
8939 overflow. Change "virtual memory" to "memory" in diagnostic, since
8940 we don't know whether the memory is virtual.
8941
1ce59070
PE
89422005-04-13 Paul Eggert <eggert@cs.ucla.edu>
8943
8944 * NEWS: Bison-generated C parsers now use the _ macro to
8945 translate strings.
8946 * data/yacc.c (_) [!defined _]: New macro.
8947 All English strings wrapped inside this macro.
8948 * doc/bison.texinfo (Bison Parser): Document _.
8949 * po/POTFILES.in: Include src/parse-gram.c, since it now
8950 includes translateable strings that parse-gram.y doesn't.
8951
a749a695
PE
89522005-04-12 Paul Eggert <eggert@cs.ucla.edu>
8953
8954 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
8955 reverting the 2004-10-11 change to this function.
8956 (symbol_check_alias_consistency): Don't call symbol_type_set
8957 if the type name is already correct.
8958 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
8959
8fb1053b
PE
89602005-03-25 Paul Eggert <eggert@cs.ucla.edu>
8961
8962 * tests/regression.at (Token definitions): Don't use a token named
8963 c, as that generates a "#define c ..." that runs afoul of buggy
8964 stdlib.h that uses the identifier c as a member of struct
8965 drand48_data. Problem reported by Horst Wente.
8966
ff498c4a
PE
89672005-03-21 Paul Eggert <eggert@cs.ucla.edu>
8968
8969 * bootstrap: Change translation URL from
8970 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
8971 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
8972 redirection glitches. Problem reported by twlevo@xs4all.nl.
8973
65211d70
PE
89742005-03-20 Paul Eggert <eggert@cs.ucla.edu>
8975
8976 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
8977 after operands; POSIX says this isn't portable for the c99 command.
8978
9577fb1f
PE
89792005-03-18 Paul Eggert <eggert@cs.ucla.edu>
8980
8981 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
8982 immediately if a data overrun has occurred; this may help us track
8983 down what may be a spurious failure on MacOS.
8984
78b178f7
PE
89852005-03-17 Paul Eggert <eggert@cs.ucla.edu>
8986
a2599d0f
PE
8987 Respond to problems reported by twlevo@xs4all.nl.
8988
8989 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
8990
78b178f7
PE
8991 * src/vcg.h: Comment fix.
8992 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
8993 (G_CMAX): Change to -1 instead of INT_MAX.
8994
8995 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 8996
7296e729
PE
89972005-03-15 Paul Eggert <eggert@cs.ucla.edu>
8998
8999 * src/tables.c (state_number_to_vector_number): Put it inside an
9000 "#if 0", since it's not currently used. Problem reported by
9001 Roland McGrath.
9002
05ac60f3
PE
90032005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9004
9005 * src/output.c (escaped_output): Renamed from
9006 escaped_file_name_output, since we now use it for symbol tags as
9007 well. All uses changed.
9008 (symbol_destructors_output, symbol_printers_output):
9009 Escape symbol tags too.
9010 Problem reported by Matyas Forstner in
9011 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9012
9013 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9014 not needed.
9015 * src/output.c (user_actions_output, token_definitions_output,
9016 symbol_destructors_output, symbol_printers_output): Likewise.
9017 * src/reader.c (prologue_augment): Likewise.
9018 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9019
9020 * src/vcg.c (output_edge): Don't quote linestyle arg.
9021 Problem reported by twlevo@xs4all.nl.
9022
7eb453ac
PE
90232005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9024
9025 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9026 example, reported by Derek M Jones. Also, make the example even
9027 more outrageous, to better illustrate how bad the problem is.
9028
4c04c52a
PE
90292005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9030
9031 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9032 putsym. Typo reported by Sebastian Piping.
9033
a61e1620
PE
90342005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9035
9036 * doc/bison.texinfo (Language and Grammar): some -> same
9037 (Epilogue): int he -> in the
9038 Typos reported by Sebastian Piping via Justin Pence.
9039
9ec93868
PE
90402005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9041
9042 * tests/glr-regression.at (Improper handling of embedded actions
9043 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9044 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9045 with dollar signs in test names.
9046 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9047 for a similar reason.
9048
73ce7e7e
PE
90492005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9050
9051 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9052 wants to redefine G_VIEW.
9053
2e72b98e
PE
90542005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9055
9056 * src/vcg.c (get_view_str): Remove case for normal_view.
9057 Problem reported by twlevo@xs4all.nl.
9058
e0d634e5
PE
90592005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9060
ccf830a4
PE
9061 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9062 Problem reported by twlevo@xs4all.nl.
9063
e0d634e5
PE
9064 * doc/bison.texinfo: Change @dircategory from "GNU programming
9065 tools" to "Software development". Requested by Richard Stallman
9066 via Karl Berry.
9067
7bbc8cb0
PE
90682005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9069
9070 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9071 Problem reported by twlevo@xs4all.nl.
9072
08b770bc
PE
90732005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9074
9075 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9076 keyword; it's not needed with modern compilers, and it doesn't
9077 affect correctness with older compilers. Suggested by
9078 twlevo@xs4all.nl.
9079
95f22ad2
PE
90802005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9083 gcc -Wswitch-default.
9084 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9085 * data/yacc.c (yyparse): Likewise.
9086
d229d15c
PE
90872005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9088
9089 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9090 already. Let config.h define any nonstandard values.
9091
ecadd90f
PE
90922005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9093
9094 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9095 for the benefit of slower hosts. Problem reported by
9096 Nelson H. F. Beebe.
9097
213744b5
PE
90982005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9099
9100 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9101 being defined and not used.
9102 * data/lalr1.cc (yyparse): Likewise.
9103 Use "if (false)" rather than "if (0)".
9104
249d3236
PE
91052005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9106
9107 * TODO: Mention that we should allow NUL bytes in tokens.
9108
987cc1fb
PE
91092005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9110
9111 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9112 Problem reported by Hans Aberg.
9113
08fe02d9
PE
91142005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9115
9116 * src/getargs.c (version): Happy new year; update overall
9117 program copyright date from 2004 to 2005.
9118
9119 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9120 Problem reported by Hans Aberg.
9121 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9122 (Output file names.): Add a test for the case when standard output
9123 is closed.
9124
010c0266
PE
91252004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9126
9127 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9128 to fix an oversight in the Bison 2.0 manual.
9129
da12206a
PE
91302004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9131
9132 * NEWS: Version 2.0. Reformat the existing news items since
9133 1.875, so that related items are grouped together.
3a4734aa 9134 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
9135 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9136
c935d934
PE
9137 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9138 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9139 otherwise, we're not testing alloca. Unfortunately there's no
9140 simple way to consult HAVE_ALLOCA here.
9141
da12206a
PE
9142 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9143 for yymsg, too.
9144
9145 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9146 hand. This avoids a warning about comparing int to size_t when
9147 GCC warnings are enabled.
9148
0a2c5137
PE
91492004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9150
d7e14fc0
PE
9151 * NEWS: Bison-generated parsers no longer default to using the
9152 alloca function (when available) to extend the parser stack, due
9153 to widespread problems in unchecked stack-overflow detection.
9154 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9155 responsibility to set it to a positive value. This lets the user
9156 specify a value that is not a preprocessor constant.
9157 * data/yacc.c (YYMAXDEPTH): Likewise.
9158 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9159 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9160 to be a compile-time constant. However, explain the constraints on it.
9161 Also, explain the constraints on YYINITDEPTH.
9162 (Table of Symbols): Explain that alloca is no longer the default.
9163 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9164 to 1.
9165
0a2c5137
PE
9166 * doc/bison.texinfo (Location Default Action): Mention that n must
9167 be zero when k is zero. Suggested by Frank Heckenbach.
9168
e019c247
AD
91692004-12-22 Akim Demaille <akim@epita.fr>
9170
9171 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9172 (parser::state_type, parser::semantic_type, parser::location_type):
9173 Private, not public.
9174 (parser::parse): Return ints, not bool.
9175 Returning a bool introduces a problem: 0 corresponds to false, and
9176 it seems weird to return false on success. Returning true changes
9177 the conventions for yyparse.
9178 Alternatively we could return void and send an exception.
9179 There is no clear consensus (yet?).
9180 (state_stack, semantic_stack, location_stack): Rename as...
9181 (state_stack_type, semantic_stack_type, location_stack_type): these.
9182 Private, not public.
9183 * tests/c++.at: New.
9184 * tests/testsuite.at, tests/Makefile.am: Adjust.
9185
72731bb7
AD
91862004-12-21 Akim Demaille <akim@epita.fr>
9187
9188 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9189
9a0d8bec
AD
91902004-12-21 Akim Demaille <akim@epita.fr>
9191
9192 Don't impose std::string for filenames.
9193
9194 * data/lalr1.cc (b4_filename_type): New.
9195 (position::filename): Use it.
9196 (parser.hh): Move the inclusion of stack.hh and location.hh below
9197 the user code, so that needed headers for the filename type can be
9198 included first.
72731bb7
AD
9199 Forward declare them before the user code.
9200 * tests/Makefile.am (check-local, installcheck-local): Pass
9201 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 9202
99880de5
AD
92032004-12-20 Akim Demaille <akim@epita.fr>
9204
9205 Use more STL like names: my_class instead of MyClass.
9206
9207 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9208 (SemanticStack, SemanticType, StateStack, StateType)
9209 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9210 (Parser::value): Rename as...
9211 (location_stack, location_type, rhs_number_type, semantic_stack)
9212 (semantic_type, state_stack, state_type, token_number_type, stack)
9213 (slice, traits, parser::yylloc, parser::yylval): these.
9214
9215 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9216
9bec482e
PE
92172004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9218
9219 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9220 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9221
f6fbd3da
PE
92222004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9223
9224 Remove uses of 'short int' and 'unsigned short int'. This raises
9225 some arbitrary limits. It uses more memory but nowadays that's
9226 not much of an issue.
9227
9228 This change does not affect the generated parsers; that's a different
9229 task, as some users will want to conserve memory there.
9230
9231 Ideally we should use size_t to represent all object counts, and
9232 something like ptrdiff_t to represent signed differences of object
9233 counts; but that will require more code-cleanup than I have the
9234 time to do right now.
9235
9236 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9237 Use size_t, not int or short int, to count objects.
9238 * src/closure.c (nritemset, closure): Likewise.
9239 * src/closure.h (nritemset, closure): Likewise.
9240 * src/nullable.c (nullable_compute): Likewise.
9241 * src/print.c (print_core): Likewise.
9242 * src/print_graph.c (print_core): Likewise.
9243 * src/state.c (state_compare, state_hash): Likewise.
9244 * src/state.h (struct state): Likewise.
9245 * src/tables.c (default_goto, goto_actions): Likewise.
9246
9247 * src/gram.h (rule_number, rule): Use int, not short int.
9248 * src/output.c (prepare_rules): Likewise.
9249 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9250 errs, reductions): Likewise.
9251 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9252 Likewise.
9253 * src/tables.c (vector_number, tally, action_number,
9254 ACTION_NUMBER_MINIMUM): Likewise.
9255 * src/output.c (muscle_insert_short_int_table): Remove.
9256
efeed023
AD
92572004-12-17 Akim Demaille <akim@epita.fr>
9258
9259 * data/lalr1.cc: Extensive Doxygenation.
9260 (error_): Rename as...
9261 (error): this, since it is visible to the user.
9262 Adjust callers.
9263 (Parser::message): Now an automatic variable from...
9264 (Parser::yyreport_syntax_error_): here.
9265 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9266 Parser::error.
9267 * tests/input.at: Escape $.
9268
bc82c5a5
PE
92692004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9270
9271 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9272 Parenthesize rhs to avoid obscure problems with mistakes like
9273 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9274 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9275 b4_rhs_location): Likewise.
9276 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9277 b4_rhs_location): Likewise.
9278
fd19f271
AD
92792004-12-16 Akim Demaille <akim@epita.fr>
9280
9281 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9282 yacc.c: be sure to stay within yycheck_.
9283 * tests/actions.at: Re-enable C++ tests.
9284
10454ea4
AD
92852004-12-16 Akim Demaille <akim@epita.fr>
9286
9287 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9288 real.
9289
c5b95ccf
AD
92902004-12-16 Akim Demaille <akim@epita.fr>
9291
9292 Use #define to handle the %name-prefix.
9293
9294 * data/glr.c, data/yacc.c: Comment changes.
9295 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9296 so that one can refer to yylex in the parser file, and have it
9297 renamed, as is the case with other skeletons.
9298
617a8f12
AD
92992004-12-16 Akim Demaille <akim@epita.fr>
9300
9301 Move lalr1.cc internals into yy*.
9302
9303 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9304 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9305 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9306 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9307 (empty_, final_, terror_, errcode_, ntokens_)
9308 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9309 (looka_, ilooka_, error_range_, nerrs_):
9310 Rename as...
9311 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9312 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9313 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9314 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9315 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9316 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9317 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9318 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9319 these.
9320
1e547e6e
PE
93212004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9322
9323 Fix some problems reported by twlevo at xs4all.
9324 * src/symtab.c (symbol_new): Report an error if the input grammar
9325 contains too many symbols. This is better than calling abort() later.
9326 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9327 (struct node, struct graph):
9328 Rename member expand to stretch. All uses changed.
9329 (struct graph): Remove member layoutalgorithm. All uses removed.
9330 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9331 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9332 All uses changed.
9333 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9334
735d6bd4
AD
93352004-12-15 Akim Demaille <akim@epita.fr>
9336
9337 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9338 Add more Doxygen comments.
9339 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9340 (report_syntax_error_, translate_): Rename as...
9341 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9342 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9343
2e1f5829
AD
93442004-12-15 Akim Demaille <akim@epita.fr>
9345
9346 * data/lalr1.cc (lex_): Rename as...
9347 (yylex_): this.
9348 Move the trace here.
9349 Take the %name-prefix into account.
9350 Reported by Alexandre Duret-Lutz.
9351
a3cb6248
AD
93522004-12-15 Akim Demaille <akim@epita.fr>
9353
9354 Simplify the C++ parser constructor.
9355
9356 * data/lalr1.cc (debug_): Rename as...
9357 (yydebug_): so that the parser's internals are always in the yy*
9358 pseudo namespace.
9359 Adjust uses.
9360 (b4_parse_param_decl): Remove the leading comma as it is now only
9361 called as unique argument list.
9362 (Parser::Parser): Remove the constructor accepting a location and
9363 an initial debugging level.
9364 Remove from the other ctor the argument for the debugging level.
9365 (debug_level_type, debug_level, set_debug_level): New.
9366
9367 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9368 constructor calls.
9369
07fed891
AD
93702004-12-15 Akim Demaille <akim@epita.fr>
9371
9372 Remove b4_root related material: failure experiment
a3cb6248 9373 (which goal was to allow to derive from a class).
07fed891
AD
9374
9375 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9376 definitions and uses.
9377
e603eaa5
PE
93782004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9379
9380 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9381 not 2, since it's not portable to subtract 1 from the start of an
9382 array. The new item 0 is never set or used. All uses changed.
9383
9384 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9385 the default definition of YYLLOC_DEFAULT. Problem reported
9386 by Frank Heckenbach.
9387
fafb007d
PE
93882004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9389
9390 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9391 the normal case and one for the error case. Just use the
9392 first one uniformly. Problem reported by Frank Heckenbach.
9393 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9394 use exactly the same macro in both places.
9395 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9396 so that the normal-case YYRHSLOC works for the error case too.
9397 All uses changed.
9398 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9399 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9400 * doc/bison.texinfo (Location Default Action): Don't claim that
9401 we have an array of locations. Use the same macro for both glr
9402 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9403 the index is 0.
9404
48814dcd
PE
94052004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9406
a4e1a53b
PE
9407 * HACKING: Update email addresses to send announcements to.
9408
48814dcd
PE
9409 * configure.ac (AC_INIT): Bump version to 1.875f.
9410
337116ba
PE
94112004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9412
9413 * NEWS: Version 1.875e.
9414 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9415
9416 * src/scan-skel.l: Include "complain.h", for "fatal".
9417
9418 * src/relation.h (relation_print, relation_digraph):
9419 Relation sizes are of type relation_node, not size_t (this is
9420 merely a doc fix, since the two types are equivalent).
9421 (relation_transpose): Relation sizes are of type relation_node,
9422 not int.
9423 * src/relation.c: Likewise.
9424 (top, infinity): Now of type relation_node, not int.
9425 (traverse, relation_transpose): Use relation_node, not int.
9426
9427 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9428 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9429 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9430
9431 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 9432 specifying whether the test should be skipped. Use it tp
337116ba 9433 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 9434 fail on some hosts, and should be skipped.
337116ba 9435
da2a7671
PE
94362004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9437
9438 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9439 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9440 unless otherwise specified below.
9441
9442 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9443 to allocate kernel_base, kernel_items, kernel_size, since
9444 they needn't be initialized to 0.
9445 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9446 * src/closure.c (new_closure): Likewise, for itemset.
9447 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9448 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9449 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9450 (build_relations): Likewise for edge, states1, includes.
9451 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9452 * src/reader.c (packgram): Likewise, for ritem, rules.
9453 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9454 * src/relation.c (relation_digraph): Likewise for VERTICES.
9455 (relation_transpose): Likewise for new_R, end_R.
9456 * src/symtab.c (symbols_token_translations_init): Likewise for
9457 token_translations.
9458 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9459 (token_actions): Likewise for yydefact, actrow, conflrow,
9460 conflict_list.
9461 (save_column): Likewise for froms[symno], tos[symno].
9462 (goto_actions): Likewise for state_count.
9463 (pack_table): Likewise for base, pos, check.
9464 (tables_generate): Likewise for width.
9465
9466 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9467 for initial core. Just have a separate core, so we needn't worry
9468 about whether kernel_size and kernel_base are initialized.
9469
9470 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9471 kernel_size, kernel_items): Remove unnecessary initialization.
9472 * src/conflicts.c (conflicts): Likewise.
9473 * src/derives.c (derives): Likewise.
9474 * src/muscle_tablc (muscle_insert): Likewise.
9475 * src/relation.c (relation_digraph): Likewise.
9476 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9477 conflrow, conflict_table, conflict_list, table, check):
9478 Likewise.
9479
9480 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9481 This is because all callers pass unsigned int.
9482 * src/closure.h (new_closure): Likewise.
9483
9484 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9485 (build_relations): Initialize includes[i] in all cases.
9486 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9487 and rules[ruleno].precsym. Initialize members in order.
9488 * src/relation.c (relation_transpose): Always initialize new_R[i]
9489 and end_R[i].
9490 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9491
9492 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9493 conflict_list[0] was always 0, but now it isn't initialized.
9494
9495 * src/table.c (table_grow): When conflict_table grew, the grown
9496 area wasn't cleared. Fix this.
9497
9498 * lib/.cvsignore: Add strdup.c, strdup.h.
9499 * m4/.cvsignore: Add strdup.m4.
9500
00baeeac
PE
95012004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9502
9503 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9504 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9505 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9506 ngotos + 1 without checking for overflow.
9507 (build_relations): Use END_NODE, not -1, to denote end of edges.
9508 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9509 build_relations): Use goto_number, not int, for goto numbers.
9510 * src/tables.c (save_column, default_goto): Likewise.
9511
be3d9d42
AD
95122004-11-23 Akim Demaille <akim@epita.fr>
9513
9514 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9515 of #defining from yystype.
9516 Don't typedef yystype, C++ does not need it.
9517 This lets it possible to forward declare it as union.
9518
78e526d5
PE
95192004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9520
9521 * bootstrap (gnulib_modules): Add extensions.
9522 Problem reported by Jim Meyering.
9523
afbb696d
PE
95242004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9525
9526 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9527 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9528 src/system.h, src/tables.c: XFREE -> free, to accommodate
9529 recent change to gnulib xalloc.h.
78e526d5 9530 Problem reported by Jim Meyering.
afbb696d 9531
c1f8f16a
AD
95322004-11-17 Akim Demaille <akim@epita.fr>
9533
9534 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9535
db7e5eb5 95362004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
9537 Alexandre Duret-Lutz <adl@gnu.org>
9538
9539 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9540 changes.
9541 (YYCDEBUG): Adjust.
9542 Use it instead of cdebug_.
9543 (Parser::debug_stream, Parser::set_debug_stream): New.
9544 (Parser::symprint_): Define cdebug_ for temporary backward
9545 compatibility.
9546 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9547 debug_stream ().
9548
68e11668
AD
95492004-11-17 Akim Demaille <akim@epita.fr>
9550
9551 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9552 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9553 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9554 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9555
97cbc73e
PE
95562004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9557
9558 * data/glr.c (yyloc_default): Remove; not used.
9559 Problem reported by Frank Heckenbach.
9560
e342c3be
AD
95612004-10-25 Akim Demaille <akim@epita.fr>
9562
9563 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9564 Introduce another definition to address simple location arrays.
9565 (yyGLRStack): New member: yyerror_range.
9566 (yyrecoverSyntaxError, yyparse): Update it.
9567 (yyrecoverSyntaxError): Use it when shifting the error token to
9568 have an accurate range, equivalent to the one computed by both
9569 yacc.c and lalr1.cc.
9570 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9571 that column numbers start at column 0, as per GNU Coding
9572 Standards, the others tests, and the doc.
9573 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9574 Adjust to the above change (first column is 0).
9575 And adjust the location of the "<error>", now covering the whole
9576 line.
9577
93602feb 95782004-10-22 Akim Demaille <akim@epita.fr>
04098407 9579 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
9580
9581 Remove some arbitrary limits on goto numbers and relations.
9582 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9583 initial values, since they're never used.
9584 (set_goto_map): ngotos is now unsigned, so test for overflow
9585 by seeing whether it wraps around to zero.
9586 * src/lalr.h (goto_number): Now size_t, not short int.
9587 (GOTO_NUMBER_MAXIMUM): Remove.
9588 * src/relation.c (relation_print, traverse, relation_transpose):
9589 Check for END_NODE rather than looking at sign.
9590 * src/relation.h (END_NODE): New macro.
9591 (relation_node): Now size_t, not short int.
9592
dba08b04
PE
95932004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9594
9595 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9596 keyword, not an identifier. Problem reported by Baron Schwartz in
9597 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9598
df09ef2e
AD
95992004-10-11 Akim Demaille <akim@epita.fr>
9600
9601 * src/symtab.c (symbol_check_alias_consistency): Also check
9602 type names, destructors, and printers.
9603 Reported by Alexandre Duret-Lutz.
9604 Recode the handling of associativity and precedence in terms
9605 of symbol_precedence_set.
9606 Accept no redeclaration at all, not even equal to the previous
9607 value.
9608 (redeclaration): New.
9609 Use it to factor redeclaration complaints.
9610 (symbol_make_alias): Don't set the type of the alias, let
9611 symbol_check_alias_consistency do it as for other features.
9612 * src/symtab.h (symbol): Add new member prec_location, and
9613 type_location.
9614 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9615 * tests/input.at (Incompatible Aliases): New.
9616
146bc99d
PE
96172004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9618
9619 .cvsignore fixes to accommodate gnulib changes,
9620 and the practice of naming build directories "_build".
9621 * .cvsignore: Add "_*". Sort.
9622 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9623 * m4/.cvsignore: Add "*_gl.m4".
9624
e503aa60
AD
96252004-10-06 Akim Demaille <akim@epita.fr>
9626
9627 * src/parse-gram.y (add_param): Fix the truncation of trailing
9628 spaces.
9629
b4a20338
AD
96302004-10-05 Akim Demaille <akim@epita.fr>
9631
9632 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9633 whether the reducion was empty or not. This leaves room to
9634 improve the use of YYLLOC_DEFAULT in such a case.
9635 lalr1.cc is still experimental, so changing this is acceptable.
9636 And finally, there are probably not many users who changed the
9637 handling of locations in GLR, so changing is admissible too.
9638
9639 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9640 empty reduction, set @$ to an empty location ending the previously
9641 stacked symbol.
9642 Adjust uses to make sure the code is triggered on empty
9643 reductions.
9644 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9645 expected output: empty reductions have empty locations.
9646
f85a5e6f
AD
96472004-09-29 Akim Demaille <akim@epita.fr>
9648
9649 * data/lalr1.cc: Move towards a more standard C++ coding style
9650 for templates: Class < T > -> Class<T>.
9651
b203fc2c
AD
96522004-09-29 Akim Demaille <akim@epita.fr>
9653
9654 * data/lalr1.cc: Reinstall the former ctor, for sake of
9655 compatibility, but warn it will be removed.
9656 Move towards a more standard C++ coding style (i.e., type *var ->
9657 type* var).
9658
5b7e1e73
PE
96592004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9660
3fee967f
PE
9661 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9662 since it's less likely to work if NULs are involved in the future.
5b7e1e73 9663
0dcca5c2
AD
96642004-09-27 Akim Demaille <akim@epita.fr>
9665
9666 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9667
6dde1c82
AD
96682004-09-27 Akim Demaille <akim@epita.fr>
9669
9670 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 9671 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
9672 and argument names.
9673 (b4_cc_constructor_call): Likewise.
9674
b233d555
AD
96752004-09-24 Akim Demaille <akim@epita.fr>
9676
9677 * src/parse-gram.y (add_param): Strip the leading and trailing
9678 blanks from a formal argument declaration.
9679 (YY_LOCATION_PRINT): New.
9680
619404e3
AD
96812004-09-24 Akim Demaille <akim@epita.fr>
9682
9683 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9684 after the location.
9685
dd8d9022
AD
96862004-09-24 Akim Demaille <akim@epita.fr>
9687
9688 * doc/bison.texinfo (Table of Symbols): Sort.
9689
0092f063
AD
96902004-09-21 Akim Demaille <akim@epita.fr>
9691
9692 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9693 the useless parentheses.
9694 Suggested by Paul Eggert.
9695
451364ed
AD
96962004-09-20 Akim Demaille <akim@epita.fr>
9697
9698 Let the initial-action act on the look-ahead, and use it for the
9699 "initial push" (corresponding to an hypothetical beginning-of-file).
9700 And let lalr1.cc honor %initial-action.
9701
9702 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9703 example.
9704 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9705 (Parser::Parser): Remove the ctor that used to initialize it.
9706 (Parser::parse): Like in the other skeletons, issue the "starting
9707 parse" message before any action.
9708 Honor %initial-action.
9709 Initialize the stacks with the lookahead.
9710 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9711 look-ahead.
9712 Push them in the stacks.
9713 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9714
18d192f0
AD
97152004-09-20 Akim Demaille <akim@epita.fr>
9716
9717 * doc/bison.texinfo (Initial Action Decl): New.
9718
b8458aa5
AD
97192004-09-20 Akim Demaille <akim@epita.fr>
9720
9721 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9722 clearer criterion to define it.
9723 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9724 When reducing on an empty RHS, use the latest stacked location as
9725 location.
9726 yylloc is not always available.
9727 * data/glr.c: Likewise.
9728 Also, honor initial-actions.
9729
3fc16193
AD
97302004-09-20 Akim Demaille <akim@epita.fr>
9731
9732 * data/yacc.c (YY_LOCATION_PRINT): New.
9733 Define when we know YYLTYPE's structure, i.e., when the default
9734 YYLLOC_DEFAULT is used.
9735 * data/c.m4 (b4_yysymprint_generate): Use it.
9736 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9737 value of the result.
9738 (error_start_): Replace with...
9739 (error_range_): this location array.
9740 This allows to replace code relying on the implementation of
9741 locations by portable code.
9742 * data/yacc.c (yylerrsp): Replace with...
9743 (yyerror_range): this.
9744 Every time a token is popped, update yyerror_range[0], to have an
9745 accurate location for the error token.
9746 * data/glr.c (YY_LOCATION_PRINT): New.
9747 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9748 deference a pointer.
9749 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9750 report the location in %printers.
9751
9752 * src/scan-skel.l: Instead of abort, report error messages to ease
9753 understanding skeleton scanning failures.
9754
ecfe33e7
AD
97552004-09-16 Akim Demaille <akim@epita.fr>
9756
9757 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9758 (iterator, const_iterator): these, to be more in the C++ spirit.
9759 Also, return reverse iterators so that when displaying the stack
9760 we display its bottom first.
9761 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9762 from yacc.c.
9763 We should probably use vector here though.
9764
1576d44d
AD
97652004-09-16 Akim Demaille <akim@epita.fr>
9766
9767 Have more complete shift traces.
9768
9769 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9770 to report Shifts instead of ad hoc YYDPRINTF invocations,
9771 including for the error token.
9772 * data/lalr1.cc (symprint_): Output the location.
9773 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9774 output the location within the %printer.
9775 Activate GLR tests, at least to make sure they compile properly.
9776 They still don't pass though.
9777 * tests/calc.at: Adjust expect verbose output, since now "Entering
9778 state..." is on a different line than the "Shifting" message.
9779
9c66f418
AD
97802004-09-08 Akim Demaille <akim@epita.fr>
9781
9782 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9783 Bison directive from the Bison file to the invocation of this
9784 macro, so that these directives are passed to
9785 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9786 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9787 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9788 the extra Bison directives instead of the whole series.
9789 Change the grammar so that there are recoverable errors, and
9790 unrecoverable errors. Now we can have the parser give up before
9791 consuming the whole input. As a result we now can observe that
9792 the lookahead is freed when needed.
9793 Change the parser source to parse argv[1] instead of a hard coded
9794 string.
9795 Simplify yylex, and give a value and location to EOF.
9796 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9797 passed directives already coded in the file.
9798 Add some tests to check the location of "error".
9799 For some tests, the C++ parser is correct, and not yacc.c.
9800 For other tests, they provide different, but unsatisfying, values,
9801 so keep the C++ value so that at least one parser is "correct"
9802 according to the test suite.
9803 (Actions after errors): Remove, this is subsumed by the
9804 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9805
52d5733f
AD
98062004-09-06 Akim Demaille <akim@epita.fr>
9807
9808 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 9809 (Parser::pop): New.
52d5733f
AD
9810 Use it.
9811
a0e68930
AD
98122004-09-06 Akim Demaille <akim@epita.fr>
9813
9814 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9815 argument, an informative message.
9816 Call YY_SYMBOL_PRINT.
9817 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9818 * data/lalr1.cc (destruct_): Likewise.
9819 In addition, no longer depend on b4_yysymprint_generate and
9820 b4_yydestruct_generate to generate these functions, do it "by
9821 hand".
9822
e757bb10
AD
98232004-09-03 Akim Demaille <akim@epita.fr>
9824
9825 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9826 invoked, yydestruct the lookahead.
9827 * tests/calc.at (Calculator $1): Update the expected lengths of
9828 traces: there is an added line for the discarded lookahead.
9829 * doc/bison.texinfo (Destructor Decl): Some rewording.
9830 Define "discarded" symbols.
9831
0fe1f06d
AD
98322004-09-02 Akim Demaille <akim@epita.fr>
9833
9834 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9835
284acc8b
AD
98362004-09-02 Akim Demaille <akim@epita.fr>
9837
9838 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9839 (YYDSYMPRINTF): Rename as...
9840 (YY_SYMBOL_PRINT): this.
9841 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9842 two.
9843 Use it instead of direct symprint_ calls.
9844 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9845 one.
9846
a5eb1ed2
AD
98472004-09-02 Akim Demaille <akim@epita.fr>
9848
b7c72fe1
AD
9849 * data/lalr1.cc (b4_yysymprint_generate): New.
9850 (symprint_): New member function, defined when YYDEBUG.
9851 Use it consistently instead of token/nterm debugging output by
9852 hand.
a5eb1ed2
AD
9853 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9854 %printer calls to use cdebug_ when using lalr1.cc.
9855
417141dd
AD
98562004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9857
9858 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9859 with #ifdef YYDEBUG.
9860
2fa09258
AD
98612004-08-26 Akim Demaille <akim@epita.fr>
9862
9863 * doc/bison.texinfo (Implementing Loops): Rename as...
9864 (Implementing Gotos/Loops): this.
9865
9378b508
PE
98662004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9867
9868 Adjust to latest gnulib.
9869 * bootstrap (gnulib_modules): Add xalloc-die.
9870 Set LC_ALL=C so that file names sort consistently.
9871 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9872 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9873 uintmax_t.m4, ulonglong.m4.
9874 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9875 po.m4 since we are now using _gl.m4 instead.
9876
87a8ad5c
PE
98772004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9878
9879 * src/scan-action.l: Remove. Scanning of semantic actions is
9880 handled in scan-gram.l.
9881
dca81a78
PE
98822004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9883
9884 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9885
9886 * src/location.h (struct): The file member is a uniqstr.
9887 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9888
c9cbf7c5
PE
98892004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9890
9891 Fix bug with non-%union parsers that have printers or destructors,
9892 which led to a Bison core dump. Reported by Peter Fales in
9893 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 9894
c9cbf7c5
PE
9895 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9896 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9897 not to our own type.
9898 * src/output.c (symbol_destructors_output, symbol_printers_output):
9899 Don't assume %union.
9900 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
9901 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
9902 UNION-FLAG. All callers changed.
9903 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
9904 Use type char, not unsigned int, when declaring an array of char;
9905 this lets us remove a cast.
9906 (Printers and Destructors): Add non-%union test cases.
9907
fa7e68c3
PE
99082004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9909
9910 * doc/bison.texinfo: Minor editorial changes, mostly to the new
9911 GLR writeups. E.g., avoid frenchspacing and the future tense,
9912 change "lookahead" to "look-ahead", and change "wrt" to "with
9913 respect to".
2fa09258 9914
fa7e68c3
PE
99152004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9916
9917 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
9918 New sections, split off from the GLR Parsers section. Put the new
9919 Simple GLR Parser near the start of the GLR section, for clarity.
9920 Rewrite connective text.
9921
99a9344e
PE
99222004-06-21 Frank Heckenbach <frank@g-n-u.de>
9923
9924 * doc/bison.texinfo (Simple GLR Parsers): New section.
9925
8dd162d3
PE
99262004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9927
9928 * NEWS, TODO, doc/bison.texinfo:
9929 Use "look-ahead" instead of "lookahead", to be consistent.
9930 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
9931 while we're fixing "look-ahead".
9932 * src/conflicts.c (shift_set): Renamed from shiftset.
9933 (look_ahead_set): Renamed from lookaheadset.
9934 * src/print.c: Likewise.
9935 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
9936 name for "lookahead".
9937 (report_types, usage): Likewise.
9938 * src/getargs.h (report_look_ahead_tokens): Renamed from
9939 report_lookaheads.
9940 * src/lalr.c (compute_look_ahead_tokens): Renamed from
9941 compute_lookaheads.
9942 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
9943 (look_ahead_tokens_print): Renamed from lookaheads_print.
9944 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
9945 state_rule_lookaheads_print.
9946 * src/state.h: Likewise.
9947 (reductions.look_ahead_tokens): Renamed from lookaheads.
9948 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
9949 AT_DATA_LOOKAHEADS_GRAMMAR.
9950
57a90331
PE
99512004-06-03 Paul Eggert <eggert@cs.ucla.edu>
9952
9953 * README: Update location of patched M4 distribution.
9954
8ed3234a
PE
99552004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
9956
9957 Don't assume the C++ compiler takes the same arguments as the C compiler
9958 (trivial change).
9959 * configure.ac (O0CXXFLAGS): New var.
9960 * tests/atlocal.in (CXXFLAGS): Use it.
9961
07971983
PE
99622004-05-29 Paul Eggert <eggert@cs.ucla.edu>
9963
9964 Fix some "make check" problems with C++ reported by
9965 Albert Chin-A-Young for Tru64 C++ in this thread:
9966 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
9967
9968 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
9969 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9970 Output to a .cc file for C++, not to a .c file.
9971 * tests/calc.at (AT_CHECK_CALC): Likewise.
9972 * tests/regression.at (AT_CHECK_DANCER): Likewise.
9973 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
9974
29058652
PE
99752004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
9976
9977 * tests/calc.at, tests/actions.at: Workaround for SGI
9978 C++ compiler. (trivial change)
9979
62cb8a99
PE
99802004-05-27 Paul Eggert <eggert@cs.ucla.edu>
9981
fd418816
PE
9982 Spent a few hours checking out which prerequisite versions the
9983 current sources actually require. I went all the way back to
9984 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
9985 a seemingly endless set of combinations of versions more recent
9986 than that. The bottom line is that the current sources require
9987 fairly recent versions of the build tools, and it'll be some work
9988 to change this.
9989 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
9990 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
9991 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
9992 Add comments explaining why those particular versions are
9993 currently needed.
2fa09258 9994
62cb8a99
PE
9995 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
9996 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 9997 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
9998
9999 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10000 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10001
caa52c10
PE
100022004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10003
10004 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10005 0.11.5. Suggested by Bruno Haible.
10006 * bootstrap: Remove gettext version checking.
10007
10008 * doc/bison.texinfo (Decl Summary): Also mention that %union
10009 can depend on prerequisite types. Problem reported by Tim
10010 Van Holder.
10011
4bfd5e4e
PE
100122004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10013
2cef3017
PE
10014 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10015 * README-alpha: Don't tell people not to package this.
10016
b9c85d5c
PE
10017 * bootstrap: Don't assume $(...) works; use `...` instead.
10018 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10019 gettext better.
10020
4bfd5e4e
PE
10021 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10022 put into the -d output file, and mention what to do if YYSTYPE is
10023 defined as a macro.
10024
6a36ff94
PE
100252004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10026
6712933e
PE
10027 Undo change made earlier today: it caused autopoint to not bring
10028 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10029 autopoint's.
10030
10031 * bootstrap: Check that gettext version matches what's in
10032 configure.ac. Warn users to ignore robots.txt ERROR 404.
10033 * bootstrap: Undo today's earlier change (logged below).
10034 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 10035
6a36ff94
PE
10036 The gettext version checking is causing more trouble than it's
10037 curing; remove it. Problem reported by Paul Hilfinger.
10038
10039 * bootstrap: Issue a warning that one can expect a message
10040 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10041 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10042
209ea708
PE
100432004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10044
10045 Ensure that the C++ compiler used for testing actually works on a
10046 simple test program; if not, skip the C++-related tests. Problem
10047 reported by Vin Shelton in:
161a71f3 10048 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
10049
10050 * m4/cxx.m4: New file.
10051 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10052 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10053 * tests/local.at (AT_COMPILE_CXX): Use it.
10054
41ca2549
PE
100552004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10056
383e69dc
PE
10057 * data/glr.c (yylloc): Output this macro even if locations are not
10058 being generated, as the GLR parser needs it even in that case.
10059 Problem reported by Troy A. Johnson
10060 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10061
41ca2549
PE
10062 * configure.ac (AC_INIT): Update to 1.875e.
10063
e476c87d
PE
100642004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10065
10066 * NEWS: Version 1.875d.
10067 * configure.ac (AC_INIT): Likewise.
10068 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10069
10070 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10071 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10072 lalr1.cc runs afoul of the first, and the last two are no longer
10073 supported by GCC 3.4.0.
10074 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10075 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10076
233a88ad
PE
100772004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10078
10079 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10080 unsigned int, for compatibility with latest gnulib hash module.
10081 * src/state.c (state_hash, state_hasher): Likewise.
10082 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10083 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 10084
12ffdd28
PE
100852004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10086
10087 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10088
10089 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10090 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10091 character and string literals.
10092 (unexpected_end): New function.
10093 (unexpected_eof): Use it.
10094 (unexpected_newline): New function.
10095 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10096 actions.
e476c87d 10097
12ffdd28
PE
10098 * NEWS: Document %expect-rr.
10099
10100 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10101 Fix typo by replacing $1 with $option.
10102 Remove more 'intl'-related files.
9668e2be 10103 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
10104
10105 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10106 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10107 strtoul.c.
10108 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10109 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10110 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10111 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10112 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10113 * src/.cvsignore: Add *.output.
10114
10115 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10116 gets copied to the output file.
e476c87d 10117
1f65350a
PE
101182004-04-28 Paul Eggert <eggert@twinsun.com>
10119
10120 Get files from the gnulib and po repositories, instead of relying
10121 on them being in our CVS. Upgrade to latest versions of gnulib
10122 and Automake.
10123
10124 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10125 * bootstrap: Bootstrap from gnulib and po repositories.
10126 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10127 * README-cvs: Document these changes. Remove version numbers from
10128 mentions of build tools, since they change so often. Mention Flex.
10129
10130 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10131 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
10132 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10133 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 10134 does this for us.
12ffdd28
PE
10135 (AC_ISC_POSIX): Remove; we no longer support this
10136 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
10137 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10138 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10139 Do not check for C89 headers, except for locale.h which is used
10140 by the Yacc library and must port to K&R hosts.
10141 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10142 Do not check for C89 functions, except for setlocale which is
10143 used by the Yacc library.
10144 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10145 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10146 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10147 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10148 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10149 AM_GNU_GETTEXT): Remove; now done by:
10150 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10151 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10152 for us.
10153
10154 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10155 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10156 Define to empty, as gnulib.mk will do the rest for us.
10157 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10158 for us.
10159 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10160 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10161
10162 * src/files.c: Include gnulib's xstrndup.h.
10163
10164 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10165 (REALLOC): Use xnrealloc, for likewise.
10166 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10167 (strnlen, memrchr): Remove decls; functions no longer used.
10168 Include <stpcpy.h>.
10169
10170 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10171 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10172 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10173 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10174 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10175 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10176 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10177 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10178 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10179 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10180 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10181 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10182 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10183 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10184 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10185 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10186 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10187 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10188 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10189 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10190 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10191 Remove, as these files are now generated automatically
10192 by bootstrap or automake.
10193
10194 * po/ChangeLog: Remove: all but one entry was a duplicate
10195 of this file, and I moved that 2000-11-02 entry here.
10196
10197 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10198 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10199 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10200 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10201 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10202 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10203 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10204 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10205 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10206 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10207 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10208 xstrndup.h.
10209 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10210 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10211 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10212 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10213 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10214 * src/.cvsignore: Remove *_.c.
10215
10216
10217 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10218 support it. (The latest stable gzip doesn't.)
10219
102202004-04-27 Paul Eggert <eggert@twinsun.com>
10221
10222 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10223 case, as stos_ is now used by destructors due to the 2004-02-09
10224 change.
10225
10226 Remove more K&R C support.
10227 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10228 * lib/subpipe.c (errno): Remove decl.
10229 Include <stdlib.h> unconditionally.
10230 (EXIT_FAILURE): Remove macro.
10231 * src/complain.c (vfprintf, strerror): Remove.
10232 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10233 unconditionally.
10234 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10235 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10236 (strchr, strspn, memchr): Remove decls.
10237 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10238 unconditionally. Do not declare perror.
10239 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10240 unconditionally.
10241
10242 * src/complain.c (_): Remove useless defn, as system.h defines this.
10243
10244 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10245 with latest obstack.h.
10246 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10247 to procedure types, as obstack.h now does that for us.
10248 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10249
10250 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10251 so that this include file can stand alone.
10252 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10253 does this now. Include subpipe.h first after config.h, to
10254 test whether it can stand alone.
10255
10256 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10257 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10258 unused declaration.
10259
10260 * tests/synclines.at (%union synch line): Put a dummy member in
10261 the union, because empty unions aren't allowed in C. Caught
10262 by GCC 3.4.0.
10263
4f16766c
PE
102642004-04-13 Jim Meyering <jim@meyering.net>
10265
10266 * src/conflicts.c (conflicts_print): Correct format string typo:
10267 use `%%' to produce literal `%'. (trivial change)
10268
779e7ceb
PE
102692004-03-30 Paul Eggert <eggert@twinsun.com>
10270
10271 * src/getargs.c (version): Update copyright year to 2004.
10272
10273 * data/c.m4 (b4_int_type): Use 'short int' rather than
10274 'short', and similarly for 'long', 'unsigned', etc.
10275 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10276 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10277 yy_yypstack, yydumpstack): Likewise.
10278 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10279 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10280 Likewise.
10281 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10282 yy_stack_print, yyparse): Likewise.
10283 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10284 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10285 * lib/bitset.c (bitset_print): Likewise.
10286 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10287 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10288 * lib/bitsetv.c (bitsetv_dump): Likewise.
10289 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10290 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10291 Likewise.
10292 * src/LR0.c (allocate_itemsets): Likewise.
10293 * src/gram.h (rule_number, rule): Likewise.
10294 * src/lalr.h (goto_number): Likewise.
10295 * src/nullable.c (nullable_compute): Likewise.
10296 * src/output.c (prepare_rules): Likewise.
10297 * src/relation.c (relation_print, relation_digraph): Likewise.
10298 * src/relation.h (relation_node): Likewise.
10299 * src/state.h (state_number, transitions, errs, reductions,
10300 struct state): Likewise.
10301 * src/symtab.h (symbol_number, struct symbol): Likewise.
10302 * src/tables.c (vector_number, tally, action_number,
10303 default_goto, goto_actions): Likewise.
10304 * tests/existing.at (GNU Cim Grammar): Likewise.
10305 * tests/regression.at (Web2c Actions): Likewise.
10306
10307 * src/output.c (muscle_insert_short_int_table): Renamed from
10308 muscle_insert_short_table. All uses changed.
10309
d6328241
PH
103102004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10311
10312 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10313 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10314 Add %expect-rr rule.
4f16766c 10315
d6328241
PH
10316 * src/scan-gram.l: Recognize %expect-rr.
10317
4f16766c 10318 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 10319 expected_conflicts.
4f16766c 10320 (expected_rr_conflicts): Declare.
d6328241
PH
10321
10322 * src/conflicts.c (expected_sr_conflicts): Rename from
10323 expected_conflicts.
10324 (expected_rr_conflicts): Define.
10325 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10326 for GLR parsers.
10327 Use expected_sr_conflicts in place of expected_conflicts.
10328 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 10329
d6328241 10330 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 10331
1452af69
PE
103322004-03-08 Paul Eggert <eggert@gnu.org>
10333
10334 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 10335 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
10336
10337 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10338 in lalr1.cc.
10339 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10340 * src/scan-gram.l (scan_integer): New function.
10341 ({int}): Use it.
10342 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10343 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10344 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10345 Say "long int", not "long", for uniformity with GNU style.
10346
006d217d
PE
103472004-02-25 Paul Eggert <eggert@twinsun.com>
10348
10349 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10350 compilers. This fixes a problem with Intel's C++ compiler being
10351 chatty, reported by Guido Trentalancia in
161a71f3 10352 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 10353
c2729758
ADL
103542004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10355
10356 Support %destructor and merge error locations in lalr1.cc.
10357
10358 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10359 (Parser::stos_): Define unconditionally.
10360 (Parser::destruct_): New method. Generate its body with
10361 b4_yydestruct_generate.
10362 (Parser::error_start_): New attribute.
10363 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10364 token which are discarded.
10365 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10366 error_start_ when erroneous token are discarded.
10367 (Parser::parse) <yyerrlab1>: Compute the location of the error
10368 token so that it covers all the discarded tokens.
10369 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10370 it can be called with `%skeleton "lalr1.cc"', and do that.
10371
dd0e0635
PE
103722004-02-02 Paul Eggert <eggert@twinsun.com>
10373
10374 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10375 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10376 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10377 There's no need to mention top_builddir since Automake does that
10378 for us.
10379 (INCLUDES): Remove, as Automake says it's obsolescent.
10380 Contents migrated into AM_CPPFLAGS as described above.
10381 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10382
103832004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10384
10385 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10386 (yyreportSyntaxError): Handle case where lookahead token is
10387 YYEMPTY.
10388
be16239b
PH
103892004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10390
10391 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10392 resulting parsers are compilable with C++.
10393
5fa90832
PE
103942003-12-23 Paul Eggert <eggert@twinsun.com>
10395
10396 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10397 * src/output.c (output_skeleton): Rename local var.
10398 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10399 Bison tokens, as this runs afoul of the 2003-10-07 change that
10400 disallowed NUL bytes in character constants or string literals.
10401
10402 * tests/local.at: Require Autoconf 2.59's Autotest.
10403 * tests/testsuite.at: Don't include local.at, since we now assume
10404 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10405 including it.
10406 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10407 multiple inclusion warnings.
dd0e0635 10408
b165c324
AD
104092003-12-02 Akim Demaille <akim@epita.fr>
10410
10411 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10412 conditions.
10413 From Bruno Haible.
10414
26e06a21
ADL
104152003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10416
10417 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10418
92ac3705
PE
104192003-10-07 Paul Eggert <eggert@twinsun.com>
10420
6a5ecb38
PE
10421 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10422 if testsuite doesn't exist.
10423
92ac3705
PE
10424 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10425 literals, unfortunately.
10426 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10427 Complain about NUL bytes in character constants or string literals.
10428
91d2c560
PE
104292003-10-05 Paul Eggert <eggert@twinsun.com>
10430
10431 * NEWS: Don't document %no-default-prec, as it's still
10432 too experimental.
10433 * doc/bison.texinfo: Document %no-default-prec only if
10434 the defaultprec flag is set. Normally it's not.
10435
0cc3da3a
PE
104362003-10-04 Paul Eggert <eggert@twinsun.com>
10437
10438 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10439 non-modifiable lvalue, instead of a modifiable one.
10440 * doc/bison.texinfo (Actions): Document that $$ can
10441 be assigned to. Do not claim that $$ and $N are
10442 array element references: user code should not rely on this.
10443
22fccf95
PE
104442003-10-01 Paul Eggert <eggert@twinsun.com>
10445
10446 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10447 (grammar_declaration): Use it.
10448 * src/scan-gram.l: New token %no-default-prec.
10449 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10450 * NEWS, doc/bison.texinfo: Document the above.
10451
fc8f2965
AD
104522003-10-01 Akim Demaille <akim@epita.fr>
10453
10454 VCG no longer supports long_straight_phase.
10455
10456 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10457 * src/print_graph.c (print_graph): Adjust.
10458
39a06c25
PE
104592003-09-30 Frank Heckenbach <frank@g-n-u.de>
10460 and Paul Eggert <eggert@twinsun.com>
10461
10462 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10463 Table of Symbols): Document %default-prec.
10464 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10465 (grammar_declaration): Set default_prec on %default-prec.
10466 * src/scan-gram.l (%default-prec): New token.
10467 * src/reader.h (default_prec): New flag.
10468 * src/reader.c: Likewise.
10469 (packgram): Handle it.
10470 * tests/conflicts.at (%default-prec without %prec,
10471 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 10472
39a06c25
PE
104732003-09-30 Paul Eggert <eggert@twinsun.com>
10474
10475 * tests/testsuite.at: Include local.at, not input.at, fixing
10476 a typo in the 2003-08-25 patch.
10477
62b6aef9
AD
104782003-08-27 Akim Demaille <akim@epita.fr>
10479
10480 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10481 GCC warnings.
10482
89e1cc61
AD
104832003-08-26 Akim Demaille <akim@epita.fr>
10484
10485 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10486 "<\#" to avoid magic from Gnus when posting parts of this script.
10487
a08460b0
AD
104882003-08-26 Akim Demaille <akim@epita.fr>
10489
10490 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10491 (Parser::parse): here.
10492 Adjust: nerrs and errstatus is now replaced by...
10493 (Parser::nerrs_, Parser::errstatus_): New.
10494
603f1cfd
AD
104952003-08-25 Akim Demaille <akim@epita.fr>
10496
10497 * config/announce-gen, Makefile.cfg: New.
10498 * Makefile.am: Adjust.
10499 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10500 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10501
cd3684cf
AD
105022003-08-25 Akim Demaille <akim@epita.fr>
10503
10504 When reducing initial empty rules, Bison parser read an initial
10505 location that is not defined. This results in garbage, and that
10506 affects Bison's own parser. Therefore we need (i) to extend Bison
10507 to support a means to initialize this location, and (ii) to use
10508 this CVS Bison to fix CVS Bison's parser.
10509
10510 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10511 with...
10512 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10513 * src/parse-gram.y: Adjust.
10514 (%initial-action): New.
10515 (%error-verbose): Since we require CVS Bison, there is no reason
10516 not to use it.
10517 * src/scan-gram.l: Adjust.
10518 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10519 * data/yacc.c (yyparse): Use b4_initial_action.
10520
4e03e201
AD
105212003-08-25 Akim Demaille <akim@epita.fr>
10522
10523 * doc/bison.texinfo: Don't promote stdout for error messages.
10524
8c182d05
AD
105252003-08-25 Akim Demaille <akim@epita.fr>
10526
10527 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10528 From Alexandre Duret-Lutz.
10529
6a60c4cf
PE
105302003-08-25 Akim Demaille <akim@epita.fr>
10531
10532 Version 1.875c.
10533
25f66e1a
AD
105342003-08-25 Akim Demaille <akim@epita.fr>
10535
10536 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10537 Use them.
10538
5348bfbe
AD
105392003-08-25 Akim Demaille <akim@epita.fr>
10540
10541 * data/lalr1.cc (Parser::reduce_print_): New.
10542 Use it.
10543
47301314
AD
105442003-08-25 Akim Demaille <akim@epita.fr>
10545
10546 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10547 error recovery loops. This patch is based on
161a71f3 10548 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
10549 Also, augment the similarity between lalr1.cc and yacc.c.
10550 Note: the locations of error recovery rules are not correct yet.
10551
10552 * data/lalr1.cc: Comment changes to augment the similarity between
10553 lalr1.cc and yacc.c.
10554 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10555 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10556 yyerrlab), when hitting EOF, pop the whole stack here instead of
10557 merely falling thru the default error handling mechanism.
10558 (yyerrorlab): New label, with the old contents of YYERROR,
10559 plus the following change: pop the stack of rhs corresponding
10560 to the production that invoked YYERROR. That is how Yacc
10561 behaves (required by POSIX).
10562 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10563 fail.
10564
1f7a61ff
AD
105652003-08-25 Akim Demaille <akim@epita.fr>
10566
10567 Tune local.at so that people can "autom4te -l autotest calc.at -o
10568 calc" for instance, to extract a sub test suite.
10569
10570 * tests/testsuite.at: Move the initialization, Autotest version
10571 requirement, and AT_TESTED invocation into...
10572 * tests/local.at: here.
10573 * tests/testsuite.at: Include it for compatibility with Autoconf
10574 2.57.
10575 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10576 be ignore.
10577
327b5b56
PE
105782003-08-04 Paul Eggert <eggert@twinsun.com>
10579
10580 Rework code slightly to avoid gcc -Wtraditional warnings.
10581 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10582 The returned value is now stored in *YY0. All callers changed.
10583 * src/output.c (merge_output): Adjust to the above change.
10584
0051e3ed
PE
105852003-07-26 Paul Eggert <eggert@twinsun.com>
10586
10587 * data/glr.c (YYASSERT): New macro.
10588 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10589 yyresolveStates, yyprocessOneStack):
10590 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10591 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 10592
137437c6
PE
105932003-07-25 Paul Eggert <eggert@twinsun.com>
10594
5b620e06
PE
10595 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10596 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 10597 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
10598 by Frank Heckenbach, though I have omitted the structure-initialization
10599 part of his glr-knr.diff patch since I recall that the Portable
10600 C Compiler didn't require that change.
10601
137437c6
PE
10602 Let the user specify how to allocate and free memory.
10603 Derived from a suggestion by Frank Heckenbach in
161a71f3 10604 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
10605 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10606 All uses of free, malloc, realloc changed to use these macros,
10607 and unnecessary casts removed.
10608 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10609
ddb85ca5
PE
106102003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10611
10612 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10613 use s.empty() rather than s == "" to test for empty string; see
161a71f3 10614 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
10615 (trivial change)
10616
39910e09
AD
106172003-06-25 Akim Demaille <akim@epita.fr>
10618
10619 * config/depcomp, config/install-sh: Update from masters.
10620
0ae99356
PE
106212003-06-20 Paul Eggert <eggert@twinsun.com>
10622
10623 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10624 and return properly parenthesized result.
10625 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10626 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10627 Remove unnecessary parentheses from uses.
10628 * doc/bison.texinfo (Location Default Action): Describe the
10629 conventions for parentheses.
10630
cd05d13c
PE
106312003-06-19 Paul Eggert <eggert@twinsun.com>
10632
81fd08ca
PE
10633 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10634 yyreportTree): Do not assume that size_t is the same width as int,
10635 when printing sizes. Print sizes using an unsigned format.
10636 Problem reported by Frank Heckenbach in
161a71f3 10637 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 10638
cd05d13c
PE
10639 Port to Forte Developer 7 C compiler.
10640 * data/glr.c (struct YYLTYPE): If locations are not being used,
10641 declare a single dummy member, as empty structs do not conform
10642 to the C standard.
10643 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10644 the Forte Developer 7 C compiler complains that end-of-loop
10645 code is not reached.
10646
4dcf140b
PE
106472003-06-17 Paul Eggert <eggert@twinsun.com>
10648
10649 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10650 avoid warnings from picky compilers about redefinition of PARAMS.
10651
8dd76bee
PE
106522003-06-17 Paul Eggert <eggert@twinsun.com>
10653
10654 Version 1.875b.
10655
10656 * NEWS: Document 1.875b.
10657
10658 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10659 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10660 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10661 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10662 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10663 per recent gettext manual's suggestion.
10664 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10665 Use prototypes, not old-style definitions.
10666 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10667 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10668 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10669 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10670 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10671 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10672 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10673 vbitset_or_and_cmp, vbitset_copy): Likewise.
10674
10675 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10676 Do not include <stdlib.h>.
10677 (PARAMS): Define unconditionally for C89.
10678 (ATTRIBUTE_NORETURN): Remove.
10679 (ATTRIBUTE_UNUSED): Define unconditionally.
10680
10681 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 10682 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
10683 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10684 * lib/vbitset.c, lib/vbitset.h: New files.
10685 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10686 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10687 from libbitset.
10688
10689 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10690 `How Can I Reset @code{yyparse}', since texinfo does not allow
10691 arbitrary @ in node names.
10692
10693 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10694 shouldn't be needed according to the gettext 0.12.1 documentation
10695 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 10696 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 10697 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 10698 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 10699
8dd76bee
PE
10700 * lib/.cvsignore: Add stdbool.h.
10701 * m4/.cvsignore: Add nls.m4, po.m4.
10702
10703 Upgrade to CVS gnulib.
10704 * stdbool_.h: File renamed from stdbool.h.in.
10705 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10706 AC_HEADER_STDBOOL.
10707 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10708 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10709 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10710 (MOSTLYCLEANFILES): New var.
10711 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10712 (stdbool.h): New rule.
10713 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10714 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10715 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10716 m4/quote.m4: Upgrade to today's gnulib.
10717
10718 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10719 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10720 the tests right now.
10721 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10722 yyerror are declared before use; C99 requires this.
10723
25005f6a
PH
107242003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10725
10726 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10727 first.
10728 (yyrecoverSyntaxError): Correct the logic for setting and testing
10729 yyerrState.
10730 Correct comment on handling EOF.
10731 Allow states with only a default reduction, rather than failing
8dd76bee 10732 (I can't quite reconstruct why these were not allowed before).
25005f6a 10733
137437c6 10734 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 10735 buffer overruns, corrupting state.
8dd76bee
PE
10736
10737 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
10738 definition.
10739 * src/reader.h (max_left_semantic_context): New variable declaration.
10740 * src/scan-gram.l (max_left_semantic_context): Define.
10741 (handle_action_dollar): Update max_left_semantic_context.
10742 * data/glr.c (YYMAXLEFT): New definition.
10743 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10744 (yyresolveAction): Ditto.
10745
10746 Fixes to problems with location handling in GLR parsers reported by
10747 Frank Heckenbach (2003/06/05).
10748
10749 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10750 (YYRHSLOC): Add parentheses, and define only if locations used.
10751 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10752 locations not used.
10753 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10754 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 10755
25005f6a
PH
10756 * tests/cxx-type.at: Exercise location information; update tests
10757 to differentiate output with and without locations.
8dd76bee 10758 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
10759 because default YYLTYPE not yet defined.
10760 Change semantic actions to compute strings, rather than printing
10761 them directly (to test proper passing of semantics values). Change
10762 output to prefix notation and update test data and expected results.
10763 (yylex): Track locations.
10764 (stmtMerge): Return value rather than printing, and include arguments
10765 in value.
8dd76bee 10766
711f40b7
PE
107672003-06-03 Paul Eggert <eggert@twinsun.com>
10768
10769 Avoid warnings generated by GCC 2.95.4 when Bison is
10770 configured with --enable-gcc-warnings.
10771 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10772 yy::]b4_parser_class_name[::translate_,
10773 yy::Stack::operator[] (unsigned),
10774 yy::Stack::operator[] (unsigned) const,
10775 yy::Slice::operator[] (unsigned),
10776 yy::Slice::operator[] (unsigned) const):
10777 Rename local vars to avoid warnings.
10778 * tests/glr-regression.at (Improper handling of embedded actions
10779 and $-N in GLR parsers): Remove unused local variable from yylex.
10780 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10781 (void) as arg when not pure, since we now assume C89 when building
10782 Bison. Pacify GCC by using parameter.
10783
ac695f7d
PE
107842003-06-02 Paul Eggert <eggert@twinsun.com>
10785
10786 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10787 yy::Location::lines, yy::Location::columns): Rename arguments
10788 to avoid shadowing; this removes a warning generated by GCC 3.3.
10789
26ec81e0
PE
107902003-06-01 Paul Eggert <eggert@twinsun.com>
10791
10792 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10793 to g++, as GCC 3.3 complains if you do it.
10794 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10795 everything that WARNING_CFLAGS has, except omit warnings
10796 not suitable for C++.
10797 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10798 * tests/atlocal.in (CXXFLAGS): New var.
10799 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10800
10801 Fix a GLR parser bug I reported in February; see
161a71f3 10802 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
10803 The problem was that GLR parsers did not conform to the C standard,
10804 because actions like { $1 = $2 + $3; } expanded to expressions
10805 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10806 to a local variable. The C standard says that expressions
10807 like (var = f ()) + (var = f ()) have undefined behavior.
10808 Another problem was that GCC sometimes issues warnings that
10809 yyfill and its parameters are unused.
10810
10811 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10812 as possibly unused.
10813 (yyfill): New function.
10814 (YYFILL): Use it.
10815 (yyuserAction): Change type of yynormal to bool, so that it matches
10816 the new yyfill signature. Mark it as possibly unused.
10817
10818
10819 Follow up on a bug I reported in February, where a Bison-generated
10820 parser can loop. Provide a test case and a fix for yacc.c. I
10821 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10822 The original bug report is in:
161a71f3 10823 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
10824
10825 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10826 macro's size was becoming unwieldy.
10827 (yyerrlab): Do not discard an empty lookahead symbol, as this
10828 might destroy garbage.
10829 (yyerrorlab): New label, with the old contents of YYERROR,
10830 plus the following change: pop the stack of rhs corresponding
10831 to the production that invoked YYERROR. That is how Yacc
10832 behaves, and POSIX requires this behavior.
10833 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10834 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10835 Define 'alarm' to do nothing if unistd.h is not available.
10836 Add a new rule "exp: '-' error;" to test the above change to
10837 data/yacc.c. Use 'alarm' to abort any test taking longer than
10838 10 seconds, as it's probably looping.
10839 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10840 Also, the new yacc.c generates two fewer diagnostics for an
10841 existing test.
10842
d0829076
PE
108432003-05-24 Paul Eggert <eggert@twinsun.com>
10844
c6ae27df
PE
10845 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10846 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10847 This fixes a problem reported by John Bowman when the Compaq/HP
10848 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10849 -ansi -Wall -gall).
10850 * data/yacc.c (union yyalloc): Likewise.
10851 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 10852
d0829076
PE
10853 Switch from 'int' to 'bool' where that makes sense.
10854
10855 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10856 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10857 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10858 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10859 Return or accept bool, not int. All callers changed.
10860 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10861 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10862 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10863 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10864 bitset_or_and_cmp_): Likewise.
10865 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10866 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10867 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10868 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10869 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10870 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10871 bitset_stats_or_and_cmp): Likewise.
10872 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10873 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10874 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10875 ebitset_xor_cmp): Likewise.
10876 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10877 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10878 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10879 lbitset_xor_cmp): Likewise.
10880 * lib/bbitset.h: Include <stdbool.h>.
10881 (struct bitset_vtable): The following members now return bool, not
10882 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10883 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10884 or_and_cmp).
10885 * src/conflicts.c (count_rr_conflicts): Likewise.
10886 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10887 All uses changed.
10888 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10889 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10890 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10891 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10892 graph_flag): Likewise.
10893 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10894 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10895 graph_flag): Likewise.
10896 * src/output.c (error_verbose): Likewise.
10897 * src/output.h (error_verbose): Likewise.
10898 * src/reader.c (start_flag, typed): Likewise.
10899 * src/reader.h (typed): Likewise.
10900 * src/getargs.c (LOCATIONS_OPTION): New constant.
10901 (long_options, getargs): Use it.
10902 * src/lalr.c (build_relations): Use bool, not int.
10903 * src/nullable.c (nullable_compute): Likewise.
10904 * src/print.c (print_reductions): Likewise.
10905 * src/tables.c (action_row, pack_vector): Likewise.
10906 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
10907 * src/output.c (prepare): Use it.
10908 * src/output.c (token_definitions_output,
10909 symbol_destructors_output, symbol_destructors_output): Use string,
10910 not boolean integer, to keep track of whether to output separator.
10911 * src/print_graph.c (print_core): Likewise.
10912 * src/state.c (state_rule_lookaheads_print): Likewise.
10913
10914 * config/install-sh: Sync from automake 1.7.5.
10915
6b2584b7
PE
109162003-05-14 Paul Eggert <eggert@twinsun.com>
10917
10918 * src/parse-gram.y (rules_or_grammar_declaration): Require a
10919 semicolon after a grammar declaration, in the interest of possible
10920 future changes to the Bison input language.
10921 Do not allow a stray semicolon at the start of the grammar.
10922 (rhses.1): Allow one or more semicolons after any rule, including
10923 just before "|" as required by POSIX.
10924 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
10925 grammar.
10926
caf37a36
ADL
109272003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
10928
10929 %parse-param support for lalr1.cc.
10930
10931 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
10932 b4_cc_constructor_calls, b4_cc_constructor_call,
10933 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
10934 definitions.
10935 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
10936 parse-param arguments.
10937 (yy::b4_parser_class_name): Declare instance variables to
10938 hold parse-param arguments.
10939 * tests/calc.at: s/value/semantic_value/ because value clashes
10940 with a member of yy::b4_parser_class_name. Adjust C++ code
10941 to handle %parse-param. Enable %parse-param test in C++.
10942
3ab37077
PE
109432003-05-12 Paul Eggert <eggert@twinsun.com>
10944
10945 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
10946 English a bit. Fix fclose typo. Change "const char" to "char
10947 const", and use ANSI C rather than K&R for "main". Suggest
10948 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
10949 and suggest yy_switch_to_buffer.
10950
109512003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
10952
10953 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
10954 C89. This avoids a diagnostic on compilers that define __STDC__
10955 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 10956 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 10957
e743727f
PE
109582003-05-03 Paul Eggert <eggert@twinsun.com>
10959
10960 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
10961 Do not overrun array bounds.
10962 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 10963 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 10964
916708d5
AD
109652003-04-29 Akim Demaille <akim@epita.fr>
10966
10967 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
10968 * src/getargs.c, src/getargs.h: here, as bool, not int.
10969 (nondeterministic_parser): New.
10970 * src/parse-gram.y, src/scan-gram.l: Support
10971 %nondeterministic-parser.
10972 * src/output.c (prepare): Use nondeterministic_parser instead
10973 of glr_parser where appropriate.
10974 * src/tables.c (conflict_row, action_row, save_row)
10975 (token_actions, token_actions, pack_vector): Ditto.
10976
a06ea4aa
AD
109772003-04-29 Akim Demaille <akim@epita.fr>
10978
10979 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
10980
211074ca
AD
109812003-04-29 Akim Demaille <akim@epita.fr>
10982
10983 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
10984 with %pure-parser and %locations to exercise the patch from Yakov
10985 Markovitch below.
10986
6175ffe3
PE
109872003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
10988
10989 * data/yacc.c: (b4_lex_param): Corrected for the case where
10990 %lex-param is provided and %pure-parser isn't.
10991
b1e95857
PE
109922003-04-27 Paul Eggert <eggert@twinsun.com>
10993
10994 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 10995 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
10996 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
10997 if it is not defined.
10998 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
10999
acda9df6
PE
110002003-04-26 Paul Eggert <eggert@twinsun.com>
11001
3470c57b
PE
11002 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11003 Declare to be of type suitable for the ninf value itself, not of
11004 type suitable for the corresponding table, since the latter might
11005 be unsigned but the ninf value might be negative. This fixes a
11006 bug reported by Alexandre Duret-Lutz in
161a71f3 11007 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 11008
acda9df6
PE
11009 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11010 invokes it. We shouldn't invoke it twice because it will attempt
11011 to put error.o in the archive twice. This fixes a glitch reported
11012 by Martin Mokrejs in
161a71f3 11013 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 11014
b5250f26
PE
110152003-04-21 Paul Eggert <eggert@twinsun.com>
11016
11017 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11018 to gnulib.
11019
089ac0f1
PE
110202003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11021
11022 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11023 Fix obvious typo that results in uncompilable GLR parsers
11024 when both %pure-parser and %locations are used. (trivial change)
11025
5ededac6
PE
110262003-04-17 Paul Eggert <eggert@twinsun.com>
11027
1b8f2fff
PE
11028 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11029 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11030 Do not insert the expected token via unput, as this runs afoul
11031 of a POSIX-compatibility bug in flex 2.5.31.
11032 All uses changed to BEGIN the parent state,
11033 since we no longer insert the expected token via unput.
11034 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11035 that is no longer emitted after the above change.
11036
5ededac6
PE
11037 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11038 the first one. This change is from Paul Hilfinger, and it fixes
11039 regression reported by Werner Lemberg in
161a71f3 11040 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
11041
11042 (resolve_sr_conflict): Don't invoke state_errs_set
11043 unless one or more tokens have been explicitly made errors.
11044 Otherwise, the above change causes Bison to abort.
11045
11046 * tests/existing.at (GNU pic Grammar): New test case, taken from
11047 Lemberg's email.
11048
b8be9132
AD
110492003-03-31 Akim Demaille <akim@epita.fr>
11050
11051 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11052
d423d460
AD
110532003-03-31 Akim Demaille <akim@epita.fr>
11054
11055 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11056 output.
11057
c7e441b4
AD
110582003-03-31 Akim Demaille <akim@epita.fr>
11059
11060 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11061 From Paul Hilfinger.
11062
231897ad
AD
110632003-03-29 Akim Demaille <akim@epita.fr>
11064
11065 * m4/error.m4: Do not put under dynamic conditions some code which
11066 expansion is under static control.
11067
5b066063
AD
110682003-03-29 Akim Demaille <akim@epita.fr>
11069
11070 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11071
22a74fec
AD
110722003-03-29 Akim Demaille <akim@epita.fr>
11073
11074 * doc/bison.texinfo (Strings are Destroyed): New.
11075
0eee27e7
PE
110762003-03-13 Paul Eggert <eggert@twinsun.com>
11077
11078 * .cvsignore: Add configure.lineno.
11079 * src/.cvsignore: Add yacc.
11080 * tests/.cvsignore: Add testsuite.log.
11081 * doc/fdl.texi: Sync with latest FSF version.
11082
f61aad93
PE
110832003-03-12 Paul Eggert <eggert@twinsun.com>
11084
537636c7
PE
11085 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11086 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11087 cursor, instead of leaving it undefined. This fixes a bug
11088 reported by Tim Van Holder in
161a71f3 11089 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
11090 * tests/input.at (Torturing the Scanner): Test the scanner on
11091 an empty input file, which was Tim Van Holder's test case.
11092
11093 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11094 <sys/resource.h> can be included, include sys/time.h and
11095 sys/times.h first, if available. This works around the SunOS
11096 4.1.4 porting bug reported by Bruce Becker in
161a71f3 11097 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
11098
11099 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11100 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11101 AC_HEADER_SYS_WAIT.
11102
f61aad93
PE
11103 Merge changes from gnulib. This was prompted because the CVS
11104 snapshot didn't build on Solaris 7 due to strnlen problems.
11105
11106 These changes need to be merged back into gnulib:
11107 * lib/hash.c: Include <stdbool.h> unconditionally.
11108 * m4/onceonly.m4 (m4_quote): New macro.
11109 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11110 Quote AC_FOREACH variable-expansions properly.
11111 The 2003-01-03 obstack.h change also needs merging.
11112 {end of changes requiring merging}
5b066063 11113
f61aad93
PE
11114 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11115 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11116 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11117 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11118 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11119 New files, imported from gnulib.
11120 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11121 above.
11122
11123 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11124 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11125 gnulib sources.
11126
11127 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11128 Add.
11129 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11130 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11131 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11132 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11133 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11134 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11135 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11136 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11137 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11138 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11139 (jm_PREREQ_ARGMATCH): Remove.
11140 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11141 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11142
11143 * src/system.h: Include <stdbool.h> unconditionally.
11144
11145 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11146 assuming at least C89 in the bitset code for some time now.
11147
d2ffe116
AD
111482003-03-03 Akim Demaille <akim@epita.fr>
11149
11150 * ro.po: New.
11151
052826fd
AD
111522003-03-02 Akim Demaille <akim@epita.fr>
11153
11154 * doc/bison.texinfo (Table of Symbols): Reactivate the
11155 documentation for %lex-param, and %parse-param.
11156
c4749565
AD
111572003-03-02 Akim Demaille <akim@epita.fr>
11158
11159 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11160 generate verbose error messages.
11161 Use the number of tokens as an upper bound in yytname, as it
11162 cannot be a non terminal.
11163
d5286af1
AD
111642003-03-02 Akim Demaille <akim@epita.fr>
11165
11166 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11167 message.
11168
22e304a6
AD
111692003-03-02 Akim Demaille <akim@epita.fr>
11170
22e304a6
AD
11171 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11172 Use them to exercise yycheck overrun.
11173 Based on Andrew Suffield's grammar.
11174
67a25fed
AD
111752003-03-02 Akim Demaille <akim@epita.fr>
11176
11177 Create tests/local.at for Bison generic testing macros.
11178
11179 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11180 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11181 This new file.
11182 * tests/calc.at (AT_CHECK_CALC): Adjust.
11183 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11184 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11185 * tests/local.at: here.
11186 (AT_COMPILE_CXX): Tags the tests using it as c++.
11187 Ignore the test if CXX is not functional.
11188
9c2b381f
PE
111892003-03-01 Paul Eggert <eggert@twinsun.com>
11190
11191 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11192 not loc->end, since loc->end might contain garbage and this leads
11193 to undefined behavior on some platforms.
11194 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11195 depend on *loc, so that the reader doesn't give the the false
11196 impression that *loc is initialized.
11197 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11198 does not survive the return.
11199
0433ba88
AD
112002003-03-01 Akim Demaille <akim@epita.fr>
11201
11202 * src/scan-gram.l (code_start): Always initialize it when entering
11203 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11204 yylex invocation. An alternative would be making it static, but
11205 then it starts with the second %%'s beginning, instead of its end.
11206
b305ea69
PE
112072003-02-28 Paul Eggert <eggert@twinsun.com>
11208
11209 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11210 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 11211 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 11212
c3d25e01
PE
112132003-02-26 Paul Eggert <eggert@twinsun.com>
11214
11215 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11216 Remove Sequent/Pyramid discussion (nobody uses them any more).
11217 Merge VMS and MS-DOS discussion; these ports may well be dead
11218 but let's keep mentioning them for now. Put <> around email
11219 addresses. Add copyright notice.
11220
c267ffbc
PE
112212003-02-24 Paul Eggert <eggert@twinsun.com>
11222
11223 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11224 to avoid collision with flex use of yylineno.
11225 Problem reported by Bruce Lilly in
161a71f3 11226 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
11227 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11228 * data/yacc.c (yy_reduce_print): Likewise.
11229
11230 * config/depcomp: Sync with Automake 1.7.3.
11231
f939fc12
AD
112322003-02-21 Akim Demaille <akim@epita.fr>
11233
11234 * data/lalr1.cc: Use temporary variables instead of casts to
11235 change integer types.
11236 Suggested by Paul Eggert.
11237
95923bd6
AD
112382003-02-21 Akim Demaille <akim@epita.fr>
11239
11240 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11241 to avoid confusions with lalr1.cc's notion of Position.
11242 Suggested by Paul Eggert.
11243
2cdc240e
AD
112442003-02-20 Akim Demaille <akim@epita.fr>
11245
11246 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11247 before initial_columns.
11248 (location.hh): Use consistent variable names when defining the
11249 operator<<.
11250 Use "last" so that we subtract from Positions, not from unsigned.
11251
5d003116
AD
112522003-02-20 Akim Demaille <akim@epita.fr>
11253
11254 * data/lalr1.cc (position.hh): New subfile, including the extended
11255 and Doxygen'ed documentation of class Position.
11256 (location.hh): Use it.
11257 Document a` la Doxygen.
ba1ecc07 11258 With the help of Benoit Perrot.
5d003116 11259
d02b25f9
AD
112602003-02-20 Akim Demaille <akim@epita.fr>
11261
11262 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11263 AT_YACC_IF.
11264 Redefine AT_YYERROR_SEES_LOC_IF using it.
11265 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11266 not defined.
11267 Don't use the location in yy::Parser::error_ and
11268 yy::Parser::print_ when not %locations.
11269 Activate more lalr1.cc tests.
11270
0d1c3a04
AD
112712003-02-19 Akim Demaille <akim@epita.fr>
11272
11273 * data/lalr1.cc: When displaying a line number, be sure to make it
11274 an int.
11275
60a777aa
AD
112762003-02-19 Akim Demaille <akim@epita.fr>
11277
11278 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11279 Remove, useless.
11280 (YYABORT, YYACCEPT, YYERROR): New.
11281 * tests/calc.at: Renable the lalr1.cc test.
11282
0b86fc41
AD
112832003-02-19 Akim Demaille <akim@epita.fr>
11284
11285 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11286 error recovery, mixing with/without pops and discarding of the
11287 lookahead.
11288 Exercise YYERROR.
11289 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11290
da99a5dc
PE
112912003-02-17 Paul Eggert <eggert@twinsun.com>
11292
11293 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11294 * tests/testsuite.at (AT_COMPILE): Use them.
11295 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 11296 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 11297
93b8c255
PE
112982003-02-12 Paul Eggert <eggert@twinsun.com>
11299
11300 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11301 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 11302 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
11303 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11304 Check for malloc failure, for consistency with yacc.c.
11305 (yytname_size): Remove, for consistency with yacc.c.
11306
11307 The bug still remains in data/lalr1.cc, as I didn't have time
11308 to fix it there.
11309
7548fed2
AD
113102003-02-06 Akim Demaille <akim@epita.fr>
11311
11312 * configure.ac (GXX): Rename as...
11313 (CXX): this, to keep the original Autoconf semantics.
11314 Require 2.57.
11315 * data/lalr1.cc: Fix b4_copyright invocations.
11316 If YYDEBUG is not defined, don't depend upon name_ being defined.
11317 (location.hh): Include string and iostream.
11318 (Position::filename): New member.
11319 (Position::Position ()): New.
11320 (operator<< (Position)): New.
11321 (operator- (Position, int)): New.
11322 (Location::first, Location::last): Rename as...
11323 (Location::begin, Location::end): these, to mock the conventional
11324 iterator names.
11325 (operator<< (Location)): New.
11326 * tests/atlocal.in (CXX): New.
11327 * tests/testsuite.at (AT_COMPILE_CXX): New.
11328 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11329 locations in a more synthetic way.
11330 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11331 lalr1.cc is used.
11332 Adjust the C locations to match those from Emacs: first column is
11333 column 0.
11334 Change all the expected results.
11335 Conform to the GCS: simplify the locations when applicable.
11336 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11337 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11338 these CPP macros with the m4 macros new defined by...
11339 (AT_CHECK_PUSHDEFS): this, i.e.:
11340 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 11341 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
11342 New macros.
11343 (AT_CHECK_POPDEFS): Undefine them.
11344 (AT_CHECK_CALC_LALR1_CC): New.
11345 Use it for the first lalr1.cc test.
11346
43a176ef
AD
113472003-02-04 Akim Demaille <akim@epita.fr>
11348
11349 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11350 Location as is defined.
11351
fc049e9c
AD
113522003-02-04 Akim Demaille <akim@epita.fr>
11353
11354 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11355 name_ being defined.
11356
a737b216
PE
113572003-02-03 Paul Eggert <eggert@twinsun.com>
11358
11359 * src/gram.h (start_symbol): Remove unused decl.
11360
11361 Use more-consistent naming conventions for local vars.
11362
11363 * src/derives.c (derives_compute): Change type of local var from
11364 int to rule_number.
11365 * src/gram.c (grammar_rules_partial_print): Likewise.
11366 * src/print.c (print_core): Likewise.
11367 * src/reduce.c (reduce_grammar_tables): Likewise.
11368
11369 * src/gram.c (grammar_dump): Change name of item_number *
11370 local var from r to rp.
11371 * src/nullable.c (nullable_compute): Likewise.
11372
11373 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11374
11375 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11376 for symbol or symbol_number var.
11377 * src/reader.c (grammar_start_symbol_set): Likewise.
11378 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11379 Likewise.
11380 * src/state.c (transitions_to): Likewise.
11381 * src/state.h: Likewise.
11382 * src/tables.c (symbol_number_to_vector_number): Likewise.
11383
11384 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11385 char * var.
11386
11387 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11388 var.
11389
11390 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11391 var.
11392
11393 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11394 Use str, not s, for char * var. Use ch, not c, for character var.
11395 Use size for size var.
11396
11397 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11398 char * var.
11399 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11400 uniqstr var.
11401 * src/uniqstr.h: Likewise.
11402
11403 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11404 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11405 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11406 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11407 param to have same name as that of enum, so that we don't use
11408 "s" to stand for a non-state.
11409
68e93ad5
AD
114102003-02-02 Akim Demaille <akim@epita.fr>
11411
11412 * src/scan-skel.l: Scan more than one inert character per yylex
11413 invocation.
11414
92898986
PE
114152003-02-01 Paul Eggert <eggert@twinsun.com>
11416
11417 Version 1.875a.
11418
1d9d5d71
PE
11419 * po/LINGUAS: Add ms.
11420
0435d061
AD
114212003-01-30 Akim Demaille <akim@epita.fr>
11422
11423 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11424
6029a57f
PH
114252003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11426
11427 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11428 of $1.
0435d061
AD
11429
11430 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 11431 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 11432 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 11433
6029a57f
PH
11434 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11435 (b4_rhs_location): Ditto.
0435d061 11436 (yyfill): New function to copy from stack tree into array
6029a57f 11437 incrementally.
0435d061
AD
11438 (yyuserAction): Modify to allow incremental move of semantic values
11439 to rhs array when in GLR mode.
11440 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
11441 as needed.
11442 Remove dummy use of yystack, as there is now a guaranteed use.
11443 (yydoAction): Modify to allow incremental move of semantic values
11444 to rhs array when in GLR mode.
11445 (yyresolveAction): Ditto.
11446 (yyglrShiftDefer): Update comment.
0435d061 11447 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
11448 (yyglrReduce): Ditto.
11449 (yydoAction): Ditto
0435d061 11450
6029a57f
PH
11451 * tests/glr-regr1.at: Rename to ...
11452 * tests/glr-regression.at: Add new regression test for the problems
11453 described above (adapted from S. Eken).
11454 Update copyright notice.
11455 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11456 * tests/Makefile.am: Ditto.
11457
6cee6297
PE
114582003-01-28 Paul Eggert <eggert@twinsun.com>
11459
11460 * data/lalr1.cc: Do not use @output_header_name@ unless
11461 b4_defines_flag is set. This fixes two bugs reported by
11462 Tim Van Holder in
161a71f3
PE
11463 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11464 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 11465
b2a836b5
PE
114662003-01-21 Paul Eggert <eggert@twinsun.com>
11467
11468 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11469 we don't need to worry about yyerrlab1 being reported as an
11470 "unused label" by non-GCC C compilers. The downside is that if
11471 locations are used then a couple of statements are duplicated each
11472 time YYERROR is invoked, but the upside is that the warnings
11473 should vanish.
11474 (yyerrlab1): Move code to YERROR.
11475 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11476 This reverts some of the 2002-12-27 change.
11477
4196b931
PE
114782003-01-17 Paul Eggert <eggert@twinsun.com>
11479
11480 * src/output.c (symbol_printers_output): Fix typo that led
11481 to core dump. Problem reported by Antonio Rus in
161a71f3 11482 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 11483
3ae831b4
AD
114842003-01-13 Akim Demaille <akim@epita.fr>,
11485 Quoc Peyrot <chojin@lrde.epita.fr>,
11486 Robert Anisko <anisko_r@lrde.epita.fr>
11487
11488 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11489 when the stacks contain one element, as the loop would otherwise
11490 free the last state, and then use the top state (the one we just
11491 popped). This means that the initial elements will not be freed
11492 explicitly, as is the case in yacc.c; it is not a problem, as
11493 these elements have fake values.
11494
e3aa65c5
PE
114952003-01-11 Paul Eggert <eggert@twinsun.com>
11496
11497 * NEWS: %expect-violations are now just warnings, reverting
11498 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11499 bootstrapping problem reported by Matthias Klose; see
161a71f3 11500 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
11501 * src/conflicts.c (conflicts_print): Likewise.
11502 * tests/conflicts.at (%expect not enough, %expect too much,
11503 %expect with reduce conflicts): Likewise.
11504 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11505 that the warning is enabled if the number of conflicts changes
11506 (not necessarily increases).
11507
11508 * src/getargs.c (version): Update copyright year.
11509
f0057011
AD
115102003-01-09 Akim Demaille <akim@epita.fr>
11511
11512 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11513
1ee6d2a0
PE
115142003-01-08 Paul Eggert <eggert@twinsun.com>
11515
11516 * Makefile.maint (WGETFLAGS):
11517 New macro, containing "-C off" to disable proxy caches.
11518 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11519 (rel-check): Use $(WGET) instead of wget.
11520
d4fd77c4
PE
115212003-01-06 Paul Eggert <eggert@twinsun.com>
11522
11523 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11524 the GLR paper of Scott, Johnstone and Hussain.
11525
464c6927
PE
115262003-01-04 Paul Eggert <eggert@twinsun.com>
11527
d600ee67
PE
11528 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11529 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11530 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11531 (EXTRA_LIBRARIES): New var, for liby.a.
11532 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11533 (EXTRA_SCRIPTS): New var, for yacc.
11534
464c6927
PE
11535 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11536 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11537 Problem reported by Nelson H. F. Beebe.
11538
115392003-01-03 Paul Eggert <eggert@twinsun.com>
11540
11541 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11542 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11543 when compiling Bison 1.875's `bitset bset = obstack_alloc
11544 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11545
11546 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11547 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11548 grow to a huge size with typical invocation.
d600ee67 11549
464c6927
PE
11550 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11551 Use the pattern recommended by Autoconf 2.57, except also protect
11552 against double-definition.
11553 * src/system.h: Likewise.
11554 Portability issues reported by Nelson H. F. Beebe.
d600ee67 11555
464c6927
PE
11556 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11557 All uses changed. Provide a definition in both C and C++.
11558 (yytrue, yyfalse): Define even if defined (__cplusplus).
11559
11560 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11561 Reported by Nelson H. F. Beebe.
d600ee67 11562
464c6927
PE
11563 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11564
0f42c7d5
PE
115652003-01-02 Paul Eggert <eggert@twinsun.com>
11566
11567 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11568 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11569 Bug reported by Nelson H. F. Beebe.
11570
dc546b0f
PE
115712003-01-01 Paul Eggert <eggert@twinsun.com>
11572
11573 * Version 1.875.
11574
2c09b6a7
PE
115752002-12-30 Paul Eggert <eggert@twinsun.com>
11576
11577 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11578 Moved here from...
11579 (<INITIAL>","): Here. This causes stray "," to be treated
11580 more uniformly.
11581
dc546b0f 11582 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
11583 last brace in braced code when not in Yacc mode, for compatibility
11584 with Bison 1.35. This resurrects the 2001-12-15 patch to
11585 src/reader.c.
11586
11587 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11588 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11589
535c0f63
PE
115902002-12-28 Paul Eggert <eggert@twinsun.com>
11591
11592 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11593 that of SYM's type. This fixes Debian bug 168069, reported by
11594 Thomas Olsson.
d600ee67 11595
963fcc17
PE
115962002-12-28 Paul Eggert <eggert@twinsun.com>
11597
11598 Version 1.75f.
11599
11600 Switch back to the Yacc style of conflict reports, undoing some
11601 of the 2002-07-30 change.
11602 * doc/bison.texinfo (Understanding): Use Yacc style for
11603 conflict reports. Also, use new way of locating rules.
11604 * src/conflicts.c (conflict_report):
11605 Renamed from conflict_report_yacc, removing the old
11606 'conflict_report'. Translate the entire conflict report at once,
11607 so that we don't assume that "," has the same interpretation in
11608 all languages.
11609 (conflicts_output): Use Yacc-style conflict report for each state,
11610 instead of our more-complicated style.
11611 (conflicts_print): Use Yacc-style conflict report, except print
11612 the input file name when not emulating Yacc.
11613 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11614 Conflicted Reduction, %expect not enough, %expect too much,
11615 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11616 * tests/existing.at (GNU Cim Grammar): Likewise.
11617 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11618
11619 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11620 fatal): Don't invoke fflush; it's not needed and it might even be
11621 harmful for stdout, as stdout might not be open.
11622 * src/reduce.c (reduce_print): Likewise.
11623
b1efe548
PE
116242002-12-27 Paul Eggert <eggert@twinsun.com>
11625
11626 Fix a bug where error locations were not being recorded correctly.
11627 This problem was originally reported by Paul Hilfinger in
161a71f3 11628 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
11629
11630 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11631 top of the location stack's error locations.
11632 (yyerrlab): Set it. When discarding a token, push its location
11633 onto yylerrsp so that we don't lose track of the error's end.
11634 (yyerrlab1): Now is only the target of YYERROR, so that we can
11635 properly record the location of the action that failed. For GCC
11636 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11637 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11638 (yyerrlab2): New label, which yyerrlab now falls through to.
11639 Compute the error's location by applying YYLLOC_DEFAULT to
11640 the locations of all the symbols that went into the error.
11641 * doc/bison.texinfo (Location Default Action): Mention that
11642 YYLLOC_DEFAULT is also invoked for syntax errors.
11643 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11644 Error locations include the locations of all the tokens that were
11645 discarded, not just the last token.
d600ee67 11646
983c5c2c
PE
116472002-12-26 Paul Eggert <eggert@twinsun.com>
11648
b1efe548
PE
11649 * src/files.c: Include quote.h.
11650 (compute_output_file_names): Warn if we detect conflicting
11651 outputs to the same file. This should catch the misunderstanding
11652 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11653
11654 * src/conflicts.c (conflicts_print): If the user specifies
11655 "%expect N", report an error if there are any reduce/reduce
11656 conflicts. This is what the manual says should happen.
11657 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11658 * tests/conflicts.at (%expect with reduce conflicts): New test.
11659
983c5c2c
PE
11660 Don't use m4_include on relative file names, as it doesn't work as
11661 desired if there happens to be a file with that name under ".".
d600ee67 11662
983c5c2c
PE
11663 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11664 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11665 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11666 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11667 * src/output.c (output_skeleton): Use full path names when
11668 specifying a file to include; don't rely on include path, as
11669 it's unreliable when the working file contains a file with
11670 that name.
d600ee67 11671
983c5c2c
PE
116722002-12-25 Paul Eggert <eggert@twinsun.com>
11673
11674 Remove obsolete references to bison.simple and bison.hairy.
11675 Problem mentioned by Aubin Mahe in
161a71f3 11676 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
11677 * data/glr.c: Comment fix.
11678 * doc/bison.1: Remove references. Also, mention "yacc".
11679
11680 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11681 with -g option.
11682
11683 * src/parse-gram.y (declaration): Use enum "report_states" rather
11684 than its numeric value 1.
11685
11686 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11687 opening a new one. This fixes Debian bug 165349, reported by
11688 Bruce Stephens.
11689
23f2d9dc
PE
116902002-12-24 Paul Eggert <eggert@twinsun.com>
11691
11692 Version 1.75e.
11693
11694 * Makefile.maint (cvs-update): Don't assume that the shell
11695 supports $(...), as Solaris sh doesn't.
11696
11697 * src/parse-gram.y (lloc_default): Remove test for empty
11698 nonterminals at the end, since it didn't change the result.
11699
117002002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
11701
11702 If the user does not define YYSTYPE as a macro, Bison now declares it
11703 using typedef instead of defining it as a macro. POSIX requires this.
11704 For consistency, YYLTYPE is also declared instead of defined.
11705
11706 %union directives can now have a tag before the `{', e.g., the
11707 directive `%union foo {...}' now generates the C code
11708 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11709 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11710 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11711 instead of `yyltype'.
11712
11713 `yystype' and `yyltype' are now obsolescent macros instead of being
11714 typedefs or tags; they are no longer documented and will be
11715 withdrawn in a future release.
11716
11717 * data/glr.c (b4_location_type): Remove.
11718 (YYSTYPE): Renamed from yystype.
11719 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11720 (struct YYLTYPE): Renamed from struct yyltype.
11721 (YYLTYPE): Renamed from yyltype.
11722 (yyltype, yystype): New (and obsolescent) macros,
11723 for backward compatibility.
11724 * data/yacc.c: Likewise.
11725
11726 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11727 does not specify a union tag. This is for compatibility with
11728 Solaris 9 yacc.
11729
11730 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11731 const *, since it is now modified by stripping surrounding { }.
11732 (current_braced_code): Remove.
11733 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11734 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11735 trailing " {...}". Now of type <chars>.
11736 (grammar_declaration): Adjust to bundled tokens.
11737 (code_content): Remove; stripping is now done by add_param.
11738 (print_token_value): Print contents of bundled tokens.
11739 (token_name): New function.
11740
11741 * src/reader.h (braced_code, current_braced_code): Remove.
11742 (token_name): New decl.
11743
11744 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11745 token_type, not braced_code code_kind. All uses changed.
11746 (SC_PRE_CODE): New state, for scanning after a keyword that
11747 has (or usually has) an immediately-following braced code.
11748 (token_type): New local var, to keep track of which token type
11749 to return when scanning braced code.
11750 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 11751 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
11752 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11753 instead of returning a token type immediately.
11754 (<INITIAL>"{"): Set token type.
11755 (<SC_BRACED_CODE>"}"): Use it.
11756 (handle_action_dollar, handle_action_at): Now returns bool
11757 indicating success. Fail if ! current_rule; this prevents a core dump.
11758 (handle_symbol_code_dollar, handle_symbol_code_at):
11759 Remove; merge body into caller.
11760 (handle_dollar, handle_at): Complain in invalid contexts.
11761
11762 * NEWS, doc/bison.texinfo: Document the above.
11763 * NEWS: Fix years and program names in copyright notice.
11764
879ca4f8
PE
117652002-12-17 Paul Eggert <eggert@twinsun.com>
11766
11767 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11768 Reporting, Table of Symbols): Omit mentions of %lex-param and
11769 %parse-param from the documentation for now.
11770
1c5fe69d
PE
117712002-12-15 Paul Eggert <eggert@twinsun.com>
11772
11773 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11774 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11775 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
11776 disagreed with the Bison documentation. Bug
11777 reported by Andrew Walrond.
d600ee67 11778
1c5fe69d
PE
11779 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11780 as the caller now does that.
11781 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11782 (YYEMPTY): Parenthesize right hand side, since others use it.
11783 (yyparse): Don't assume that our generated code is the only code
11784 that sets yychar.
11785
d1de5372
PE
117862002-12-13 Paul Eggert <eggert@twinsun.com>
11787
11788 Version 1.75d.
11789
11790 POSIX requires a "yacc" command.
11791 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11792 (MOSTLYCLEANFILES): Add yacc.
11793 (yacc): New rule.
1c5fe69d 11794 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
11795 as an alias for bison y.
11796
11797 * po/LINGUAS: Add da.
d600ee67 11798
d1de5372
PE
11799 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11800 problem with latest <getopt.h>.
11801 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11802
11803 * doc/fdl.texi: Upgrade to 1.2.
11804 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11805 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11806 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11807 gnulib.
11808 * config/install-sh: Sync with autotools.
11809
11810 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 11811 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
11812 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11813 locations are requested.
11814 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11815 locations are requested.
11816
d0f3fe23
PE
118172002-12-12 Paul Eggert <eggert@twinsun.com>
11818
11819 Remove unportable casts and storage allocation tricks.
11820 While we're at it, remove almost all casts, since they
11821 usually aren't needed and are a sign of trouble.
11822
11823 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11824
11825 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11826 the pointer DSET returned by malloc; this isn't portable.
11827 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11828 Similarly for DERIVES.
11829 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11830 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11831 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11832
11833 * src/derives.c (derives_compute): Do not bother invoking
11834 int_of_rule_number, since rule numbers are integers.
11835
11836 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11837 rather than XMALLOC (char, N).
11838
11839 * src/files.c (filename_split): Rewrite to avoid cast.
11840
11841 * src/gram.h (symbol_number_as_item_number,
11842 item_number_as_symbol_number, rule_number_as_item_number,
11843 item_number_as_rule_number):
11844 Now inline functions rather than macros, to avoid casts.
11845 * src/state.h (state_number_as_int): Likewise.
11846 * src/tables.c (state_number_to_vector_number,
11847 symbol_number_to_vector_number): Likewise.
11848
11849 * src/gram.h (int_of_rule_number): Remove; no longer used.
11850
11851 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11852 since the resulting storage is always stored into.
11853
11854 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11855 where it's needed.
11856
11857 * src/muscle_tab.c (muscle_m4_output):
11858 Now inline. Return bool, not int.
11859 * src/state.c (state_compare): Likewise.
11860 * src/symtab.c (symbol_check_defined,
11861 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11862 hash_compare_symbol, hash_symbol):
11863 Likewise.
11864 * src/uniqstr.c (uniqstr_print): Likewise.
11865 * src/muscle_tab.c (muscle_m4_output_processor):
11866 New function, to avoid casts.
11867 * src/state.c (state_comparator, stage_hasher): Likewise.
11868 * src/symtab.c (symbol_check_defined_processor,
11869 symbol_check_alias_consistency_processor, symbol_pack_processor,
11870 symbol_translation_processor, hash_symbol_comparator,
11871 hash_symbol_hasher): Likewise.
11872 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11873 * src/muscle_tab.c (muscles_m4_output):
11874 Use new functions instead of casting old functions unportably.
11875 * src/state.c (state_hash_new): Likewise.
11876 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11877 symbols_token_translations_init):
11878 Likewise.
11879 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11880
11881 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11882 var instead of casting to long, to avoid casts.
11883 (prepare_states): Use MALLOC rather than alloca, so that we don't
11884 have to worry about alloca.
11885 * src/state.c (state_hash_lookup): Likewise.
11886
11887 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11888 local var instead of casting to unsigned char, to avoid casts.
11889
11890 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11891 STATE_ALLOC): Remove.
11892 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11893 rather than calloc, and use offsetof to avoid allocating slightly
11894 too much storage.
11895 (state_new): Initialize all members.
11896
11897 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11898
11899 * src/symtab.c (symbol_free): Remove; unused.
11900 (symbol_get): Remove cast in lhs of assignment.
11901 (symbols_do): Now static. Accept generic arguments, not
11902 hashing-related ones.
11903
11904 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
11905 (symbol_processor): Remove.
11906 (symbols_do): Remove decl; now static.
11907
11908 * src/system.h (alloca): Remove; decl no longer needed.
11909 (<stddef.h>): Include, for offsetof.
11910 (<inttypes.>, <stdint.h>): Include if available.
11911 (uintptr_t): New type, if system lacks it.
11912 (CALLOC, MALLOC, REALLOC): New macros.
11913 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
11914 new macros.
11915
11916 * src/tables.c (table_size): Now int, to pacify GCC.
11917 (table_grow, table_ninf_remap): Use signed table size.
11918 (save_row): Don't bother initializing locals when not needed.
11919 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
11920 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
11921
11922 * src/vcg.h: Correct misspellings.
11923
11924 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
11925
11926
11927 * src/getargs.c (getargs): Don't assume EOF == -1.
11928
26b4a969
PE
119292002-12-09 Paul Eggert <eggert@twinsun.com>
11930
11931 Change identifier spellings to avoid collisions with names
11932 that are reserved by POSIX.
11933
11934 Don't use names ending in _t, since POSIX reserves them.
11935 For consistency, remove _e and _s endings -- they're weren't
11936 needed to remove ambiguity. All uses changed.
11937 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
11938 turn was just renamed from struniq_t.
11939 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
11940 which in turn was just renamed from struniq_processor_t.
11941 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
11942 in turn was renamed from hash_compare_struniq_t.
11943 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
11944 (state_list): Renamed from state_list_t.
11945 * src/assoc.h (assoc): Renamed from assoc_t.
11946 * src/conflicts.c (enum conflict_resolution): Renamed from
11947 enum conflict_resolution_e.
11948 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
11949 (rule_list): Renamed from rule_list_t.
11950 * src/getargs.h (enum trace): Renamed from enum trace_e.
11951 (enum report): Renamed from enum report_e.
11952 * src/gram.h (item_number): Renamed from item_number_t.
11953 (rule_number): Renamed from rule_number_t.
11954 (struct rule_s): Remove the "rule_s" part; not used.
11955 (rule): Renamed from rule_t.
11956 (rule_filter): Renamed from rule_filter_t.
11957 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
11958 (goto_list): Renamed from goto_list_t.
11959 * src/lalr.h (goto_number): Renamed from goto_number_t.
11960 * src/location.h (location): Renamed from location_t.
11961 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
11962 and moved here from:
11963 * src/muscle_tab.h (muscle_entry_t): here.
11964 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
11965 (rule_list): Renamed from rule_list_t.
11966 * src/print_graph.c (static_graph): Renamed from graph.
11967 * src/reader.h (braced_code): Renamed from braced_code_t.
11968 Remove brace_code_e tag.
11969 * src/relation.h (relation_node): Renamed from relation_node_t.
11970 (relation_nodes): Renamed from relation_nodes_t.
11971 (relation): Renamed from relation_t.
11972 * src/state.h (state_number): Renamed from state_number_t.
11973 (struct state): Renamed from struct state_s.
11974 (state): Renamed from state_t.
11975 (transitions): Renamed from transitions_t. Unused (and
11976 misspelled) transtion_s tag removed.
11977 (errs): Renamed from errs_t. Unused errs_s tag removed.
11978 (reductions): Renamed from reductions_t. Unused tag
11979 reductions_s removed.
11980 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
11981 (struct symbol_list): Renamed from struct symbol_list_s.
11982 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
11983 (struct symbol): Renamed from struct symbol_s.
11984 (symbol): Renamed from symbol_t.
11985 * src/tables.c (vector_number): Renamed from vector_number_t.
11986 (action_number): Renamed from action_t.
11987 * src/tables.h (base_number): Renamed from base_t.
11988 * src/vcg.h (enum color): Renamed from enum color_e.
11989 (enum textmode): Renamed from enum textmode_e.
11990 (enum shape): Renamed from enum shape_e.
11991 (struct colorentry): Renamed from struct colorentry_s.
11992 (struct classname): Renamed from struct classname_s.
11993 (struct infoname): Renamed from struct infoname_s.
11994 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
11995 (enum decision): Renamed from enum decision_e.
11996 (enum orientation): Renamed from enum orientation_e.
11997 (enum alignment): Renamed from enum alignment_e.
11998 (enum arrow_mode): Renamed from enum arrow_mode_e.
11999 (enum crossing_type): Renamed from enum crossing_type_e.
12000 (enum view): Renamed from enum view_e.
12001 (struct node): Renamed from struct node_s.
12002 (node): Renamed from node_t.
12003 (enum linestyle): Renamed from enum linestyle_e.
12004 (enum arrowstyle): Renamed from enum arrowstyle_e.
12005 (struct edge): Renamed from struct edge.
12006 (edge): Renamed from edge_t.
12007 (struct graph): Renamed from struct graph_s.
12008 (graph): Renamed from graph_t.
12009 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12010 Rename value_t -> value.
12011 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12012 value_t_as_yystype -> value_as_yystype.
12013
12014 Don't include <errno.h> in the mainstream code, since it
12015 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12016 * lib/get-errno.c, lib/get-errno.h: New files.
12017 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12018 get-errno.c.
12019 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12020 * src/output.c (output_skeleton): Likewise.
12021 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12022 instead of errno.
12023 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12024 Likewise.
12025 (handle_action_dollar, handle_action_at): Likewise.
12026 * src/system.h: Do not include <errno.h>.
12027 (TAB_EXT): Renamed from EXT_TAB.
12028 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12029
12030 Avoid str[a-z]*, since <string.h> reserves that name space.
12031 Change all instances of "struniq" in names to "uniqstr", and
12032 likewise for "STRUNIQ" and "UNIQSTR".
12033 * src/uniqstr.c: Renamed from src/struniq.c.
12034 * src/uniqstr.h: Renamed from src/struniq.h.
12035 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12036 * src/files.c (strsuffix): Remove; unused.
12037 (concat2): Renamed from stringappend. Now static.
12038 * src/files.h (strsuffix, stringappend): Remove; unused.
12039 * src/parse-gram.y (<chars>): Renamed from <string>.
12040 (<uniqstr>): Renamed from <struniq>.
12041 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12042 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12043 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12044 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12045 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12046 (N_EXPAND): Renamed from N_STRETCH.
12047
12048 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12049 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12050 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12051 Remove; unused.
12052 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12053 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12054 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12055 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12056 (BASE_MAXIMUM): Renamed from BASE_MAX.
12057 (BASE_MINIMUM): Renamed from BASE_MIN.
12058 (ACTION_MAX): Remove; unused.
12059 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12060 Unnecessary casts removed from above defines.
12061
12062
12063 Fix misspelling in names.
12064 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12065 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12066 G_NODE_ALIGNEMENT.
12067
12068
12069 * lib/timevar.c (timevar_report): Renamed from time_report,
12070 for consistency with other names.
12071 * lib/timevar.h (timevar_report): New decl.
12072 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12073
12074
12075 Sort include-file uses.
12076
12077 Reorder all include files under src to be in the order "system.h".
12078 then the ../lib include files in angle brackets (alphabetized),
12079 then the . include files in double-quotes (alphabetized). Fix
12080 dependency breakages encountered in this process, as follows:
12081 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12082 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12083 * src/state.h: Include "symtab.h".
12084
996b1c7e
PE
120852002-12-08 Paul Eggert <eggert@twinsun.com>
12086
12087 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12088 since this causes problems when __file__ contains character
12089 sequences like "@" that are treated specially by src/scan-skel.l.
12090 Instead, just use the file's basename. This fixes the bug
12091 reported by Martin Mokrejs in
161a71f3 12092 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 12093
e19c4e5d
PE
120942002-12-06 Paul Eggert <eggert@twinsun.com>
12095
12096 Add support for rules that do not have trailing semicolons, as
12097 POSIX requires. Improve the quality of locations in Bison
12098 diagnostics.
26b4a969 12099
e19c4e5d
PE
12100 * src/location.c: Include <quotearg.h>.
12101 (empty_location): Now const.
12102 (location_print): New function. Follow the recommendation of the
12103 GNU Coding Standards for locations that span file boundaries.
12104 * src/location.h: Do not include <quotearg.h>; no longer needed.
12105 (boundary): New type.
12106 (location_t): Use it. This allows locations to span file boundaries.
12107 All member uses changed: file -> start.file or end.file (as needed),
12108 first_line -> start.line, first_column -> start.column,
12109 last_line -> end.line, last_column -> end.column.
12110 (equal_boundaries): New function.
12111 (LOCATION_RESET, LOCATION_STEP): Remove.
12112 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12113 (empty_location): Now const.
12114 (location_print): New decl.
12115 * src/parse-gram.y (lloc_default): New function, which handles
12116 empty locations more accurately.
12117 (YYLLOC_DEFAULT): Use it.
12118 (%token COLON): Remove.
12119 (%token ID_COLON): New token.
26b4a969 12120 (rules): Use it.
e19c4e5d
PE
12121 (declarations, rules): Remove trailing semicolon.
12122 (declaration, rules_or_grammar_declaration):
12123 Allow empty (";") declaration.
12124 (symbol_def): Remove empty actions; no longer needed.
12125 (rules_or_grammar_declaration): Remove trailing semicolon.
12126 (semi_colon.opt): Remove.
12127 * src/reader.h: Include location.h.
12128 (scanner_cursor): New decl.
12129 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12130 rolling our own.
12131 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12132 of *loc.
12133 (STEP): Remove. No longer needed, now that adjust_location does
12134 the work. All uses removed.
12135 (scanner_cursor): New var.
12136 (adjust_location): Renamed from extend_location. It now sets
12137 *loc and adjusts the scanner cursor. All uses changed.
12138 Don't bother testing for CR.
12139 (handle_syncline): Remove location arg; now updates scanner cursor.
12140 All callers changed.
12141 (unexpected_end_of_file): Now accepts start boundary of token or
12142 comment, not location. All callers changed. Update scanner cursor,
12143 not the location.
12144 (SC_AFTER_IDENTIFIER): New state.
12145 (context_state): Renamed from c_context. All uses changed.
12146 (id_loc, code_start, token_start): New local vars.
12147 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12148 processing of Yacc white space and equivalents here.
12149 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12150 instead of returning ID immediately, since we need to search for
12151 a subsequent colon.
12152 (<INITIAL>"'", "\""): Save token_start.
12153 (<INITIAL>"%{", "{", "%%"): Save code_start.
12154 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12155 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12156 BEGIN context_state at end, not INITIAL.
12157 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12158 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12159 Return correct token start.
12160 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12161 the start of a character, string or multiline comment is found.
12162 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12163 Reduction): Adjust reported locations to match the more-precise
12164 results now expected.
12165 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12166 * tests/reduce.at (Useless Rules, Reduced Automaton,
12167 Underivable Rules): Likewise.
12168 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12169 or "|"' now that so many other tokens are allowed by the new grammar.
12170
12171 * src/complain.h (current_file): Remove duplicate decl;
12172 current_file is now owned by files.h.
12173 * src/complain.c, src/scan-gram.l: Include files.h.
12174
121752002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 12176
e19c4e5d
PE
12177 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12178 promotes to int; it might be unsigned int.
12179 * data/yacc.c (yy_reduce_print): Likewise.
12180
12181 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12182 be #defined in the prologue, not in the Bison declarations.
12183 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 12184
b64755e3
PE
121852002-12-02 Paul Eggert <eggert@twinsun.com>
12186
12187 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12188 * lib/strtoul.c: New file, from gnulib.
12189 This fixes a porting bug reported by Peter Klein in
161a71f3 12190 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 12191
6e746484
PE
121922002-11-30 Paul Eggert <eggert@twinsun.com>
12193
b64755e3
PE
12194 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12195 and put only a forward declaration in the prologue. This is for
12196 consistency with the other scanner helper functions.
12197
6ba55592
PE
12198 Type clashes now generate warnings, not errors, since it
12199 appears that POSIX may allow some grammars with type clashes.
12200 * src/reader.c (grammar_current_rule_check): Warn about
12201 type clashes instead of complaining.
12202 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12203
6e746484
PE
12204 Add Yacc library, since POSIX requires it.
12205 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12206 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12207 * lib/main.c, lib/yyerror.c: New files.
12208
12209 gram_error can be static; it need not be extern.
12210 * src/reader.h (gram_error): Remove decl.
12211 * src/parse-gram.y (gram_error): Now static. Add static decl.
12212 (print_token_value): Omit parameter names from forward decl,
12213 for consistency.
12214
88510f9c
PE
122152002-11-29 Paul Eggert <eggert@twinsun.com>
12216
6e746484
PE
12217 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12218 be declared before being used. E.g., one should typically
12219 declare them in the prologue. Use GNU coding style in examples.
12220 Put "const" consistently after the type it modifies. Mention
12221 that C99 supports "inline". Mention that yyerror traditionally
12222 returns "int".
12223
88510f9c
PE
12224 %parse-param and %lex-param now take just one argument, the
12225 declaration; the argument name is deduced from the declaration.
12226
12227 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12228 Reporting, Table of Symbols): Document this.
12229 * src/parse-gram.y (add_param): New function.
12230 (COMMA): Remove.
12231 (declaration): Implement new rule for %parse-param and %lex-param.
12232 * src/scan-gram.l: "," now elicits a warning, rather than being
12233 a token; this is more compatible with byacc.
12234 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12235
bb92250c
PE
122362002-11-27 Paul Eggert <eggert@twinsun.com>
12237
12238 Rename identifiers to avoid real and potential collisions.
12239
12240 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12241 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 12242 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
12243 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12244 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12245 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12246 All uses changed.
12247 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12248 The name "yycontrol" violates the name space rules, and this stuff
12249 wasn't being used anyway.
12250 (input): Remove action; this stuff wasn't being used.
12251 (gram_error): Rename local variable yylloc -> loc.
12252 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12253 (YY_DECL): Don't use "yy" at start of local variables.
12254 All uses changed, e.g., yylloc -> loc.
12255 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12256 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12257 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12258 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12259
12260 * src/parse-gram.y (gram_error): loc is now const *.
12261 * src/reader.h (gram_error): Likewise.
12262
3af4feb2
PE
122632002-11-24 Paul Eggert <eggert@twinsun.com>
12264
12265 Version 1.75c.
12266
12267 * tests/actions.at (Actions after errors): Use an output format
12268 more similar to that of the Printers and Destructors test.
12269 Test the position of the ';' token too.
12270 (Printers and Destructors): Likewise.
12271 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12272 unnecessarily alarming people when the test fails.
12273
12274 * data/yacc.c (yyerrlab1): Move this label down, so that the
12275 parser does not discard the lookahead token if the user code
12276 invokes YYERROR. This change is required for POSIX conformance.
12277
12278 * lib/error.c: Sync with gnulib.
12279
122802002-11-22 Paul Eggert <eggert@twinsun.com>
12281
12282 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12283 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12284 * lib/xmalloc.c: Likewise.
26b4a969 12285
58004308
PE
122862002-11-20 Paul Eggert <eggert@twinsun.com>
12287
12288 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12289
122902002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 12291
58004308
PE
12292 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12293 should use `if (! x) abort ();' rather than `assert (x);', and
12294 anyway it's one less thing to worry about configuring.
12295
12296 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12297 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12298 and replace all instances of assert with abort.
12299 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12300 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12301
12302 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12303 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12304 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12305 hash_find_entry, hash_rehash, hash_insert): Likewise.
12306 * src/conflicts.c (resolve_sr_conflict): Likewise.
12307 * src/lalr.c (set_goto_map, map_goto): Likewise.
12308 * src/nullable.c (nullable_compute): Likewise.
12309 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12310 * src/reader.c (packgram, reader): Likewise.
12311 * src/state.c (state_new, state_free, state_transitions_set,
12312 state_reduction_find): Likewise.
12313 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12314 symbol_pack): Likewise.
12315 * src/tables.c (conflict_row, pack_vector): Likewise.
12316 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12317 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12318 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12319 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12320
12321 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12322 (ARGMATCH_CONSTRAINT): New macro.
12323 (ARGMATCH_ASSERT): Use it.
12324
12325 * src/system.h (verify): New macro.
12326 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12327 rather than assert.
12328 * src/tables.c (tables_generate): Likewise.
12329
12330 * src/struniq.c (struniq_assert): Now returns void, and aborts
12331 if the assertion is false.
12332 (struniq_assert_p): Remove.
12333 * src/struniq.h: Likewise.
12334
76ae8198
PE
123352002-11-18 Paul Eggert <eggert@twinsun.com>
12336
12337 * data/glr.c (yygetLRActions): Replace `yyindex' with
12338 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12339 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 12340 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 12341
d3c4e709
AD
123422002-11-18 Akim Demaille <akim@epita.fr>
12343
12344 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12345 space.
12346 From Tim Van Holder.
12347
8d8a7238
PE
123482002-11-17 Paul Eggert <eggert@twinsun.com>
12349
12350 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12351 to "SyntaxError" for consistency with my 2002-11-15 change.
12352
12353 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12354 not define to {}, since this breaks the common use of `YYDPRINTF
12355 ((...));' if a single statement is desired (e.g. before `else').
12356 Work around GCC warnings by surrounding corresponding calls with
12357 {} if needed.
12358 (yyhasResolvedValue): Remove unused function.
12359 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12360 loop body.
12361 (yyreportSyntaxError): Renamed from yyreportParseError.
12362 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12363 All uses changed.
12364 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12365 extern when possible. Remove unused initializations.
12366
b0937b22
AD
123672002-11-16 Akim Demaille <akim@epita.fr>
12368
12369 Augment the similarity between GLR and LALR traces.
12370
12371 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12372 (YY_REDUCE_PRINT): New.
12373 (yyparse): Use them.
12374 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12375 YYDPRINT here.
12376 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12377 state reached after the reduction/recovery, since...
12378 (yyparse, yyprocessOneStack): Report the state we are entering in.
12379
c5e3e510
AD
123802002-11-16 Akim Demaille <akim@epita.fr>
12381
12382 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12383 Add support for --trace=skeleton.
12384 * src/scan-skel.l: %option debug.
12385 Scan strings of non-@ or \n instead of character by character.
12386 (scan_skel): Handle trace_skeleton.
12387 (QPUTS): New.
12388 (@output_parser_name@, @output_header_name@): ``Restore'' their
12389 support (used to be M4 macros).
12390 * data/yacc.c: Quote larger chunks, a la glr.c.
12391 * data/lalr1.cc: Likewise.
12392 The header guards are no longer available, so use some other
12393 string than `YYLSP_NEEDED'.
12394
4c6cc1db
AD
123952002-11-16 Akim Demaille <akim@epita.fr>
12396
12397 Make the ``Printers and Destructors'' test more verbose, taking
12398 `yacc.c''s behavior as (possibly wrong) reference.
12399
12400 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12401 instead of fprint on stdout.
12402 Set and report the last_line of the symbols.
12403 Consistently display values and locations.
12404
6d9e8019
PE
124052002-11-16 Paul Eggert <eggert@twinsun.com>
12406
12407 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12408
6e649e65
PE
124092002-11-15 Paul Eggert <eggert@twinsun.com>
12410
b25d88f6
PE
12411 * tests/actions.at (Actions after errors): New test case.
12412
6e649e65
PE
12413 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12414 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12415 tests/action.at, tests/calc.at, tests/conflicts.at,
12416 tests/cxx-type.at, tests/regression.at:
12417 "parse error" -> "syntax error" for POSIX compatibility.
12418 "parsing stack overflow..." -> "parser stack overflow" so
12419 that code matches Bison documentation.
12420
0f39aab9
AD
124212002-11-15 Akim Demaille <akim@epita.fr>
12422
12423 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12424 take two BRACED_CODE, not two string_content.
12425 Free the scanner's obstack when we are done.
12426 (code_content): New.
12427 * tests/calc.at: Adjust.
12428 * doc/bison.texinfo: Adjust.
12429 Also, make sure to include the `,' for these declarations.
12430
761c1926
AD
124312002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12432
12433 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12434 definition; avoids potential autoreconf problems.
12435
b0f98b10
AD
124362002-11-15 Akim Demaille <akim@epita.fr>
12437
12438 Always check the value returned by yyparse.
12439
12440 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12441 returned by yyparse.
12442 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12443 Adjust calls.
12444 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12445 returned by yyparse.
12446
970785f1
PH
124472002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12448
12449 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12450 on input.at test.
12451
8fcc7db1
PE
124522002-11-14 Paul Eggert <eggert@twinsun.com>
12453
7ec1b48e
PE
12454 * src/output.c (output_skeleton): Call xfopen instead of
12455 duplicating xfopen's body.
12456
cfff7583 12457 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 12458 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 12459
8fcc7db1
PE
12460 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12461 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12462 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12463 file twice in the grammar, as an extra check.
12464
12465 * tests/input.at (Torturing the Scanner): Surround the
12466 backslash-newline tests with "#if 0", to make it less likely that
12467 we'll run into compiler bugs. Bring back solitary \ inside
12468 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 12469 test backslash-newline in C character constant.
8fcc7db1 12470
4e8d992c
AD
124712002-11-14 Akim Demaille <akim@epita.fr>
12472
12473 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12474 status of the compiler.
f32b346d 12475 Calling `exit 1' is no longer needed.
4e8d992c
AD
12476 Reported by Nelson H. F. Beebe.
12477
9501dc6e
AD
124782002-11-14 Akim Demaille <akim@epita.fr>
12479
12480 * tests/atlocal.in (CPPFLAGS): We have config.h.
12481 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12482 New.
12483 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12484 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12485 * tests/regression.at, tests/torture.at: Use them for all the
12486 grammars that are to be compiled.
12487 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12488 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12489 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12490
18b519c0
AD
124912002-11-14 Akim Demaille <akim@epita.fr>
12492
12493 * doc/bison.texinfo: Various formatting changes (alignments in
12494 samples, additional @group/@end group, GCS in samples.
12495 Use @deffn instead of simple @table to define the directives,
12496 macros, variables etc.
12497
9a86cdb9
PE
124982002-11-13 Paul Eggert <eggert@twinsun.com>
12499
daa33def 12500 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 12501 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 12502
daa33def 12503 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 12504 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
12505 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12506 * tests/headers.at (export YYLTYPE): Likewise.
12507
12508 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 12509 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 12510
9a86cdb9
PE
12511 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12512 comments, since they're not portable. Use GNU coding style.
12513
9c1e26bd
AD
125142002-11-13 Akim Demaille <akim@epita.fr>
12515
12516 * data/yacc.c: Leave bigger chunks of quoted text.
12517 (YYDSYMPRINTF): New.
12518 Use it to report symbol activities.
12519 * data/glr.c (YYDSYMPRINTF): New.
12520 Use it.
12521
87f721cc
PE
125222002-11-12 Paul Eggert <eggert@twinsun.com>
12523
12524 Version 1.75b.
12525
12526 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12527 (yyglrReduce): Return yyok, not 0.
12528 This should avoid the enumerated-type warnings reported
464c6927 12529 by Nelson H. F. Beebe in
161a71f3 12530 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
12531
12532 * lib/bbitset.h (BITSET_INLINE): Remove.
12533 * lib/bitset.h [! BITSET_INLINE]: Remove.
12534 (bitset_set, bitset_reset, bitset_test): Rename local vars
12535 to avoid shadowing warnings by GCC.
12536
12537 * data/glr.c (inline): Remove #define. It's the user's
12538 responsibility to #define it away, just like 'const'.
464c6927 12539 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 12540 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 12541
87f721cc
PE
12542 * Makefile.maint (po-check): Scan .l and .y files instead of the
12543 .c and the .h files that they generate. This fixes the bug
12544 reported by Tim Van Holder in:
161a71f3 12545 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
12546 Look for N_ as well as for _. Try to avoid matching #define for
12547 N_ and _.
12548 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12549 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12550 * src/scan-gram.l: Revamp regular expressions so that " and '
12551 do not confuse xgettext.
12552
12553 * src/struniq.h (struniq_new): Do not declare the return type
12554 to be 'const'; this violates the C standard.
12555 * src/struniq.c (struniq_new): Likewise.
12556
be14ade5
AD
125572002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12558
12559 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12560 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12561 linker.
12562
05291fbc
AD
125632002-11-12 Akim Demaille <akim@epita.fr>
12564
12565 * Makefile.maint: Sync with Autoconf:
12566 (local_updates): New.
12567
1f5fd52e
AD
125682002-11-12 Akim Demaille <akim@epita.fr>
12569
12570 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12571
283f1e64
AD
125722002-11-12 Akim Demaille <akim@epita.fr>
12573
12574 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12575 locations.
12576
886b69d1
AD
125772002-11-12 Akim Demaille <akim@epita.fr>
12578
12579 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12580 not yyvalue.
12581
3df37415
AD
125822002-11-12 Akim Demaille <akim@epita.fr>
12583
12584 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12585 Use it to test the GLR parser.
12586
7bd6c77e
AD
125872002-11-12 Akim Demaille <akim@epita.fr>
12588
12589 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12590 defines it.
12591 * data/glr.c (yystos): New.
12592 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12593 (YYDSYMPRINT): New.
12594 (yyval): Don't define it, it is handled via M4.
12595 (yyrecoverParseError): Free verbosely the discarded symbols.
12596 * data/yacc.c (yysymprint): Remove, rather...
12597 (b4_yysymprint_generate): invoke.
12598 * data/c.m4 (b4_yysymprint_generate): New.
12599 Accept pointers as arguments, as opposed to the version from
12600 yacc.c.
12601 (b4_yydestruct_generate): Likewise.
12602 * tests/cations.at (Printers and Destructors): Use Bison directives
12603 instead of CPP macros.
12604 Don't rely on internal details.
12605
b0400cc6
AD
126062002-11-12 Akim Demaille <akim@epita.fr>
12607
12608 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12609 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12610 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12611 it against YYEMPTY and so forth), work on yytoken (i.e., set
12612 it to YYEMPTY etc.).
12613 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12614 (b4_symbol_actions): Remove.
12615 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12616 for 0, end-of-input.
12617
72f889cc
AD
126182002-11-12 Akim Demaille <akim@epita.fr>
12619
12620 * doc/bison.texinfo (Destructor Decl): New.
12621
b1ae9233
AD
126222002-11-12 Akim Demaille <akim@epita.fr>
12623
12624 * src/tables.c (tables_generate): Use free for pointers that
12625 cannot be NULL, not XFREE.
12626 (pack_vector): Use assert, not fatal, for bound violations.
12627 * src/state.c (state_new): Likewise.
12628 * src/reader.c (reader): Likewise.
12629 * src/lalr.c (set_goto_map): Likewise.
72f889cc 12630 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
12631 the file name.
12632
7ec2d4cd
AD
126332002-11-12 Akim Demaille <akim@epita.fr>
12634
12635 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12636 Restore.
12637 * src/scan-gram.l (last_string): Is global to the file, not to
12638 yylex.
12639 * src/parse-gram.y (input): Don't append the epilogue here,
12640 (epilogue.opt): do it here, and free the scanner's obstack.
12641 * src/reader.c (epilogue_set): Rename as...
12642 (epilogue_augment): this.
12643 * data/c.m4 (b4_epilogue): Defaults to empty.
12644
573a6cd3
AD
126452002-11-12 Akim Demaille <akim@epita.fr>
12646
12647 * src/getargs.c (long_options): Remove duplicates.
12648 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12649 Remove.
12650 * doc/bison.rnh: Remove.
12651 * doc/bison.texinfo (VMS Invocation): Remove.
12652
95612cfa
AD
126532002-11-12 Akim Demaille <akim@epita.fr>
12654
12655 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12656 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12657
12658 Use struniq for symbols.
12659
12660 * src/symtab.h (symbol_t): The tag member is a struniq.
12661 (symbol_type_set): Adjust.
12662 * src/symtab.c (symbol_new): Takes a struniq.
12663 (symbol_free): Don't free the tag member.
12664 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12665 (hash_compare_symbol, hash_symbol): these.
12666 Use the fact that tags as struniqs.
12667 (symbol_get): Use struniq_new.
12668 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12669 Returns a strniq.
12670 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12671 and type members are struniqs.
12672 * src/reader.c (get_merge_function)
12673 (grammar_current_rule_merge_set): Adjust.
12674 (TYPE, current_type): Are struniq.
12675
12676 Use struniq for file names.
12677
12678 * src/files.h, src/files.c (infile): Split into...
12679 (grammar_file, current_file): these.
12680 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12681 * src/reduce.c (reduce_print): Likewise.
12682 * src/getargs.c (getargs): Likewise.
12683 * src/complain.h, src/complain.c: Likewise.
12684 * src/main.c (main): Call struniqs_new early enough to use it for
12685 file names.
12686 Don't free the input file name.
12687
3e6656f9
AD
126882002-11-12 Akim Demaille <akim@epita.fr>
12689
12690 * src/symtab.c (symbol_free): Remove dead deactivated code:
12691 type_name are properly removed.
12692 Don't use XFREE to free items that cannot be NULL.
12693 * src/struniq.h, src/struniq.c: New.
12694 * src/main.c (main): Initialize/free struniqs.
12695 * src/parse-gram.y (%union): Add astruniq member.
12696 (yyprint): Adjust.
12697 * src/scan-gram.l (<{tag}>): Return a struniq.
12698 Free the obstack bit that used to store it.
12699 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12700
7672019c
PE
127012002-11-11 Paul Eggert <eggert@twinsun.com>
12702
12703 Revamp to fix many (but not all) of the C- and M4-related quoting
12704 problems. Among other things, this fixes the Bison bug reported
12705 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 12706 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
12707
12708 Use new @ escapes consistently. Represent brackets with @{ and @}
12709 rather than @<:@ and @:>@, since this works a bit better with dumb
12710 editors like vi. Represent @ with @@, since @ is now consistently
12711 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12712 __ofile__, to avoid unexpected expansions. Similarly, use @output
12713 rather than #output.
12714
12715 * data/c.m4 (b4_copyright): Omit file name from comment, since
12716 the file name could contain "*/".
12717 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12718 be quoted. All uses changed.
12719
12720 * data/glr.c: Use new @ escapes consistently.
12721 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12722 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12723 Remove, since they couldn't handle arbitrary characters in file
12724 names.
12725 * data/lalr1.cc: Likewise.
12726 * data/yacc.c: Likewise.
12727
12728 * src/files.c (output_infix): Remove; all uses removed.
12729 * src/files.h: Likewise.
12730
12731 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12732 mishandled funny characters in file names, and anyway it isn't
12733 needed any more.
12734 * data/yacc.c: Likewise.
12735 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12736
12737 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12738 * data/yacc.c: Likewise.
12739
12740 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12741 strings now.
12742 (muscle_init): Quote filename as a C string.
12743 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12744 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12745 * src/output.c (escaped_file_name_output): New function.
12746 (prepare_symbols): Quote tokens for M4.
12747 (prepare): Don't insert output_infix, output_prefix,
12748 output_parser_name, output_header_name; this is now down by scan-skel.
12749 Insert skeleton as a C string.
12750
12751 * src/output.c (user_actions_output, symbol_destructors_output,
12752 symbol_printers_output): Quote filenames for C and M4.
12753 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12754
12755 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12756 escapes other than \\ and \'; this simplifies the code.
12757 (<SC_STRING>): Likewise, for \\ and \".
12758 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12759 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12760 Use new escapes @{ and @} for [ and ].
12761
12762 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12763 them with auto vars.
12764 Switch to new escape scheme, where @ is the escape character uniformly.
12765 Abort if a stray escape character is found. Avoid unbounded input
12766 buffer when parsing non-escaped text.
12767
12768 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12769 __oline__, #output, $@, and @{ do not have unintended meanings.
12770
acea4f3b
PE
127712002-11-09 Paul Eggert <eggert@twinsun.com>
12772
12773 Fix the test failure due to GCC warnings described in
161a71f3 12774 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
12775 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12776 evaluate to 0 if it's impossible for NINF to be in the respective
12777 table.
12778 (yygetLRActions, yyrecoverParseError): Use them.
12779
12780 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12781 counted in the token inserted at end of file. Now takes
12782 location_t *, not location_t, so that the location can be
12783 adjusted. All uses changed.
12784
12785 * tests/regression.at (Invalid inputs): Adjust wording in
12786 diagnostic to match the new behavior.
12787
12788 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12789 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12790 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12791 abort ();'. This reduces the runtime of the "Many lookaheads"
12792 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12793 GCC 3.2.
12794
20ef1ad5
PE
127952002-11-07 Paul Eggert <eggert@twinsun.com>
12796
12797 * src/parse-gram.y (CHARACTER): Remove unused token.
12798 All uses removed.
12799
12800 * src/scan-gram.l: Remove stack option. We no longer use the
12801 stack, since the stack was never deeper than 1; instead, use the
12802 new auto var c_context to record the stacked value.
12803
12804 Remove nounput option. At an unexpected end of file, we now unput
12805 the minimal input necessary to end cleanly; this simplifies the
12806 code.
12807
12808 Avoid unbounded token sizes where this is easy.
12809
12810 (unexpected_end_of_file): New function.
12811 Use it to systematize the error message on unexpected EOF.
12812 (last-string): Now auto, not static.
12813 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12814 (scanner_last_string_free): Remove; not used.
12815 (percent_percent_count): Move decl to just before use.
12816 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12817 not the (never otherwised-used) CHARACTER.
12818
93724f13
AD
128192002-11-07 Akim Demaille <akim@epita.fr>
12820
12821 Let yyerror always receive the msg as last argument, so that
12822 yyerror can be variadic.
12823
12824 * data/yacc.c (b4_yyerror_args): New.
12825 Use it when calling yyerror.
12826 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12827 Use it when calling yyerror.
12828 * doc/bison.texinfo (Error Reporting): Adjust.
12829 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12830 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12831
6e40b4eb
AD
128322002-11-06 Akim Demaille <akim@epita.fr>
12833
12834 #line should have quoted strings.
12835 Ideally, this should be done by m4_quotearg.
12836
12837 * src/scan-skel.l: Include quotearg.h.
12838 Quote __ofile__.
12839 * src/output.c (symbol_printers_output)
12840 (symbol_destructors_output): Quote the file name.
12841
2dfbfc12
AD
128422002-11-06 Akim Demaille <akim@epita.fr>
12843
12844 * tests/regression.at (Invalid inputs): Adjust to the recent
12845 messages.
12846
437c2d80
AD
128472002-11-06 Akim Demaille <akim@epita.fr>
12848
12849 Restore --no-lines.
12850 Reported by Jim Kent.
12851
12852 * data/c.m4 (b4_syncline): New.
12853 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12854 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12855 * src/output.c (user_actions_output): Likewise.
12856 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 12857 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 12858
900c5db5
AD
128592002-11-06 Akim Demaille <akim@epita.fr>
12860
12861 * src/main.c (main): Free `infile'.
12862 * src/scan-gram.l (handle_syncline): New.
12863 Recognize `#line'.
12864 * src/output.c (user_actions_output, symbol_destructors_output)
12865 (symbol_printers_output): Use the location's file name, not
12866 infile.
12867 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12868
e183b123 128692002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 12870
e183b123 12871 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 12872 either has GLR conflict entries.
e183b123 12873
193eb6b7
PE
128742002-11-05 Paul Eggert <eggert@twinsun.com>
12875
e183b123
PE
12876 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12877 "integer out of range" rather than "invalid value".
12878 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12879 accordingly.
12880
193eb6b7
PE
12881 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12882 Also, remove one static variable in the scanner.
12883
12884 * src/scan-gram.l (braces_level): Now auto, not static.
12885 Initialize to zero if the compiler is being picky.
12886 (INITIAL): Clear braces_level instead of incrementing it.
12887 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12888 as POSIX 1003.1-2001 requires.
12889 * src/system.h (IF_LINT): New macro, taken from coreutils.
12890 * configure.ac: Define "lint" if --enable-gcc-warnings.
12891
29c01725
AD
128922002-11-05 Akim Demaille <akim@epita.fr>
12893
12894 * src/scan-gram.l: When it starts with `%', complain about the
12895 whole directive, not just that `invalid character: %'.
12896
8aeac3ca
AD
128972002-11-04 Akim Demaille <akim@epita.fr>
12898
12899 * Makefile.maint: Update from Autoconf.
12900 (update, cvs-update, po-update, do-po-update): New.
12901
793a58bb
AD
129022002-11-04 Akim Demaille <akim@epita.fr>
12903
12904 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
12905 and yyerror.
12906 Have yyerror `use' its arguments.
12907 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
12908 returns true when location & yacc & pure & parse-param.
12909 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
12910
c4d720cd
AD
129112002-11-04 Akim Demaille <akim@epita.fr>
12912
12913 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
12914 clashes.
12915 * src/scan-gram.l: Use [\'] instead of ['] to pacify
12916 font-lock-mode.
12917 Use complain_at.
12918 Use quote, not quote_n since LOCATION_PRINT no longer uses the
12919 slot 0.
12920
613a0dc5
PE
129212002-11-03 Paul Eggert <eggert@twinsun.com>
12922
12923 * src/reader.c (get_merge_function, grammar_current_rule_check):
12924 Use consistent diagnostics for reporting type name clashes.
12925 Quote the types with <>, for consistency with Yacc.
12926 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
12927
2a8d363a
AD
129282002-11-03 Akim Demaille <akim@epita.fr>
12929
12930 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
12931 New.
12932 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
12933 (b4_parse_param): Remove.
12934 Use b4_identification.
12935 Propagate b4_pure_args where needed to pass them to yyerror.
12936 * data/glr.m4 (b4_parse_param): Remove.
12937 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
12938 (b4_lpure_formals): New.
12939 Use b4_identification.
12940 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
12941 b4_user_formals and b4_user_args.
12942 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
12943 (yyreportAmbiguity): When using a pure parser, also need
12944 the location, and the parse-params.
12945 Adjust callers.
12946 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
12947 When using a pure parser, also need the parse-params.
12948 Adjust callers.
12949 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
12950 (%pure-parser + %parse-param) LALR and GLR parsers.
12951 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
12952 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
12953 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
12954 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
12955 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
12956 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
12957 * doc/bison.texinfo: Untabify the whole file.
12958 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
12959 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
12960 (Error Reporting): Adjust to these new directives.
12961 Document %error-verbose, deprecate YYERROR_VERBOSE.
12962
9e32add8
AD
129632002-11-03 Akim Demaille <akim@epita.fr>
12964
12965 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
12966 AT_CHECK_CALC_GLR invocations to use % directives, instead of
12967 command line options.
12968 * tests/cxx-type.at: Formatting changes.
12969
b02d90a5
PE
129702002-11-03 Paul Eggert <eggert@twinsun.com>
12971
12972 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
12973 to count columns correctly, and to check for invalid inputs.
9e32add8 12974
b02d90a5
PE
12975 Use mbsnwidth to count columns correctly. Account for tabs, too.
12976 Include mbswidth.h.
12977 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
12978 (extend_location): New function.
12979 (YY_LINES): Remove.
12980
12981 Handle CRLF in C code rather than in Lex code.
12982 (YY_INPUT): New macro.
12983 (no_cr_read): New function.
12984
12985 Scan UCNs, even though we don't fully handle them yet.
12986 (convert_ucn_to_byte): New function.
12987
12988 Handle backslash-newline correctly in C code.
12989 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
12990 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
12991 all uses changed.
12992 (tag, splice): New EREs. Do not allow NUL or newline in tags.
12993 Use {splice} wherever C allows backslash-newline.
12994 YY_STEP after space, newline, vertical-tab.
12995 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 12996
b02d90a5
PE
12997 (letter, id): Don't assume ASCII; e.g., spell out a-z.
12998
12999 ({int}, handle_action_dollar, handle_action_at): Check for integer
13000 overflow.
9e32add8 13001
b02d90a5
PE
13002 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13003
13004 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13005 as well as \000. Check for UCHAR_MAX, not 255.
13006 Allow \x with an arbitrary positive number of digits, as in C.
13007 Check for overflow here.
13008 Allow \? and UCNs, for compatibility with C.
13009
13010 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13011 with quote slot used by complain_at.
13012
13013 * tests/input.at: Add tests for backslash-newline, m4 quotes
13014 in symbols, long literals, and funny escapes in strings.
13015
13016 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13017 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13018 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13019 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13020 * m4/mbswidth.m4: New file, from GNU coreutils.
13021
13022 * doc/bison.texinfo (Grammar Outline): Document // comments.
13023 (Symbols): Document that trigraphs have no special meaning in Bison,
13024 nor is backslash-newline allowed.
13025 (Actions): Document that trigraphs have no special meaning.
13026
13027 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13028 no longer used.
13029
130302002-11-02 Paul Eggert <eggert@twinsun.com>
13031
13032 * src/reader.c: Don't include quote.h; not needed.
13033 (get_merge_function): Reword warning to be consistent with
13034 type clash diagnostic in grammar_current_rule_check.
13035
13036 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13037 bug in trigraph handling.
13038
13039 * src/output.c (prepare_symbols): When printing token names,
13040 escape "[" as "@<:@" and likewise for "]".
13041
13042 * src/system.h (errno): Remove declaration, as we are now
13043 assuming C89 or better, and C89 guarantees errno.
13044
762b212b
PE
130452002-10-30 Paul Eggert <eggert@twinsun.com>
13046
13047 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13048 Check for close failures.
13049 * src/files.h (xfclose): Return void, not int, since it always
13050 returned zero.
13051 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13052 indicates one.
13053 * src/output.c (output_skeleton): Use xfclose rather than fclose
13054 and ferror. xfclose now checks ferror.
13055
13056 * data/glr.c (YYLEFTMOST_STATE): Remove.
13057 (yyreportTree): Use a stack-based leftmost state. This avoids
13058 our continuing battles with bogus warnings about initializers.
13059
56100c60
AD
130602002-10-30 Akim Demaille <akim@epita.fr>
13061
13062 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13063 #if.
13064
51b4a04c
PH
130652002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13066
13067 * tests/glr-regr1.at: New test for reported regressions.
13068 * tests/testsuite.at: Add glr-regr1.at test.
13069 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 13070
bf1ebda2
PE
130712002-10-24 Paul Eggert <eggert@twinsun.com>
13072
5c16c6b1
PE
13073 Version 1.75a.
13074
bf1ebda2
PE
13075 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13076 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13077 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13078 Don't assume strdup exists; POSIX says its an XSI extension.
13079 Check for buffer overflow on input.
13080
b526ee61
AD
130812002-10-24 Akim Demaille <akim@epita.fr>
13082
13083 * src/output.c (output_skeleton): Don't disable M4sugar comments
13084 too soon: it results in comments being expanded.
13085 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13086 first output.
13087
f1886bb2
AD
130882002-10-24 Akim Demaille <akim@epita.fr>
13089
13090 * data/yacc.c (m4_int_type): New.
13091 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13092 char' as only yacc.c wants K&R portability.
13093 * data/glr.c (yysigned_char): Remove.
13094 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13095 Reported by Quoc Peyrot.
13096
c5576256
PE
130972002-10-23 Paul Eggert <eggert@twinsun.com>
13098
13099 * src/main.c (main): With --trace=time, report times even if a
13100 non-fatal error occurs. Formerly, the times were reported in some
13101 such cases but not in others.
13102 * src/reader.c (reader): Just return if a complaint has been issued,
13103 instead of exiting, so that 'main' can report times.
13104
27b0ffea
AD
131052002-10-22 Akim Demaille <akim@epita.fr>
13106
13107 * src/system.h: Include sys/types.
13108 Reported by Bert Deknuydt.
13109
223a7883
PE
131102002-10-23 Paul Eggert <eggert@twinsun.com>
13111
13112 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13113 Suggested by Art Haas.
13114
131152002-10-22 Paul Eggert <eggert@twinsun.com>
13116
13117 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13118 decl; not needed any more.
13119 * src/main.c (main): Use return to exit, undoing yesterday's change.
13120 The last OS that we could find where this wouldn't work is
13121 SunOS 3.5, and that's too old to worry about now.
13122
13123 * data/glr.c (struct yyltype): Define members even when not
13124 doing locations. This is more consistent with yacc.c, and it
13125 works around the following bug reports:
161a71f3
PE
13126 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13127 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 13128
223a7883
PE
13129 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13130 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13131 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13132
8b76775a
AD
131332002-10-22 Akim Demaille <akim@epita.fr>
13134
13135 * data/README: New.
13136
6db10d14
PE
131372002-10-21 Paul Eggert <eggert@twinsun.com>
13138
13139 Be consistent about 'bool'; the old code used an enum in one
13140 module and an int in another, and this violates the C standard.
13141 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13142 * configure.ac (AC_HEADER_STDBOOL): Add.
13143 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13144 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13145 * src/symtab.c (hash_compare_symbol_t): Likewise.
13146 * src/system.h (bool, false, true): Use a definition consistent
13147 with ../lib/hash.c. All uses changed.
13148
13149 * src/complain.c (warning_issued): Renamed from warn_message_count,
13150 so that we needn't worry about integer overflow (!).
13151 Now of type bool. All uses changed.
13152 (complaint_issued): Renamed from complain_message_count; likewise.
13153
13154 * src/main.c (main): Use exit to exit with failure.
27b0ffea 13155
6db10d14
PE
13156 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13157 rather than 1 and 0.
13158 * src/main.c (main): Likewise.
13159 * src/getargs.c (getargs): Likewise.
13160 * src/reader.c (reader): Likewise.
13161
13162 * src/getarg.c (getargs): Remove duplicate code for
13163 "Try `bison --help'".
13164
13165 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13166 What was that "2" for?
13167
13168 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13169 * src/getargs.c (usage): Likewise.
13170
13171 * src/getargs.c (getargs): When there are too few operands, report
13172 the last one. When there are too many, report the first extra
13173 one. This is how diffutils does it.
13174
92a060fd
PE
131752002-10-20 Paul Eggert <eggert@twinsun.com>
13176
13177 Remove K&R vestiges.
13178 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13179 * src/complain.c (VA_START): Remove. Assume prototypes.
13180 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13181 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13182 fatal): Assume prototypes.
13183 * src/complain.h: Assume prototypes.
13184 * src/system.h (PARAMS): Remove.
13185 Include <limits.h> unconditionally, since it's guaranteeed even
13186 for a freestanding C89 compiler.
13187 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13188 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 13189
e7cb57c0
AD
131902002-10-20 Akim Demaille <akim@epita.fr>
13191
13192 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13193 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13194 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13195 (yyresolveStates, yyresolveAction, yyresolveStack)
13196 (yyprocessOneStack): Use them.
13197 (yy_reduce_print): New.
13198 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13199
0245f82d
AD
132002002-10-20 Akim Demaille <akim@epita.fr>
13201
13202 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13203 arguments and output `void'.
13204 (b4_c_function): Rename as...
13205 (b4_c_function_def): this.
13206 (b4_c_function_decl, b4_c_ansi_function_def)
13207 (b4_c_ansi_function_decl): New.
13208 Change the interpretation of the arguments: before `int, foo', now
13209 `int foo, foo'.
13210 * data/yacc.c (yyparse): Prototype and define thanks to these.
13211 Adjust b4_c_function_def uses.
13212 * data/glr.c (yyparse): Likewise, but ANSI only.
13213
39912f52
AD
132142002-10-20 Akim Demaille <akim@epita.fr>
13215
13216 * src/output.c (prepare): Move the definition of `tokens_number',
13217 `nterms_number', `undef_token_number', `user_token_number_max'
13218 to...
13219 (prepare_tokens): Here.
13220 (prepare_tokens): Rename as...
13221 (prepare_symbols): this.
13222 (prepare): Move the definition of `rules_number' to...
13223 (prepare_rules): here.
13224 (prepare): Move the definition of `last', `final_state_number',
13225 `states_number' to...
13226 (prepare_states): here.
13227 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13228
20c1e2ad
AD
132292002-10-20 Akim Demaille <akim@epita.fr>
13230
13231 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13232
21964f43
AD
132332002-10-20 Akim Demaille <akim@epita.fr>
13234
13235 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13236 * data/c.m4: here.
13237
66d30cd4
AD
132382002-10-20 Akim Demaille <akim@epita.fr>
13239
13240 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13241 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13242 `pair'.
13243 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13244 `name' to...
13245 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13246 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13247 These.
13248
95f2c9fe
PE
132492002-10-19 Paul Eggert <eggert@twinsun.com>
13250
13251 Do not create a temporary file, as that involves security and
13252 cleanup headaches. Instead, use a pair of pipes.
13253 Derived from a suggestion by Florian Krohm.
13254 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13255 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13256 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13257 (BISON_PREREQ_SUBPIPE): Add.
13258 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13259 Add subpipe.h, subpipe.c.
13260 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13261 * po/POTFILES.in: Add lib/subpipe.c.
13262 * src/output.c: Include "subpipe.h".
13263 (m4_invoke): Remove decl.
13264 (scan_skel): New decl.
13265 (output_skeleton): Use pipe rather than temporary file for m4 input.
13266 Check that m4sugar.m4 is readable, to avoid deadlock.
13267 Check for pipe I/O error.
13268 * src/scan-skel.l (readpipe): Remove decl.
13269 (scan_skel): New function, to be used in place of m4_invoke.
13270 Read from stream rather than file.
66d30cd4 13271
95f2c9fe
PE
13272 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13273 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13274 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13275 this generates a more-accurate value anyway.
13276
13277 * lib/timevar.c (timervar_accumulate): Rename locals to
13278 avoid confusion with similarly-named more-global.
13279 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13280
13281 * src/output.c (prepare): Use xstrdup to convert char const *
13282 to char *, to avoid GCC warning.
13283
c19988b7
AD
132842002-10-19 Akim Demaille <akim@epita.fr>
13285
13286 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13287 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13288 Use them to have `calc.y' ready for %pure-parser.
13289 * data/yacc.c (YYLEX): Pass a yylex return type to
13290 b4_c_function_call.
13291
ae7453f2
AD
132922002-10-19 Akim Demaille <akim@epita.fr>
13293
13294 Prototype support of %lex-param and %parse-param.
13295
13296 * src/parse-gram.y: Add the definition of the %lex-param and
13297 %parse-param tokens, plus their rules.
13298 Drop the `_' version of %glr-parser.
13299 Add the "," token.
13300 * src/scan-gram.l (INITIAL): Scan them.
13301 * src/muscle_tab.c: Comment changes.
13302 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13303 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13304 (muscle_entry_s): The `value' member is no longer const.
13305 Adjust all dependencies.
13306 * src/muscle_tab.c (muscle_init): Adjust: use
13307 MUSCLE_INSERT_STRING.
13308 Initialize the obstack earlier.
13309 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13310 (muscle_pair_list_grow): New.
13311 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13312 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13313 * tests/calc.at: Use %locations, not --locations.
13314 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13315
0e575721
AD
133162002-10-19 Akim Demaille <akim@epita.fr>
13317
13318 * src/getargs.c (usage): Take status as argument and exit
13319 accordingly.
13320 Report the traditional `Try ... --help' message when status != 0.
13321 (usage, version): Don't take a FILE * as arg, it is pointless.
13322 (getargs): When there is an incorrect number of arguments, make it
13323 an error, and report it GNUlically thanks to `usage ()'.
13324
724ce7f5
PE
133252002-10-18 Paul Eggert <eggert@twinsun.com>
13326
3a781eb2
PE
13327 * data/glr.c (yyreportParseError): Don't assume that sprintf
13328 yields the length of the printed string, as this is not true
13329 on SunOS 4.1.4. Reported by Peter Klein.
13330
724ce7f5
PE
13331 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13332 * tests/conflicts.at (%nonassoc and eof): Likewise.
13333 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13334
473d0a75
AD
133352002-10-17 Akim Demaille <akim@epita.fr>
13336
13337 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13338 * src/getargs.c (trace_types, trace_args): Adjust.
13339 * src/reader.c (grammar_current_rule_prec_set)
13340 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13341 Standardize error messages.
13342 And s/@prec/%prec/!
13343 (reader): Use trace_flag to enable scanner/parser debugging,
13344 instead of an adhoc scheme.
13345 * src/scan-gram.l: Remove trailing debugging code.
13346
e76d2469
PE
133472002-10-16 Paul Eggert <eggert@twinsun.com>
13348
93e2236a
PE
13349 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13350 MUSCLE_TAB_H.
13351
e76d2469
PE
13352 * NEWS: Officially drop support for building Bison with K&R C,
13353 since it didn't work anyway and it's not worth worrying about.
13354 * Makefile.maint (wget_files): Remove ansi2knr.c.
13355 (ansi2knr.c-url_prefix): Remove.
13356 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13357 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13358 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13359
5bd1c419
PE
133602002-10-15 Paul Eggert <eggert@twinsun.com>
13361
13362 Stop using the "enum_" trick for K&R-style function definitions;
13363 it confused me, and I was the author! Instead, assume that people
13364 who want to use K&R C compilers (when using these modules in GCC,
13365 perhaps?) will run ansi2knr.
13366
13367 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13368 All uses of "enum_" changed to "enum ".
13369 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13370 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 13371
5bd1c419
PE
13372 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13373 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13374 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13375 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13376 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13377 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13378 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13379 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13380 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13381 Use function prototypes; this removes the need for declaring
13382 static functions simply to provide their prototypes.
13383 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13384 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13385 bitset_count_, bitset_create, bitset_dump, bitset_first,
13386 bitset_free, bitset_init, bitset_last, bitset_next,
13387 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13388 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13389 bitset_print, bitset_release_memory, bitset_toggle_,
13390 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13391 debug_bitset): Likewise.
13392 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13393 * lib/bitset_stats.c (bitset_log_histogram_print,
13394 bitset_percent_histogram_print, bitset_stats_and,
13395 bitset_stats_and_cmp, bitset_stats_and_or,
13396 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13397 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13398 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13399 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13400 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13401 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13402 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13403 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13404 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13405 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13406 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13407 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13408 bitset_stats_zero): Likewise.
13409 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13410 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13411 bitsetv_dump, debug_bitsetv): Likewise.
13412 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13413 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13414 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13415 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13416 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13417 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13418 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13419 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13420 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13421 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13422 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13423 Likewise.
13424 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13425 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13426 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13427 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13428 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13429 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13430 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13431 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13432 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13433 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13434 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 13435
ae26e1f0
AD
134362002-10-14 Akim Demaille <akim@epita.fr>
13437
13438 Version 1.75.
13439
d43baf71
AD
134402002-10-14 Akim Demaille <akim@epita.fr>
13441
13442 * tests/Makefile.am (maintainer-check-posix): New.
13443
7ebc83e3
AD
134442002-10-14 Akim Demaille <akim@epita.fr>
13445
13446 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13447 member.
13448
05846dae
AD
134492002-10-14 Akim Demaille <akim@epita.fr>
13450
13451 * src/tables.c (table_ninf_remap): base -> tab.
13452 Reported by Matt Rosing.
13453
1318e37d
PE
134542002-10-14 Paul Eggert <eggert@twinsun.com>
13455
447fbb17
PE
13456 * tests/action.at, tests/calc.at, tests/conflicts.at,
13457 tests/cxx-type.at, tests/headers.at, tests/input.at,
13458 tests/regression.at, tests/synclines.at, tests/torture.at:
13459 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13460 so that the tests still work even if POSIXLY_CORRECT is set.
13461 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 13462
1318e37d
PE
13463 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13464 for portability to K&R hosts. Fix typo: signed char is guaranteed
13465 only to 127, not to 128.
13466 * data/glr.c (yysigned_char): New type.
13467 * data/yacc.c (yysigned_char): Likewise.
13468 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13469
cc0f0794
PE
134702002-10-13 Paul Eggert <eggert@twinsun.com>
13471
5038f418
PE
13472 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13473 true due to limited range of data type" warning from GCC.
13474
cc0f0794
PE
13475 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13476 by wrapping enum yytokentype's definition inside #ifndef
13477 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13478
6fed0802
AD
134792002-10-13 Akim Demaille <akim@epita.fr>
13480
13481 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13482 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13483
32f0598d
AD
134842002-10-13 Akim Demaille <akim@epita.fr>
13485
13486 * Makefile.maint: Update from Autoconf 2.54.
13487 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13488
7ea9a33f
AD
134892002-10-13 Akim Demaille <akim@epita.fr>
13490
13491 * src/print.c (print_state): Separate the list of solved conflicts
13492 from the other items.
13493 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13494
ea99527d
AD
134952002-10-13 Akim Demaille <akim@epita.fr>
13496
13497 Let nondeterministic skeletons be usable with deterministic
13498 tables.
13499
13500 With the patch, GAWK compiled by GCC without -O2 passes its test
13501 suite using a GLR parser driven by LALR tables. It fails with -O2
13502 because `struct stat' gives two different answers on my machine:
13503 88 (definition of an auto var) and later 96 (memset on this var).
13504 Hence the stack is badly corrumpted. The headers inclusion is to
13505 blame: if I move the awk.h inclusion before GLR's system header
13506 inclusion, the two struct stat have the same size.
13507
13508 * src/tables.c (pack_table): Always create conflict_table.
13509 (token_actions): Always create conflict_list.
13510 * data/glr.c (YYFLAG): Remove, unused.
13511
f377f69f
AD
135122002-10-13 Akim Demaille <akim@epita.fr>
13513
13514 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13515 (O0FLAGS): New.
13516 (VALGRIND, GXX): New.
13517 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13518 * tests/bison.in: Run $PREBISON a pre-command.
13519 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13520 (maintainer-check-g++): New.
13521 * Makefile.am (maintainer-check): New.
13522
2a1fe6ed
AD
135232002-10-13 Akim Demaille <akim@epita.fr>
13524
13525 * data/glr.c: Formatting changes.
13526 Tweak some trace messages to match yacc.c's.
13527
f50adbbd
AD
135282002-10-13 Akim Demaille <akim@epita.fr>
13529
13530 GLR parsers sometimes raise parse errors instead of performing the
13531 default reduction.
13532 Reported by Charles-Henry de Boysson.
13533
13534 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 13535 check the length of the traces when %glr.
f50adbbd
AD
13536 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13537 GLR's traces.
13538 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13539 Test GLR parsers.
13540 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13541 (yyltype): Remove the yy prefix from the member names.
13542 (yytable): Complete its comment.
13543 (yygetLRActions): Map error action number from YYTABLE from
13544 YYTABLE_NINF to 0.
13545 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13546 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13547 not satisfying as we could compare an YYACTION computed from
13548 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13549 only value for error actions.
13550 (yyreportParseError): In verbose parse error messages, don't issue
13551 `error' in the list of expected tokens.
13552 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13553 next action to perform to match glr.c's decoding.
13554 (yytable): Complete its comment.
13555
bcbad5b9
PE
135562002-10-13 Paul Eggert <eggert@twinsun.com>
13557
13558 Fix problem reported by Henrik Grubbstroem in
161a71f3 13559 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
13560 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13561 because the Bison parser reads the second action before reducing
13562 the first one.
13563 * src/scan-gram.l (rule_length): New static var.
13564 Use it to keep track of the rule length in the scanner, since
13565 we can't expect the parser to be in lock-step sync with the scanner.
13566 (handle_action_dollar, handle_action_at): Use this var.
13567 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 13568
14904b89
PE
135692002-10-12 Paul Eggert <eggert@twinsun.com>
13570
1fe611e5
PE
13571 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13572 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13573 Include <sys/time.h> when checking for clock_t and struct tms.
13574 Use same include order as source.
13575 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 13576 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 13577
1fe611e5
PE
13578 * lib/timevar.c: Update copyright date and clarify comments.
13579 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 13580
1fe611e5
PE
13581 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13582 GCC version as of today, then merge Bison's changes.
13583 Change "GCC" to "Bison" in copyright notice. timevar.def's
13584 author is Akim, so change that too.
13585
98194095
PE
13586 * src/reader.c (grammar_current_rule_check):
13587 Don't worry about the default action if $$ is untyped.
13588 Prevents bogus warnings reported by Jim Gifford in
161a71f3 13589 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 13590
14904b89
PE
13591 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13592 * data/glr.c, data/lalr1.cc, data/yacc.c:
13593 Output token definitions before the first part of user declarations.
13594 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 13595 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 13596
ff6dca18
PE
135972002-10-11 Paul Eggert <eggert@twinsun.com>
13598
13599 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13600 (yyparse): here. This undoes some of the 2002-07-25 change.
13601 Compatibility problem reported by Ralf S. Engelschall with
13602 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13603
eb714592
AD
136042002-10-11 Akim Demaille <akim@epita.fr>
13605
13606 * tests/regression.at Characters Escapes): New.
13607 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13608 characters.
13609 Reported by Jan Nieuwenhuizen.
13610
b7195100
AD
136112002-10-11 Akim Demaille <akim@epita.fr>
13612
13613 * po/id.po: New.
13614
f28a0f2d
PE
136152002-10-10 Paul Eggert <eggert@twinsun.com>
13616
13617 Portability fixes for bitsets; this also avoids several GCC
13618 warnings.
13619
13620 * lib/abitset.c: Include <stddef.h>, for offsetof.
13621 * lib/lbitset.c: Likewise.
13622
13623 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13624 properly for vectors of objects. Do not assume that adding a
13625 header size to a multiple of a word size yields a value that is
13626 properly aligned for the whole union.
13627 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13628
13629 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13630 unique names for structures.
13631 * lib/ebitset.c (ebitset_bytes): Likewise.
13632 * lib/lbitset.c (lbitset_bytes): Likewise.
13633
13634 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13635 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13636 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13637 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13638 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13639 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13640 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13641 to improve the type-checking that GCC can do.
13642 * lib/bitset.c (bitset_op4_cmp): Likewise.
13643 * lib/bitset_stats.c (bitset_stats_count,
13644 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13645 bitset_stats_copy, bitset_stats_disjoint_p,
13646 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13647 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13648 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13649 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13650 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13651 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13652 bitset_stats_or_and_cmp): Likewise.
13653 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13654 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13655 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13656 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13657
13658 * lib/abitset.h: Include bitset.h, not bbitset.h.
13659 * lib/ebitset.h: Likewise.
13660 * lib/lbitset.h: Likewise.
13661
13662 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13663 All instances of parameters of type enum bitset_opts are now of
13664 type enum_bitset_opts, to conform to the C Standard, and similarly
13665 for enum_bitset_type.
13666 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13667 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13668
13669 Do not use "struct bitset_struct" to mean different things in
13670 different modules. Not only is this confusing, it violates
13671 the C Standard, which requires that structure types in different
13672 modules must be compatible if one is to be passed to the other.
13673 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13674 All instances of "struct bitset_struct *" replaced with "bitset".
13675 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13676 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13677 struct lbitset_struct, struct bitset_stats_struct): New types.
13678 All uses of struct bitset_struct changed to union bitset_union,
13679 etc.
ba0fe3c7 13680 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
13681 struct bitset_struct): Remove.
13682 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13683 struct bitset_struct): Remove.
13684 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13685 bitset_struct): Remove.
13686 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13687 Likewise.
13688
13689 Do not call a function of type T using a call that assumes the
13690 function is of a different type U. Standard C requires that a
13691 function must be called with a type that is compatible with its
13692 definition.
13693 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13694 New decls.
13695 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13696 New functions.
13697 * lib/ebitset.c (PFV): Remove.
13698 * lib/lbitset.c (PFV): Likewise.
13699 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13700 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13701 decls.
13702 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13703 (ebitset_vtable): Use them.
13704 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13705 lbitset_xor): New functions.
13706 (lbitset_vtable): Use them.
13707
13708 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13709 Declare.
13710
13711 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13712 GCC warning.
13713 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13714 Use offsetof, for simplicity.
13715
6fbe4984
PE
137162002-10-06 Paul Eggert <eggert@twinsun.com>
13717
13718 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13719 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 13720 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
13721 which was inadvertently undone by the 2002-09-30 patch.
13722 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13723 the same width as int.
13724
420f93c8
PE
137252002-10-04 Paul Eggert <eggert@twinsun.com>
13726
13727 Version 1.50.
13728
13729 * configure.ac (AC_INIT), NEWS: Increment version number.
13730
13731 * doc/bison.texinfo: Minor spelling, grammar, and white space
13732 fixes.
13733 (Symbols): Mention that any negative value returned from yylex
13734 signifies end-of-input. Warn about negative chars. Mention
13735 the portable Standard C character set.
13736
13737 The GNU coding standard says CFLAGS and YFLAGS are reserved
13738 for the installer to set.
13739 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13740 * src/Makefile.am (AM_CFLAGS): Likewise.
13741 (AM_YFLAGS): Renamed from YFLAGS.
13742
13743 Fix some MAX and MIN problems.
13744 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13745 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13746 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13747 * src/reader.c (reader): Use it.
13748
13749 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13750 POSIX 1003.1-2001 has removed fgrep.
13751
137522002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13753
13754 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13755 interpreted as signed.
13756 * lib/ebitset.c (ebitset_list): Fix bug.
13757
ff68026d
PE
137582002-10-01 Paul Eggert <eggert@twinsun.com>
13759
13760 More fixes for 64-bit hosts and large bitsets.
13761
13762 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13763 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13764 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13765 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13766 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13767 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13768 bitset_count_): Likewise.
13769 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13770 bitset_first, bitset_last): Likewise.
13771 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13772 bitset_stats_list_reverse, bitset_stats_size,
13773 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13774 Likewise.
13775 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13776 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13777 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13778 bitsetv_reflexive_transitive_closure): Likewise.
13779 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13780 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13781 Likewise.
13782 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13783 Likewise.
420f93c8 13784
ff68026d
PE
13785 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13786 Use size_t, not unsigned int, to count bytes.
13787 * lib/abitset.h (abitset_bytes): Likewise.
13788 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13789 Likewise.
13790 * lib/bitset.h (bitset_bytes): Likewise.
13791 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13792 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13793 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13794 * lib/ebitset.c (ebitset_bytes): Likewise.
13795 * lib/ebitset.h (ebitset_bytes): Likewise.
13796 * lib/lbitset.c (lbitset_bytes): Likewise.
13797 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 13798
ff68026d
PE
13799 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13800 abitset_subset_p, abitset_disjoint_p, abitset_and,
13801 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13802 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13803 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13804 abitset_or_and, abitset_or_and_cmp):
13805 Use bitset_windex instead of unsigned int.
13806 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13807 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13808 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13809 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13810 Likewise.
13811 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 13812
ff68026d
PE
13813 * lib/bitset.c (bitset_print):
13814 Use proper printf formats for widths of integer types.
13815 * lib/bitset_stats.c (bitset_percent_histogram_print,
13816 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13817 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13818 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13819 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 13820
ff68026d
PE
13821 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13822 BITSET_SIZE_MAX): New macros.
13823 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13824 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13825 to BITSET_WINDEX_MAX.
13826
13827 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13828 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13829 since we now return the bitset_bindex type (not int).
13830
13831 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13832 when computing sizes.
13833 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13834
13835 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13836 and avoid cast to unsigned.
13837
6aa452a6
AD
138382002-09-30 Akim Demaille <akim@epita.fr>
13839
13840 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13841 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13842 Updates from Michael Hayes.
13843
927f7817
AD
138442002-09-30 Art Haas <ahaas@neosoft.com>
13845
13846 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13847 invocations.
13848 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13849 defined.
13850
9738f41e
AD
138512002-09-27 Akim Demaille <akim@epita.fr>
13852
13853 Version 1.49c.
13854
a5c75d7f
AD
138552002-09-27 Akim Demaille <akim@epita.fr>
13856
13857 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13858 (Because of AC_LIBSOURCE).
13859
8280e179
AD
138602002-09-27 Akim Demaille <akim@epita.fr>
13861
13862 Playing with Autoscan.
13863
13864 * configure.ac: Remove the old LIBOBJ tweaks.
13865 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13866 * lib/strrchr.c: New.
13867 * lib/strtol.c: New, from the Coreutils 4.5.1.
13868
ae64af35
AD
138692002-09-27 Akim Demaille <akim@epita.fr>
13870
13871 Playing with Autoscan.
13872
13873 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13874 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13875 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13876 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13877 Coreutils 4.5.1.
13878
d1a1114f
AD
138792002-09-24 Akim Demaille <akim@epita.fr>
13880
13881 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13882 (Frequently Asked Questions, Parser Stack Overflow): New.
13883
b906441c
AD
138842002-09-13 Akim Demaille <akim@epita.fr>
13885
13886 Playing with autoscan.
13887
13888 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13889 * src/files.c (skeleton_find): Remove, unused.
13890 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13891 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13892
bd701811
AD
138932002-09-13 Akim Demaille <akim@epita.fr>
13894
13895 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13896 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13897
e0a13e7b
AD
138982002-09-13 Akim Demaille <akim@epita.fr>
13899
13900 * configure.ac: Require 2.54.
13901 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
13902 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
13903 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
13904 Remove, provided by Autoconf macros.
13905
c97011bf
AD
139062002-09-12 Akim Demaille <akim@epita.fr>
13907
13908 * m4/prereq.m4: Update, from Coreutils 4.5.1.
13909
d862b1be
AD
139102002-09-12 Akim Demaille <akim@epita.fr>
13911
13912 * m4/prereq.m4: Update, from Fileutils 4.1.5.
13913 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
13914 Reported by Martin Mokrejs.
13915
3d38c03a
AD
139162002-09-10 Akim Demaille <akim@epita.fr>
13917
13918 * src/parse-gram.y: Associate a human readable string to each
13919 token type.
13920 * tests/regression.at (Invalid inputs): Adjust.
13921
b6347355
AD
139222002-09-10 Gary V. Vaughan <gary@gnu.org>
13923
13924 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
13925 with an Autoconf-2.5x style configure.ac.
13926
09ba4ab2
PE
139272002-09-06 Paul Eggert <eggert@twinsun.com>
13928
13929 * doc/bison.texinfo (Conditions): Make explicit that the GPL
13930 exception applies only to yacc.c. This is a modification of a
13931 patch originally suggested by Akim Demaille.
13932
21846f69
AD
139332002-09-06 Akim Demaille <akim@epita.fr>
13934
09ba4ab2
PE
13935 * data/c.m4 (b4_copyright): Move the GPL exception comment from
13936 here to...
13937 * data/yacc.c: here.
13938
21846f69
AD
13939 * data/lalr1.cc (struct yyltype): Don't define it, since we use
13940 LocationType.
13941 (b4_ltype): Default to yy::Location from location.hh.
13942
c0ad8bf3
AD
139432002-09-04 Jim Meyering <jim@meyering.net>
13944
13945 * data/yacc.c: Guard the declaration of yytoknum also with
13946 `#ifdef YYPRINT', so it is declared only when used.
13947
3a93251e
AD
139482002-09-04 Akim Demaille <akim@epita.fr>
13949
13950 * configure.in: Rename as...
13951 * configure.ac: this.
13952 Bump to 1.49c.
13953
427c0dda
AD
139542002-09-04 Akim Demaille <akim@epita.fr>
13955
13956 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
13957 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
13958 translate maintainer only messages.
13959
6a254321
PE
139602002-08-12 Paul Eggert <eggert@twinsun.com>
13961
645e30d1
PE
13962 Version 1.49b.
13963
6a254321
PE
13964 * Makefile.am (SUBDIRS): Remove intl.
13965 (DISTCLEANFILES): Remove.
13966 * NEWS: Mention that GNU M4 is now required. Clarify what is
13967 meant by "larger grammars". Mention the pt_BR translation.
13968 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
13969 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
13970 Bump version from 0.11.2 to 0.11.5.
13971 (BISON_PREREQ_STAGE): Remove.
13972 (AM_GNU_GETTEXT): Use external gettext.
13973 (AC_OUTPUT): Remove intl/Makefile.
13974
13975 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
13976
13977 * data/glr.c: Include string.h, for strlen.
13978 (yyreportParseError): Use size_t for yysize.
13979 (yy_yypstack): No longer nested inside yypstates, as nested
13980 functions are not portable. Do not assume size_t is the
13981 same width as int.
13982 (yypstates): Do not assume that ptrdiff_t is the same width
13983 as int, and similarly for yyposn and YYINDEX.
13984
13985 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
13986
13987 * lib/Makefile.am (INCLUDES): Do not include from the intl
13988 directory, which has been removed.
13989 * src/Makefile.am (INCLUDES): Likewise.
13990
13991 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
13992 (bitsets_sources, additional_bitsets_sources, timevars_sources):
13993 New vars.
13994
13995 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
13996 * tests/Makefile.am (EXTRA_DIST): Likewise.
13997
13998 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
13999 Do not assume that bitset_windex is the same width as unsigned.
14000
14001 * lib/abitset.c (abitset_unused_clear): Do not assume that
14002 bitset_word is the same width as int.
14003 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14004 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14005 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14006 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14007 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14008
14009 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14010 portability to one's complement hosts!).
14011 * lib/ebitset.c (ebitset_op1): Likewise.
14012 * lib/lbitset.c (lbitset_op1): Likewise.
14013
14014 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14015 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14016 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14017 Sync with fileutils.
14018 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14019 lib/gettext.h: Sync with diffutils.
14020
14021 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14022 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14023
14024 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14025 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14026 check for void *.
14027
14028 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14029 size_t; the old version tried to do this but casted improperly.
14030 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14031 (bitset_test): Now returns int, not unsigned long.
14032
14033 * lib/bitset_stats.c: Include "gettext.h".
14034 (_): New macro.
14035 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14036 name locals "index", as it generates unnecessary warnings on some
14037 hosts that have an "index" function.
14038
14039 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14040 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14041 they need translation.
14042 * src/LR0.c (state_list_append, new_itemsets, get_state,
14043 append_states, generate_states): Likewise.
14044 * src/assoc.c (assoc_to_string): Likewise.
14045 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14046 * src/gram.c (grammar_dump): Likewise.
14047 * src/injections.c (injections_compute): Likewise.
14048 * src/lalr.c (lookaheads_print): Likewise.
14049 * src/relation.c (relation_transpose): Likewise.
14050 * src/scan-gram.l: Likewise.
14051 * src/tables.c (table_grow, pack_vector): Likewise.
14052
14053 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14054 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14055 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14056 * m4/mbstate_t.m4: Sync with fileutils.
14057 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14058
14059 * po/LINGUAS: Add pt_BR.
14060 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14061 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14062 lib/timevar.c.
14063 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14064 manual recommends.
14065 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14066
14067 * src/complain.c (strerror_r): Remove decl; not needed.
14068 (strerror): Use same pattern as ../lib/error.c.
14069
14070 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14071
14072 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14073
14074 * src/main.c (main): Cast result of bindtextdomain and textdomain
14075 to void, to avoid a GCC warning when --disable-nls is in effect.
14076
14077 * src/scan-gram.l: Use strings rather than escapes when possible,
14078 to minimize the number of warnings from xgettext.
14079 (handle_action_dollar, handle_action_at): Don't use isdigit,
14080 as it mishandles negative chars and it may not work as expected
14081 outside the C locale.
14082
14083 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14084 this is a GCC extension and is not portable to other compilers.
14085
14086 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14087 Do not include <ctype.h>; no longer needed.
14088 Do not include <malloc.h>; no longer needed (and generates
14089 warnings on OpenBSD 3.0).
14090
14091 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14092 it's not portable.
14093
14094 * tests/regression.at: Do not use 'cc -c input.c -o input';
14095 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14096
14097 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14098 exit status as failure, not just exit status 1. Sun C exits
14099 with status 2 sometimes.
14100
14101 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14102 Use it for the two large tests.
14103
c8f002c7
AD
141042002-08-02 Akim Demaille <akim@epita.fr>
14105
14106 * src/conflicts.c (conflicts_output): Don't output rules never
14107 reduced here, since anyway that computation doesn't work.
14108 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14109 (rule_useless_p, rule_never_reduced_p): New.
14110 (grammar_rules_partial_print): Use a filter instead of a range.
14111 Display the title only if needed.
14112 (grammar_rules_print): Adjust.
14113 (grammar_rules_never_reduced_report): New.
14114 * src/tables.c (action_row): Move the computation of rules never
14115 reduced to...
14116 (token_actions): here.
14117 * src/main.c (main): Make the parser before making the report, so
14118 that rules never reduced are computed.
14119 Call grammar_rules_never_reduced_report.
14120 * src/print.c (print_results): Report rules never reduced.
14121 * tests/conflicts.at, tests/reduce.at: Adjust.
14122
cd08e51e
AD
141232002-08-01 Akim Demaille <akim@epita.fr>
14124
14125 Instead of attaching lookaheads and duplicating the rules being
14126 reduced by a state, attach the lookaheads to the reductions.
14127
14128 * src/state.h (state_t): Remove the `lookaheads',
14129 `lookaheads_rule' member.
14130 (reductions_t): Add a `lookaheads' member.
14131 Use a regular array for the `rules'.
14132 * src/state.c (reductions_new): Initialize the lookaheads member
14133 to 0.
14134 (state_rule_lookaheads_print): Adjust.
14135 * src/state.h, src/state.c (state_reductions_find): New.
14136 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14137 (count_rr_conflicts): Adjust.
14138 * src/lalr.c (LArule): Remove.
14139 (add_lookback_edge): Adjust.
14140 (state_lookaheads_count): New.
14141 (states_lookaheads_initialize): Merge into...
14142 (initialize_LA): this.
14143 (lalr_free): Adjust.
14144 * src/main.c (main): Don't free nullable and derives too early: it
14145 is used by --verbose.
14146 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14147
bb0027a9
AD
141482002-08-01 Akim Demaille <akim@epita.fr>
14149
14150 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14151 `rule_number_t**'.
14152 (set_derives, free_derives): Rename as...
14153 (derives_compute, derives_free): this.
14154 Adjust all dependencies.
14155 * src/nullable.c (set_nullable, free_nullable): Rename as...
14156 (nullable_compute, nullable_free): these.
14157 (rule_list_t): Store rule_t *, not rule_number_t.
14158 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14159 pointers, instead of their numbers.
14160 * src/main.c (main): Call nullable_free, and derives_free earlier,
14161 as they were lo longer used.
14162
3325ddc4
AD
141632002-08-01 Akim Demaille <akim@epita.fr>
14164
14165 * lib/timevar.c (get_time): Include children time.
14166 * src/lalr.h (LA, LArule): Don't export them: used with the
14167 state_t.
14168 * src/lalr.c (LA, LArule): Static.
14169 * src/lalr.h, src/lalr.c (lalr_free): New.
14170 * src/main.c (main): Call it.
14171 * src/tables.c (pack_vector): Check whether loc is >= to the
14172 table_size, not >.
14173 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14174 (tables_generate): do it, since that's also it which allocates
14175 them.
14176 Don't free LA and LArule, main does.
14177
c6f1a33c
AD
141782002-07-31 Akim Demaille <akim@epita.fr>
14179
14180 Separate parser tables computation and output.
14181
14182 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14183 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14184 (yydefgoto, yydefact, high): Move to...
14185 * src/tables.h, src/tables.c: here.
14186 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14187 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14188 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14189 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14190 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14191 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14192 (action_row, save_row, token_actions, save_column, default_goto)
14193 (goto_actions, sort_actions, matching_state, pack_vector)
14194 (table_ninf_remap, pack_table, prepare_actions): Move to...
14195 * src/tables.c: here.
14196 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14197 * src/output.c (token_actions, output_base, output_conflicts)
14198 (output_check): Merge into...
14199 (prepare_actions): this.
14200 (actions_output): Rename as...
14201 (user_actions_output): this.
14202 * src/main.c (main): Call tables_generate and tables_free.
14203
1509d42f
AD
142042002-07-31 Akim Demaille <akim@epita.fr>
14205
14206 Steal GCC's --time-report support.
14207
14208 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14209 stolen/adjusted from GCC.
14210 * m4/stage.m4: Remove time related checks.
14211 * m4/timevar.m4: New.
14212 * configure.in: Adjust.
14213 * src/system.h: Adjust to using timevar.h.
14214 * src/getargs.h, src/getargs.c: Support trace_time for
14215 --trace=time.
14216 * src/main.c (stage): Remove.
14217 (main): Replace `stage' invocations with timevar calls.
14218 * src/output.c: Insert pertinent timevar calls.
14219
273a74fa
AD
142202002-07-31 Akim Demaille <akim@epita.fr>
14221
14222 Let --trace have arguments.
14223
14224 * src/getargs.h (enum trace_e): New.
14225 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14226 (long_options, short_options): --trace/-T takes an optional
14227 argument.
14228 Change all the uses of trace_flag to reflect the new flags.
14229 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14230
14231 Strengthen `stage' portability.
14232
14233 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14234 * configure.in: Use it.
14235 Don't check for malloc.h and sys/times.h.
14236 * src/system.h: Include them when appropriate.
14237 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14238 times and struct tms are available.
14239
217598da
AD
142402002-07-30 Akim Demaille <akim@epita.fr>
14241
14242 In verbose parse error message, don't report `error' as an
14243 expected token.
14244 * tests/actions.at (Printers and Destructors): Adjust.
14245 * tests/calc.at (Calculator $1): Adjust.
14246 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14247 error message, do not report the parser accepts the error token in
14248 that state.
14249
52489d44
AD
142502002-07-30 Akim Demaille <akim@epita.fr>
14251
14252 Normalize conflict related messages.
14253
14254 * src/complain.h, src/complain.c (warn, complain): New.
14255 * src/conflicts.c (conflicts_print): Use them.
14256 (conflict_report_yacc): New, extracted from...
14257 (conflicts_print): here.
14258 * tests/conflicts.at, tests/existing.at: Adjust.
14259
e8832397
AD
142602002-07-30 Akim Demaille <akim@epita.fr>
14261
14262 Report rules which are never reduced by the parser: those hidden
14263 by conflicts.
14264
14265 * src/LR0.c (save_reductions): Don't make the final state too
14266 different: save its reduction (accept) instead of having a state
14267 without any action (no shift or goto, no reduce).
14268 Note: the final state is now a ``regular'' state, i.e., the
14269 parsers now contain `reduce 0' as default reduction.
14270 Nevertheless, since they decide to `accept' when yystate =
14271 final_state, they still will not reduce rule 0.
14272 * src/print.c (print_actions, print_reduction): Adjust.
14273 * src/output.c (action_row): Track reduced rules.
14274 (token_actions): Report rules never reduced.
14275 * tests/conflicts.at, tests/regression.at: Adjust.
14276
caf23d24
AD
142772002-07-30 Akim Demaille <akim@epita.fr>
14278
14279 `stage' was accidently included in a previous patch.
14280 Initiate its autoconfiscation.
14281
14282 * configure.in: Look for malloc.h and sys/times.h.
14283 * src/main.c (stage): Adjust.
14284 Report only when trace_flag.
14285
640748ee
AD
142862002-07-29 Akim Demaille <akim@epita.fr>
14287
14288 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14289 state_number_t.
14290 (errs_t): symbol_t*, not symbol_number_t.
14291 (reductions_t): rule_t*, not rule_number_t.
14292 (FOR_EACH_SHIFT): New.
14293 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14294 * src/print.c, src/print_graph.c: Adjust.
14295
88bce5a2
AD
142962002-07-29 Akim Demaille <akim@epita.fr>
14297
14298 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14299
14300 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14301 (endtoken, accept): these.
14302 * src/reader.c (reader): Set endtoken's default tag to "$end".
14303 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14304 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14305 Adjust.
14306
1bfb97db
AD
143072002-07-29 Akim Demaille <akim@epita.fr>
14308
14309 * src/reduce.c (reduce_grammar): When the language is empty,
14310 complain about the start symbol, not the axiom.
14311 Use its location.
14312 * tests/reduce.at (Empty Language): New.
14313
fc5734fe
AD
143142002-07-26 Akim Demaille <akim@epita.fr>
14315
14316 * src/reader.h, src/reader.c (gram_error): ... can't get
14317 yycontrol without making too strong assumptions on the parser
14318 itself.
14319 * src/output.c (prepare_tokens): Use the real 0th value of
14320 token_translations instead of `0'.
14321 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14322 visible here.
14323 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14324 for the time being: %locations ought to provide it to yyerror.
14325
3650b4b8
AD
143262002-07-25 Akim Demaille <akim@epita.fr>
14327
14328 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14329 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14330 * tests/regression.at (Web2c Actions): Adjust.
14331
4b3d3a8e
AD
143322002-07-25 Akim Demaille <akim@epita.fr>
14333
14334 Stop storing rules from 1 to nrules + 1.
14335
14336 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14337 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14338 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14339 Iterate from 0 to nrules.
14340 Use rule_number_as_item_number and item_number_as_rule_number.
14341 Adjust to `derive' now containing possibly 0.
14342 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14343 Handle the `- 1' part in rule numbers from/to item numbers.
14344 * src/conflicts.c (log_resolution): Fix the message which reversed
14345 shift and reduce.
14346 * src/output.c (action_row): Initialize default_rule to -1.
14347 (token_actions): Adjust.
14348 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14349 expected output.
14350 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14351
4a2a22f4
AD
143522002-07-25 Akim Demaille <akim@epita.fr>
14353
14354 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14355 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14356 (b4_c_knr_arg_decl): New.
14357 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14358 yyreport_parse_error.
14359
b8df3223
AD
143602002-07-25 Akim Demaille <akim@epita.fr>
14361
14362 * data/yacc.c (yyreport_parse_error): New, extracted from...
14363 (yyparse): here.
14364 (yydestruct, yysymprint): Move above yyparse.
14365 Be K&R compliant.
14366
a762e609
AD
143672002-07-25 Akim Demaille <akim@epita.fr>
14368
14369 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14370 replace...
14371 (b4_sint_type, b4_uint_type): these.
14372 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14373 * tests/regression.at (Web2c Actions): Adjust.
14374
12b0043a
AD
143752002-07-25 Akim Demaille <akim@epita.fr>
14376
14377 * src/gram.h (TIEM_NUMBER_MAX): New.
14378 (item_number_of_rule_number, rule_number_of_item_number): Rename
14379 as...
14380 (rule_number_as_item_number, item_number_as_rule_number): these.
14381 Adjust dependencies.
14382 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14383 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14384 (symbol_number_to_vector_number): New.
14385 (order): Of vector_number_t* type.
14386 (base_t, BASE_MAX, BASE_MIN): New.
14387 (froms, tos, width, pos, check): Of base_t type.
14388 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14389 (actrow): Of action_number_t type.
14390 (conflrow): Of unsigned int type.
14391 (table_ninf, base_ninf): New.
14392 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14393 (muscle_insert_int_table, muscle_insert_base_table)
14394 (muscle_insert_rule_number_table): New.
14395 (prepare_tokens): Output `toknum' as int_table.
14396 (action_row): Returns a rule_number_t.
14397 Use ACTION_MIN, not SHRT_MIN.
14398 (token_actions): yydefact is rule_number_t*.
14399 (table_ninf_remap): New.
14400 (pack_table): Use it for `base' and `table'.
14401 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14402 replaced with...
14403 (YYPACT_NINF, YYTABLE_NINF): these.
14404 (yypact, yytable): Compute their types instead of hard-coded
14405 `short'.
14406 * tests/regression.at (Web2c Actions): Adjust.
14407
5dde258a
AD
144082002-07-19 Akim Demaille <akim@epita.fr>
14409
14410 * src/scan-gram.l (id): Can start with an underscore.
14411
a945ec39
AD
144122002-07-16 Akim Demaille <akim@epita.fr>
14413
14414 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14415 Adjust all former `associativity' dependencies.
14416 * src/symtab.c (symbol_new): Default associativity is `undef', not
14417 `right'.
14418 (symbol_check_alias_consistence): Adjust.
14419
fae437e8
AD
144202002-07-09 Akim Demaille <akim@epita.fr>
14421
14422 * doc/bison.texinfo: Properly set the ``header'' part.
14423 Use @dircategory ``GNU programming tools'' as per Texinfo's
14424 documentation.
14425 Use @copying.
14426
1a715ef2
AD
144272002-07-09 Akim Demaille <akim@epita.fr>
14428
14429 * lib/quotearg.h: Protect against multiple inclusions.
14430 * src/location.h (location_t): Add a `file' member.
14431 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14432 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14433 `error_one_per_line' support.
14434
a5d50994
AD
144352002-07-09 Akim Demaille <akim@epita.fr>
14436
14437 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14438 * src/reader.c (lineno): Remove.
14439 Adjust all dependencies.
14440 (get_merge_function): Take a location and use complain_at.
14441 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14442 * tests/regression.at (Invalid inputs, Mixing %token styles):
14443 Adjust.
14444
b275314e
AD
144452002-07-09 Akim Demaille <akim@epita.fr>
14446
14447 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14448 recovery rule, and forbid extensions when --yacc.
14449 (gram_error): Use complain_at.
14450 * src/reader.c (reader): Exit if there were parse errors.
14451
865b9df1
AD
144522002-07-09 Akim Demaille <akim@epita.fr>
14453
14454 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14455 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14456 Reported by R Blake <blakers@mac.com>.
14457
c76e14da
AD
144582002-07-09 Akim Demaille <akim@epita.fr>
14459
14460 * data/yacc.c: Output the copyright notive in the header.
14461
7db2ed2d
AD
144622002-07-03 Akim Demaille <akim@epita.fr>
14463
14464 * src/output.c (froms, tos): Are state_number_t.
14465 (save_column): sp, sp1, and sp2 are state_number_t.
14466 (prepare): Rename `final' as `final_state_number', `nnts' as
14467 `nterms_number', `nrules' as `rules_number', `nstates' as
14468 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14469 unused.
14470 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14471 * data/lalr1.cc (nsym_): Remove, unused.
14472
e68e0410
AD
144732002-07-03 Akim Demaille <akim@epita.fr>
14474
14475 * src/lalr.h, src/lalr.c (goto_number_t): New.
14476 * src/lalr.c (goto_list_t): New.
14477 Propagate them.
14478 * src/nullable.c (rule_list_t): New.
14479 Propagate.
14480 * src/types.h: Remove.
14481
e1a4f3a4
AD
144822002-07-03 Akim Demaille <akim@epita.fr>
14483
14484 * src/closure.c (print_fderives): Use rule_rhs_print.
14485 * src/derives.c (print_derives): Use rule_rhs_print.
14486 (rule_list_t): New, replaces `shorts'.
14487 (set_derives): Add comments.
14488 * tests/sets.at (Nullable, Firsts): Adjust.
14489
536545f3
AD
144902002-07-03 Akim Demaille <akim@epita.fr>
14491
14492 * src/output.c (prepare_actions): Free `tally' and `width'.
14493 (prepare_actions): Allocate and free `order'.
14494 * src/symtab.c (symbols_free): Free `symbols'.
14495 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14496 * src/output.c (m4_invoke): Move to...
14497 * src/scan-skel.l: here.
14498 (<<EOF>>): Close yyout, and free its name.
14499
8b752b00
AD
145002002-07-03 Akim Demaille <akim@epita.fr>
14501
14502 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14503
14504 * src/LR0.c (new_state): Merge into...
14505 (state_list_append): this.
14506 (new_states): Merge into...
14507 (generate_states): here.
14508 (set_states): Don't ensure a proper `errs' state member here, do it...
14509 * src/conflicts.c (conflicts_solve): here.
14510 * src/state.h, src/state.c: Comment changes.
14511 (state_t): Rename member `shifts' as `transitions'.
14512 Adjust all dependencies.
14513 (errs_new): For consistency, also take the values as argument.
14514 (errs_dup): Remove.
14515 (state_errs_set): New.
14516 (state_reductions_set, state_transitions_set): Assert that no
14517 previous value was assigned.
14518 (state_free): New.
14519 (states_free): Use it.
14520 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14521 temporary storage: use `errs' and `nerrs' as elsewhere.
14522 (set_conflicts): Allocate and free this `errs'.
14523
613f5e1a
AD
145242002-07-02 Akim Demaille <akim@epita.fr>
14525
14526 * lib/libiberty.h: New.
14527 * lib: Update the bitset implementation from upstream.
14528 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14529 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14530 * src/main.c: Adjust bitset stats calls.
14531
26e0cadc
PE
145322002-07-01 Paul Eggert <eggert@twinsun.com>
14533
14534 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14535 char, so that negative chars don't collide with $.
14536
1154cced
AD
145372002-06-30 Akim Demaille <akim@epita.fr>
14538
14539 Have the GLR tests be `warning' checked, and fix the warnings.
14540
14541 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14542 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14543 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14544 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14545 (yyaddDeferredAction): static.
14546 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14547 (yyreportParseError): yyprefix is const.
14548 yytokenp is used only when verbose.
14549 (yy__GNUC__): Replace with __GNUC__.
14550 (yypdumpstack): yyi is size_t.
14551 (yypreference): Un-yy local variables and arguments, to avoid
14552 clashes with `yyr1'. Anyway, we are not in the user name space.
14553 (yytname_size): be an int, as is compared with ints.
14554 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14555 Use them.
14556 * tests/cxx-gram.at: Use quotation to protect $1.
14557 Use AT_COMPILE to enable warnings hunts.
14558 Prototype yylex and yyerror.
14559 `Use' argc.
14560 Include `string.h', not `strings.h'.
14561 Produce and prototype stmtMerge only when used.
14562 yylex takes a location.
14563
97650f4e
AD
145642002-06-30 Akim Demaille <akim@epita.fr>
14565
14566 We spend a lot of time in quotearg, in particular when --verbose.
14567
14568 * src/symtab.c (symbol_get): Store a quoted version of the key.
14569 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14570 Adjust all callers.
14571
d2576365
AD
145722002-06-30 Akim Demaille <akim@epita.fr>
14573
14574 * src/state.h (reductions_t): Rename member `nreds' as num.
14575 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14576 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14577
ccaf65bc
AD
145782002-06-30 Akim Demaille <akim@epita.fr>
14579
14580 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14581 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14582 (shifts_to): Rename as...
14583 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14584 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14585 (TRANSITION_IS_DISABLED, transitions_to): these.
14586
87675353
AD
145872002-06-30 Akim Demaille <akim@epita.fr>
14588
14589 * src/print.c (print_shifts, print_gotos): Merge into...
14590 (print_transitions): this.
14591 (print_transitions, print_errs, print_reductions): Align the
14592 lookaheads columns.
14593 (print_core, print_transitions, print_errs, print_state,
14594 print_grammar): Output empty lines separator before, not after.
14595 (state_default_rule_compute): Rename as...
14596 (state_default_rule): this.
14597 * tests/conflicts.at (Defaulted Conflicted Reduction),
14598 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14599 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14600
ce4ccb4b
AD
146012002-06-30 Akim Demaille <akim@epita.fr>
14602
14603 Display items as we display rules.
14604
14605 * src/gram.h, src/gram.c (rule_lhs_print): New.
14606 * src/gram.c (grammar_rules_partial_print): Use it.
14607 * src/print.c (print_core): Likewise.
14608 * tests/conflicts.at (Defaulted Conflicted Reduction),
14609 (Unresolved SR Conflicts): Adjust.
14610 (Unresolved SR Conflicts): Adjust and rename as...
14611 (Resolved SR Conflicts): this, as was meant.
14612 * tests/regression.at (Web2c Report): Adjust.
14613
bc933ef1
AD
146142002-06-30 Akim Demaille <akim@epita.fr>
14615
14616 * src/print.c (state_default_rule_compute): New, extracted from...
14617 (print_reductions): here.
14618 Pessimize, but clarify the code.
14619 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14620
53d4308d
AD
146212002-06-30 Akim Demaille <akim@epita.fr>
14622
14623 * src/output.c (action_row): Let default_rule be always a rule
14624 number.
14625
574fb2d5
AD
146262002-06-30 Akim Demaille <akim@epita.fr>
14627
14628 * src/closure.c (print_firsts, print_fderives, closure):
14629 Use BITSET_EXECUTE.
14630 * src/lalr.c (lookaheads_print): Likewise.
14631 * src/state.c (state_rule_lookaheads_print): Likewise.
14632 * src/print_graph.c (print_core): Likewise.
14633 * src/print.c (print_reductions): Likewise.
14634 * src/output.c (action_row): Likewise.
14635 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14636
05811fd7
AD
146372002-06-30 Akim Demaille <akim@epita.fr>
14638
14639 * src/print_graph.c: Use report_flag.
14640
0e4d5753
AD
146412002-06-30 Akim Demaille <akim@epita.fr>
14642
14643 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14644 to...
14645 * src/relation.h, src/relation.c (traverse, relation_digraph)
14646 (relation_print, relation_transpose): New.
14647
24c7d800
AD
146482002-06-30 Akim Demaille <akim@epita.fr>
14649
14650 * src/state.h, src/state.c (shifts_to): New.
14651 * src/lalr.c (build_relations): Use it.
14652
9222837b
AD
146532002-06-30 Akim Demaille <akim@epita.fr>
14654
14655 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14656 (item_number_of_rule_number, rule_number_of_item_number): New.
14657 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14658 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14659 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14660 Propagate their use.
14661 Much remains to be done, in particular wrt `shorts' from types.h.
14662
260008e5
AD
146632002-06-30 Akim Demaille <akim@epita.fr>
14664
14665 * src/symtab.c (symbol_new): Initialize the `printer' member.
14666
8a731ca8
AD
146672002-06-30 Akim Demaille <akim@epita.fr>
14668
14669 * src/LR0.c (save_reductions): Remove, replaced by...
14670 * src/state.h, src/state.c (state_reductions_set): New.
14671 (reductions, errs): Rename as...
14672 (reductions_t, errs_t): these.
14673 Adjust all dependencies.
14674
32e1e0a4
AD
146752002-06-30 Akim Demaille <akim@epita.fr>
14676
14677 * src/LR0.c (state_list_t, state_list_append): New.
14678 (first_state, last_state): Now symbol_list_t.
14679 (this_state): Remove.
14680 (new_itemsets, append_states, save_reductions): Take a state_t as
14681 argument.
14682 (set_states, generate_states): Adjust.
14683 (save_shifts): Remove, replaced by...
14684 * src/state.h, src/state.c (state_shifts_set): New.
14685 (shifts): Rename as...
14686 (shifts_t): this.
14687 Adjust all dependencies.
14688 * src/state.h (state_t): Remove the `next' member.
14689
e5fb6710
AD
146902002-06-30 Akim Demaille <akim@epita.fr>
14691
14692 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14693 escaped in slot 0.
14694
c7ca99d4
AD
146952002-06-30 Akim Demaille <akim@epita.fr>
14696
14697 Use hash.h for the state hash table.
14698
14699 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14700 (allocate_storage): Use state_hash_new.
14701 (free_storage): Use state_hash_free.
14702 (new_state, get_state): Adjust.
14703 * src/lalr.h, src/lalr.c (states): Move to...
14704 * src/states.h (state_t): Remove the `link' member, no longer
14705 used.
14706 * src/states.h, src/states.c: here.
14707 (state_hash_new, state_hash_free, state_hash_lookup)
14708 (state_hash_insert, states_free): New.
14709 * src/states.c (state_table, state_compare, state_hash): New.
14710 * src/output.c (output_actions): Do not free states now, since we
14711 still need to know the final_state number in `prepare', called
14712 afterwards. Do it...
14713 * src/main.c (main): here: call states_free after `output'.
14714
df0e7316
AD
147152002-06-30 Akim Demaille <akim@epita.fr>
14716
14717 * src/state.h, src/state.c (state_new): New, extracted from...
14718 * src/LR0.c (new_state): here.
14719 * src/state.h (STATE_ALLOC): Move to...
14720 * src/state.c: here.
14721 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14722 * src/state.h, src/state.c: here.
14723
39f41916
AD
147242002-06-30 Akim Demaille <akim@epita.fr>
14725
14726 * src/reader.c (gensym): Rename as...
14727 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14728 (getsym): Rename as...
14729 (symbol_get): this.
14730
d57650a5
AD
147312002-06-30 Akim Demaille <akim@epita.fr>
14732
14733 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14734 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14735 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14736 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14737
5a08f1ce
AD
147382002-06-30 Akim Demaille <akim@epita.fr>
14739
14740 Make the test suite pass with warnings checked.
14741
14742 * tests/actions.at (Printers and Destructors): Improve.
14743 Avoid unsigned vs. signed issues.
14744 * tests/calc.at: Don't exercise the scanner here, do it...
14745 * tests/input.at (Torturing the Scanner): here.
14746
720623af
PH
147472002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14748
88e7e941 14749 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
14750 reorganize first lines parallel to yacc.c.
14751
fb8135fa
AD
147522002-06-28 Akim Demaille <akim@epita.fr>
14753
14754 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14755 (b4_token_enum, b4_token_defines): New, factored from...
14756 * data/lalr1.cc, data/yacc.c, glr.c: here.
14757
41442480
AD
147582002-06-28 Akim Demaille <akim@epita.fr>
14759
14760 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14761 unused variables.
14762 * src/output.c (merger_output): static.
14763
e0e5bf84
AD
147642002-06-28 Akim Demaille <akim@epita.fr>
14765
ba0fe3c7 14766 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
14767 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14768 pacify GCC.
14769 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 14770
676385e2
PH
147712002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14772
14773 Accumulated changelog for new GLR parsing features.
14774
6a254321 14775 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
14776 conflicts_total_count.
14777 * src/conflicts.h: Ditto.
14778 * src/output.c (token_actions): Use the new name.
14779 (output_conflicts): Change conflp => conflict_list_heads, and
14780 confl => conflict_list for better readability.
14781 * data/glr.c: Use the new names.
14782 * NEWS: Add self to GLR announcement.
e0e5bf84 14783
676385e2
PH
14784 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14785
14786 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14787 Akim Demaille.
14788
14789 * data/bison.glr: Change name to glr.c
14790 * data/glr.c: Renamed from bison.glr.
14791 * data/Makefile.am: Add glr.c
e0e5bf84
AD
14792
14793 * src/getargs.c:
14794
676385e2 14795 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 14796 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 14797
676385e2
PH
14798 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14799
14800 * data/bison.glr: Be sure to restore the
14801 current #line when returning to the skeleton contents after having
14802 exposed the input file's #line.
14803
14804 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14805
14806 * data/bison.glr: Bring up to date with changes to bison.simple.
14807
14808 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14809
14810 * data/bison.glr: Correct definitions that use b4_prefix.
14811 Various reformatting.
14812 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14813 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14814 yytokenp argument; now part of stack.
14815 (yychar): Define to behave as documented.
14816 (yyclearin): Ditto.
e0e5bf84 14817
676385e2
PH
14818 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14819
14820 * src/reader.h: Add declaration for free_merger_functions.
14821
14822 * src/reader.c (merge_functions): New variable.
14823 (get_merge_function): New function.
14824 (free_merger_functions): New function.
14825 (readgram): Check for %prec that is not followed by a symbol.
14826 Handle %dprec and %merge declarations.
14827 (packgram): Initialize dprec and merger fields in rules array.
14828
14829 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14830 conflict_list_cnt, conflict_list_free): New variables.
14831 (table_grow): Also grow conflict_table.
e0e5bf84 14832 (prepare_rules): Output dprec and merger tables.
676385e2 14833 (conflict_row): New function.
e0e5bf84 14834 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
14835 default reduction in conflicted states for GLR parser so that there
14836 are spaces for the conflict lists.
14837 (save_row): Also save conflict information.
14838 (token_actions): Allocate conflict list.
14839 (merger_output): New function.
14840 (pack_vector): Pack conflict table, too.
14841 (output_conflicts): New function to output yyconflp and yyconfl.
14842 (output_check): Allocate conflict_tos.
14843 (output_actions): Output conflict tables, also.
14844 (output_skeleton): Output b4_mergers definition.
14845 (prepare): Output b4_max_rhs_length definition.
14846 Use 'bison.glr' as default skeleton for GLR parsers.
14847
14848 * src/gram.c (glr_parser): New flag.
14849 (grammar_free): Call free_merger_functions.
14850
14851 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14852 all pairs of conflicting reductions, rather than just all tokens
14853 causing conflicts. Needed to size conflict tables.
e0e5bf84 14854 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
14855 interface.
14856 (conflicts_print): Ditto.
14857 (count_total_conflicts): New function.
14858
14859 * src/reader.h (merger_list): New type.
14860 (merge_functions): New variable.
14861
14862 * src/lex.h (tok_dprec, tok_merge): New token types.
14863
14864 * src/gram.h (rule_s): Add dprec and merger fields.
14865 (glr_parser): New flag.
14866
14867 * src/conflicts.h (count_total_conflicts): New function.
14868
14869 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14870
14871 * doc/bison.texinfo (Generalized LR Parsing): New section.
14872 (GLR Parsers): New section.
14873 (Language and Grammar): Mention GLR parsing.
14874 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14875 Correct typo ("tge" -> "the").
14876
14877 * data/bison.glr: New skeleton for GLR parsing.
14878
14879 * tests/cxx-gram.at: New tests for GLR parsing.
14880
14881 * tests/testsuite.at: Include cxx-gram.at.
14882
14883 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 14884
676385e2
PH
14885 * src/parse-gram.y:
14886
14887 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14888
14889 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 14890
b5480d74 148912002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
14892
14893 * src/options.h, src/options.c: Remove.
14894 * src/getargs.c (short_options, long_options): New.
14895
60491a94
AD
148962002-06-27 Akim Demaille <akim@epita.fr>
14897
14898 * data/bison.simple, data/bison.c++: Rename as...
14899 * data/yacc.c, data/lalr1.cc: these.
14900 * doc/bison.texinfo (Environment Variables): Remove.
14901
9be0c25b
AD
149022002-06-25 Raja R Harinath <harinath@cs.umn.edu>
14903
14904 * src/getargs.c (report_argmatch): Initialize strtok().
14905
1ae72863
AD
149062002-06-20 Akim Demaille <akim@epita.fr>
14907
14908 * data/bison.simple (b4_symbol_actions): New, replaces...
14909 (b4_symbol_destructor, b4_symbol_printer): these.
14910 (yysymprint): Be sure to call YYPRINT only for tokens, and using
14911 user token numbers.
14912
87542d29
AD
149132002-06-20 Akim Demaille <akim@epita.fr>
14914
14915 * data/bison.simple (yydestructor): Rename as...
14916 (yydestruct): this.
14917
1a31ed21
AD
149182002-06-20 Akim Demaille <akim@epita.fr>
14919
14920 * src/symtab.h, src/symtab.c (symbol_type_set)
14921 (symbol_destructor_set, symbol_precedence_set): The location is
14922 the last argument.
14923 Adjust all callers.
14924
e776192e
AD
149252002-06-20 Akim Demaille <akim@epita.fr>
14926
14927 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
14928 internals.
14929 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
14930 Takes a location.
14931 * src/symtab.h, src/symtab.c (symbol_class_set)
14932 (symbol_user_token_number_set): Likewise.
14933 Adjust all callers.
14934 Promote complain_at.
14935 * tests/input.at (Type Clashes): Adjust.
14936
5c1180b3
AD
149372002-06-20 Akim Demaille <akim@epita.fr>
14938
14939 * data/bison.simple (YYLEX): Fix the declaration when
14940 %pure-parser.
14941
e3170060
AD
149422002-06-20 Akim Demaille <akim@epita.fr>
14943
14944 * data/bison.simple (yysymprint): Don't print the token number,
14945 just its name.
14946 * tests/actions.at (Destructors): Rename as...
14947 (Printers and Destructors): this.
14948 Also exercise %printer.
14949
253862fd
AD
149502002-06-20 Akim Demaille <akim@epita.fr>
14951
14952 * data/bison.simple (YYDSYMPRINT): New.
14953 Use it to remove many of the #if YYDEBUG/if (yydebug).
14954
366eea36
AD
149552002-06-20 Akim Demaille <akim@epita.fr>
14956
14957 * src/symtab.h, src/symtab.c (symbol_t): printer and
14958 printer_location are new members.
14959 (symbol_printer_set): New.
14960 * src/parse-gram.y (PERCENT_PRINTER): New token.
14961 Handle its associated rule.
14962 * src/scan-gram.l: Adjust.
14963 (handle_destructor_at, handle_destructor_dollar): Rename as...
14964 (handle_symbol_code_at, handle_symbol_code_dollar): these.
14965 * src/output.c (symbol_printers_output): New.
14966 (output_skeleton): Call it.
14967 * data/bison.simple (yysymprint): New. Cannot be named yyprint
14968 since there are already many grammar files with a user `yyprint'.
14969 Replace the calls to YYPRINT to calls to yysymprint.
14970 * tests/calc.at: Adjust.
14971 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
14972 taking advantage of parser very internal details (stack size!).
14973
4f25ebb0
AD
149742002-06-20 Akim Demaille <akim@epita.fr>
14975
14976 * src/scan-gram.l: Complete the scanner with the missing patterns
14977 to pacify Flex.
14978 Use `quote' and `symbol_tag_get' where appropriate.
14979
93b68a0e
AD
149802002-06-19 Akim Demaille <akim@epita.fr>
14981
14982 * tests/actions.at (Destructors): Augment to test locations.
14983 * data/bison.simple (yydestructor): Pass it the current location
14984 if locations are enabled.
14985 Prototype only when __STDC__ or C++.
14986 Change the argument names to move into the yy name space: there is
14987 user code here.
14988
58612f1d
AD
149892002-06-19 Akim Demaille <akim@epita.fr>
14990
74310291
AD
14991 * data/bison.simple (b4_pure_if): New.
14992 Use it instead of #ifdef YYPURE.
14993
149942002-06-19 Akim Demaille <akim@epita.fr>
14995
14996 * data/bison.simple (b4_location_if): New.
58612f1d
AD
14997 Use it instead of #ifdef YYLSP_NEEDED.
14998
f25bfb75
AD
149992002-06-19 Akim Demaille <akim@epita.fr>
15000
15001 Prepare @$ in %destructor, but currently don't bind it in the
15002 skeleton, as %location use is not cleaned up yet.
15003
15004 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15005 (handle_action_at): New.
15006 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15007 a braced_code_t and a location as additional arguments.
15008 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15009 unquote one when outputting `b4_dollar_dollar'.
15010 Adjust callers.
15011 * data/bison.simple (b4_eval): Remove.
15012 (b4_symbol_destructor): Adjust.
15013 * tests/input.at (Invalid @n): Adjust.
15014
c732d2c6
AD
150152002-06-19 Zack Weinberg <zack@codesourcery.com>
15016
15017 * doc/bison.texinfo: Document ability to have multiple
15018 prologue sections.
15019
8c165d89
AD
150202002-06-18 Akim Demaille <akim@epita.fr>
15021
15022 * src/files.c (compute_base_names): When computing the output file
15023 names from the input file name, strip the directory part.
15024
ca98bf57
AD
150252002-06-18 Akim Demaille <akim@epita.fr>
15026
15027 * data/bison.simple.new: Comment changes.
15028 Reported by Andreas Schwab.
15029
0bfb02ff
AD
150302002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15031
15032 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15033 there are no `label `yyoverflowlab' defined but not used' warnings
15034 when yyoverflow is defined.
15035
24c0aad7
AD
150362002-06-18 Akim Demaille <akim@epita.fr>
15037
15038 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15039 new member.
15040 (symbol_destructor_set): Adjust.
15041 * src/output.c (symbol_destructors_output): Output the destructor
15042 locations.
15043 Output the symbol name.
15044 * data/bison.simple (b4_symbol_destructor): Adjust.
15045
5719c109
AD
150462002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15047 and Akim Demaille <akim@epita.fr>
15048
15049 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15050 what's left on the stack when the error recovery hits EOF.
15051 * tests/actions.at (Destructors): Complete to exercise this case.
15052
9280d3ef
AD
150532002-06-17 Akim Demaille <akim@epita.fr>
15054
15055 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15056 arguments is really empty, not only equal to `[]'.
15057 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15058 member.
15059 (symbol_destructor_set): New.
15060 * src/output.c (symbol_destructors_output): New.
15061 * src/reader.h (brace_code_t, current_braced_code): New.
15062 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15063 (handle_dollar): Rename as...
15064 (handle_action_dollar): this.
15065 (handle_destructor_dollar): New.
15066 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15067 (grammar_declaration): Use it.
15068 * data/bison.simple (yystos): Is always defined.
15069 (yydestructor): New.
15070 * tests/actions.at (Destructors): New.
15071 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15072
dafdc66f
AD
150732002-06-17 Akim Demaille <akim@epita.fr>
15074
15075 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15076 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15077 rule_length only when needed.
15078 * src/output.c (actions_output, token_definitions_output): Output
15079 the full M4 block.
15080 * src/symtab.c: Don't access directly to the symbol tag, use
15081 symbol_tag_get.
15082 * src/parse-gram.y: Use symbol_list_free.
15083
56c47203
AD
150842002-06-17 Akim Demaille <akim@epita.fr>
15085
15086 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15087 (symbol_list_prepend, get_type_name): Move to...
15088 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15089 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15090 Adjust all callers.
15091 (symbol_list_free): New.
15092 * src/scan-gram.l (handle_dollar): Takes a location.
15093 * tests/input.at (Invalid $n): Adjust.
15094
1e0bab92
AD
150952002-06-17 Akim Demaille <akim@epita.fr>
15096
15097 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15098 (symbol_list_prepend): New.
15099 * src/parse-gram.y (%union): `list' is a new member.
15100 (symbols.1): New, replaces...
15101 (terms_to_prec.1, nterms_to_type.1): these.
15102 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15103 Take a location as additional argument.
15104 Adjust all callers.
15105
04e60654
AD
151062002-06-15 Akim Demaille <akim@epita.fr>
15107
15108 * src/parse-gram.y: Move %token in the declaration section so that
15109 we don't depend upon CVS Bison.
15110
10e5b8bd
AD
151112002-06-15 Akim Demaille <akim@epita.fr>
15112
15113 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15114 * src/print.c (print_core): Use it.
15115
9801d40c
AD
151162002-06-15 Akim Demaille <akim@epita.fr>
15117
15118 * src/conflicts.c (log_resolution): Accept the rule involved in
15119 the sr conflicts instead of the lookahead number that points to
15120 that rule.
15121 (flush_reduce): Accept the current lookahead vector as argument,
15122 instead of the index in LA.
15123 (resolve_sr_conflict): Accept the current number of lookahead
15124 bitset to consider for the STATE, instead of the index in LA.
15125 (set_conflicts): Adjust.
15126 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15127
c0263492
AD
151282002-06-15 Akim Demaille <akim@epita.fr>
15129
15130 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15131 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15132 Adjust all dependencies.
15133 * src/lalr.c (initialize_lookaheads): Split into...
15134 (states_lookaheads_count, states_lookaheads_initialize): these.
15135 (lalr): Adjust.
15136
9757c359
AD
151372002-06-15 Akim Demaille <akim@epita.fr>
15138
15139 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15140 out of...
15141 (grammar_rules_print): here.
15142 * src/reduce.c (reduce_output): Use it.
15143 * tests/reduce.at (Useless Rules, Reduced Automaton)
15144 (Underivable Rules): Adjust.
15145
6b98e4b5
AD
151462002-06-15 Akim Demaille <akim@epita.fr>
15147
15148 Copy BYacc's nice way to report the grammar.
15149
15150 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15151 New.
15152 Don't print the rules' location, it is confusing and useless.
15153 (rule_print): Use grammar_rhs_print.
15154 * src/print.c (print_grammar): Use grammar_rules_print.
15155
6b98e4b5
AD
151562002-06-15 Akim Demaille <akim@epita.fr>
15157
15158 Complete and rationalize `useless thing' warnings.
15159
15160 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15161 (symbol_tag_print): New.
15162 Use them everywhere in place of accessing directly the tag member.
15163 * src/gram.h, src/gram.c (rule_print): New.
15164 Use it where a rule used to be printed `by hand'.
15165 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15166 (reduce_grammar_tables): Report the useless rules.
15167 (reduce_print): Useless things are a warning, not an error.
15168 Report it as such.
15169 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15170 (Reduced Automaton, Underivable Rules): Adjust.
15171 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15172 * tests/conflicts.at (Unresolved SR Conflicts)
15173 (Solved SR Conflicts): Adjust.
15174
ee000ba4
AD
151752002-06-15 Akim Demaille <akim@epita.fr>
15176
15177 Let symbols have a location.
15178
15179 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15180 (getsym): Adjust.
15181 Adjust all callers.
15182 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15183 Use location_t, not int.
15184 * src/symtab.c (symbol_check_defined): Take advantage of the
15185 location.
15186 * tests/regression.at (Invalid inputs): Adjust.
15187
8efe435c
AD
151882002-06-15 Akim Demaille <akim@epita.fr>
15189
15190 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15191 (input): Don't try to initialize yylloc here, do it in the
15192 scanner.
15193 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15194 * src/gram.h (rule_t): Change line and action_line into location
15195 and action_location, of location_t type.
15196 Adjust all dependencies.
15197 * src/location.h, src/location.c (empty_location): New.
15198 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15199 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15200 (grammar_current_rule_symbol_append)
15201 (grammar_current_rule_action_append): Expect a location as argument.
15202 * src/reader.c (grammar_midrule_action): Adjust to attach an
15203 action's location as dummy symbol location.
15204 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15205 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15206 the line numbers.
15207
1921f1d7
AD
152082002-06-14 Akim Demaille <akim@epita.fr>
15209
15210 Grammar declarations may be found in the grammar section.
15211
15212 * src/parse-gram.y (rules_or_grammar_declaration): New.
15213 (declarations): Each declaration may end with a semicolon, not
15214 just...
15215 (grammar_declaration): `"%union"'.
15216 (grammar): Branch to rules_or_grammar_declaration.
15217
4515534c
AD
152182002-06-14 Akim Demaille <akim@epita.fr>
15219
15220 * src/main.c (main): Invoke scanner_free.
15221
f958596b
AD
152222002-06-14 Akim Demaille <akim@epita.fr>
15223
15224 * src/output.c (m4_invoke): Extracted from...
15225 (output_skeleton): here.
15226 Free tempfile.
15227
2c569025
AD
152282002-06-14 Akim Demaille <akim@epita.fr>
15229
15230 * src/parse-gram.y (directives, directive, gram)
15231 (grammar_directives, precedence_directives, precedence_directive):
15232 Rename as...
15233 (declarations, declaration, grammar, grammar_declaration)
15234 (precedence_declaration, precedence_declarator): these.
15235 (symbol_declaration): New.
15236
592e8d4d
AD
152372002-06-14 Akim Demaille <akim@epita.fr>
15238
15239 * src/files.c (action_obstack): Remove, unused.
15240 (output_obstack): Remove it, and all its dependencies, as it is no
15241 longer needed.
15242 * src/reader.c (epilogue_set): Build the epilogue in the
15243 muscle_obstack.
15244 * src/output.h, src/output.c (muscle_obstack): Move to...
15245 * src/muscle_tab.h, src/muscle_tab.h: here.
15246 (muscle_init): Initialize muscle_obstack.
15247 (muscle_free): New.
15248 * src/main.c (main): Call it.
15249
0c15323d
AD
152502002-06-14 Akim Demaille <akim@epita.fr>
15251
15252 * src/location.h: New, extracted from...
15253 * src/reader.h: here.
15254 * src/Makefile.am (noinst_HEADERS): Merge into
15255 (bison_SOURCES): this.
15256 Add location.h.
15257 * src/parse-gram.y: Use location_t instead of Bison's.
15258 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15259 Use location_t instead of ints.
15260
e96c9728
AD
152612002-06-14 Akim Demaille <akim@epita.fr>
15262
15263 * data/bison.simple, data/bison.c++: Be sure to restore the
15264 current #line when returning to the skeleton contents after having
15265 exposed the input file's #line.
15266
75d1fe16
AD
152672002-06-12 Akim Demaille <akim@epita.fr>
15268
15269 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15270 eager.
15271 * tests/actions.at (Exotic Dollars): New.
15272
6c35d22c
AD
152732002-06-12 Akim Demaille <akim@epita.fr>
15274
15275 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15276 ['"/] too eagerly.
15277 * tests/input.at (Torturing the Scanner): New.
15278
1d6412ad
AD
152792002-06-11 Akim Demaille <akim@epita.fr>
15280
15281 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15282 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15283 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15284 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15285 * src/reader.c (reader): Use it.
15286
4cdb01db
AD
152872002-06-11 Akim Demaille <akim@epita.fr>
15288
15289 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15290 Adjust all callers.
15291 (scanner_last_string_free): New.
15292
44995b2e
AD
152932002-06-11 Akim Demaille <akim@epita.fr>
15294
15295 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15296 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15297 (last_string, YY_OBS_FREE): New.
15298 Use them when returning an ID.
15299
e9955c83
AD
153002002-06-11 Akim Demaille <akim@epita.fr>
15301
15302 Have Bison grammars parsed by a Bison grammar.
15303
15304 * src/reader.c, src/reader.h (prologue_augment): New.
15305 * src/reader.c (copy_definition): Remove.
15306
15307 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15308 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15309 (grammar_current_rule_prec_set, grammar_current_rule_check)
15310 (grammar_current_rule_symbol_append)
15311 (grammar_current_rule_action_append): Export.
15312 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15313 (symbol_list_action_append): Remove.
15314 Hook the routines from reader.
15315 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15316 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15317
15318 * src/reader.c (read_declarations): Remove, unused.
15319
15320 * src/parse-gram.y: Handle the epilogue.
15321 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15322 (grammar_start_symbol_set): this.
15323 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15324 * src/reader.c (readgram): Remove, unused.
15325 (reader): Adjust to insert eoftoken and axiom where appropriate.
15326
15327 * src/reader.c (copy_dollar): Replace with...
15328 * src/scan-gram.h (handle_dollar): this.
15329 * src/parse-gram.y: Remove `%thong'.
15330
15331 * src/reader.c (copy_at): Replace with...
15332 * src/scan-gram.h (handle_at): this.
15333
15334 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15335 New.
15336
15337 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15338 time being.
15339
15340 * src/reader.h, src/reader.c (grammar_rule_end): New.
15341
15342 * src/parse.y (current_type, current_class): New.
15343 Implement `%nterm', `%token' support.
15344 Merge `%term' into `%token'.
15345 (string_as_id): New.
15346 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15347 type name.
15348
15349 * src/parse-gram.y: Be sure to handle properly the beginning of
15350 rules.
15351
15352 * src/parse-gram.y: Handle %type.
15353 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15354
15355 * src/parse-gram.y: More directives support.
15356 * src/options.c: No longer handle source directives.
15357
15358 * src/parse-gram.y: Fix %output.
15359
15360 * src/parse-gram.y: Handle %union.
15361 Use the prologue locations.
15362 * src/reader.c (parse_union_decl): Remove.
15363
15364 * src/reader.h, src/reader.c (epilogue_set): New.
15365 * src/parse-gram.y: Use it.
15366
15367 * data/bison.simple, data/bison.c++: b4_stype is now either not
15368 defined, then default to int, or to the contents of %union,
15369 without `union' itself.
15370 Adjust.
15371 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15372
15373 * src/output.c (actions_output): Don't output braces, as they are
15374 already handled by the scanner.
15375
15376 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15377 characters to themselves.
15378
15379 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15380 that the epilogue has a proper #line.
15381
15382 * src/parse-gram.y: Handle precedence/associativity.
15383
15384 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15385 a terminal.
15386 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15387 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15388 at all to define terminals that cannot be emitted.
15389
15390 * src/scan-gram.l: Escape M4 characters.
15391
15392 * src/scan-gram.l: Working properly with escapes in user
15393 strings/characters.
15394
15395 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15396 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15397 grammar.
15398 Use more modest sizes, as for the time being the parser does not
15399 release memory, and therefore the process swallows a huge amount
15400 of memory.
15401
15402 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15403 stricter %token grammar.
15404
15405 * src/symtab.h (associativity): Add `undef_assoc'.
15406 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15407 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15408
15409 * tests/regression.at (Invalid %directive): Remove, as it is now
15410 meaningless.
15411 (Invalid inputs): Adjust to the new error messages.
15412 (Token definitions): The new grammar doesn't allow too many
15413 eccentricities.
15414
15415 * src/lex.h, src/lex.c: Remove.
15416 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15417 (copy_character, copy_string2, copy_string, copy_identifier)
15418 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15419 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15420 (parse_action): Remove.
15421 * po/POTFILES.in: Adjust.
15422
2e047461
AD
154232002-06-11 Akim Demaille <akim@epita.fr>
15424
cd05d13c 15425 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
15426 rule's action member: return the action as a string.
15427 Don't require `rule_length' as an argument: compute it.
15428 (grammar_current_rule_symbol_append)
15429 (grammar_current_rule_action_append): New, eved out from
15430 (readgram): here.
15431 Remove `action_flag', `rulelength', unused now.
15432
9af3fbce
AD
154332002-06-11 Akim Demaille <akim@epita.fr>
15434
15435 * src/reader.c (grammar_current_rule_prec_set).
15436 (grammar_current_rule_check): New, eved out from...
15437 (readgram): here.
15438 Remove `xaction', `first_rhs': useless.
15439 * tests/input.at (Type clashes): New.
15440 * tests/existing.at (GNU Cim Grammar): Adjust.
15441
1485e106
AD
154422002-06-11 Akim Demaille <akim@epita.fr>
15443
15444 * src/reader.c (grammar_midrule_action): New, Eved out from
15445 (readgram): here.
15446
da4160c3
AD
154472002-06-11 Akim Demaille <akim@epita.fr>
15448
15449 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15450 New.
15451 (readgram): Use them as replacement of inlined code, crule and
15452 crule1.
15453
f6d0f937
AD
154542002-06-11 Akim Demaille <akim@epita.fr>
15455
15456 * src/reader.c (grammar_end, grammar_symbol_append): New.
15457 (readgram): Use them.
15458 Make the use of `p' as local as possible.
15459
69078d4b
AD
154602002-06-10 Akim Demaille <akim@epita.fr>
15461
15462 GCJ's parser requires the tokens to be defined before the prologue.
15463
15464 * data/bison.simple: Output the token definition before the user's
15465 prologue.
15466 * tests/regression.at (Braces parsing, Duplicate string)
15467 (Mixing %token styles): Check the output from bison.
15468 (Early token definitions): New.
15469
5e424082
AD
154702002-06-10 Akim Demaille <akim@epita.fr>
15471
15472 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15473 assigning twice the same user number to a token, so that we can
15474 use it in...
15475 * src/lex.c (lex): here.
15476 Also use `symbol_class_set' instead of hand written code.
15477 * src/reader.c (parse_assoc_decl): Likewise.
15478
44536b35
AD
154792002-06-10 Akim Demaille <akim@epita.fr>
15480
15481 * src/symtab.c, src/symtab.c (symbol_class_set)
15482 (symbol_user_token_number_set): New.
15483 * src/reader.c (parse_token_decl): Use them.
15484 Use a switch instead of ifs.
15485 Use a single argument.
15486
8b9f2372
AD
154872002-06-10 Akim Demaille <akim@epita.fr>
15488
15489 Remove `%thong' support as it is undocumented, unused, duplicates
15490 `%token's job, and creates useless e-mail traffic with people who
15491 want to know what it is, why it is undocumented, unused, and
15492 duplicates `%token's job.
15493
15494 * src/reader.c (parse_thong_decl): Remove.
15495 * src/options.c (option_table): Remove "thong".
15496 * src/lex.h (tok_thong): Remove.
15497
3ae2b51f
AD
154982002-06-10 Akim Demaille <akim@epita.fr>
15499
15500 * src/symtab.c, src/symtab.c (symbol_type_set)
15501 (symbol_precedence_set): New.
15502 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15503 (value_components_used): Remove, unused.
15504
2f1afb73
AD
155052002-06-09 Akim Demaille <akim@epita.fr>
15506
15507 Move symbols handling code out of the reader.
15508
15509 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15510 (axiom): Move to...
15511 * src/symtab.h, src/symtab.c: here.
15512
15513 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15514 * src/reader.c (startval): Rename as...
15515 * src/symtab.h, src/symtab.c (startsymbol): this.
15516 * src/reader.c: Adjust.
15517
15518 * src/reader.c (symbol_check_defined, symbol_make_alias)
15519 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15520 (token_translations_init)
15521 Move to...
15522 * src/symtab.c: here.
15523 * src/reader.c (packsymbols): Move to...
15524 * src/symtab.h, src/symtab.c (symbols_pack): here.
15525 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15526 argument.
15527
e9bca3ad
AD
155282002-06-03 Akim Demaille <akim@epita.fr>
15529
15530 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15531 then statements.
15532
86eff183
AD
155332002-06-03 Akim Demaille <akim@epita.fr>
15534
15535 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15536 structs with non literals.
15537 * src/scan-skel.l: never-interactive.
15538 * src/conflicts.c (enum conflict_resolution_e): No trailing
15539 comma.
15540 * src/getargs.c (usage): Split long literal strings.
15541 Reported by Hans Aberg.
15542
717be197
AD
155432002-05-28 Akim Demaille <akim@epita.fr>
15544
15545 * data/bison.c++: Use C++ ostreams.
15546 (cdebug_): New member.
15547
670ddffd
AD
155482002-05-28 Akim Demaille <akim@epita.fr>
15549
15550 * src/output.c (output_skeleton): Be sure to allocate enough room
15551 for `/' _and_ for `\0' in full_skeleton.
15552
769b430f
AD
155532002-05-28 Akim Demaille <akim@epita.fr>
15554
15555 * data/bison.c++: Catch up with bison.simple:
15556 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15557 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15558 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15559 and popping traces.
15560
7067cb36
PH
155612002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15562
15563 * src/output.c (output_skeleton): Put an explicit path in front of
15564 the skeleton file name, rather than relying on the -I directory,
15565 to partially alleviate effects of having a skeleton file lying around
15566 in the current directory.
769b430f 15567
4a713ec2
PH
155682002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15569
769b430f 15570 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
15571 obstack_printf should be obstack_fgrow1.
15572
b408954b
AD
155732002-05-26 Akim Demaille <akim@epita.fr>
15574
15575 * src/state.h (state_t): `solved_conflicts' is a new member.
15576 * src/LR0.c (new_state): Set it to 0.
15577 * src/conflicts.h, src/conflicts.c (print_conflicts)
15578 (free_conflicts, solve_conflicts): Rename as...
15579 (conflicts_print, conflicts_free, conflicts_solve): these.
15580 Adjust callers.
15581 * src/conflicts.c (enum conflict_resolution_e)
15582 (solved_conflicts_obstack): New, used by...
15583 (log_resolution): this.
15584 Adjust to attach the conflict resolution to each state.
15585 Complete the description with the precedence/associativity
15586 information.
15587 (resolve_sr_conflict): Adjust.
15588 * src/print.c (print_state): Output its solved_conflicts.
15589 * tests/conflicts.at (Unresolved SR Conflicts)
15590 (Solved SR Conflicts): Exercise --report=all.
15591
a49aecd5
AD
155922002-05-26 Akim Demaille <akim@epita.fr>
15593
15594 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15595 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15596 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15597 (token_number_t, item_number_as_token_number)
15598 (token_number_as_item_number, muscle_insert_token_number_table):
15599 Rename as...
15600 (symbol_number_t, item_number_as_symbol_number)
15601 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15602 these, since it is more appropriate.
15603
5504898e
AD
156042002-05-26 Akim Demaille <akim@epita.fr>
15605
15606 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15607 `Error:' lines.
15608 * data/bison.simple (yystos) [YYDEBUG]: New.
15609 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15610 error recovery.
15611 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15612
ec3bc396
AD
156132002-05-25 Akim Demaille <akim@epita.fr>
15614
15615 * doc/bison.texinfo (Debugging): Split into...
15616 (Tracing): this new section, its former contents, and...
15617 (Understanding): this new section.
15618 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15619 by...
15620 (report_flag): this.
15621 Adjust all dependencies.
15622 (report_args, report_types, report_argmatch): New.
15623 (usage, getargs): Report/support -r, --report.
15624 * src/options.h
15625 (struct option_table_struct): Rename as..,
15626 (struct option_table_s): this.
15627 Rename the `set_flag' member to `flag' to match with getopt_long's
15628 struct.
15629 * src/options.c (option_table): Split verbose into an entry for
15630 %verbose, and another for --verbose.
15631 Support --report/-r, so remove -r from the obsolete --raw.
15632 * src/print.c: Attach full item sets and lookaheads reports to
15633 report_flag instead of trace_flag.
15634 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15635
78df8250
PE
156362002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15637 and Paul Eggert <eggert@twinsun.com>
769b430f 15638
78df8250
PE
15639 * data/bison.simple (yyparse): Correct error handling to conform to
15640 POSIX and yacc. Specifically, after syntax error is discovered,
15641 do not reduce further before shifting the error token.
15642 Clean up the code a bit by removing the labels yyerrdefault,
15643 yyerrhandle, yyerrpop.
15644 * NEWS: Document the above.
15645
c0c9ea05
PH
156462002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15647
15648 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15649 type; it isn't always big enough, since it doesn't necessarily
15650 include non-terminals.
769b430f 15651 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
15652 the latter can be removed.
15653 (yy_token_number_type): Remove, only one use.
15654 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15655 don't use TokenNumberType as element type.
769b430f 15656
c0c9ea05
PH
15657 * tests/regression.at: Modify expected output to agree with change
15658 to yyr1 and yytranslate.
769b430f 15659
6390a83f
FK
156602002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15661
15662 * src/reader.c (parse_action): Use copy_character instead of
15663 obstack_1grow.
15664
db7c8e9a
AD
156652002-05-13 Akim Demaille <akim@epita.fr>
15666
15667 * tests/regression.at (Token definitions): Prototype yylex and
15668 yyerror.
15669
fcc61800
PH
156702002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15671
158c687b 15672 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
15673 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15674 32-bit arithmetic.
15675 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15676
5683e9b2
AD
156772002-05-07 Akim Demaille <akim@epita.fr>
15678
15679 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15680 avoid GCC warnings.
15681
0c2d3f4c
AD
156822002-05-07 Akim Demaille <akim@epita.fr>
15683
15684 Kill GCC warnings.
15685
15686 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15687 over the RHS of each rule.
15688 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15689 * src/state.h (state_t): Member `nitems' is unsigned short.
15690 * src/LR0.c (get_state): Adjust.
15691 * src/reader.c (packgram): Likewise.
15692 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15693 `Type'.
15694 (muscle_insert_int_table): Remove, unused.
15695 (prepare_rules): Remove `max'.
15696
1565b720
AD
156972002-05-06 Akim Demaille <akim@epita.fr>
15698
15699 * src/closure.c (print_firsts): Display of the symbol tags.
15700 (bitmatrix_print): Move to...
15701 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15702 here.
15703 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15704
cfaee611
AD
157052002-05-06 Akim Demaille <akim@epita.fr>
15706
15707 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15708 hash_do_for_each.
15709
458be8e0
AD
157102002-05-06 Akim Demaille <akim@epita.fr>
15711
15712 * src/LR0.c (new_state, get_state): Instead of using the global
15713 `kernel_size' and `kernel_base', have two new arguments:
15714 `core_size' and `core'.
15715 Adjust callers.
15716
a900a624
AD
157172002-05-06 Akim Demaille <akim@epita.fr>
15718
15719 * src/reader.c (packgram): No longer end `ritem' with a 0
15720 sentinel: it is not used.
15721
d4e7d3a1
AD
157222002-05-05 Akim Demaille <akim@epita.fr>
15723
15724 New experimental feature: display the lookaheads in the report and
15725 graph.
15726
15727 * src/print (print_core): When --trace-flag, display the rules
15728 lookaheads.
15729 * src/print_graph.c (print_core): Likewise.
15730 Swap the arguments.
15731 Adjust caller.
15732
39ceb25b
AD
157332002-05-05 Akim Demaille <akim@epita.fr>
15734
15735 * tests/torture.at (Many lookaheads): New test.
15736
5372019f
AD
157372002-05-05 Akim Demaille <akim@epita.fr>
15738
15739 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15740 (GENERATE_MUSCLE_INSERT_TABLE): this.
15741 (output_int_table, output_unsigned_int_table, output_short_table)
15742 (output_token_number_table, output_item_number_table): Replace with...
15743 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15744 (muscle_insert_short_table, muscle_insert_token_number_table)
15745 (muscle_insert_item_number_table): these.
15746 Adjust all callers.
15747 (prepare_tokens): Don't free `translations', since...
15748 * src/reader.h, src/reader.c (grammar_free): do it.
15749 Move to...
15750 * src/gram.h, src/gram.c (grammar_free): here.
15751 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15752 b4_translate_max.
15753
5df5f6d5
AD
157542002-05-05 Akim Demaille <akim@epita.fr>
15755
15756 * src/output.c (output_unsigned_int_table): New.
15757 (prepare_rules): `i' is unsigned.
15758 `prhs', `rline', `r2' are unsigned int.
15759 Rename muscle `rhs_number_max' as `rhs_max'.
15760 Output muscles `prhs_max', `rline_max', and `r2_max'.
15761 Free rline and r1.
15762 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15763 to compute types instead of constant types.
15764 * tests/regression.at (Web2c Actions): Adjust.
15765
b87f8b21
AD
157662002-05-04 Akim Demaille <akim@epita.fr>
15767
15768 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15769 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15770 Adjust dependencies.
15771 * src/output.c (token_definitions_output): Be sure not to output a
15772 `#define 'a'' when fed with `%token 'a' "a"'.
15773 * tests/regression.at (Token definitions): New.
15774
8bb936e4
PE
157752002-05-03 Paul Eggert <eggert@twinsun.com>
15776
15777 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15778 for K&R C.
15779
157802002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15781
15782 * Makefile.am (SUBDIRS): Remove intl.
15783 (EXTRA_DIST): Add config/config.rpath.
15784
53c71a12
AD
157852002-05-03 Akim Demaille <akim@epita.fr>
15786
15787 * data/bison.simple (m4_if): Don't output empty enums.
15788 And actually, output valid enum definitions :(.
15789
289dd0cf
AD
157902002-05-03 Akim Demaille <akim@epita.fr>
15791
15792 * configure.bat: Remove, completely obsolete.
15793 * Makefile.am (EXTRA_DIST): Adjust.
15794 Don't distribute config.rpath...
15795 * config/Makefile.am (EXTRA_DIST): Do it.
15796
db85e524
AD
157972002-05-03 Akim Demaille <akim@epita.fr>
15798
15799 * configure.in (GETTEXT_VERSION): New.
15800 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15801
83ccf991
AD
158022002-05-03 Akim Demaille <akim@epita.fr>
15803
15804 * data/bison.simple (b4_token_enum): New.
15805 (b4_token_defines): Use it to output tokens both as #define and
15806 enums.
15807 Suggested by Paul Eggert.
15808 * src/output.c (token_definitions_output): Don't output spurious
15809 white spaces.
15810
1f418995
AD
158112002-05-03 Akim Demaille <akim@epita.fr>
15812
15813 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15814
45119f04
RA
158152002-05-02 Robert Anisko <robert@lrde.epita.fr>
15816
15817 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15818 Update the stack class, give a try to deque as the default container.
15819
b2d52318
AD
158202002-05-02 Akim Demaille <akim@epita.fr>
15821
15822 * data/bison.simple (yyparse): Do not implement @$ = @1.
15823 (YYLLOC_DEFAULT): Adjust to do it.
15824 * doc/bison.texinfo (Location Default Action): Fix.
15825
3a8b4109
AD
158262002-05-02 Akim Demaille <akim@epita.fr>
15827
15828 * src/reader.c (parse_braces): Merge into...
15829 (parse_action): this.
15830
84614e13
AD
158312002-05-02 Akim Demaille <akim@epita.fr>
15832
15833 * configure.in (ALL_LINGUAS): Remove.
15834 * po/LINGUAS, hr.po: New.
15835
fdbcd8e2
AD
158362002-05-02 Akim Demaille <akim@epita.fr>
15837
15838 Remove the so called hairy (semantic) parsers.
15839
15840 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15841 * src/gram.h, src/gram.c (semantic_parser): Remove.
15842 (rule_t): Remove the guard and guard_line members.
15843 * src/lex.h (token_t): remove tok_guard.
15844 * src/options.c (option_table): Remove %guard and %semantic_parser
15845 support.
15846 * src/output.c, src/output.h (guards_output): Remove.
15847 (prepare): Adjust.
15848 (token_definitions_output): Don't output the `T'
15849 tokens (???).
15850 (output_skeleton): Don't output the guards.
15851 * src/files.c, src/files.c (attrsfile): Remove.
15852 * src/reader.c (symbol_list): Remove the guard and guard_line
15853 members.
15854 Adjust dependencies.
15855 (parse_guard): Remove.
15856 * data/bison.hairy: Remove.
15857 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15858 BISON_HAIRY.
15859
82b6cb3f
AD
158602002-05-02 Akim Demaille <akim@epita.fr>
15861
15862 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15863 (parse_guard): Rename the formal argument `stack_offset' as
15864 `rule_length', which is more readable.
15865 Adjust callers.
15866 (copy_at, copy_dollar): Instead of outputting the hard coded
15867 values of $$, $n and so forth, output invocation to b4_lhs_value,
15868 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
15869 Note: this patch partially drops `semantic-parser' support: it
15870 always does `rule_length - n', where semantic parsers ought to
15871 always use `-n'.
82b6cb3f
AD
15872 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15873 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15874
6cbfbcc5
AD
158752002-05-02 Akim Demaille <akim@epita.fr>
15876
15877 * configure.in (AC_INIT): Bump to 1.49b.
15878 (AM_INIT_AUTOMAKE): Short invocation.
15879
b8548114
AD
158802002-05-02 Akim Demaille <akim@epita.fr>
15881
15882 Version 1.49a.
15883
c20cd1fa
AD
158842002-05-01 Akim Demaille <akim@epita.fr>
15885
15886 * src/skeleton.h: Remove.
15887
8a9566d4
AD
158882002-05-01 Akim Demaille <akim@epita.fr>
15889
15890 * src/skeleton.h: Fix the #endif.
15891 Reported by Magnus Fromreide.
15892
8c6d399a
PE
158932002-04-26 Paul Eggert <eggert@twinsun.com>
15894
15895 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15896 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 15897 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 15898
2b7ed18a
RA
158992002-04-25 Robert Anisko <robert@lrde.epita.fr>
15900
15901 * src/scan-skel.l: Postprocess quadrigraphs.
15902
15903 * src/reader.c (copy_character): New function, used to output
15904 single characters while replacing `[' and `]' with quadrigraphs, to
15905 avoid troubles with M4 quotes.
15906 (copy_comment): Output characters with copy_character.
15907 (read_additionnal_code): Likewise.
15908 (copy_string2): Likewise.
15909 (copy_definition): Likewise.
15910
15911 * tests/calc.at: Exercise M4 quoting.
15912
34a89c50
AD
159132002-04-25 Akim Demaille <akim@epita.fr>
15914
15915 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
15916 between `!' and the command.
15917 Reported by Paul Eggert.
15918
0dd1580a
RA
159192002-04-24 Robert Anisko <robert@lrde.epita.fr>
15920
15921 * tests/calc.at: Exercise prologue splitting.
15922
15923 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
15924 `b4_post_prologue' instead of `b4_prologue'.
15925
15926 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
15927 muscles.
15928 (output): Free pre_prologue_obstack and post_prologue_obstack.
15929 * src/files.h, src/files.c (attrs_obstack): Remove.
15930 (pre_prologue_obstack, post_prologue_obstack): New.
15931 * src/reader.c (copy_definition): Add a parameter to specify the
15932 obstack to fill, instead of using attrs_obstack unconditionally.
15933 (read_declarations): Pass pre_prologue_obstack to copy_definition if
15934 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
15935
83c1796f
PE
159362002-04-23 Paul Eggert <eggert@twinsun.com>
15937
15938 * data/bison.simple: Remove unnecessary commentary and white
15939 space differences from 1_29-branch.
15940 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
15941
15942 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
15943 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
15944 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
15945 constructors or destructors.
15946
15947 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
15948
1207eeac
AD
159492002-04-23 Akim Demaille <akim@epita.fr>
15950
15951 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
15952 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
15953 location with columns.
15954 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
15955 All reported by Paul Eggert.
15956
78ab8f67
AD
159572002-04-22 Akim Demaille <akim@epita.fr>
15958
15959 * src/reduce.c (dump_grammar): Move to...
15960 * src/gram.h, src/gram.c (grammar_dump): here.
15961 Be sure to separate long item numbers.
15962 Don't read the members of a rule's prec if its nil.
15963
133c20e2
AD
159642002-04-22 Akim Demaille <akim@epita.fr>
15965
15966 * src/output.c (table_size, table_grow): New.
15967 (MAXTABLE): Remove, replace uses with table_size.
15968 (pack_vector): Instead of dying when the table is too big, grow it.
15969
9515e8a7
AD
159702002-04-22 Akim Demaille <akim@epita.fr>
15971
15972 * data/bison.simple (yyr1): Its type is that of a token number.
15973 * data/bison.c++ (r1_): Likewise.
15974 * tests/regression.at (Web2c Actions): Adjust.
15975
23c5a174
AD
159762002-04-22 Akim Demaille <akim@epita.fr>
15977
15978 * src/reader.c (token_translations_init): 256 is now the default
15979 value for the error token, i.e., it will be assigned another
15980 number if the user assigned 256 to one of her tokens.
15981 (reader): Don't force 256 to error.
15982 * doc/bison.texinfo (Symbols): Adjust.
15983 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
15984 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
15985 etc. instead of 10, 20, 30 (which was used to `jump' over error
15986 (256) and undefined (2)).
15987
5fbb0954
AD
159882002-04-22 Akim Demaille <akim@epita.fr>
15989
15990 Propagate more token_number_t.
15991
15992 * src/gram.h (token_number_as_item_number)
15993 (item_number_as_token_number): New.
15994 * src/output.c (GENERATE_OUTPUT_TABLE): New.
15995 Use it to create output_item_number_table and
15996 output_token_number_table.
15997 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15998 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
15999 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16000 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16001
4f940944
AD
160022002-04-22 Akim Demaille <akim@epita.fr>
16003
16004 * src/output.h, src/output.c (get_lines_number): Remove.
16005
3ded9a63
AD
160062002-04-19 Akim Demaille <akim@epita.fr>
16007
16008 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16009 as Lex/Flex'.
16010 (Debugging): More details about enabling the debugging features.
16011 (Table of Symbols): Describe $$, $n, @$, and @n.
16012 Suggested by Tim Josling.
16013
e0c471a9
AD
160142002-04-19 Akim Demaille <akim@epita.fr>
16015
16016 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16017
fecc10cd
AD
160182002-04-10 Akim Demaille <akim@epita.fr>
16019
16020 * src/system.h: Rely on HAVE_LIMITS_H.
16021 Suggested by Paul Eggert.
16022
51dec47b
AD
160232002-04-09 Akim Demaille <akim@epita.fr>
16024
16025 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16026 full stderr, and strip it according to the bison options, instead
16027 of composing the error message from different bits.
16028 This makes it easier to check for several error messages.
16029 Adjust all the invocations.
16030 Add an invocation exercising the error token.
16031 Add an invocation demonstrating a stupid error message.
16032 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16033 Adjust the tests.
16034 Error message are for stderr, not stdout.
16035
007a50a4
AD
160362002-04-09 Akim Demaille <akim@epita.fr>
16037
16038 * src/gram.h, src/gram.c (error_token_number): Remove, use
16039 errtoken->number.
16040 * src/reader.c (reader): Don't specify the user token number (2)
16041 for $undefined, as it uselessly prevents using it.
16042 * src/gram.h (token_number_t): Move to...
16043 * src/symtab.h: here.
16044 (state_t.number): Is a token_number_t.
16045 * src/print.c, src/reader.c: Use undeftoken->number instead of
16046 hard coded 2.
16047 (Even though this 2 is not the same as above: the number of the
16048 undeftoken remains being 2, it is its user token number which
16049 might not be 2).
16050 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16051 `user_token_number_max'.
16052 Output `undef_token_number'.
16053 * data/bison.simple, data/bison.c++: Use them.
16054 Be sure to map invalid yylex return values to
16055 `undef_token_number'. This saves us from gratuitous SEGV.
16056
16057 * tests/conflicts.at (Solved SR Conflicts)
16058 (Unresolved SR Conflicts): Adjust.
16059 * tests/regression.at (Web2c Actions): Adjust.
16060
06446ccf
AD
160612002-04-08 Akim Demaille <akim@epita.fr>
16062
16063 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16064 Adding #line.
16065 Remove the duplicate `typedefs'.
16066 (RhsNumberType): Fix the declaration and various other typos.
16067 Use __ofile__.
16068 * data/bison.simple: Use __ofile__.
16069 * src/scan-skel.l: Handle __ofile__.
16070
62a3e4f0
AD
160712002-04-08 Akim Demaille <akim@epita.fr>
16072
16073 * src/gram.h (item_number_t): New, the type of item numbers in
16074 RITEM. Note that it must be able to code symbol numbers as
16075 positive number, and the negation of rule numbers as negative
16076 numbers.
16077 Adjust all dependencies (pretty many).
16078 * src/reduce.c (rule): Remove this `short *' pointer: use
16079 item_number_t.
16080 * src/system.h (MINSHORT, MAXSHORT): Remove.
16081 Include `limits.h'.
16082 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16083 (shortcpy): Remove.
16084 (MAXTABLE): Move to...
16085 * src/output.c (MAXTABLE): here.
16086 (prepare_rules): Use output_int_table to output rhs.
16087 * data/bison.simple, data/bison.c++: Adjust.
16088 * tests/torture.at (Big triangle): Move the limit from 254 to
16089 500.
16090 * tests/regression.at (Web2c Actions): Ajust.
16091
16092 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16093 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16094 passes, but produces negative #line number, once fixed, GCC is
16095 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16096 C), it passes.
16097 * src/state.h (state_h): Code input lines on ints, not shorts.
16098
bb88b0fc
AD
160992002-04-08 Akim Demaille <akim@epita.fr>
16100
16101 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16102 and then the grammar.
16103
9a636f47
AD
161042002-04-08 Akim Demaille <akim@epita.fr>
16105
16106 * src/system.h: No longer using strndup.
16107
680e8701
AD
161082002-04-07 Akim Demaille <akim@epita.fr>
16109
16110 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16111 * src/output.c (output_table_data): Return the longest number.
16112 (prepare_tokens): Output `token_number_max').
16113 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16114 New.
16115 Use them to define yy_token_number_type/TokenNumberType.
16116 Use this type for yytranslate.
16117 * tests/torture.at (Big triangle): Push the limit from 124 to
16118 253.
16119 * tests/regression.at (Web2c Actions): Adjust.
16120
817e9f41
AD
161212002-04-07 Akim Demaille <akim@epita.fr>
16122
16123 * tests/torture.at (Big triangle): New.
16124 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16125 * tests/existing.at: here.
16126
5123689b
AD
161272002-04-07 Akim Demaille <akim@epita.fr>
16128
16129 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16130 nritems.
16131 Adjust dependencies.
16132
f3849179
AD
161332002-04-07 Akim Demaille <akim@epita.fr>
16134
16135 * src/reader.c: Normalize increments to prefix form.
16136
bd02036a
AD
161372002-04-07 Akim Demaille <akim@epita.fr>
16138
16139 * src/reader.c, symtab.c: Remove debugging code.
16140
db8837cb
AD
161412002-04-07 Akim Demaille <akim@epita.fr>
16142
16143 Rename all the `bucket's as `symbol_t'.
16144
16145 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16146 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16147 * src/symtab.c, src/symtab.h (bucket): Rename as...
16148 (symbol_t): this.
16149 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16150 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16151 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16152 (buckets_new, buckets_free, buckets_do): Rename as...
16153 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16154 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16155 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16156 (symbols_new, symbols_free, symbols_do): these.
16157
72a23c97
AD
161582002-04-07 Akim Demaille <akim@epita.fr>
16159
16160 Use lib/hash for the symbol table.
16161
16162 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16163 EOF.
16164 * src/lex.c (lex): Set the `number' member of new terminals.
16165 * src/reader.c (bucket_check_defined, bucket_make_alias)
16166 (bucket_check_alias_consistence, bucket_translation): New.
16167 (reader, grammar_free, readgram, token_translations_init)
16168 (packsymbols): Adjust.
16169 (reader): Number the predefined tokens.
16170 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16171 for predefined tokens.
16172 * src/symtab.h (bucket): Remove all the hash table related
16173 members.
16174 * src/symtab.c (symtab): Replace by...
16175 (bucket_table): this.
16176 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16177 (buckets_new, buckets_do): New.
16178
280a38c3
AD
161792002-04-07 Akim Demaille <akim@epita.fr>
16180
16181 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16182 (start_symbol, max_user_token_number, semantic_parser)
16183 (error_token_number): Initialize.
16184 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16185 Initialize.
16186 (reader): Don't.
16187 (errtoken, eoftoken, undeftoken, axiom): Extern.
16188
03b31c0c
AD
161892002-04-07 Akim Demaille <akim@epita.fr>
16190
16191 * src/gram.h (rule_s): prec and precsym are now pointers
16192 to the bucket giving the priority/associativity.
16193 Member `associativity' removed: useless.
16194 * src/reduce.c, src/conflicts.c: Adjust.
16195
8b3df748
AD
161962002-04-07 Akim Demaille <akim@epita.fr>
16197
16198 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16199 Properly escape the symbols' TAG when outputting them.
16200
e601aa1d
AD
162012002-04-07 Akim Demaille <akim@epita.fr>
16202
16203 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16204
b0299a2e
AD
162052002-04-07 Akim Demaille <akim@epita.fr>
16206
16207 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16208 (LArule): this, which is an array to rule_t*.
16209 * src/print.c, src/conflicts.c: Adjust.
16210
d7e1f00c
AD
162112002-04-07 Akim Demaille <akim@epita.fr>
16212
16213 * src/gram.h (rule_t): Rename `number' as `user_number'.
16214 `number' is a new member.
16215 Adjust dependencies.
16216 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16217
cc9305dd
AD
162182002-04-07 Akim Demaille <akim@epita.fr>
16219
16220 As a result of the previous patch, it is no longer needed
16221 to reorder ritem itself.
16222
16223 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16224
b0940840
AD
162252002-04-07 Akim Demaille <akim@epita.fr>
16226
16227 Be sure never to walk through RITEMS, but use only data related to
16228 the rules themselves. RITEMS should be banished.
16229
16230 * src/output.c (output_token_translations): Rename as...
16231 (prepare_tokens): this.
16232 In addition to `translate', prepare the muscles `tname' and
16233 `toknum', which were handled by...
16234 (output_rule_data): this.
16235 Remove, and move the remainder of its outputs into...
16236 (prepare_rules): this new routines, which also merges content from
16237 (output_gram): this.
16238 (prepare_rules): Be sure never to walk through RITEMS.
16239 (output_stos): Rename as...
16240 (prepare_stos): this.
16241 (output): Always invoke prepare_states, after all, just don't use it
16242 in the output if you don't need it.
16243
643a5994
AD
162442002-04-07 Akim Demaille <akim@epita.fr>
16245
16246 * src/LR0.c (new_state): Display `nstates' as the name of the
16247 newly created state.
16248 Adjust to initialize first_state and last_state if needed.
16249 Be sure to distinguish the initial from the final state.
16250 (new_states): Create the itemset of the initial state, and use
16251 new_state.
16252 * src/closure.c (closure): Now that the initial state has its
16253 items properly set, there is no need for a special case when
16254 creating `ruleset'.
16255
16256 As a result, now the rule 0, reducing to $axiom, is visible in the
16257 outputs. Adjust the test suite.
16258
16259 * tests/conflicts.at (Solved SR Conflicts)
16260 (Unresolved SR Conflicts): Adjust.
16261 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16262 * tests/conflicts.at (S/R in initial): New.
16263
b4c4ccc2
AD
162642002-04-07 Akim Demaille <akim@epita.fr>
16265
16266 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16267 the RHS of the rules.
16268 * src/output.c (output_gram): Likewise.
16269
bba97eb2
AD
162702002-04-07 Akim Demaille <akim@epita.fr>
16271
16272 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16273 bucket.
16274 Adjust all dependencies.
16275 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16276 `number' of the buckets too.
16277 * src/gram.h: Include `symtab.h'.
16278 (associativity): Move to...
16279 * src/symtab.h: here.
16280 No longer include `gram.h'.
16281
c3b407f4
AD
162822002-04-07 Akim Demaille <akim@epita.fr>
16283
16284 * src/gram.h, src/gram.c (rules_rhs_length): New.
16285 (ritem_longest_rhs): Use it.
16286 * src/gram.h (rule_t): `number' is a new member.
16287 * src/reader.c (packgram): Set it.
16288 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16289 the end of `rules', and count them out of `nrules'.
16290 (reduce_output, dump_grammar): Adjust.
16291 * src/print.c (print_grammar): It is no longer needed to check for
16292 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16293 * tests/reduce.at (Reduced Automaton): New test.
16294
11652ab3
AD
162952002-04-07 Akim Demaille <akim@epita.fr>
16296
16297 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16298 lacking `+ 1' to nrules, Bison reported as useless a token if it
16299 was used solely to set the precedence of the last rule...
16300
26b23c1a
AD
163012002-04-07 Akim Demaille <akim@epita.fr>
16302
16303 * data/bison.c++, data/bison.simple: Don't output the current file
16304 name in #line, to avoid useless diffs between two identical
16305 outputs under different names.
16306
18bcecb0
AD
163072002-04-07 Akim Demaille <akim@epita.fr>
16308
16309 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16310 Normalize loops to using `< nrules + 1', not `<= nrules'.
16311
fa770c86
AD
163122002-04-07 Akim Demaille <akim@epita.fr>
16313
16314 * TODO: Update.
16315
d9b739c3
AD
163162002-04-07 Akim Demaille <akim@epita.fr>
16317
16318 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16319 bucket.value as bucket.number.
16320
99013900
AD
163212002-04-07 Akim Demaille <akim@epita.fr>
16322
16323 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16324 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16325 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16326 RHS, instead of being an index in RITEMS.
16327
e966383b
PE
163282002-04-04 Paul Eggert <eggert@twinsun.com>
16329
16330 * doc/bison.texinfo: Update copyright date.
16331 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16332 (Symbols): Warn about running Bison in one character set,
16333 but compiling and/or running in an incompatible one.
16334 Warn about character code 256, too.
16335
163362002-04-03 Paul Eggert <eggert@twinsun.com>
16337
16338 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16339 YYERROR_VERBOSE is nonzero, not whether it is defined.
16340
16341 Merge changes from bison-1_29-branch.
c307773e 16342
8d6c48b9
PE
163432002-03-20 Paul Eggert <eggert@twinsun.com>
16344
16345 Merge fixes from Debian bison_1.34-1.diff.
16346
16347 * configure.in (AC_PREREQ): 2.53.
16348
e53c6322
AD
163492002-03-20 Akim Demaille <akim@epita.fr>
16350
16351 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16352
9ffbeca7
PE
163532002-03-19 Paul Eggert <eggert@twinsun.com>
16354
21db0b2a
PE
16355 * src/bison.simple (YYCOPY): New macro.
16356 (YYSTACK_RELOCATE): Use it.
16357 Remove Type arg; no longer needed. All callers changed.
16358 (yymemcpy): Remove; no longer needed.
16359
9ffbeca7
PE
16360 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16361 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16362
642cb8f8
AD
163632002-03-19 Akim Demaille <akim@epita.fr>
16364
16365 Test and fix the #line outputs.
16366
16367 * tests/atlocal.at (GCC): New.
16368 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 16369 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
16370 (Action synch line, Epilogue synch line): New tests.
16371 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16372 * data/bison.simple, data/bison.c++: Use it.
16373
3c31a486
AD
163742002-03-19 Akim Demaille <akim@epita.fr>
16375
16376 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16377 (Solved SR Conflicts, %expect not enough, %expect right)
16378 (%expect too much): Move to...
16379 * tests/conflicts.at: this new file.
16380
0d8bed56
AD
163812002-03-19 Akim Demaille <akim@epita.fr>
16382
16383 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16384 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16385 that we can move to enums for instance.
16386 * src/output.c (token_definitions_output): Output a list of
16387 `token-name, token-number' instead of the #define.
16388 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16389
9208d17f
AD
163902002-03-14 Akim Demaille <akim@epita.fr>
16391
16392 Use Gettext 0.11.1.
16393
af27eacb
RA
163942002-03-09 Robert Anisko <robert@lrde.epita.fr>
16395
16396 * data/bison.c++: Make the user able to add members to the generated
16397 parser by subclassing.
16398
9101a310
RA
163992002-03-05 Robert Anisko <robert@lrde.epita.fr>
16400
16401 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16402 a character.
16403 Reported by Nicolas Tisserand and Nicolas Burrus.
16404
fff9bf0b
RA
164052002-03-04 Robert Anisko <robert@lrde.epita.fr>
16406
16407 * src/reader.c: Warn about lacking semi-colons, do not complain.
16408
64dba31e
RA
164092002-03-04 Robert Anisko <robert@lrde.epita.fr>
16410
16411 * data/bison.c++: Remove a debug line.
16412
374f5a14
RA
164132002-03-04 Robert Anisko <robert@lrde.epita.fr>
16414
16415 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16416 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16417 provide a default implementation.
16418
bfcf1f3a
AD
164192002-03-04 Akim Demaille <akim@epita.fr>
16420
16421 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16422 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16423 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16424 * tests/semantic.at (Parsing Guards): Similarly.
16425 * src/reader.at (readgram): Complain if the last rule is not ended
16426 with a semi-colon.
16427
65ccf9fc
AD
164282002-03-04 Akim Demaille <akim@epita.fr>
16429
16430 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16431 * src/closure.c: here.
16432 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16433 RTC.
16434 * src/warshall.h, src/warshall.c: Remove.
16435 * tests/sets.at (Broken Closure): Adjust.
16436
d0039cbc
AD
164372002-03-04 Akim Demaille <akim@epita.fr>
16438
16439 * src/output.c (output_skeleton): tempdir is const.
16440 bytes_read is unused.
16441
345cea78
AD
164422002-03-04 Akim Demaille <akim@epita.fr>
16443
16444 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16445 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16446 Update.
16447 From Michael Hayes.
16448
564801f7
AD
164492002-03-04 Akim Demaille <akim@epita.fr>
16450
16451 * src/closure.c (closure): `r' is unused.
16452
e5352bc7
AD
164532002-03-04 Akim Demaille <akim@epita.fr>
16454
16455 * tests/sets.at (Broken Closure): Add the ending `;'.
16456 * src/reader.at (readgram): Complain if a rule is not ended with a
16457 semi-colon.
16458
914feea9
AD
164592002-03-04 Akim Demaille <akim@epita.fr>
16460
16461 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16462 (count_sr_conflicts): Use bitset_count.
16463 * src/reduce.c (inaccessable_symbols): Ditto.
16464 (bits_size): Remove.
16465 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16466
f0250de6
AD
164672002-03-04 Akim Demaille <akim@epita.fr>
16468
16469 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16470 * src/reduce.c: Remove the `bitset_zero's following the
16471 `bitset_create's, as now it is performed by the latter.
16472
ef017502
AD
164732002-03-04 Akim Demaille <akim@epita.fr>
16474
16475 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16476 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16477 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16478 latest sources from Michael.
16479
76514394
AD
164802002-03-04 Akim Demaille <akim@epita.fr>
16481
16482 * src/output.c (output): Don't free the grammar.
16483 * src/reader.c (grammar_free): New.
16484 * src/main.c (main): Call it and don't free symtab here.
16485
55024580
AD
164862002-03-04 Akim Demaille <akim@epita.fr>
16487
16488 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16489 before returning.
16490 Reported by Benoit Perrot.
16491
f9abaa2c
AD
164922002-03-04 Akim Demaille <akim@epita.fr>
16493
16494 Use bitset operations when possible, not loops over bits.
16495
16496 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16497 bitset_or.
16498 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16499 * src/reduce.c (useless_nonterminals): Formatting changes.
16500 * src/warshall.c (TC): Use bitset_or.
16501
0e721e75
AD
165022002-03-04 Akim Demaille <akim@epita.fr>
16503
16504 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16505 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16506 Ditto.
16507
0fb1ffb1
AD
165082002-03-04 Akim Demaille <akim@epita.fr>
16509
16510 * src/lalr.c (F): Now a bitset*.
16511 Adjust all dependencies.
16512
b86796bf
AD
165132002-03-04 Akim Demaille <akim@epita.fr>
16514
16515 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16516 Adjust all dependencies.
16517
602bbf31
AD
165182002-03-04 Akim Demaille <akim@epita.fr>
16519
16520 * src/L0.c, src/LR0.h (nstates): Be size_t.
16521 Adjust comparisons (signed vs unsigned).
16522 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16523 bitset*.
16524 Adjust all dependencies.
16525
d8a0245c
AD
165262002-03-04 Akim Demaille <akim@epita.fr>
16527
16528 * src/closure.c (firsts): Now, also a bitset.
16529 Adjust all dependencies.
16530 (varsetsize): Remove, now unused.
16531 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16532
34ba9743
AD
165332002-03-04 Akim Demaille <akim@epita.fr>
16534
16535 * src/print.c: Convert to use bitset.h, not hand coded iterations
16536 over ints.
16537
ed86e78c
AD
165382002-03-04 Akim Demaille <akim@epita.fr>
16539
16540 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16541
dfdb1797
AD
165422002-03-04 Akim Demaille <akim@epita.fr>
16543
16544 * src/closure.c (ruleset): Be a bitset.
16545 (rulesetsize): Remove.
16546
7086e707
AD
165472002-03-04 Akim Demaille <akim@epita.fr>
16548
16549 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16550 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16551 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16552 * src/closure.c (fderives): Be an array of bitsets.
16553
98254360
RA
165542002-02-28 Robert Anisko <robert@lrde.epita.fr>
16555
16556 * data/bison.c++: Merge the two generated headers. Insert a copyright
16557 notice in each output file.
16558
a75c057f
AD
165592002-02-28 Akim Demaille <akim@epita.fr>
16560
16561 * data/bison.c++: Copy the prologue of bison.simple to fetch
16562 useful M4 definitions, such as b4_header_guard.
16563
06b00abc
AD
165642002-02-25 Akim Demaille <akim@epita.fr>
16565
16566 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
16567 translator friendly scheme for the bgr
16568 copyright notice.
06b00abc 16569
70e7d534
AD
165702002-02-25 Akim Demaille <akim@epita.fr>
16571
16572 * src/output.c (header_output): Remove, now handled completely via
16573 M4.
16574
abe017f6
AD
165752002-02-25 Akim Demaille <akim@epita.fr>
16576
16577 * m4/m4.m4: New, from CVS Autoconf.
16578 * configure.in: Invoke it.
16579 * src/output.c (output_skeleton): Use its result instead of the
16580 hard coded name.
16581
381fb12e
AD
165822002-02-25 Akim Demaille <akim@epita.fr>
16583
16584 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16585 Fileutils 4.1.5.
16586 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16587 * src/output.c (output_skeleton): Use mkstemp to create a real
16588 temporary file.
16589 Move the filling of `skeleton' and its muscle to...
16590 (prepare): here.
16591 (output): Move the definition of the prologue muscle to...
16592 (prepare): here.
16593 * src/system.h (DEFAULT_TMPDIR): New.
16594
6f38107f
PE
165952002-02-14 Paul Eggert <eggert@twinsun.com>
16596
16597 Remove the support for C++ namespace cleanliness; it was
16598 causing more problems than it was curing, since it didn't work
16599 properly on some nonstandard C++ compilers. This can wait
16600 for a proper C++ parser.
16601
16602 * NEWS: Document this.
16603 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16604 of C++, as it's treated like C now.
16605 * src/bison.simple (YYSTD): Remove.
16606 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16607 Treat C++ just like Standard C instead of trying to support
16608 namespace cleanliness.
16609
80cce3da
AD
166102002-02-14 Akim Demaille <akim@epita.fr>
16611
16612 * tests/regression.at (else): Adjust to Andreas' change.
16613
842e8679
AD
166142002-02-14 Akim Demaille <akim@epita.fr>
16615
16616 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16617
4bda3f10
AD
166182002-02-13 Andreas Schwab <schwab@suse.de>
16619
16620 * src/output.c (output_rule_data): Don't output NULL, it might
16621 not be defined yet.
16622
4162fa07 166232002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 16624
4162fa07
RA
16625 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16626 (Copyright notice): Update.
b418ecd8 16627
bd16a5dc
AD
166282002-02-11 Akim Demaille <akim@epita.fr>
16629
16630 * tests/regression.at (%nonassoc and eof): Don't include
16631 nonportable headers.
16632
8d69a1a3
RA
166332002-02-08 Robert Anisko <robert@lrde.epita.fr>
16634
16635 * data/bison.c++: Correct error recovery. Make the user able to
16636 initialize the starting location.
16637
9b2d0677
AD
166382002-02-07 Akim Demaille <akim@epita.fr>
16639
16640 * tests/input.at: New.
16641
69e2658b
RA
166422002-02-07 Robert Anisko <robert@lrde.epita.fr>
16643
16644 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 16645 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
16646 directives around tables only needed for debugging.
16647
4aacc3a7
RA
166482002-02-07 Robert Anisko <robert@lrde.epita.fr>
16649
16650 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16651 C++ parsers.
16652 (yy::b4_name::parse): Use print_.
16653
762a801e
RA
166542002-02-07 Robert Anisko <robert@lrde.epita.fr>
16655
16656 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16657
4bb2bc3f
RA
166582002-02-07 Robert Anisko <robert@lrde.epita.fr>
16659
16660 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16661 C++ parsers.
16662 (yy::b4_name::parse): Build verbose error messages, and use error_.
16663
6b45a3ca
RA
166642002-02-06 Robert Anisko <robert@lrde.epita.fr>
16665
16666 * data/bison.c++: Fix m4 quoting in comments.
16667
50997c6e
RA
166682002-02-06 Robert Anisko <robert@lrde.epita.fr>
16669
16670 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16671 not expanded by m4.
16672
3f3eed27
AD
166732002-02-05 Akim Demaille <akim@epita.fr>
16674
16675 * data/bison.c++: Adjust to the M4 back end.
16676 More is certainly needed.
16677
be2a1a68
AD
166782002-02-05 Akim Demaille <akim@epita.fr>
16679
16680 Give a try to M4 as a back end.
16681
16682 * lib/readpipe.c: New, from wdiff.
16683 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16684 BISON_HAIRY.
16685 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16686 specific values. Now it is m4 that performs the lookup.
16687 * src/parse-skel.y: Remove.
16688 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16689 * src/output.c (actions_output, guards_output)
16690 (token_definitions_output): No longer keeps track of the output
16691 line number, hence remove the second argument.
16692 (guards_output): Check against the guard member of a rule, not the
16693 action member.
16694 Adjust callers.
16695 (output_skeleton): Don't look for the skeleton location, let m4 do
16696 that.
16697 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16698 file will be used.
16699 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16700 (prepare): Given that for the time being changesyntax is not
16701 usable in M4, rename the muscles using `-' to `_'.
16702 Define `defines_flag', `output_parser_name' and `output_header_name'.
16703 * src/output.h (actions_output, guards_output)
16704 (token_definitions_output): Adjust prototypes.
16705 * src/scan-skel.l: Instead of scanning the skeletons, it now
16706 processes the output of m4: `__oline__' and `#output'.
16707 * data/bison.simple: Adjust to be used by M4(sugar).
16708 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16709 to date.
16710 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16711 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16712 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16713 shamelessly stolen from CVS Autoconf.
16714
beda758b
AD
167152002-02-05 Akim Demaille <akim@epita.fr>
16716
16717 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16718 * configure.in: Check for the declarations of free and malloc.
16719 * src/muscle_tab.c: Adjust.
16720
5ece6d43
AD
167212002-02-05 Akim Demaille <akim@epita.fr>
16722
16723 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16724 which have no values.
16725
5bb18f9a
AD
167262002-02-05 Akim Demaille <akim@epita.fr>
16727
16728 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16729 * data/: here.
16730
894dd62e
PE
167312002-01-29 Paul Eggert <eggert@twinsun.com>
16732
16733 * src/bison.simple (YYSIZE_T): Do not define merely because
16734 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16735 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16736
82841af7
AD
167372002-01-27 Akim Demaille <akim@epita.fr>
16738
16739 Fix `%nonassoc and eof'.
16740
16741 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16742 which were not properly copied! Replace
16743 memcpy (res->errs, src->errs, src->nerrs);
16744 with
16745 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16746 !!!
16747 * tests/regression.at (%nonassoc and eof): Adjust to newest
16748 Autotest: `.' is not in the PATH.
16749
318b76e9
AD
167502002-01-27 Akim Demaille <akim@epita.fr>
16751
16752 * tests/sets.at (AT_EXTRACT_SETS): New.
16753 (Nullable): Use it.
16754 (Firsts): New.
16755
30d2f3d5
AD
167562002-01-26 Akim Demaille <akim@epita.fr>
16757
16758 * tests/actions.at, tests/calc.at, tests/headers.at,
16759 * tests/torture.at: Adjust to the newest Autotest which no longer
16760 forces `.' in the PATH.
16761
30f8c395
AD
167622002-01-25 Akim Demaille <akim@epita.fr>
16763
16764 * tests/regression.at (%nonassoc and eof): New.
16765 Suggested by Robert Anisko.
16766
29ae55f1
AD
167672002-01-24 Akim Demaille <akim@epita.fr>
16768
16769 Bison dumps core when trying to complain about broken input files.
16770 Reported by Cris van Pelt.
16771
16772 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16773 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16774 into...
16775 (Invalid inputs): Strengthen: exercise parse_percent_token.
16776
2b548aa6
RA
167772002-01-24 Robert Anisko <robert.anisko@epita.fr>
16778
16779 * src/Makefile.am: Add bison.c++.
16780 * src/bison.c++: New skeleton.
16781
bb0146c2
AD
167822002-01-21 Paolo Bonzini <bonzini@gnu.org>
16783
16784 * po/it.po: New.
16785
bec30531
AD
167862002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16787
16788 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16789
fc6edc45
MA
167902002-01-20 Marc Autret <marc@gnu.org>
16791
16792 * src/files.c (compute_output_file_names): Fix
16793
5e5d5415
MA
167942002-01-20 Marc Autret <marc@gnu.org>
16795
16796 * tests/output.at: New test.
16797 * src/files.c (compute_base_names): Don't map extensions when
16798 the YACC flag is set, use defaults.
16799 Reported by Evgeny Stambulchik.
16800
44ea3fbd
MA
168012002-01-20 Marc Autret <marc@gnu.org>
16802
ba0fe3c7
PE
16803 * src/system.h: Need to define __attribute__ away for non-GCC
16804 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
16805 Suggested by Albert Chin-A-Young.
16806
338963d1
TVH
168072002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16808
16809 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16810 canonical definition.
16811 * src/system.h: Use the canonical definition for PARAMS (avoids
16812 a conflict with the macro from lib/hash.h).
16813
c57b2479
AD
168142002-01-11 Akim Demaille <akim@epita.fr>
16815
16816 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 16817 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 16818
b85810ae
AD
168192002-01-09 Akim Demaille <akim@epita.fr>
16820
16821 * src/files.c, src/files.h (output_infix): New.
16822 (tab_extension): Remove.
16823 (compute_base_names): Compute the former, drop the latter.
16824 * src/output.c (prepare): Insert the muscles `output-infix', and
16825 `output-suffix'.
16826 * src/parse-skel.y (string, string.1): New.
16827 (section.header): Use it.
16828 (section.yacc): Remove.
16829 (prefix): Remove too.
16830 * src/scan-skel.l: Adjust.
16831 * src/bison.simple, src/bison.hairy: Adjust.
16832
cae60122
AD
168332002-01-09 Akim Demaille <akim@epita.fr>
16834
16835 * configure.in (WERROR_CFLAGS): Compute it.
16836 * src/Makefile.am (CFLAGS): Pass it.
16837 * tests/atlocal.in (CFLAGS): Idem.
16838 * src/files.c: Fix a few warnings.
16839 (get_extension_index): Remove, unused.
16840
ae404801
AD
168412002-01-08 Akim Demaille <akim@epita.fr>
16842
16843 * src/getargs.c (AS_FILE_NAME): New.
16844 (getargs): Use it to convert DOSish file names.
16845 * src/files.c (base_name): Rename as full_base_name to avoid
16846 clashes with `base_name ()'.
16847 (filename_split): New.
16848 (compute_base_names): N-th rewrite, using filename_split.
16849
22312b71
AD
168502002-01-08 Akim Demaille <akim@epita.fr>
16851
16852 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16853 New, stolen from the Fileutils 4.1.
16854 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16855 * configure.in: Check for the presence of memrchr, and of its
16856 prototype.
16857
a67cef01
TVH
168582002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16859
16860 * lib/hash.h (__P): Added definition for this macro.
16861 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16862 BUILT_SOURCES, to ensure they are generated first.
16863 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16864 %error-verbose to allow bootstrapping with bison 1.30x.
16865
2b25d624
AD
168662002-01-06 Akim Demaille <akim@epita.fr>
16867
16868 * src/reader.c (parse_braces): Don't fetch the next char, the
16869 convention is to fetch on entry.
16870 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16871 'switch' without a following semicolon.
16872 * tests/regression.at (braces parsing): New.
16873
3460813b
AD
168742002-01-06 Akim Demaille <akim@epita.fr>
16875
16876 Bison is dead wrong in its RR conflict reports.
16877
16878 * tests/torture.at (GNU Cim Grammar): New.
16879 * src/conflicts.c (count_rr_conflicts): Fix.
16880
73784c64
AD
168812002-01-06 Akim Demaille <akim@epita.fr>
16882
16883 Creating package.m4 from configure.ac causes too many problems.
16884
16885 * tests/Makefile.am (package.m4): Create it by hand,
16886 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16887
25d81090
AD
168882002-01-06 Akim Demaille <akim@epita.fr>
16889
16890 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16891 skeleton.h.
16892
a9b8959e
PE
168932002-01-04 Paul Eggert <eggert@twinsun.com>
16894
16895 * doc/bison.texinfo (Debugging):
16896 Remove YYSTDERR; it's no longer defined or used.
16897 Also, s/cstdio.h/cstdio/.
16898
25d81090
AD
168992002-01-03 Akim Demaille <akim@epita.fr>
16900
16901 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
16902
1109455c
AD
169032002-01-03 Akim Demaille <akim@epita.fr>
16904
16905 * src/parse-skel.y (process_skeleton): Don't bind the parser's
16906 tracing code to --trace, wait for a better --trace option, with
16907 args.
16908
7ea5e977
AD
169092002-01-03 Akim Demaille <akim@epita.fr>
16910
16911 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
16912 The ISO C++ standard is extremely clear about it: stderr is
16913 considered a macro, not a regular symbol (see table 94 `Header
16914 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
16915 Therefore std:: does not apply to it. It still does with fprintf.
16916 Also, s/cstdio.h/cstdio/.
16917
fab5b110
AD
169182002-01-03 Akim Demaille <akim@epita.fr>
16919
16920 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
16921 for non system headers.
16922
aed7fd9b
AD
169232002-01-02 Akim Demaille <akim@epita.fr>
16924
16925 Equip the skeleton chain with location tracking, runtime trace,
16926 pure parser and scanner.
16927
16928 * src/parse-skel.y: Request a pure parser, locations, and prefix
16929 renaming.
16930 (%union): Having several members with the same type does not help
16931 type mismatches, simplify.
16932 (YYPRINT, yyprint): New.
16933 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
16934 (skel_error): this.
16935 Handle locations.
16936 * src/scan-skel.l: Adjust to these changes.
16937 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
16938 (LOCATION_PRINT, skel_control_t): New.
16939
24fad99e
AD
169402001-12-30 Akim Demaille <akim@epita.fr>
16941
16942 * src/parse-skel.y: Get rid of the shift/reduce conflict:
16943 replace `gb' with BLANKS.
16944 * src/scan-skel.l: Adjust.
16945
a4b36db4
AD
169462001-12-30 Akim Demaille <akim@epita.fr>
16947
16948 * src/system.h: We don't need nor want bcopy.
16949 Throw away MS-DOS crap: we don't need getpid.
16950 * configure.in: We don't need strndup. It was even causing
16951 problems: because Flex includes the headers *before* us,
16952 _GNU_SOURCE is not defined by config.h, and therefore strndup was
16953 not visible.
16954 * lib/xstrndup.c: New.
16955 * src/scan-skel.l: Use it.
16956 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
16957 * src/parse-skel.y: Use %directives instead of #defines.
16958
1239777d
AD
169592001-12-30 Akim Demaille <akim@epita.fr>
16960
16961 * src/skeleton.h: New.
16962 * src/output.c (output_parser, output_master_parser): Remove, dead
16963 code.
16964 * src/output.h (get_lines_number, actions_output, guards_output)
16965 (token_definitions_output): Prototype them.
16966 * src/parse-skel.y: Add the license notice.
16967 Include output.h and skeleton.h.
16968 (process_skeleton): Returns void, and takes a single parameter.
16969 * src/scan-skel.l: Add the license notice.
16970 Include skeleton.h.
16971 Don't use %option yylineno: it seems that then Flex imagines
16972 REJECT has been used, and therefore it won't reallocate its
16973 buffers (which makes no other sense to me than a bug). It results
16974 in warnings for `unused: yy_flex_realloc'.
16975
9b3add5b
RA
169762001-12-30 Robert Anisko <robert.anisko@epita.fr>
16977
16978 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16979 (MUSCLE_INSERT_PREFIX): ...to there.
16980 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16981 (MUSCLE_INSERT_PREFIX): Move from here...
16982
16983 * src/bison.hairy: Add a section directive. Put braces around muscle
16984 names. This parser skeleton is still broken, but Bison should not
16985 choke on a bad muscle 'syntax'.
16986 * src/bison.simple: Add a section directive. Put braces around muscle
16987 names.
16988
16989 * src/files.h (strsuffix, stringappend): Add declarations.
16990 (tab_extension): Add declaration.
16991 (short_base_name): Add declaration.
16992
16993 * src/files.c (strsuffix, stringappend): No longer static. These
16994 functions are used in the skeleton parser.
16995 (tab_extension): New.
16996 (compute_base_names): Use the computations done in this function
fab5b110 16997 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
16998 names.
16999 (short_base_name): No longer static.
17000
17001 * src/output.c (output_skeleton): New.
17002 (output): Disable call to output_master_parser, and give a try to
17003 a new skeleton handling system.
17004 (guards_output, actions_output): No longer static.
17005 (token_definitions_output, get_lines_number): No longer static.
17006
17007 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17008
fab5b110 17009 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
17010 parse-skel.y.
17011
17012 * src/parse-skel.y: New file.
17013 * src/scan-skel.l: New file.
17014
b5b61c61
AD
170152001-12-29 Akim Demaille <akim@epita.fr>
17016
17017 %name-prefix is broken.
17018
17019 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17020 Adjust all dependencies.
17021 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17022 %name-prefix.
17023
17024 Renaming yylval but not yylloc is not consistent. Now we do.
17025
17026 * src/bison.simple: Prefix yylloc if used.
17027 * doc/bison.texinfo (Decl Summary): Document that.
17028
8c9a50be
AD
170292001-12-29 Akim Demaille <akim@epita.fr>
17030
17031 * doc/bison.texinfo: Promote `%long-directive' over
17032 `%long_directive'.
17033 Remove all references to fixed-output-files, yacc is enough.
17034
d99361e6
AD
170352001-12-29 Akim Demaille <akim@epita.fr>
17036
17037 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17038 user prologue. These are defaults.
17039 * tests/actions.at (Mid-rule actions): Make sure the user can
17040 define YYDEBUG and YYERROR_VERBOSE.
17041
b9cecb91
AD
170422001-12-29 Akim Demaille <akim@epita.fr>
17043
17044 * src/output.c (header_output): Don't forget to export YYLTYPE and
17045 yylloc.
17046 * tests/headers.at (export YYLTYPE): New, make sure it does.
17047 * tests/regression.at (%union and --defines, Invalid CPP headers):
17048 Move to...
17049 * tests/headers.at: here.
17050
aea13e97
AD
170512001-12-29 Akim Demaille <akim@epita.fr>
17052
17053 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17054
931394cb
AD
170552001-12-29 Akim Demaille <akim@epita.fr>
17056
17057 * tests/actions.at (Mid-rule actions): Output on a single line
17058 instead of several.
17059
704a47c4
AD
170602001-12-29 Akim Demaille <akim@epita.fr>
17061
17062 * doc/bison.texinfo: Formatting changes.
17063
091e20bb
AD
170642001-12-29 Akim Demaille <akim@epita.fr>
17065
17066 Don't store the token defs in a muscle, just be ready to output it
17067 on command. Now possible via `symbols'. Fixes a memory leak.
17068
17069 * src/output.c (token_definitions_output): New.
17070 (output_parser, header_output): Use it.
17071 * src/reader.c (symbols_save): Remove.
17072
cce71710
AD
170732001-12-29 Akim Demaille <akim@epita.fr>
17074
17075 * src/bison.simple: Do not provide a default for YYSTYPE and
17076 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17077 default.
17078
82c035a8
AD
170792001-12-29 Akim Demaille <akim@epita.fr>
17080
17081 Mid-rule actions are simply... ignored!
17082
17083 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17084 the empty-rule associated to the dummy symbol, not to the host
17085 rule.
17086 * tests/actions.at (Mid-rule actions): New.
17087
8419d367
AD
170882001-12-29 Akim Demaille <akim@epita.fr>
17089
17090 Memory leak.
17091
17092 * src/reader.c (reader): Free grammar.
17093
375d5806
AD
170942001-12-29 Akim Demaille <akim@epita.fr>
17095
17096 Memory leak.
17097
17098 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17099 since it allocates it for each state, although only one is needed.
17100 (allocate_storage): Do it here.
17101
f51cb8ff
AD
171022001-12-29 Akim Demaille <akim@epita.fr>
17103
17104 * src/options.h, src/options.c (create_long_option_table): Rename
17105 as...
17106 (long_option_table_new): this, with a clearer prototype.
17107 (percent_table): Remove, unused,
17108 * src/getargs.c (getargs): Adjust.
17109
29e88316
AD
171102001-12-29 Akim Demaille <akim@epita.fr>
17111
17112 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17113 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17114 as states.
17115
b9f71f19
AD
171162001-12-29 Akim Demaille <akim@epita.fr>
17117
17118 * src/lalr.c (build_relations): Rename `states' as `states1'.
17119 Sorry, I don't understand exactly what it is, no better name...
17120
1a2b5d37
AD
171212001-12-29 Akim Demaille <akim@epita.fr>
17122
17123 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17124 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17125 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17126 as rules.
17127
1cca533e
AD
171282001-12-29 Akim Demaille <akim@epita.fr>
17129
17130 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17131 ago.
17132
c03ae966
AD
171332001-12-29 Akim Demaille <akim@epita.fr>
17134
17135 * src/reader.c, src/reader.h (user_toknums): Remove.
17136 Adjust all users to use symbols[i]->user_token_number.
17137
5a670b1e
AD
171382001-12-29 Akim Demaille <akim@epita.fr>
17139
17140 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17141 Adjust all users to use symbols[i]->prec or ->assoc.
17142
ad949da9
AD
171432001-12-29 Akim Demaille <akim@epita.fr>
17144
17145 * src/reader.c, src/reader.h (tags): Remove.
17146 Adjust all users to use symbols[i]->tag.
17147
0e78e603
AD
171482001-12-29 Akim Demaille <akim@epita.fr>
17149
17150 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17151 and rule_table.
17152 * src/reader.c (packsymbols): Fill this table.
17153 Drop sprec.
17154 * src/conflicts.c (resolve_sr_conflict): Adjust.
17155 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17156 single table.
17157 Use symbols[i]->tag instead of tags[i].
17158
213e640e
AD
171592001-12-29 Akim Demaille <akim@epita.fr>
17160
17161 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17162 In addition, put a comment in there, to replace...
17163 * tests/regression.at (%union and C comments): Remove.
17164
e7b8bef1
AD
171652001-12-29 Akim Demaille <akim@epita.fr>
17166
17167 * tests/regression.at (Web2c Actions): Blindly move the actual
17168 output as expected output. The contents *seem* right to me, but I
17169 can't pretend reading perfectly parser tables... Nonetheless, all
17170 the other tests pass correctly, the table look OK, even though the
17171 presence of `$axiom' is to be noted: AFAICS it is useless (but
17172 harmless).
17173
b68e7744
AD
171742001-12-29 Akim Demaille <akim@epita.fr>
17175
17176 * src/reader.c (readgram): Don't add the rule 0 if there were no
17177 rules read. In other words, add it _after_ having performed
17178 grammar sanity checks.
17179 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17180
78d5bae9
AD
171812001-12-29 Akim Demaille <akim@epita.fr>
17182
17183 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17184 visible, and some states have now a different number.
17185
ff442794
AD
171862001-12-29 Akim Demaille <akim@epita.fr>
17187
17188 * src/reader.c (readgram): Bind the initial rule's lineno to that
17189 of the first rule.
17190 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17191 (Solved SR Conflicts): Adjust rule 0's line number.
17192
610ab194
AD
171932001-12-29 Akim Demaille <akim@epita.fr>
17194
17195 Fix the `GAWK Grammar' failure.
17196
17197 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17198 the reductions of the first state which was mistakenly confused
17199 with the final state because precisely final_state was initialized
17200 to 0.
17201 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17202 now noticed by Bison.
17203 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17204 have a reduction on $default.
17205
29d29c8f
AD
172062001-12-29 Akim Demaille <akim@epita.fr>
17207
17208 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17209 rule line numbers.
17210 * src/closure.c (print_closure): Likewise.
17211 * src/derives.c (print_derives): Likewise.
17212 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17213 now.
17214
7c6b64d0
AD
172152001-12-29 Akim Demaille <akim@epita.fr>
17216
17217 * src/lalr.c (lookaheads_print): New.
17218 (lalr): Call it when --trace-flag.
17219 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17220 are dumped.
17221
3d4daee3
AD
172222001-12-29 Akim Demaille <akim@epita.fr>
17223
17224 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17225 when walking through ritem, even via rule->rhs.
17226 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17227 (useful_production, useless_nonterminals): Likewise.
17228 (reduce_grammar_tables): Likewise, plus update nritems.
17229 * src/nullable.c (set_nullable): Likewise.
17230 * src/lalr.c (build_relations): Likewise.
17231 * tests/sets.at (Nullable): Adjust.
17232 Fortunately, now, the $axiom is no longer nullable.
17233
9e7f6bbd
AD
172342001-12-29 Akim Demaille <akim@epita.fr>
17235
17236 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17237 the 0-sentinel.
17238 * src/gram.c (ritem_longest_rhs): Likewise.
17239 * src/reduce.c (nonterminals_reduce): Likewise.
17240 * src/print_graph.c (print_graph): Likewise.
17241 * src/output.c (output_rule_data): Likewise.
17242 * src/nullable.c (set_nullable): Likewise.
17243
255ef638
AD
172442001-12-29 Akim Demaille <akim@epita.fr>
17245
17246 * src/output.c: Comment changes.
17247
0d8a7363
AD
172482001-12-27 Paul Eggert <eggert@twinsun.com>
17249
17250 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17251 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17252 Sparc, as they were causing more porting problems than the
17253 (minor) performance improvement was worth.
17254
17255 Also, catch up with 1.31's YYSTD.
17256
3db472b9
AD
172572001-12-27 Akim Demaille <akim@epita.fr>
17258
17259 * src/output.c (output_gram): Rely on nritems, not the
17260 0-sentinel. See below.
17261 Use -1 as separator, not 0.
17262 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17263 Rely on -1 as separator in yyrhs, instead of 0.
17264 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17265 twice `Now at end of input', therefore there are two lines less to
17266 expect.
17267
b365aa05
AD
172682001-12-27 Akim Demaille <akim@epita.fr>
17269
17270 * tests/regression.at (Unresolved SR Conflicts):
17271 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17272 below.
17273
30171f79
AD
172742001-12-27 Akim Demaille <akim@epita.fr>
17275
17276 * src/LR0.c (new_state): Recognize the final state by the fact it
17277 is reached by eoftoken.
17278 (insert_start_shifting_state, insert_eof_shifting_state)
17279 (insert_accepting_state, augment_automaton): Remove, since now
17280 these states are automatically computed from the initial state.
17281 (generate_states): Adjust.
17282 * src/print.c: When reporting a rule number to the user, substract
17283 1, so that the axiom rule is rule 0, and the first user rule is 1.
17284 * src/reduce.c: Likewise.
17285 * src/print_graph.c (print_core): For the time being, just as for
17286 the report, depend upon --trace-flags to dump the full set of
17287 items.
17288 * src/reader.c (readgram): Once the grammar read, insert the rule
17289 0: `$axiom: START-SYMBOL $'.
17290 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17291 number of the states has changed (the final state is no longer
17292 necessarily the last), catch up.
17293
75142d45
AD
172942001-12-27 Akim Demaille <akim@epita.fr>
17295
17296 Try to make the use of the eoftoken valid. Given that its value
17297 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17298 is used instead of > 0 where appropriate, (ii), depend upon nritems
17299 instead of the 0-sentinel.
17300
17301 * src/gram.h, src/gram.c (nritems): New.
17302 Expected to be duplication of nitems, but for the time being...
17303 * src/reader.c (packgram): Assert nritems and nitems are equal.
17304 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17305 * src/closure.c (print_closure, print_fderives): Likewise.
17306 * src/gram.c (ritem_print): Likewise.
17307 * src/print.c (print_core, print_grammar): Likewise.
17308 * src/print_graph.c: Likewise.
17309
b7c49edf
AD
173102001-12-27 Akim Demaille <akim@epita.fr>
17311
17312 * src/main.c (main): If there are complains after grammar
17313 reductions, then output the report anyway if requested, then die.
17314 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17315 * src/reader.c (eoftoken): New.
17316 (parse_token_decl): If the token being defined has value `0', it
17317 is the eoftoken.
17318 (packsymbols): No longer hack `tags' to insert `$' by hand.
17319 Be sure to preserve the value of the eoftoken.
17320 (reader): Make sure eoftoken is defined.
17321 Initialize nsyms to 0: now eoftoken is created just like the others.
17322 * src/print.c (print_grammar): Don't special case the eof token.
17323 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17324 lie anyway, albeit pleasant.
17325 * tests/calc.at: Exercise error messages with eoftoken.
17326 Change the grammar so that empty input is invalid.
17327 Adjust expectations.
17328 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17329
ec2da99f
AD
173302001-12-27 Akim Demaille <akim@epita.fr>
17331
17332 * configure.in: Check the protos of strchr ans strspn.
17333 Replace strchr if needed.
17334 * src/system.h: Provide the protos of strchr, strspn and memchr if
17335 missing.
17336 * lib/strchr.c: New.
17337 * src/reader.c (symbols_save): Use strchr.
17338
8adfa272
AD
173392001-12-27 Akim Demaille <akim@epita.fr>
17340
17341 * src/print.c, src/print_graph.c (escape): New.
17342 Use it to quote the TAGS outputs.
17343 * src/print_graph.c (print_state): Now errors are in red, and
17344 reductions in green.
17345 Prefer high to wide: output the state number on a line of its own.
17346
80dac38c
AD
173472001-12-27 Akim Demaille <akim@epita.fr>
17348
17349 * src/state.h, src/state.c (reductions_new): New.
17350 * src/LR0.c (set_state_table): Let all the states have a
17351 `reductions', even if reduced to 0.
17352 (save_reductions): Adjust.
17353 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17354 * src/print.c (print_reductions, print_actions): Adjust.
17355 * src/output.c (action_row): Adjust.
17356
2cec70b9
AD
173572001-12-27 Akim Demaille <akim@epita.fr>
17358
17359 * src/state.h, src/state.c (errs_new, errs_dup): New.
17360 * src/LR0.c (set_state_table): Let all the states have an errs,
17361 even if reduced to 0.
17362 * src/print.c (print_errs, print_reductions): Adjust.
17363 * src/output.c (output_actions, action_row): Adjust.
17364 * src/conflicts.c (resolve_sr_conflict): Adjust.
17365
13ca549a
AD
173662001-12-27 Akim Demaille <akim@epita.fr>
17367
17368 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17369
5092aba5
AD
173702001-12-27 Akim Demaille <akim@epita.fr>
17371
17372 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17373 * src/print.c: here.
17374 (lookaheadset, shiftset): New, used as additional storage by
17375 print_reductions.
17376 (print_results): Adjust.
17377 (print_shifts, print_gotos, print_errs): New, extracted from...
17378 (print_actions): here.
17379 * src/print_graph.c (print_actions): Remove dead code.
17380
11e2beca
AD
173812001-12-27 Akim Demaille <akim@epita.fr>
17382
17383 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17384 `$n' and `@n'.
17385
dac3c910
AD
173862001-12-27 Akim Demaille <akim@epita.fr>
17387
17388 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17389 (build_relations): Adjust.
17390
d0b0fefa
AD
173912001-12-27 Akim Demaille <akim@epita.fr>
17392
17393 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17394 duplication.
17395
adc8c848
AD
173962001-12-27 Akim Demaille <akim@epita.fr>
17397
17398 * src/reader.c (packgram): Catch nitems overflows.
17399
14d293ac
AD
174002001-12-27 Akim Demaille <akim@epita.fr>
17401
17402 * src/files.c, src/files.h (guard_obstack): Remove.
17403 * src/output.c (output): Adjust.
17404 * src/reader.c (parse_braces): New, factoring...
17405 (copy_action, copy_guard): these two which are renamed as...
17406 (parse_action, parse_guard): these.
17407 As a voluntary consequence, using braces around guards is now
17408 mandatory.
17409
f499b062
AD
174102001-12-27 Akim Demaille <akim@epita.fr>
17411
17412 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17413 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17414 members.
17415 (symbol_list_new): Adjust.
17416 (copy_action): action_line is the first line, not the last.
17417 (copy_guard): Just as for actions, store the `action' only, not
17418 the switch/case/break flesh.
17419 Don't parse the user action that might follow the guard, let...
17420 (readgram): do it, i.e., now, there can be an action after a
17421 guard.
17422 In other words the guard is just explicitly optional.
17423 (packgram): Adjust.
17424 * src/output.c (guards_output): New.
17425 (output_parser): Call it when needed.
17426 (output): Also free the guard and attrs obstacks.
17427 * src/files.c, src/files.h (obstack_save): Remove.
17428 (output_files): Remove.
17429 As a result, if one needs the former `.act' file, using an
17430 appropriate skeleton which requires actions and guards is now
17431 required.
17432 * src/main.c (main): Adjust.
17433 * tests/semantic.at: New.
17434 * tests/regression.at: Use `input.y' as input file name.
17435 Avoid 8+3 problems by requiring input.c when the test needs the
17436 parser.
17437
d945f5cd
AD
174382001-12-27 Akim Demaille <akim@epita.fr>
17439
17440 * src/reader.c (symbol_list_new): Be sure to initialize all the
17441 fields.
17442
d200e455
AD
174432001-12-27 Akim Demaille <akim@epita.fr>
17444
17445 All the hacks using a final pseudo state are now useless.
17446
17447 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17448 * src/lalr.c (nLA): New.
17449 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17450 instead of lookaheadsp from the pseudo state (nstate + 1).
17451
f9507c28
AD
174522001-12-27 Akim Demaille <akim@epita.fr>
17453
17454 * src/output.c (action_row, token_actions): Use a state_t instead
17455 of a integer, and nlookaheads instead of the following state's
17456 lookaheadsp.
17457
065fbd27
AD
174582001-12-27 Akim Demaille <akim@epita.fr>
17459
17460 * src/conflicts.c (log_resolution, flush_shift)
17461 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17462 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17463 (conflicts_print, print_reductions): Use a state_t instead of an
17464 integer when referring to a state.
17465 As much as possible, depend upon nlookaheads, instead of the
17466 `lookaheadsp' member of the following state (since lookaheads of
17467 successive states are successive, the difference between state n + 1
17468 and n served as the number of lookaheads for state n).
17469 * src/lalr.c (add_lookback_edge): Likewise.
17470 * src/print.c (print_core, print_actions, print_state)
17471 (print_results): Likewise.
17472 * src/print_graph.c (print_core, print_actions, print_state)
17473 (print_graph): Likewise.
17474 * src/conflicts.h: Adjust.
17475
1b177bd7
AD
174762001-12-27 Akim Demaille <akim@epita.fr>
17477
17478 * src/bison.hairy: Formatting/comment changes.
17479 ANSIfy.
17480 Remove `register' indications.
17481 Add plenty of `static'.
17482
7742ddeb
AD
174832001-12-27 Akim Demaille <akim@epita.fr>
17484
17485 * src/output.c (prepare): Drop the muscle `ntbase' which
17486 duplicates ntokens.
17487 * src/bison.simple: Formatting/comment changes.
17488 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17489 is an undocumented synonym.
17490
1fa14068
AD
174912001-12-22 Akim Demaille <akim@epita.fr>
17492
17493 * src/output.c (output_table_data): Change the prototype to use
17494 `int' for array ranges: some invocations do pass an int, not a
17495 short.
17496 Reported by Wayne Green.
17497
b9752825
AD
174982001-12-22 Akim Demaille <akim@epita.fr>
17499
17500 Some actions of web2c.y are improperly triggered.
17501 Reported by Mike Castle.
17502
17503 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17504 * tests/regression.at (Web2c): Rename as...
17505 (Web2c Report): this.
17506 (Web2c Actions): New.
17507
776209d6
AD
175082001-12-22 Akim Demaille <akim@epita.fr>
17509
17510 Reductions in web2c.y are improperly reported.
17511 Reported by Mike Castle.
17512
17513 * src/conflicts.c (print_reductions): Fix.
17514 * tests/regression.at (Web2c): New.
17515
275fc3ad
AD
175162001-12-18 Akim Demaille <akim@epita.fr>
17517
17518 Some host fail on `assert (!"foo")', which expands to
17519 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17520 Reported by Nelson Beebee.
17521
17522 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17523 `#define it_succeeded 0' and `assert (it_succeeded)'.
17524
897668ee
MA
175252001-12-17 Marc Autret <autret_m@epita.fr>
17526
17527 * src/bison.simple: Don't hard code the skeleton line and filename.
17528 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17529 New line counter 'skeleton_line' (skeleton-line muscle).
17530
ab3399e0
PE
175312001-12-17 Paul Eggert <eggert@twinsun.com>
17532
17533 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17534 YYDEBUG must be defined to a nonzero value.
17535
17536 * src/bison.simple (yytname): Do not assume that the user defines
17537 YYDEBUG to a properly parenthesized expression.
17538
3877f72b
AD
175392001-12-17 Akim Demaille <akim@epita.fr>
17540
17541 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17542 nlookaheads is a new member.
17543 Adjust all users.
17544 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17545 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17546 state.
776209d6 17547
331dbc1b
AD
175482001-12-17 Akim Demaille <akim@epita.fr>
17549
17550 * src/files.h, src/files.c (open_files, close_files): Remove.
17551 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17552 let...
17553 * src/reader.c (reader): Do it.
776209d6 17554
be750e4c
AD
175552001-12-17 Akim Demaille <akim@epita.fr>
17556
17557 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 17558
709ae8c6
AD
175592001-12-17 Akim Demaille <akim@epita.fr>
17560
17561 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17562 (flush_reduce): New.
17563 (resolve_sr_conflict): Adjust.
776209d6 17564
f87685c3
AD
175652001-12-17 Akim Demaille <akim@epita.fr>
17566
17567 * src/output.c (output_obstack): Be static and rename as...
17568 (format_obstack): this, to avoid any confusion with files.c's
17569 output_obstack.
17570 * src/reader.h (muscle_obstack): Move to...
17571 * src/output.h: here, since it's defined in output.c.
17572
837491d8
AD
175732001-12-17 Akim Demaille <akim@epita.fr>
17574
17575 * src/output.c (action_row, save_column, default_goto)
17576 (sort_actions, matching_state, pack_vector): Better variable
17577 locality.
17578
796d61fb
AD
175792001-12-17 Akim Demaille <akim@epita.fr>
17580
17581 * src/output.c: Various formatting changes.
776209d6 17582
64d15509
AD
175832001-12-17 Akim Demaille <akim@epita.fr>
17584
17585 * src/files.c (output_files): Free the output_obstack.
17586 * src/main.c (main): Call print and print_graph conditionally.
17587 * src/print.c (print): Work unconditionally.
17588 * src/print_graph.c (print_graph): Work unconditionally.
17589 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17590
fbc8ecb7
MA
175912001-12-16 Marc Autret <autret_m@epita.fr>
17592
17593 * src/output.c (actions_output): Fix. When we use %no-lines,
17594 there is one less line per action.
17595
f0440388
MA
175962001-12-16 Marc Autret <autret_m@epita.fr>
17597
17598 * src/bison.simple: Remove a useless #line directive.
17599 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17600 * src/output.c (get_lines_number): New.
776209d6 17601 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
17602 output muscles.
17603 Fix line numbering.
17604 (actions_output): Computes the number of lines taken by actions.
17605 (output_master_parser): Insert new skeleton which is the name of
17606 the output parser file name.
17607
a79986b8
MA
176082001-12-15 Marc Autret <autret_m@epita.fr>
17609
17610 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17611
4ec8e00f
MA
176122001-12-15 Marc Autret <autret_m@epita.fr>
17613
17614 * src/output.c (output_gram): Keep track of the hairy one.
17615
1a4648ff
AD
176162001-12-15 Akim Demaille <akim@epita.fr>
17617
17618 Make `make distcheck' work.
17619
17620 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17621 system.h which uses libgettext.h.
17622
9c2c67e6
AD
176232001-12-15 Akim Demaille <akim@epita.fr>
17624
17625 * src/nullable.c (set_nullable): Useless rules must be skipped,
17626 otherwise, since we range over their symbols, we might look at a
17627 nonterminal which no longer ``exists'', i.e., it is not counted in
17628 `nvars', hence we overflow our arrays.
17629
93ede233
AD
176302001-12-15 Akim Demaille <akim@epita.fr>
17631
17632 The header can also be produced directly, without any obstack!
17633 Yahoo!
17634
17635 * src/files.c, src/files.h (defines_obstack): Remove.
17636 (compute_header_macro): Global.
17637 (defines_obstack_save): Remove.
17638 * src/reader.c (parse_union_decl): No longer output to
17639 defines_obstack: its content can be found in the `stype' muscle
17640 anyway.
17641 (output_token_translations): Merge into...
17642 (symbols_output): this.
17643 Rename as...
17644 (symbols_save): this.
17645 (reader): Adjust.
17646 * src/output.c (header_output): New.
17647 (output): Call it.
17648
2666f928
AD
176492001-12-15 Akim Demaille <akim@epita.fr>
17650
17651 * src/reader.c (parse_union_decl): Instead of handling two obstack
17652 simultaneously, use one to define the `stype' muscle, and use the
17653 value of the latter to fill defines_obstack.
17654 (copy_comment): Remove.
17655 (copy_comment2): Work for a single obstack.
17656 Rename as...
17657 (copy_comment): this.
17658
428046f8
AD
176592001-12-15 Akim Demaille <akim@epita.fr>
17660
17661 * src/lex.c, src/lex.h (xgetc): No longer static.
17662 * src/reader.c (parse_union_decl): Revamp.
17663
ea52d706
AD
176642001-12-15 Akim Demaille <akim@epita.fr>
17665
17666 Still making progress in separating Bison into (i) input, (ii)
17667 process, (iii) output: now we can directly output the parser file
17668 without using table_obstack at all.
17669
17670 * src/files.c, src/files.h (table_obstack): Bye bye.
17671 (parser_file_name): New.
17672 * src/files.c (compute_output_file_names): Compute it.
17673 * src/output.c (actions_output, output_parser)
17674 (output_master_parser): To a file instead of an obstack.
17675
3f96f4dc
AD
176762001-12-15 Akim Demaille <akim@epita.fr>
17677
17678 Attach actions to rules, instead of pre-outputting them to
17679 actions_obstack.
17680
17681 * src/gram.h (rule_t): action and action_line are new members.
17682 * src/reader.c (symbol_list): Likewise.
17683 (copy_action): Save the actions within the rule.
17684 (packgram): Save them in rule_table.
17685 * src/output.c (actions_output): New.
17686 (output_parser): Use it on `%%actions'.
17687 (output_rule_data): Don't free rule_table.
17688 (output): Do it.
17689 (prepare): Don't save the `action' muscle.
17690 * src/bison.simple: s/%%action/%%actions/.
17691
51576fb3
AD
176922001-12-15 Akim Demaille <akim@epita.fr>
17693
17694 * src/reader.c (copy_action): When --yacc, don't append a `;'
17695 to the user action: let it fail if lacking.
dee049eb 17696 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 17697
2648a72d
AD
176982001-12-14 Akim Demaille <akim@epita.fr>
17699
17700 * src/lex.c (literalchar): Simply return the char you decoded, non
17701 longer mess around with obstacks and int pointers.
17702 Adjust all callers.
17703
92790e5b
AD
177042001-12-14 Akim Demaille <akim@epita.fr>
17705
17706 * src/lex.c (literalchar): Don't escape the special characters,
17707 just decode them, and keep them as char (before, eol was output as
17708 the 2 char string `\n' etc.).
17709 * src/output.c (output_rule_data): Use quotearg to output the
17710 token strings.
17711
927c1557
PE
177122001-12-13 Paul Eggert <eggert@twinsun.com>
17713
17714 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17715 Do not infringe on the global user namespace when using C++.
17716 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17717 All uses of `fprintf' and `stderr' changed.
17718
17719 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17720
ed8e1f68
AD
177212001-12-13 Akim Demaille <akim@epita.fr>
17722
17723 The computation of nullable is broken: it doesn't handle empty
17724 RHS's properly.
17725
17726 * tests/torture.at (GNU AWK Grammar): New.
17727 * tests/sets.at (Nullable): New.
17728 * src/nullable.c (set_nullable): Instead of blindly looping over
17729 `ritems', loop over the rules, and then over their rhs's.
17730
17731 Work around Autotest bugs.
17732
17733 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17734 frame, because Autotest understand lines starting with a `+' as
17735 traces from the shell. Then, they are not processed properly.
17736 Admittedly an Autotest bug, but we don't have time to wait for
17737 Autotest to catch up.
17738 * tests/regression.at (Broken Closure): Adjust to the new table
17739 frames.
17740 Move to...
17741 * tests/sets.at: here.
17742
cb581495
AD
177432001-12-13 Akim Demaille <akim@epita.fr>
17744
17745 * src/closure.c (closure): Use nrules instead of playing tricks
17746 with BITS_PER_WORD.
17747
2e729273
AD
177482001-12-13 Akim Demaille <akim@epita.fr>
17749
17750 * src/print.c (print_actions): Output the handling of `$' as the
17751 traces do: shifting the token EOF. Before EOF was treated as a
17752 nonterminal.
17753 * tests/regression.at: Adjust some tests.
17754 * src/print_graph.c (print_core): Complete the set of items via
17755 closure. The next-to-final and final states are still unsatisfying,
17756 but that's to be addressed elsewhere.
17757 No longer output the rule numbers, but do output the state number.
17758 A single loop for the shifts + gotos is enough, but picked a
17759 distinct color for each.
17760 (print_graph): Initialize and finalize closure.
17761
107f7dfb
AD
177622001-12-13 Akim Demaille <akim@epita.fr>
17763
17764 * src/reader.c (readgram): Remove dead code, an strip useless
17765 braces.
17766 (get_type): Remove, unused.
17767
9b53a24f
AD
177682001-12-12 Akim Demaille <akim@epita.fr>
17769
17770 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17771 on that of lib/error.c.
17772
dbfb6dcd
AD
177732001-12-12 Akim Demaille <akim@epita.fr>
17774
17775 Some hosts don't like `/' in includes.
17776
17777 * src/system.h: Include libgettext.h without qualifying the path.
17778 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17779 $(top_srcdir).
17780
c25fb648
MA
177812001-12-11 Marc Autret <autret_m@epita.fr>
17782
17783 * src/output.c (output_parser): Remove useless muscle.
17784
710ddc4f
MA
177852001-12-11 Marc Autret <autret_m@epita.fr>
17786
17787 * src/bison.simple: Remove #line just before %%epilogue. It
17788 is now handled in ...
17789 * src/reader.c (read_additionnal_code): Add the output of a
17790 #line for the epilogue.
17791
e83d80b8
MA
177922001-12-10 Marc Autret <autret_m@epita.fr>
17793
927c1557 17794 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
17795 replace precedent remove.
17796 * src/bison.simple: Remove #line before %%prologue because
17797 %%input-line is wrong at this time.
17798
971d5158
MA
177992001-12-10 Marc Autret <autret_m@epita.fr>
17800
17801 * src/reader.c (symbols_output): Clean up.
927c1557 17802 * src/output.c (output_gram, output): Clean up.
971d5158 17803
5edafffd
AD
178042001-12-10 Akim Demaille <akim@epita.fr>
17805
17806 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17807 * src/LR0.c (set_state_table): here.
17808 * src/lalr.c (lalr): Call it.
17809
0279f8e9
AD
178102001-12-10 Akim Demaille <akim@epita.fr>
17811
17812 * src/state.h (shifts): Remove the `number' member: shifts are
17813 attached to state, hence no longer need to be labelled with a
17814 state number.
17815
190c4f5f
AD
178162001-12-10 Akim Demaille <akim@epita.fr>
17817
17818 Now that states have a complete set of members, the linked list of
17819 shifts is useless: just fill directly the state's shifts member.
17820
17821 * src/state.h (shifts): Remove the `next' member.
17822 * src/LR0.c (first_state, last_state): Remove.
17823 Adjust the callers.
17824 (augment_automaton): Don't look for the shifts that must be added
17825 a shift on EOF: it is those of the state we looked for! But now,
17826 since shifts are attached, it is no longer needed to looking
17827 merely by its id: its number.
17828
2a73b93d
AD
178292001-12-10 Akim Demaille <akim@epita.fr>
17830
17831 * src/LR0.c (augment_automaton): Better variable locality.
17832 Remove an impossible branch: if there is a state corresponding to
17833 the start symbol being shifted, then there is shift for the start
17834 symbol from the initial state.
17835
74392f6a
AD
178362001-12-10 Akim Demaille <akim@epita.fr>
17837
17838 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17839 only when appropriate: when insert_start_shifting_state' is not
17840 invoked.
17841 * tests/regression.at (Rule Line Numbers): Adjust.
17842
37c82725
AD
178432001-12-10 Akim Demaille <akim@epita.fr>
17844
17845 * src/LR0.c (augment_automaton): Now that all states have shifts,
17846 merge the two cases addition shifts to the initial state.
17847
6a164e0c
AD
178482001-12-10 Akim Demaille <akim@epita.fr>
17849
17850 * src/lalr.c (set_state_table): Move to...
17851 * src/LR0.c: here.
17852 * src/lalr.c (lalr): Don't call it...
17853 * src/LR0.c (generate_states): do it.
17854 * src/LR0.h (first_state): Remove, only the table is used.
17855
7215de24
AD
178562001-12-10 Akim Demaille <akim@epita.fr>
17857
17858 * src/LR0.h (first_shift, first_reduction): Remove.
17859 * src/lalr.c: Don't use first_shift: find shifts through the
17860 states.
17861
80e25d4d
AD
178622001-12-10 Akim Demaille <akim@epita.fr>
17863
17864 * src/LR0.c: Attach shifts to states as soon as they are
17865 computed.
17866 * src/lalr.c (set_state_table): Instead of assigning shifts to
17867 state, just assert that the mapping was properly done.
17868
0ab3728b
AD
178692001-12-10 Akim Demaille <akim@epita.fr>
17870
17871 * src/LR0.c (insert_start_shift): Rename as...
17872 (insert_start_shifting_state): this.
17873 (insert_eof_shifting_state, insert_accepting_state): New.
17874 (augment_automaton): Adjust.
17875 Better locality of the variables.
17876 When looking if the start_symbol is shifted from the initial
17877 state, using `while (... symbol != start_symbol ...)' sounds
17878 better than `while (... symbol < start_symbol ...)': If fail
17879 to see how the order between symbols could be relevant!
17880
78af9bbc
AD
178812001-12-10 Akim Demaille <akim@epita.fr>
17882
17883 * src/getargs.h: Don't declare `spec_name_prefix' and
17884 `spec_file_prefix', declared by src/files.h.
17885 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17886 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17887 * src/output.c (prepare): Adjust.
17888 * src/reader.c (symbols_output): Likewise.
17889 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17890
bdef2a41
AD
178912001-12-10 Akim Demaille <akim@epita.fr>
17892
17893 * src/muscle_tab.c (muscle_init): NULL is a better default than
17894 `"0"'.
17895
3735969c
AD
178962001-12-10 Akim Demaille <akim@epita.fr>
17897
17898 * src/reader.c (reader): Calling symbols_output once is enough.
17899
49701457
AD
179002001-12-10 Akim Demaille <akim@epita.fr>
17901
17902 Now that states have a complete set of members, the linked list of
17903 reductions is useless: just fill directly the state's reductions
17904 member.
17905
17906 * src/state.h (struct reductions): Remove member `number' and
17907 `next'.
17908 * src/LR0.c (first_reduction, last_reduction): Remove.
17909 (save_reductions): Don't link the new reductions, store them in
17910 this_state.
17911 * src/lalr.c (set_state_table): No need to attach reductions to
17912 states, it's already done.
17913 * src/output.c (output_actions): No longer free the shifts, then
17914 the reductions, then the states: free all the states and their
17915 members.
17916
0edad749
AD
179172001-12-10 Akim Demaille <akim@epita.fr>
17918
17919 * src/options.c (OPTN, DRTV, BOTH): New.
17920 (option_table): Use them.
17921
0edad749
AD
17922 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
17923 the job of system.h.
17924 * src/options.c: Don't include stdio.h and xalloc.h for the same
17925 reasons.
17926
5449dd0f
AD
179272001-12-10 Akim Demaille <akim@epita.fr>
17928
17929 * src/output.c (output, prepare): Make sure the values of the
17930 muscles `action' and `prologue' are 0-terminated.
17931
a870c567
AD
179322001-12-10 Akim Demaille <akim@epita.fr>
17933
17934 Clean up GCC warnings.
17935
17936 * src/reader.c (copy_action): `buf' is not used.
17937 (parse_skel_decl): Be static.
17938 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
17939 * src/options.h (create_long_option_table): Have a real prototype.
17940 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
17941 (hash_delete_at): Return const void *.
17942 Adjust casts to preserve the const.
17943
80df8768
AD
179442001-12-10 Akim Demaille <akim@epita.fr>
17945
17946 * configure.in: Require 2.52g.
17947 M4 is not needed, but AUTOM4TE is.
17948 * m4/m4.m4: Remove.
17949 * tests/Makefile.am: Adjust.
17950
f693ad14
AD
179512001-12-10 Akim Demaille <akim@epita.fr>
17952
17953 One structure for states is enough, even though theoretically
17954 there are LR(0) states and LALR(1) states.
17955
17956 * src/lalr.h (state_t): Remove.
17957 (state_table): Be state_t **, not state_t *.
17958 * src/state.h (core, CORE_ALLOC): Rename as...
17959 (state_t, STATE_ALLOC): this.
17960 Add the LALR(1) members: shifts, reductions, errs.
17961 * src/LR0.c (state_table): Rename as...
17962 (state_hash): this, to avoid name clashes with the global
17963 `state_table'.
17964 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
17965 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
17966
74ffbcb6
AD
179672001-12-10 Akim Demaille <akim@epita.fr>
17968
17969 Bison dumps core on bash.y.
17970 Reported by Pascal Bart.
17971
17972 * src/warshall.c (bitmatrix_print): New.
17973 (TC): Use it.
ba0fe3c7 17974 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
17975 j must be the outer loop.
17976 * tests/regression.at (Broken Closure): New.
17977
07708e19
AD
179782001-12-05 Akim Demaille <akim@epita.fr>
17979
17980 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
17981 its argument.
ba1ecc07 17982 Reported by Peter Hamorsky.
07708e19 17983
92b16366
AD
179842001-12-05 Akim Demaille <akim@epita.fr>
17985
17986 * src/conflicts.c (err_table): Remove.
17987 (resolve_sr_conflict): Adjust.
17988 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
17989 Rename as...
17990 (state_t.reductions, state_t.shifts): this.
17991
076ab033
AD
179922001-12-05 Akim Demaille <akim@epita.fr>
17993
17994 * src/reduce.c (reduce_grammar_tables): No longer disable the
17995 removal of useless rules via CPP but via `if (0)', so that the
17996 compiler still check the code is valid.
17997 For instance, it should have noticed `rline' no longer exists: use
17998 the `line' member of rule_t.
17999 * src/gram.c (dummy, rline): Remove, unused.
18000
3843c413
AD
180012001-12-05 Akim Demaille <akim@epita.fr>
18002
18003 * src/output.c (pack_vector): Use assert, not berror.
18004 * src/main.c (berror): Remove, unused.
18005
43168960
AD
180062001-12-05 Akim Demaille <akim@epita.fr>
18007
18008 New experimental feature: if --verbose --trace output all the
18009 items of a state, not only its kernel.
18010
18011 * src/print.c (print_core): If `trace_flag', then invoke closure
18012 before outputting the items of the state (print_core is no longer
18013 a correct name them).
18014 (print_results): Invoke new_closure/free_closure if needed.
18015
b2872512
AD
180162001-12-05 Akim Demaille <akim@epita.fr>
18017
18018 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18019 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18020 (nitemset): for consistency with the rest of the project.
18021
23cbcc6c
AD
180222001-12-05 Akim Demaille <akim@epita.fr>
18023
18024 * src/closure.c (print_closure): Improve.
18025 (closure): Use it for printing input and output.
18026
03ec521c
AD
180272001-12-05 Akim Demaille <akim@epita.fr>
18028
18029 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18030 indexed by nonterminals.
18031
3a7456dd
AD
180322001-12-05 Akim Demaille <akim@epita.fr>
18033
18034 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18035 what it was!).
18036 * src/warshall.h: Remove accidental duplication of the content.
18037
1cbcf2e7
AD
180382001-12-05 Akim Demaille <akim@epita.fr>
18039
18040 * src/closure.c (set_fderives): De-obfuscate.
18041
84182270
AD
180422001-12-05 Akim Demaille <akim@epita.fr>
18043
18044 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18045
3f6f053c
AD
180462001-12-05 Akim Demaille <akim@epita.fr>
18047
18048 * src/closure.c (set_firsts): De-obfuscate.
18049
7a5350ba
AD
180502001-12-05 Akim Demaille <akim@epita.fr>
18051
18052 * src/output.c (action_row): De-obfuscate
18053 using the good o' techniques: arrays not pointers, variable
18054 locality, BITISSET, RESETBIT etc.
18055
d954473d
AD
180562001-12-05 Akim Demaille <akim@epita.fr>
18057
18058 Pessimize the code to simplify it: from now on, all the states
18059 have a valid SHIFTS, which NSHIFTS is possibly 0.
18060
18061 * src/LR0.c (shifts_new): Be global and move to..
18062 * src/state.c, src/state.h: here.
18063 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18064 * src/print_graph: Adjust.
18065
9839bbe5
AD
180662001-12-05 Akim Demaille <akim@epita.fr>
18067
18068 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18069 * src/conflicts.c: Use it.
18070 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18071 incorrectly ``simplified''.
18072
9f136c07
AD
180732001-12-05 Akim Demaille <akim@epita.fr>
18074
18075 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18076 using the good o' techniques: arrays not pointers, variable
18077 locality, BITISSET, RESETBIT etc.
18078
b608206e
AD
180792001-12-05 Akim Demaille <akim@epita.fr>
18080
18081 * src/state.h (SHIFT_SYMBOL): New.
18082 * src/conflicts.c: Use it to deobfuscate.
18083
52afa962
AD
180842001-12-05 Akim Demaille <akim@epita.fr>
18085
18086 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18087 (print_reductions): De-obfuscate using the good o' techniques:
18088 arrays not pointers, variable locality, BITISSET.
18089
e74dc321
AD
180902001-12-05 Akim Demaille <akim@epita.fr>
18091
18092 * src/conflicts.c (print_reductions): Arrays, not pointers.
18093 Use BITISSET.
18094
768fca83
AD
180952001-12-05 Akim Demaille <akim@epita.fr>
18096
18097 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18098
a17e599f
AD
180992001-12-05 Akim Demaille <akim@epita.fr>
18100
18101 * src/conflicts.c (print_reductions): Improve variable locality.
18102
a04bc341
AD
181032001-12-05 Akim Demaille <akim@epita.fr>
18104
18105 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18106
c8ea038e
AD
181072001-12-05 Akim Demaille <akim@epita.fr>
18108
18109 * src/conflicts.c (print_reductions): Improve variable locality.
18110
aa2aab3c
AD
181112001-12-05 Akim Demaille <akim@epita.fr>
18112
18113 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18114 * src/lalr.c: Use them.
18115
b178c8cc
AD
181162001-12-05 Akim Demaille <akim@epita.fr>
18117
18118 * src/LR0.c (augment_automaton): Formatting changes.
18119 Better variable locality.
18120
f67d13aa
AD
181212001-12-05 Akim Demaille <akim@epita.fr>
18122
18123 * src/lalr.c (matrix_print): New.
18124 (transpose): Use it.
18125 Use arrays instead of pointers.
18126
c2713865
AD
181272001-12-05 Akim Demaille <akim@epita.fr>
18128
18129 * src/lalr.c (maxrhs): Move to...
18130 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18131 * src/lalr.c (build_relations): Adjust.
18132
9887c18a
AD
181332001-12-05 Akim Demaille <akim@epita.fr>
18134
18135 * src/lalr.c (transpose): Free the memory allocated to the
18136 argument, as it is replaced by the results by the unique caller.
18137 (build_relations): Merely invoke transpose: it handles the memory
18138 deallocation.
18139 Improve variable locality.
18140 Avoid variables used as mere abbreviations.
18141 (compute_lookaheads): Use arrays instead of pointers.
18142
4d4f699c
AD
181432001-12-05 Akim Demaille <akim@epita.fr>
18144
18145 * src/lalr.c (initialize_F): Improve variable locality.
18146 Avoid variables used as mere abbreviations.
18147
80a69750
AD
181482001-12-05 Akim Demaille <akim@epita.fr>
18149
18150 * src/derives.c (print_derives): Display the ruleno.
18151 * src/lalr.c (initialize_F, transpose): Better variable locality
18152 to improve readability.
18153 Avoid variables used as mere abbreviations.
18154
fe961097
AD
181552001-12-05 Akim Demaille <akim@epita.fr>
18156
18157 * src/lalr.c (traverse): Use arrays instead of pointers.
18158
e3e4e814
AD
181592001-12-05 Akim Demaille <akim@epita.fr>
18160
18161 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18162 the handling of squeue.
18163 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18164
630e182b
AD
181652001-12-05 Akim Demaille <akim@epita.fr>
18166
18167 Because useless nonterminals are now kept alive (instead of being
18168 `destroyed'), we now sometimes examine them, and store information
18169 related to them. Hence we need to know their number, and adjust
18170 memory allocations.
18171
18172 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18173 static.
18174 * src/LR0.c (allocate_itemsets): The memory allocated to
18175 `symbol_count' was used for two different purpose: once to count
18176 the number of occurrences of each symbol, and later reassigned to
18177 `shift_symbol', containing the symbol that can be shifted from a
18178 given state.
18179 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18180 only, and...
18181 (new_itemsets): Allocate `shift_symbol' here.
18182 (allocate_itemsets): symbol_count includes useless nonterminals.
18183 Make room for them.
18184 (free_storage): Use `free', not `XFREE', for pointers that cannot
18185 be null.
18186
81b51460
AD
181872001-12-05 Akim Demaille <akim@epita.fr>
18188
18189 * src/nullable.c (set_nullable): Deobfuscate the handling of
18190 ritem.
18191 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18192
3067fbef
AD
181932001-12-05 Akim Demaille <akim@epita.fr>
18194
18195 * src/gram.c, src/gram.h (ritem_print): New.
18196 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18197 (This useless function was defined only to work around VMS linkers
18198 that can't handle compilation units with variables only).
18199 * src/reduce.c (dump_grammar): Use it to trace the construction of
18200 ritem.
18201
c2bea5f9
PE
182022001-12-04 Paul Eggert <eggert@twinsun.com>
18203
7d27c823
PE
18204 * src/bison.simple (union yyalloc): Change member names
18205 to be the same as the stack names.
18206 (yyparse): yyptr is now union yyalloc *, not char *.
18207 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18208 and may generate better code on some machines.
c2bea5f9
PE
18209 (yystpcpy): Use prototype if __STDC__ is defined, not just
18210 if __cplusplus is defined.
35687a9d 18211
2c8a9dfa
AD
182122001-11-30 Akim Demaille <akim@epita.fr>
18213
18214 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18215 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18216 Gettext doesn't compile cleanly, and dies with -Werror.
18217 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18218 Include WARNING_CFLAGS here.
18219 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18220 before being defined.
18221
f4e421e6
AD
182222001-11-27 Paul Eggert <eggert@twinsun.com>
18223
18224 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18225 First arg is int, not unsigned.
18226 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18227 (SIZE_MAX, UINT_MAX): New macros.
18228 (quotearg_n_options): Abort if N is negative.
18229 Avoid overflow check on hosts where size_t is 64 bits and int
18230 is 32 bits, as overflow is impossible there.
18231 Fix off-by-one typo that caused unnecessary reallocation.
18232
7093d0f5
AD
182332001-11-29 Paul Eggert <eggert@twinsun.com>
18234
18235 Name space cleanup in generated parser.
18236
18237 * doc/bison.texinfo (Bison Parser): Discuss system headers
18238 and their effect on the user name space.
18239
18240 * src/bison.simple:
18241 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18242 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18243 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18244
18245 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18246 on user names when possible.
18247
18248 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18249 Simplify test for whather <alloca.h> exists.
18250
18251 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18252
18253 (<stdio.h>): Include if YYDEBUG.
18254
18255 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18256 ! defined (yyoverflow) && ! defined (yymemcpy).
18257
18258 (yymemcpy, yyparse): Rename local variables as needed so that
18259 they all begin with 'yy'.
18260
18261 (yystrlen, yystpcpy): New functions.
18262
18263 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18264 All uses changed.
18265
18266 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18267 instead of relying on string.h functions. Use YYSTACK_ALLOC
18268 and YYSTACK_FREE instead of malloc and free.
18269
fd51e5ff
AD
182702001-11-30 Akim Demaille <akim@epita.fr>
18271
18272 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18273 before their first uses.
18274 (YYBISON, YYPURE): Move to the top of the output.
18275
7d13ff5f
AD
182762001-11-30 Akim Demaille <akim@epita.fr>
18277
18278 * tests/reduce.at (Useless Nonterminals): Fix.
18279
892a3995
AD
182802001-11-30 Akim Demaille <akim@epita.fr>
18281
18282 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18283 if body instead of `;' to pacify GCC's warnings.
18284
68f1e3ed
AD
182852001-11-30 Akim Demaille <akim@epita.fr>
18286
18287 Instead of mapping the LHS of unused rules to -1, keep the LHS
18288 valid, but flag the rules as invalid.
18289
18290 * src/gram.h (rule_t): `useful' is a new member.
18291 * src/print.c (print_grammar): Adjust.
18292 * src/derives.c (set_derives): Likewise.
18293 * src/reader.c (packgram, reduce_output): Likewise.
18294 * src/reduce.c (reduce_grammar_tables): Likewise.
18295 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18296
d2d1b42b
AD
182972001-11-30 Akim Demaille <akim@epita.fr>
18298
18299 * src/reduce.c (reduce_output): Formatting changes.
18300 * src/print.c (print_results, print_grammar): Likewise.
18301 * tests/regression.at (Rule Line Numbers)
18302 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18303
760b53a8
AD
183042001-11-30 Akim Demaille <akim@epita.fr>
18305
18306 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18307 useless nonterminals, move them at the end of the symbol arrays.
18308 (reduce_output): Adjust.
18309 * tests/reduce.at (Useless Nonterminals): Adjust.
18310
00238958
AD
183112001-11-30 Akim Demaille <akim@epita.fr>
18312
18313 * src/reduce.c: Various comment/formatting changes.
18314 (nonterminals_reduce): New, extracted from...
18315 (reduce_grammar_tables): here.
18316 (reduce_grammar): Call nonterminals_reduce.
18317
396452de
PE
183182001-11-29 Paul Eggert <eggert@twinsun.com>
18319
18320 * src/bison.simple (YYSTACK_REALLOC): Remove.
18321 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18322 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18323 New macros.
18324 (union yyalloc): New type.
18325 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18326 an arbitrary restriction on hosts where size_t is wider than int.
18327
18328 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18329 a parser stack overflow. Allocate just one block of memory for all
18330 three stacks, instead of allocating three blocks; this typically is
18331 faster and reduces fragmentation.
18332
18333 Do not limit the number of items in the stack to a value that fits
18334 in 'int', as this is an arbitrary limit on hosts with 64-bit
18335 size_t and 32-bit int.
18336
147e184c
MA
183372001-11-29 Marc Autret <autret_m@epita.fr>
18338
18339 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18340 of defining YYERROR_VERBOSE.
18341 [AT_DATA]: $4 is now out of C declarations in the prologue.
18342
426cf563
MA
183432001-11-28 Marc Autret <autret_m@epita.fr>
18344
18345 * src/reader.c (parse_dquoted_param): New.
18346 (parse_skel_decl): Use it.
18347 * src/lex.h: Add its prototype.
18348 * src/lex.c (literalchar): Become not static.
18349
c7925b99
MA
183502001-11-28 Marc Autret <autret_m@epita.fr>
18351
18352 * src/output.h: And put its extern declaration here.
18353 * src/output.c (error_verbose): Define here.
18354 (prepare): Echo name modification.
18355 * src/getargs.h: Clean its extern declaration.
18356 * src/getargs.c (error_verbose_flag): Remove.
18357 (getargs): Remove case 'e'.
18358 * src/options.c (option_table): 'error-verbose' is now seen as simple
18359 percent option.
18360 Include output.h.
18361
18362 * src/reader.c (read_declarations): Remove case tok_include.
18363 (parse_include_decl): Remove.
18364 * src/lex.h (token_t): Remove tok_include.
18365 * src/options.c (option_table): 'include' is now a simple command line
18366 option.
18367
5b5d1929
MA
183682001-11-28 Marc Autret <autret_m@epita.fr>
18369
18370 * src/bison.simple: Adjust muscle names.
18371 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18372 * src/output.c (prepare): s/_/-/ for the muscles names.
18373 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18374
8850be4b
MA
183752001-11-28 Marc Autret <autret_m@epita.fr>
18376
18377 * src/bison.simple: Fix debug.
18378 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18379
4a38e613
AD
183802001-11-28 Akim Demaille <akim@epita.fr>
18381
18382 * src/LR0.c (shifts_new): New.
18383 (save_shifts, insert_start_shift, augment_automaton): Use it.
18384
4b35e1c1
AD
183852001-11-28 Akim Demaille <akim@epita.fr>
18386
18387 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18388 keep ruleno only.
18389
d2b04478
AD
183902001-11-28 Akim Demaille <akim@epita.fr>
18391
18392 * src/closure.c (closure): Instead of looping over word in array
18393 then bits in words, loop over bits in array.
18394
2c4c30aa
AD
183952001-11-28 Akim Demaille <akim@epita.fr>
18396
18397 * src/closure.c (closure): No longer optimize the special case
18398 where all the bits of `ruleset[r]' are set to 0, to make the code
18399 clearer.
18400
576890b7
AD
184012001-11-28 Akim Demaille <akim@epita.fr>
18402
18403 * src/closure.c (closure): `r' and `c' are new variables, used to
18404 de-obfuscate accesses to RULESET and CORE.
18405
cb487d7d
AD
184062001-11-28 Akim Demaille <akim@epita.fr>
18407
18408 * src/reduce.c (reduce_print): Use ngettext.
18409 (dump_grammar): Improve the trace accuracy.
18410
6013d43f
AD
184112001-11-28 Akim Demaille <akim@epita.fr>
18412
18413 * src/reduce.c (dump_grammar): Don't translate trace messages.
18414
cb4956ee
AD
184152001-11-28 Akim Demaille <akim@epita.fr>
18416
18417 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18418 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18419 as all tags are free'ed afterwards.
18420 From Enrico Scholz.
18421
648185ab
PE
184222001-11-27 Paul Eggert <eggert@twinsun.com>
18423
18424 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18425 use alloca when we didn't want to, and vice versa.
18426
68254a03
MA
184272001-11-27 Marc Autret <autret_m@epita.fr>
18428
9113b58f
AD
18429 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18430 initialization.
68254a03
MA
18431 * src/output.c (prepare): Remove its update.
18432
04d843a2
MA
184332001-11-27 Marc Autret <autret_m@epita.fr>
18434
18435 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18436 Use %error-verbose.
18437
d2079671 184382001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
18439
18440 * src/bison.simple: Remove YYERROR_VERBOSE using.
18441 Use %%error_verbose.
18442 (yyparse): Likewise.
18443 * src/output.c (prepare): Give its final value.
18444 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18445 * src/getargs.h: Add its extern declaration.
18446 * src/getargs.c (error_verbose_flag): New int.
18447 (getargs): Update to catch new case.
18448 * src/options.c (option_table): 'error-verbose' is a new option.
18449 (shortopts): Update.
18450
e0327bc8
AD
184512001-11-27 Akim Demaille <akim@epita.fr>
18452
18453 * src/system.h: Use intl/libgettext.h.
18454 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18455
000f1a3c
AD
184562001-11-27 Akim Demaille <akim@epita.fr>
18457
18458 * tests/torture.at (Exploding the Stack Size with Malloc):
18459 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18460
26cfe0be
AD
184612001-11-27 Akim Demaille <akim@epita.fr>
18462
18463 * src/files.c: Include error.h.
18464 Reported by Hans Aberg.
18465
f6bd5427
MA
184662001-11-26 Marc Autret <autret_m@epita.fr>
18467
d2079671 18468 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
18469 (read_declarations): Add case tok_include.
18470 * src/getargs.h (include): Add its extern definition.
18471 * src/getargs.c (include): New const char *.
18472 (getargs): Add case '-I'.
18473 * src/options.c (option_table): Add include as command line and
18474 percent option.
18475 * src/lex.h (token_t): Add tok_include.
18476
2ca209c1
AD
184772001-11-26 Akim Demaille <akim@epita.fr>
18478
18479 * src/reader.c (readgram): Make sure rules for mid-rule actions
18480 have a lineno equal to that of their host rule.
18481 Reported by Hans Aberg.
18482 * tests/regression.at (Rule Line Numbers): New.
18483
0e41b407
AD
184842001-11-26 Akim Demaille <akim@epita.fr>
18485
18486 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18487 size_ts.
18488
184892001-11-26 Akim Demaille <akim@epita.fr>
18490
18491 * src/complain.c, src/complain.h (error): Remove, provided by
18492 lib/error.[ch].
18493
e0c40012
AD
184942001-11-26 Akim Demaille <akim@epita.fr>
18495
18496 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18497 issue an error message.
18498 * tests/regression.at (Invalid %directive): New.
18499 Reported by Hans Aberg.
18500
5e147124
AD
185012001-11-26 Akim Demaille <akim@epita.fr>
18502
18503 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18504 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18505
a034c8b8
AD
185062001-11-26 Akim Demaille <akim@epita.fr>
18507
18508 * src/conflicts.c (conflicts_print): Don't complain at all when
18509 there are no reduce/reduce conflicts, and as many shift/reduce
18510 conflicts as expected.
18511 * tests/regression.at (%expect right): Adjust.
18512
c64a20f3
AD
185132001-11-23 Akim Demaille <akim@epita.fr>
18514
18515 * lib/alloca.c: Update, from fileutils.
18516
5b0d29bb
AD
185172001-11-23 Akim Demaille <akim@epita.fr>
18518
18519 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18520
722c4bfe
AD
185212001-11-23 Akim Demaille <akim@epita.fr>
18522
18523 * src/system.h: Include alloca.h.
18524 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18525
6255b435
AD
185262001-11-23 Akim Demaille <akim@epita.fr>
18527
18528 * src/print_graph.c (print_actions): Remove `rule', unused.
18529 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18530 pacify GCC's signed < unsigned warnings.
18531 * src/closure.c (itemsetsize): Likewise.
18532 * src/reader.c (symbol_list_new): Static.
18533
b29b2ed5
AD
185342001-11-23 Akim Demaille <akim@epita.fr>
18535
18536 Attaching lineno to buckets is stupid, since only one copy of each
18537 symbol is kept, only the line of the first occurrence is kept too.
18538
18539 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18540 * src/reader.c (rline_allocated): Remove, unused.
18541 (symbol_list): Have a `line' member.
18542 (symbol_list_new): New.
18543 (readgram): Use it.
18544 * src/print.c (print_grammar): Output the rule line numbers.
18545 * tests/regression.at (Solved SR Conflicts)
18546 (Unresolved SR Conflicts): Adjust.
18547 Reported by Hans Aberg.
18548
a81b1d4a
MA
185492001-11-22 Marc Autret <autret_m@epita.fr>
18550
18551 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18552
c1ecb3c1
MA
185532001-11-22 Marc Autret <autret_m@epita.fr>
18554
18555 * src/muscle_tab.c (muscle_init): Remove initialization of
18556 skeleton muscle.
18557 * src/output.c (output_master_parser): Do it here.
18558
fbe01355
AD
185592001-11-20 Akim Demaille <akim@epita.fr>
18560
18561 * po/sv.po: New.
18562 * configure.in (ALL_LINGUAS): Adjust.
18563 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18564 longer contains strings to translate.
18565
81e895c0
AD
185662001-11-19 Akim Demaille <akim@epita.fr>
18567
18568 * src/conflicts.c (conflicts_print): Add a missing \n.
18569
6bb1878b
AD
185702001-11-19 Akim Demaille <akim@epita.fr>
18571
18572 * src/nullable.c (nullable_print): New.
18573 (set_nullable): Call it when tracing.
18574 Better locality of variables.
18575
d9ec2d07
AD
185762001-11-19 Akim Demaille <akim@epita.fr>
18577
18578 * src/print.c (print_actions): Better locality of variables.
18579
720e5c1b
AD
185802001-11-19 Akim Demaille <akim@epita.fr>
18581
18582 * src/derives.c (print_derives): Fix and enrich.
18583 * src/closure.c (print_fderives): Likewise.
18584
fb908786
AD
185852001-11-19 Akim Demaille <akim@epita.fr>
18586
18587 * src/closure.c (itemsetend): Remove, replaced with...
18588 (itemsetsize): new.
18589
125ecb56
AD
185902001-11-19 Akim Demaille <akim@epita.fr>
18591
18592 * src/LR0.c (kernel_end): Remove, replaced with...
18593 (kernel_size): new.
18594
d8cf039f
AD
185952001-11-19 Akim Demaille <akim@epita.fr>
18596
18597 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18598 to clarify.
18599
7bec0760
AD
186002001-11-19 Akim Demaille <akim@epita.fr>
18601
18602 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18603
c87d4863
AD
186042001-11-19 Akim Demaille <akim@epita.fr>
18605
18606 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18607 trace messages.
18608 * src/LR0.c: Likewise.
18609 (allocate_itemsets): Use arrays instead of pointers to clarify.
18610
9bfe901c
AD
186112001-11-19 Akim Demaille <akim@epita.fr>
18612
18613 * src/getargs.c (statistics_flag): Replace with...
18614 (trace_flag): New.
18615 (longopts): Accept --trace instead of --statistics.
18616 * src/getargs.h, src/options.c: Adjust.
18617 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18618 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18619
97db7bd4
AD
186202001-11-19 Akim Demaille <akim@epita.fr>
18621
cc72668c 18622 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
18623 pointers to clarify the code.
18624 (save_reductions, save_shifts): Factor common parts of alternatives.
18625
2c5f66ed
AD
186262001-11-19 Akim Demaille <akim@epita.fr>
18627
18628 * src/LR0.c (new_state, get_state): Complete TRACE code.
18629 * src/closure.c: Include `reader.h' to get `tags', needed by the
18630 trace code.
18631 Rename the conditional DEBUG as TRACE.
18632 Output consistently TRACEs to stderr, not stdout.
18633 * src/derives.c: Likewise.
18634 * src/reduce.c: (inaccessable_symbols): Using if is better style
18635 than goto.
18636 Use `#if TRACE' instead of `#if 0' for tracing code.
18637
300f275f
AD
186382001-11-19 Akim Demaille <akim@epita.fr>
18639
18640 * src/system.h (LIST_FREE, shortcpy): New.
18641 * src/LR0.c: Use them.
18642 * src/output.c (free_itemsets, free_reductions, free_shifts):
18643 Remove, replaced by LIST_FREE.
18644
f59c437a
AD
186452001-11-19 Akim Demaille <akim@epita.fr>
18646
18647 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18648 (REDUCTIONS_ALLOC): New.
18649 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18650 allocation.
18651
6986fd9e
AD
186522001-11-19 Akim Demaille <akim@epita.fr>
18653
18654 * src/LR0.c (new_state): Complete trace code.
18655 * src/nullable.c (set_nullable): Don't translate traces.
18656
4bc30f78
AD
186572001-11-19 Akim Demaille <akim@epita.fr>
18658
18659 * src/print_graph.c (print_core): Better locality of variables.
18660 * src/print.c (print_core): Likewise.
18661
08a946e0
AD
186622001-11-19 Akim Demaille <akim@epita.fr>
18663
18664 * src/vcg.c: You do the output, so you are responsible of the
18665 handling of VCG syntax, in particular: use quotearg.
18666 * src/print_graph.c: Don't.
18667 (print_actions): Don't output the actions as part of the nodes,
18668 since that's the job of the edges.
18669 (print_state): Don't output by hand: fill the node description,
9bfe901c 18670 and ask for its output.
08a946e0 18671
f0473484
AD
186722001-11-19 Akim Demaille <akim@epita.fr>
18673
cc72668c
AD
18674 * src/bison.simple (yyparse): When verbosely reporting an error,
18675 no longer put additional quotes around token names.
f0473484
AD
18676 * tests/calc.at: Adjust.
18677
e41dc700
AD
186782001-11-19 Akim Demaille <akim@epita.fr>
18679
18680 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18681 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18682 * src/output.c: Adjust.
18683
652a871c
AD
186842001-11-19 Akim Demaille <akim@epita.fr>
18685
18686 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18687 (rule_t): this.
18688 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18689
b2ed6e58
AD
186902001-11-19 Akim Demaille <akim@epita.fr>
18691
18692 * src/gram.h (rule_t): New.
18693 (rule_table): New.
18694 (rrhs, rlhs): Remove, part of state_t.
18695 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18696 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18697 * src/reader.c, src/reduce.c: Adjust.
18698
edad7067
AD
186992001-11-19 Akim Demaille <akim@epita.fr>
18700
18701 * src/reader.c (symbols_output): New, extracted from...
18702 (packsymbols): Here.
18703 (reader): Call it.
18704
3feec034
AD
187052001-11-19 Akim Demaille <akim@epita.fr>
18706
18707 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18708 (maxrhs): this new function.
18709
ddcd5fdf
AD
187102001-11-19 Akim Demaille <akim@epita.fr>
18711
cc72668c 18712 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
18713 Adjust.
18714
bb527fc2
AD
187152001-11-19 Akim Demaille <akim@epita.fr>
18716
cc72668c 18717 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
18718 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18719 * src/lalr.c: Adjust.
18720
a845a697
AD
187212001-11-19 Akim Demaille <akim@epita.fr>
18722
18723 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18724 (set_state_table): handle the `lookaheads' members.
18725
f004bf6a
AD
187262001-11-19 Akim Demaille <akim@epita.fr>
18727
cc72668c
AD
18728 * src/lalr.h (lookaheads): Removed array, whose contents is now
18729 a member of...
f004bf6a
AD
18730 (state_t): this structure.
18731 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18732 Adjust.
18733
de326cc0
AD
187342001-11-19 Akim Demaille <akim@epita.fr>
18735
cc72668c
AD
18736 * src/lalr.h (consistent): Removed array, whose contents is now
18737 a member of...
de326cc0
AD
18738 (state_t): this structure.
18739 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18740 Adjust.
18741
90b4416b
AD
187422001-11-19 Akim Demaille <akim@epita.fr>
18743
cc72668c
AD
18744 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18745 contents are now members of...
90b4416b
AD
18746 (state_t): this structure.
18747 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18748 Adjust.
18749
9703cc49
AD
187502001-11-19 Akim Demaille <akim@epita.fr>
18751
18752 * src/lalr.h (state_t): New.
18753 (state_table): Be a state_t * instead of a core **.
18754 (accessing_symbol): Remove, part of state_t.
18755 * src/lalr.c: Adjust.
18756 (set_accessing_symbol): Merge into...
18757 (set_state_table): this.
18758 * src/print_graph.c, src/conflicts.c: Adjust.
18759
d803322e
AD
187602001-11-14 Akim Demaille <akim@epita.fr>
18761
18762 * tests/calc.at, tests/output.at, tests/regression.at,
18763 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18764 now the tests are run in private dirs, therefore AC_CLEANUP and
18765 family can be simplified to 0-ary.
18766 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18767 use abs. path to find config.h.
18768 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18769 stderr, there can be way too much random noise.
18770 Instead pass -Werror to GCC and rely on the exit status.
18771 Reported by Wolfram Wagner.
18772
3d76b07d
AD
187732001-11-14 Akim Demaille <akim@epita.fr>
18774
18775 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18776 defined only if yyoverflow is defined, to avoid `warning: unused
18777 variable `yyvs1''.
18778 Reported by The Test Suite.
18779
09b503c8
AD
187802001-11-14 Akim Demaille <akim@epita.fr>
18781
18782 * src/print.c: Include reduce.h.
18783 Reported by Hans Aberg.
18784
187852001-11-14 Akim Demaille <akim@epita.fr>
18786
18787 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18788 Revert a previous patch: these are really const.
18789 * src/conflicts.c (conflict_report): Additional useless pair of
18790 braces to pacify GCC's warnings for `if () if () {} else {}'.
18791 * src/lex.c (parse_percent_token): Replace equal_offset with
18792 arg_offset.
18793 arg is const.
18794 Be sure to strdup `arg' when used, since there is no reason for
18795 token_buffer not to change.
18796
0f37a994
AD
187972001-11-14 Akim Demaille <akim@epita.fr>
18798
18799 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18800 definition.
18801 * src/main.c (main): Use them.
18802 Suggested by Hans Aberg.
18803
d39d93b8
AD
188042001-11-12 Akim Demaille <akim@epita.fr>
18805
18806 * src/system.h (ngettext): Now that we use ngettext, be sure to
18807 provide a default definition when NLS are not used.
18808
9edcd895
AD
188092001-11-12 Akim Demaille <akim@epita.fr>
18810
18811 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18812 Use @kbd to denote user input.
18813 (Language and Grammar): ANSIfy the example.
18814 Adjust its layout for info/notinfo.
18815 (Location Tracking Calc): Output error messages to stderr.
18816 Output locations in a more GNUtically correct way.
18817 Fix a couple of Englishos.
18818 Adjust @group/@end group pairs.
18819
7da99ede
AD
188202001-11-12 Akim Demaille <akim@epita.fr>
18821
e3aa65c5 18822 %expect was not functioning at all.
7da99ede
AD
18823
18824 * src/conflicts.c (expected_conflicts): Set to -1.
18825 (conflict_report): Use ngettext.
18826 (conflicts_print): Check %expect and make its violation an error.
18827 * doc/bison.texinfo (Expect Decl): Adjust.
18828 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18829 * tests/regression.at (%expect not enough, %expect right)
18830 (%expect too much): New.
18831
ba9dda1a
AD
188322001-11-12 Akim Demaille <akim@epita.fr>
18833
18834 * tests/regression.at (Conflicts): Rename as...
18835 (Unresolved SR Conflicts): this.
18836 (Solved SR Conflicts): New.
18837
337c5bd1
AD
188382001-11-12 Akim Demaille <akim@epita.fr>
18839
18840 * src/reduce.c (print_results): Rename as...
18841 (reduce_output): This.
18842 Output to OUT, passed as argument, instead of output_obstack.
18843 (dump_grammar): Likewise.
18844 (reduce_free): New.
18845 Also free V1.
18846 (reduce_grammar): No longer call reduce_output, since...
18847 * src/print.c (print_results): do it.
18848 * src/main.c (main): Call reduce_free;
18849
c73a41af
AD
188502001-11-12 Akim Demaille <akim@epita.fr>
18851
18852 * src/conflicts.c (print_reductions): Accept OUT as argument.
18853 Output to it, not to output_obstack.
18854 * src/print.c (print_actions): Adjust.
18855
0df87bb6
AD
188562001-11-12 Akim Demaille <akim@epita.fr>
18857
18858 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18859 the result instead of using...
18860 (src_total, rrc_total, src_count, rrc_count): Remove.
18861 (any_conflicts): Remove.
18862 (print_conflicts): Split into...
18863 (conflicts_print, conflicts_output): New.
18864 * src/conflicts.h: Adjust.
18865 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 18866 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
18867 * tests/regression.at (Conflicts): New.
18868 Reported by Tom Lane.
18869
e4d3d4de
AD
188702001-11-12 Akim Demaille <akim@epita.fr>
18871
18872 * tests/regression.at (Invalid input): Remove, duplicate with
18873 ``Invalid input: 1''.
18874
6d7d248e
AD
188752001-11-12 Akim Demaille <akim@epita.fr>
18876
18877 * tests/torture.at (AT_DATA_STACK_TORTURE)
18878 (Exploding the Stack Size with Alloca)
18879 (Exploding the Stack Size with Malloc): New.
18880
e9e4c321
AD
188812001-11-12 Akim Demaille <akim@epita.fr>
18882
18883 * src/bison.simple (YYSTACK_REALLOC): New.
18884 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 18885 Reported by Per Allansson.
e9e4c321 18886
5f7e0832
AD
188872001-11-12 Pascal Bart <pascal.bart@epita.fr>
18888
18889 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18890 define CPP macro, which substitute YYSTYPE by yystype.
18891 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18892 with yyltype/YYLTYPE. This allows inclusion of the generated
18893 header within the parser if the compiler, such as GGC, accepts
18894 multiple equivalent #defines.
18895 From Akim.
18896
e3f1699f
AD
188972001-11-05 Akim Demaille <akim@epita.fr>
18898
18899 * src/reader.c (symbols_output): New, extracted from...
18900 (packsymbols): here.
18901 (reader): Adjust.
18902
65be0866
AD
189032001-11-05 Akim Demaille <akim@epita.fr>
18904
18905 * src/lex.c (parse_percent_token): s/quotearg/quote/.
18906
e4d910bf
AD
189072001-11-05 Akim Demaille <akim@epita.fr>
18908
18909 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
18910 pattern.
18911
951366c1
AD
189122001-11-05 Akim Demaille <akim@epita.fr>
18913
18914 * src/options.h (struct option_table_struct): set_flags is void*.
18915 * src/options.c (longopts): Support `--output' and `%output'.
18916 (usage): Adjust.
18917 * src/lex.h (tok_setopt): Remove, replaced with...
18918 (tok_intopt, tok_stropt): these new guys.
18919 * src/lex.c (getopt.h): Not needed.
18920 (token_buffer, unlexed_token_buffer): Not const.
18921 (percent_table): Promote `-' over `_' in directive names.
18922 Active `%name-prefix', `file-prefix', and `output'.
18923 (parse_percent_token): Accept possible arguments to directives.
18924 Promote `-' over `_' in directive names.
18925
d8988b2f
AD
189262001-11-04 Akim Demaille <akim@epita.fr>
18927
18928 * doc/bison.texinfo (Decl Summary): Split the list into
18929 `directives for grammars' and `directives for bison'.
18930 Sort'em.
18931 Add description of `%name-prefix', `file-prefix', and `output'.
18932 Promote `-' over `_' in directive names.
18933 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
18934 Simplify the description of `--name-prefix'.
18935 Promote `-' over `_' in directive names.
18936 Promote `--output' over `--output-file'.
18937 Fix the description of `--defines'.
18938 * tests/output.at: Exercise %file-prefix and %output.
18939
6468d18e
AD
189402001-11-02 Akim Demaille <akim@epita.fr>
18941
18942 * doc/refcard.tex: Update.
18943
6b7e85b9
AD
189442001-11-02 Akim Demaille <akim@epita.fr>
18945
18946 * src/symtab.h (SUNDEF): New.
18947 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
18948 stand for `uninitialized', instead of 0.
18949 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
18950 * src/lex.c (lex): Adjust.
18951
18952 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
18953 Number it 0.
18954 Let yylex return it instead of a plain 0.
18955 Reported by Dick Streefland.
18956
cd5aafcf
AD
189572001-11-02 Akim Demaille <akim@epita.fr>
18958
18959 * tests/regression.at (Mixing %token styles): New test.
18960
037ca2f1
AD
189612001-11-02 Akim Demaille <akim@epita.fr>
18962
18963 * src/reader.c (parse_thong_decl): Formatting changes.
18964 (token_translations_init): New, extracted from...
18965 (packsymbols): Here.
18966 Adjust.
18967
270a173c
AD
189682001-11-01 Akim Demaille <akim@epita.fr>
18969
18970 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
18971 Check that `9foo.y' produces correct cpp guards.
18972 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
18973 guards.
18974 Reported by Wwp.
18975
561f9a30
AD
189762001-11-01 Akim Demaille <akim@epita.fr>
18977
18978 * tests/regression.at (Invalid input: 2): New.
18979 * src/lex.c (unlexed_token_buffer): New.
18980 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
18981 too.
18982 Reported by Wwp.
18983
f987e9d2
AD
189842001-11-01 Akim Demaille <akim@epita.fr>
18985
18986 * tests/calc.at: Catch up with 1.30.
18987 * configure.in: Bump to 1.49a.
18988 Adjust to newer Autotest.
18989
0846f581
PB
189902001-10-19 Pascal Bart <pascal.bart@epita.fr>
18991
18992 * src/conflicts.c: Move global variables rrc_total and src_total ...
18993 (print_conflicts): here.
18994 * src/output.c (output): Free global variable user_toknums.
18995 * src/lex.c (token_obstack): Become static.
18996
3c1a79b3
AD
189972001-10-18 Akim Demaille <akim@epita.fr>
18998
18999 * tests/atlocal.in (GCC): Add.
19000 * tests/calc.at: s/m4_match/m4_bmatch/.
19001 s/m4_patsubst/m4_bpatsubst/.
19002 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19003 * configure.in: AC_SUBST(GCC).
19004
5d52e7d0
MA
190052001-10-14 Marc Autret <autret_m@epita.fr>
19006
19007 * src/options.c (create_long_option_table): Fix.
19008
631aa1d3
AD
190092001-10-10 Akim Demaille <akim@epita.fr>
19010
19011 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19012
f6ec6d13
AD
190132001-10-04 Akim Demaille <akim@epita.fr>
19014
19015 * src/reader.c (parse_union_decl): Push the caracters in
19016 union_obstack, not attrs_obstack.
19017
342b8b6e
AD
190182001-10-04 Akim Demaille <akim@epita.fr>
19019
19020 Merge in the branch 1.29.
19021
19022 * src/reader.c (packsymbols): Use a temporary obstack for
19023 `%%tokendef', since output_stack is already used elsewhere.
19024
19025 2001-10-02 Akim Demaille <akim@epita.fr>
19026
19027 Bump 1.29d.
19028
19029 2001-10-02 Akim Demaille <akim@epita.fr>
19030
19031 Version 1.29c.
19032
19033 2001-10-02 Akim Demaille <akim@epita.fr>
19034
19035 * tests/regression.at (Invalid CPP headers): New.
19036 From Alexander Belopolsky.
19037 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19038
19039 2001-10-02 Akim Demaille <akim@epita.fr>
19040
19041 * tests/regression.at (Invalid input): New.
19042 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19043 Reported by Shura.
19044
19045 2001-10-02 Akim Demaille <akim@epita.fr>
19046
19047 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19048
19049 2001-10-02 Akim Demaille <akim@epita.fr>
19050
19051 * src/output.c (output_parser): Assert `skeleton'.
19052 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19053 systems.
19054 From Shura.
19055
19056 2001-10-01 Marc Autret <autret_m@epita.fr>
19057
19058 * src/lex.h: Echo modifications.
19059 * src/lex.c (unlex): Parameter is now token_t.
19060 From Hans Aberg.
19061
19062 2001-10-01 Marc Autret <autret_m@epita.fr>
19063
19064 * src/main.c: Include lex.h.
19065 From Hans Aberg.
19066
19067 2001-09-29 Akim Demaille <akim@epita.fr>
19068
19069 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19070
19071 2001-09-28 Akim Demaille <akim@epita.fr>
19072
19073 * tests/testsuite.at: Update to newer Autotest.
19074 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19075
19076 2001-09-27 Akim Demaille <akim@epita.fr>
19077
19078 Position independent wrapper.
19079
19080 * tests/bison: Remove.
19081 * tests/bison.in: New.
19082 * configure.in: Adjust.
19083
19084 2001-09-27 Paul Eggert <eggert@twinsun.com>
19085
19086 Port quotearg fixes from tar 1.13.24.
19087
19088 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19089 tm to be declared.
19090 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19091 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19092
19093 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19094 * m4/mbrtowc.m4: New file.
19095 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19096 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19097
19098 2001-09-27 Akim Demaille <akim@epita.fr>
19099
19100 Bump to 1.29c.
19101
19102 2001-09-27 Akim Demaille <akim@epita.fr>
19103
19104 Version 1.29b.
19105
19106 2001-09-25 Akim Demaille <akim@epita.fr>
19107
19108 * src/system.h: Include `xalloc.h'.
19109 Remove it from the C files.
19110 * src/files.c (output_files): Free the obstacks.
19111 * src/lex.c (init_lex): Rename as...
19112 (lex_init): this.
19113 (lex_free): New.
19114 * src/main.c (main): Use it.
19115
19116 2001-09-24 Marc Autret <autret_m@epita.fr>
19117
19118 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19119 to output informations in fout (FILE*).
19120 (open_graph, close_graph): Likewise.
19121 (output_graph, output_edge, output_node): Likewise.
19122 * src/vcg.h: Update function prototypes.
19123 * src/print_graph.c (print_graph): Open output graph file.
19124 (print_actions): Adjust.
19125 * src/files.h: Remove extern declaration.
19126 * src/files.c: Remove graph_obstack declaration.
19127 (open_files): Remove graph_obstack initialization.
19128 (output_files): Remove graph_obstack saving.
19129
19130 2001-09-24 Marc Autret <autret_m@epita.fr>
19131
19132 * src/files.c (compute_output_file_names): Fix.
19133
19134 2001-09-24 Marc Autret <autret_m@epita.fr>,
19135 Akim Demaille <akim@epita.fr>
19136
19137 * src/reader.c (reader): Remove call to free_symtab ().
19138 * src/main.c (main): Call it here.
19139 Include symtab.h.
19140 * src/conflicts.c (initialize_conflicts): Rename as...
19141 (solve_conflicts): this.
19142 * src/print.c (print_core, print_actions, print_state)
19143 (print_grammar): Dump to a file instead a `output_obstack'.
19144 (print_results): Dump `output_obstack', and then proceed with the
19145 FILE *.
19146 * src/files.c (compute_output_file_names, close_files): New.
19147 (output_files): Adjust.
19148 * src/main.c (main): Adjust.
19149
19150 2001-09-23 Marc Autret <autret_m@epita.fr>
19151
19152 * src/files.c (compute_header_macro): Computes header macro name
19153 from spec_defines_file when given.
19154
19155 2001-09-23 Marc Autret <autret_m@epita.fr>
19156
19157 * src/files.c (output_files): Add default extensions.
19158
19159 2001-09-22 Akim Demaille <akim@epita.fr>
19160
19161 * src/conflicts.c (finalize_conflicts): Rename as...
19162 (free_conflicts): this.
19163
19164 2001-09-22 Akim Demaille <akim@epita.fr>
19165
19166 * src/gram.c (gram_free): Rename back as...
19167 (dummy): this.
19168 (output_token_translations): Free `token_translations'.
19169 * src/symtab.c (free_symtab): Free the tag field.
19170
19171 2001-09-22 Akim Demaille <akim@epita.fr>
19172
19173 Remove `translations' as it is always set to true.
19174
19175 * src/gram.h: Adjust.
19176 * src/reader.c (packsymbols, parse_token_decl): Adjust
19177 * src/print.c (print_grammar): Adjust.
19178 * src/output.c (output_token_translations): Adjust.
19179 * src/lex.c (lex): Adjust.
19180 * src/gram.c: Be sure the set pointers to NULL.
19181 (dummy): Rename as...
19182 (gram_free): this.
19183
19184 2001-09-22 Akim Demaille <akim@epita.fr>
19185
19186 * configure.in: Invoke AM_LIB_DMALLOC.
19187 * src/system.h: Use dmalloc.
19188 * src/LR0.c: Be sure to have pointers initialized to NULL.
19189 (allocate_itemsets): Allocate kernel_items only if needed.
19190
19191 2001-09-22 Akim Demaille <akim@epita.fr>
19192
19193 * configure.in: Bump to 1.29b.
19194 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19195 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19196 need xmalloc.c in calc.y.
19197 From Pascal Bart.
19198
19199 2001-09-21 Akim Demaille <akim@epita.fr>
19200
19201 Version 1.29a.
19202 * Makefile.maint, config/config.guess, config/config.sub,
19203 * config/missing: Update from masters.
19204 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19205 upon package.m4.
19206 * configure.in (ALL_LINGUAS): Add `tr'.
19207
19208 2001-09-21 Akim Demaille <akim@epita.fr>
19209
19210 * tests/Makefile.am (package.m4): Move to...
19211 ($(srcdir)/$(TESTSUITE)): here.
19212
19213 2001-09-20 Akim Demaille <akim@epita.fr>
19214
19215 * src/complain.c: No longer try to be standalone: use system.h.
19216 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19217 * src/complain.h: Likewise.
19218 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19219 Remove the unused variable `n'.
19220 From Albert Chin-A-Young.
19221
19222 2001-09-18 Marc Autret <autret_m@epita.fr>
19223
19224 * doc/bison.1: Update.
19225 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19226 descriptions.
19227 (Option Cross Key): Update.
19228 Add --graph.
19229
19230 2001-09-18 Marc Autret <autret_m@epita.fr>
19231
19232 * tests/regression.at: New test (comment in %union).
19233
19234 2001-09-18 Marc Autret <autret_m@epita.fr>
19235
19236 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19237 do that.
19238 Reported by Keith Browne.
19239
19240 2001-09-18 Marc Autret <autret_m@epita.fr>
19241
19242 * tests/output.at: Add tests for --defines and --graph.
19243
19244 2001-09-18 Marc Autret <autret_m@epita.fr>
19245
19246 * tests/output.at: Removes tests of %{header,src}_extension features.
19247
19248 2001-09-18 Akim Demaille <akim@epita.fr>
19249
19250 * tests/Makefile.am (package.m4): New.
19251 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19252 (_AT_CHECK_CALC_ERROR): Likewise.
19253 Factor the `, ' part of verbose error messages.
19254
19255 2001-09-18 Marc Autret <autret_m@epita.fr>
19256
19257 * src/getargs.c (longopts): Declare --defines and --graph as options
19258 with optional arguments.
19259 * src/files.h: Add extern declarations.
19260 * src/files.c (spec_graph_file, spec_defines_file): New.
19261 (output_files): Update.
19262 Remove CPP-outed code.
19263
19264 2001-09-18 Marc Autret <autret_m@epita.fr>
19265
19266 Turn off %{source,header}_extension feature.
19267
19268 * src/files.c (compute_exts_from_gf): Update.
19269 (compute_exts_from_src): Update.
19270 (output_files): CPP-out useless code.
19271 * src/files.h: Remove {header,source}_extension extern declarations.
19272 * src/reader.c (parse_dquoted_param): CPP-out.
19273 (parse_header_extension_decl): Remove.
19274 (parse_source_extension_decl): Remove.
19275 (read_declarations): Remove cases tok_{hdrext,srcext}.
19276 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19277 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19278
19279 2001-09-10 Akim Demaille <akim@epita.fr>
19280
19281 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19282 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19283 (AT_CHECK_OUTPUT): this.
19284 Merely check ls' exit status, its output is useless.
19285
19286 2001-09-10 Akim Demaille <akim@epita.fr>
19287
19288 * tests/calc.at: Use m4_match.
19289 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19290
19291 2001-09-10 Marc Autret <autret_m@epita.fr>,
19292 Akim Demaille <akim@epita.fr>
19293
19294 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19295 enum color_e.
19296 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19297 to `normal'.
19298 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19299 * src/lex.h: Adjust prototype.
19300 (token_t): Add `tok_undef'.
19301 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19302 (parse_percent_token): Now returns token_t.
19303 Add default statement in switch.
19304 (lex): Separate `c' as an input variable, from the token_t result
19305 part.
19306 (unlexed): Is a token_t.
19307
19308 2001-09-10 Akim Demaille <akim@epita.fr>
19309
19310 * configure.in: Bump to 1.29a.
19311
19312 2001-09-07 Akim Demaille <akim@epita.fr>
19313
19314 Version 1.29.
19315
19316 2001-08-30 Akim Demaille <akim@epita.fr>
19317
19318 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19319 * m4/atconfig.m4: Remove.
19320 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19321 * tests/bison: New.
19322 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19323 m4_if, m4_patsubst, and m4_regexp.
19324 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19325 `input' file instead of echo.
19326
19327 2001-08-29 Akim Demaille <akim@epita.fr>
19328
19329 Bump to 1.28e.
19330
19331 2001-08-29 Akim Demaille <akim@epita.fr>
19332
19333 Version 1.28d.
19334
19335 2001-08-29 Paul Eggert <eggert@twinsun.com>
19336
19337 * src/bison.simple (yyparse): Don't take the address of an
19338 item before the start of an array, as that doesn't conform to
19339 the C Standard.
19340
19341 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19342
19343 * doc/bison.texinfo (Location Tracking Calc): New node.
19344
19345 2001-08-29 Paul Eggert <eggert@twinsun.com>
19346
19347 * src/output.c (output): Do not define const, as this now
19348 causes more problems than it cures.
19349
19350 2001-08-29 Akim Demaille <akim@epita.fr>
19351
19352 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19353 the nodes.
19354 Be sure to tag the `detailmenu'.
19355
19356 2001-08-29 Akim Demaille <akim@epita.fr>
19357
19358 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19359 download in a tmp dir.
19360
19361 2001-08-28 Marc Autret <autret_m@epita.fr>
19362
19363 * config/depcomp: New file.
19364
19365 2001-08-28 Marc Autret <autret_m@epita.fr>
19366
19367 * doc/bison.1 (mandoc): Adjust.
19368 From Juan Manuel Guerrero.
19369
19370 2001-08-28 Marc Autret <autret_m@epita.fr>
19371
19372 * src/print_graph.c (print_state): Fix.
19373
19374 2001-08-27 Marc Autret <autret_m@epita.fr>
19375
19376 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19377 char * members.
19378 Echo modifications to the functions prototypes.
19379 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19380
19381 2001-08-27 Marc Autret <autret_m@epita.fr>
19382
19383 * src/vcg.c: Include `xalloc.h'.
19384 (add_colorentry): New.
19385 (add_classname): New.
19386 (add_infoname): New.
19387 * src/vcg.h: Add new prototypes.
19388
19389 2001-08-27 Akim Demaille <akim@epita.fr>
19390
19391 * Makefile.maint: Sync. again with CVS Autoconf.
19392
19393 2001-08-27 Akim Demaille <akim@epita.fr>
19394
19395 * Makefile.maint: Formatting changes.
19396 (po-update, cvs-update, update): New targets.
19397 (AMTAR): Remove.
19398
19399 2001-08-27 Akim Demaille <akim@epita.fr>
19400
19401 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19402 * Makefile.maint: Sync. with CVS Autoconf.
19403
19404 2001-08-27 Marc Autret <autret_m@epita.fr>
19405
19406 * src/vcg.h (struct infoname_s): New.
19407 (struct colorentry_s): New.
19408 (graph_s): New fields {vertical,horizontal}_order in structure.
19409 Add `infoname' field.
19410 Add `colorentry' field;
19411 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19412 (G_HORIZONTAL_ORDER): New.
19413 (G_INFONAME): New.
19414 (G_COLORENTRY): New.
19415 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19416 Add output of `infoname'.
19417 Add output of `colorentry'.
19418
19419 2001-08-27 Marc Autret <autret_m@epita.fr>
19420
19421 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19422 This one shadowed a global parameter.
19423
19424 2001-08-24 Marc Autret <autret_m@epita.fr>
19425
19426 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19427 instead of `unsigned'.
19428 (print_state): Do not call obstack_object_size () in obstack_grow ()
19429 to avoid macro variables shadowing.
19430
19431 2001-08-23 Marc Autret <autret_m@epita.fr>
19432
19433 * src/lex.c (percent_table): Typo: s/naem/name/.
19434 Add graph option.
19435 Normalize new options declarations.
19436
19437 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19438
19439 * tests/suite.at: Exercise %header_extension and %source_extension.
19440
19441 2001-08-16 Marc Autret <autret_m@epita.fr>
19442
19443 * src/reader.c (parse_dquoted_param): New.
19444 (parse_header_extension_decl): Use it.
19445 (parse_source_extension_decl): Likewise.
19446
19447 2001-08-16 Marc Autret <autret_m@epita.fr>
19448
19449 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19450 (get_xxxx_str): Use assert () instead of complain ().
19451 Remove return invokations in default cases.
19452 (get_decision_str): Modify default behaviour. Remove second argument.
19453 Echo modifications on calls.
19454 (output_graph): Fix.
19455
19456 2001-08-16 Marc Autret <autret_m@epita.fr>
19457
19458 * src/getargs.c (usage): Update with ``-g, --graph''.
19459
19460 2001-08-16 Marc Autret <autret_m@epita.fr>
19461
19462 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19463 (Option Cross Key): Likewise.
19464 * doc/bison.1: Update.
19465
1c8c2190
PB
194662001-09-25 Pascal Bart <pascal.bart@epita.fr>
19467
19468 * src/output.c (output_master_parser): Don't finish action_obstack.
19469 (output_parser): Don't care about the muscle action, here.
19470 (prepare): Copy the action_obstack in the action muscle.
19471 (output): Free action_obstack.
19472
180d45ba
PB
194732001-09-23 Pascal Bart <pascal.bart@epita.fr>
19474
19475 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19476 will contain `%union' declaration.
19477 (parse_union_decl): Delete #line directive output.
19478 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19479 informations about %union.
19480 (parse_union_decl): Copy the union_obstack in the muscle stype.
19481 * src/bison.simple: Add new #line directive.
19482 Add typdef %%stype YYSTYPE.
19483
c51d1a19
PB
194842001-09-23 Pascal Bart <pascal.bart@epita.fr>
19485
19486 * src/bison.simple: Add new `#line' directive.
19487
6f9344da
PB
194882001-09-22 Pascal Bart <pascal.bart@epita.fr>
19489
19490 * src/bison.simple: New `#line' directive.
19491 * src/output.c (output_parser): Support new dynamic muscle input_line.
19492
652def80
MA
194932001-09-22 Marc Autret <autret_m@epita.fr>
19494
19495 * src/output.c (output_master_parser): New.
19496 (output_parser): Be more re-entrant.
19497
25b222fa
MA
194982001-09-21 Marc Autret <autret_m@epita.fr>
19499
19500 * src/reader.c (copy_definition, parse_union_decl): Update and use
19501 `linef' muscle.
19502 (copy_action): Likewise.
19503 Use obstack_1grow ().
19504 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19505
6bc35ae5
MA
195062001-09-21 Marc Autret <autret_m@epita.fr>
19507
19508 * src/options.c (option_table): Adjust.
19509 * src/lex.c (parse_percent_token): Fix.
19510
c0629aa1
PB
195112001-09-20 Pascal Bart <pascal.bart@epita.fr>
19512
19513 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 19514
82b6d266
PB
195152001-09-20 Pascal Bart <pascal.bart@epita.fr>
19516
19517 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19518 is now an option_table_struct*.
19519 (option_strcmp): New function option_strcmp.
19520 (parse_percent_token): Call option_strcmp.
19521 * src/getargs.c (xalloc.h, options.h): Include it.
19522 (getargs): Call create_long_option_table.
19523 (getargs): Free longopts at the end of the function.
19524 (shortopts): Move in options.c.
19525 * src/options.c (create_long_option_table): New function. Convert
19526 information from option_table to option structure.
19527 * src/reader.c (options.h): Include it.
19528
19529 * src/Makefile.am: Adjust.
19530 * src/options.c (option_table): Create from longopts and percent_table.
19531 * src/getargs.c (longopts): Delete.
19532 * src/lex.c (struct percent_table_struct): Delete.
19533 (percent_table): Delete.
19534 (options.h): Include it.
19535 * src/options.c: Create.
19536 * src/options.h: Create.
19537 Declare enum opt_access_e.
19538 Define struct option_table_struct.
19539
75f5aaea
MA
195402001-09-20 Marc Autret <autret_m@epita.fr>
19541
19542 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19543 sections of Bison.
19544
f508cb0a
PB
195452001-09-19 Pascal Bart <pascal.bart@epita.fr>
19546
19547 * src/bison.simple: s/%%filename/%%skeleton.
19548 * src/muscle_tab.c (getargs.h): Include it.
19549 (muscle_init): Insert new muscle skeleton.
19550
13105fc1
PB
195512001-09-18 Pascal Bart <pascal.bart@epita.fr>
19552
19553 * src/output.c (output_parser): Delete unused variable actions_dumped.
19554
b0c4483e
PB
195552001-09-07 Pascal Bart <pascal.bart@epita.fr>
19556
19557 * src/output.c (output): Delete call to reader_output_yylsp.
19558 * src/reader.c (reader): Likewise.
ba0fe3c7 19559 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 19560
11d82f03
MA
195612001-09-02 Marc Autret <autret_m@epita.fr>
19562
19563 * src/reader.c: Include muscle_tab.h.
19564 (parse_union_decl): Update.
19565 (parse_macro_decl): Rename parse_muscle_decl.
19566 Update to use renamed functions and variable.
19567 (read_declarations, copy_action, read_additionnal_code, : Updated
19568 with correct variables and functions names.
19569 (packsymbols, reader): Likewise.
342b8b6e 19570
11d82f03 19571 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 19572
11d82f03
MA
19573 * src/output.c: Include muscle_tab.h
19574 In all functions using macro_insert, change by using muscle_insert ().
19575 (macro_obstack): Rename muscle_obstack.
19576 Echo modifications in the whole file.
19577 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19578 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19579 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19580
19581 * src/muscle_tab.h: Update double inclusion macros.
19582 (macro_entry_s): Rename muscle_entry_s.
19583 Update prototypes.
342b8b6e 19584
11d82f03
MA
19585 * src/muscle_tab.c: Include muscle_tab.h.
19586 Rename macro_tabble to muscle_table.
19587 (mhash1, mhash2, mcmp): Use muscle_entry.
19588 (macro_init): Rename muscle_init. Update.
19589 (macro_insert): Rename muscle_insert. Update.
19590 (macro_find): Rename muscle_find. Update.
19591
19592 * src/main.c: Include muscle_tab.h.
19593 (main): Call muscle_init ().
19594 * src/Makefile.am (bison_SOURCES): Echo modifications.
19595
93a37297
MA
195962001-09-02 Marc Autret <autret_m@epita.fr>
19597
f753cd62 19598 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 19599
f753cd62
MA
19600 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19601
196022001-09-02 Marc Autret <autret_m@epita.fr>
19603
19604 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 19605
682d48cd
PB
196062001-09-01 Pascal Bart <pascal.bart@epita.fr>
19607
342b8b6e 19608 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
19609 filename.
19610
087c8fda
MA
196112001-09-01 Marc Autret <autret_m@epita.fr>
19612
19613 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19614 to an explicit value to activate the feature. We do it here.
19615
dda680cb
PB
196162001-08-31 Pascal Bart <pascal.bart@epita.fr>
19617
19618 * src/output.c (prepare): Delete the `filename' muscule insertion.
19619 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19620 (parse_union_decl): Likewise.
19621 * src/macrotab.c (macro_init): Initialize filename by infile.
19622
9e644e64
MA
196232001-08-31 Marc Autret <autret_m@epita.fr>
19624
19625 * src/bison.simple (YYLSP_NEEDED): New definition.
19626 * src/output.c (prepare): Add macro insertion of `locations_flag'
19627
17da6427
PB
196282001-08-31 Pascal Bart <pascal.bart@epita.fr>
19629
19630 * src/output.c (prepare): Delete insertion of previous muscles,
19631 and insert the `prefix' muscles.
19632 * src/macrotab.c (macro_init): Likewise.
19633 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 19634 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
19635 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19636 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 19637 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
19638 name_prefix.
19639
e8cb70b9
PB
196402001-08-31 Pascal Bart <pascal.bart@epita.fr>
19641
19642 * src/main.c (main): Standardize.
19643 * src/output.c (output_table_data, output_parser): Likewise.
19644 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19645
63c2d5de
MA
196462001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19647
342b8b6e 19648 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
19649 %%epilogue.
19650 * src/output.c (output): Rename %%declarations to %%prologue.
19651 * src/bison.simple: Echo modifications.
342b8b6e 19652
d8cb5183
MA
196532001-08-31 Marc Autret <autret_m@epita.fr>
19654
19655 * src/reader.c (readgram): CleanUp.
19656 (output_token_defines): Likewise.
19657 (packsymbols): Likewise.
19658 (reader): Likewise.
19659 * src/output.c (output): CPP-out useless code.
19660
6c686258
PB
196612001-08-31 Pascal Bart <pascal.bart@epita.fr>
19662
342b8b6e 19663 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
19664 output_trailers and output_headers.
19665 * src/output.h: Remove obsolete functions prototypes of output_headers
19666 and output_trailers.
19667
8f451ef7
PB
196682001-08-30 Pascal Bart <pascal.bart@epita.fr>
19669
19670 * src/main.c: Include macrotab.h.
342b8b6e 19671 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
19672 Adjust functions prototypes.
19673 * src/macrotab.c (macro_insert): Constify key and value.
19674 (macro_find): Constify key.
19675 (macro_insert): Include 'xalloc.h'
19676 (macro_insert): Use XMALLOC.
19677 (macro_find): Constify return value.
19678 * src/output.c (output_table_data): Rename table to table_data.
19679 (output_parser): Constify macro_key, macro_value.
19680
997b6fd0 196812001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
19682
19683 * src/reader.c (parse_skel_decl): New.
342b8b6e 19684 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
19685 * src/lex.h (token_t): New token `tok_skel'.
19686 * src/lex.c (percent_table): Add skeleton option entry.
19687 Standardize.
19688
ff48177d
MA
196892001-08-29 Marc Autret <autret_m@epita.fr>
19690
19691 * src/bison.simple: Add %%user_code directive at the end.
19692 * src/reader.c (read_additionnal_code): New.
19693 (reader): Use it.
19694 * src/output.c (output_program): Remove.
19695 (output): Update.
19696
b33160bf
MA
196972001-08-28 Marc Autret <autret_m@epita.fr>
19698
19699 * src/output.c (output_actions): Clean up.
4e5caae2 19700 (output_gram): CPP-out useless code.
b33160bf
MA
19701 * src/reader.c (reader): Clean up, CPP-out useless code.
19702
d1a2daf7
PB
197032001-08-28 Pascal Bart <pascal.bart@epita.fr>
19704
342b8b6e 19705 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 19706 directive.
d1a2daf7
PB
19707 * src/bison.simple: Add `%%definitions'.
19708
2b763dfe
MA
197092001-08-28 Marc Autret <autret_m@epita.fr>
19710
19711 * config/depcomp: New file.
19712
f1a87ef6
PE
197132001-08-27 Paul Eggert <eggert@twinsun.com>
19714
19715 * src/bison.simple (yyparse): Don't take the address of an
19716 item before the start of an array, as that doesn't conform to
19717 the C Standard.
19718
82e236e2
RA
197192001-08-27 Robert Anisko <robert.anisko@epita.fr>
19720
f1a87ef6 19721 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
19722 obstack. It was done too late here.
19723
19724 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19725 completely wrong.
19726 (reader): Initialize the macro obstack here, since we need it to grow
19727 '%define' directives.
19728
19729 * src/reader.h: Declare the macro obstack as extern.
19730
b0cfa28a
RA
197312001-08-27 Robert Anisko <robert.anisko@epita.fr>
19732
19733 * src/output.c (output_parser): Fix. Store single '%' characters in
19734 the output obstack instead of throwing them away.
19735
6fc74234
AD
197362001-08-27 Akim Demaille <akim@epita.fr>
19737
19738 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19739
9c76d118
RA
197402001-08-25 Robert Anisko <robert.anisko@epita.fr>
19741
19742 * lib/Makefile.am: Adjust.
19743
a8289c62
RA
197442001-08-25 Robert Anisko <robert.anisko@epita.fr>
19745
19746 * src/bison.simple: Update and add '%%' directives.
19747
b6610515
RA
197482001-08-25 Robert Anisko <robert.anisko@epita.fr>
19749
19750 * src/reader.c (reader): Remove calls to 'output_headers' and
19751 'output_trailers'. Remove some C output.
19752 (readgram): Disable a piece of code that was writing a default
19753 definition for 'YYSTYPE'.
19754 (reader_output_yylsp): Remove.
19755 (packsymbols): Output token defintions to a macro.
19756 (copy_definition): Disable C output.
6fc74234 19757
b6610515
RA
19758 * src/reader.c (parse_macro_decl): New function used to parse macro
19759 declarations.
19760 (copy_string2): Put the body of copy_string into this new function.
19761 Add a parameter to let the caller choose whether he wants to copy the
19762 string delimiters or not.
19763 (copy_string): Be a simple call to copy_string2 with the last argument
19764 bound to true.
19765 (read_declarations): Add case for macro definition.
19766 (copy_identifier): New.
6fc74234 19767 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
19768 rather than lex.
19769
26f609ff
RA
197702001-08-25 Robert Anisko <robert.anisko@epita.fr>
19771
19772 * src/output.c (prepare): Add prefixed names.
19773 (output_parser): Output semantic actions.
19774 (output_parser): Fix bug on '%%line' directives.
6fc74234 19775
26f609ff
RA
19776 * src/output.c (output_headers): Remove. The C code printed by this
19777 function should now be in the skeletons.
19778 (output_trailers): Remove.
19779 (output): Disable call to 'reader_output_yylsp'.
19780 (output_rule_data): Do not output tables to the table obstack.
19781
19782 * src/output.c: Remove some C dedicated output.
19783 Improve the use of macro and output obstacks.
19784 (output_defines): Remove.
6fc74234 19785
26f609ff
RA
19786 * src/output.c (output_token_translations): Associate 'translate'
19787 table with a macro. No output to the table obstack.
19788 (output_gram): Same for 'rhs' and 'prhs'.
19789 (output_stos): Same for 'stos'.
19790 (output_rule_data): Same for 'r1' and 'r2'.
19791 (token_actions): Same for 'defact'.
19792 (goto_actions): Same for 'defgoto'.
19793 (output_base): Same for 'pact' and 'pgoto'.
19794 (output_table): Same for 'table'.
19795 (output_check): Same for 'check'.
6fc74234 19796
26f609ff
RA
19797 * src/output.c (output_table_data): New function.
19798 (output_short_table): Remove.
19799 (output_short_or_char_table): Remove.
6fc74234 19800
26f609ff
RA
19801 * src/output.c (output_parser): Replace most of the skeleton copy code
19802 with something new. Skeletons are now processed character by character
19803 rather than line by line, and Bison looks for '%%' macros. This is the
19804 first step in making Bison's output process (a lot) more flexible.
19805 (output_parser): Use the macro table.
19806
6f43b113
RA
198072001-08-25 Robert Anisko <robert.anisko@epita.fr>
19808
19809 * src/main.c (main): Initialize the macro table.
19810
dd3127cf
RA
198112001-08-25 Robert Anisko <robert.anisko@epita.fr>
19812
19813 * src/lex.c (percent_table): Add tok_define.
19814 * src/lex.h: Add tok_define.
19815
aa321494
RA
198162001-08-25 Robert Anisko <robert.anisko@epita.fr>
19817
19818 * src/macrotab.c: New file.
19819 * src/macrotab.h: New file.
19820 * src/Makefile.am: Update.
19821
68bd3b6b
RA
198222001-08-25 Robert Anisko <robert.anisko@epita.fr>
19823
19824 * lib/hash.c: New file.
19825 * lib/hash.h: New file.
19826 * lib/Makefile.am: Update.
19827
45f8dd1e
AD
198282001-08-15 Akim Demaille <akim@epita.fr>
19829
19830 Version 1.28c.
19831
40a64a7a 198322001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
19833
19834 * src/reader.c (readgram): Indent output macro YYSTYPE.
19835 (packsymbols): Likewise.
19836 (output_token_defines): Likewise.
19837 * src/files.c: Standardize.
19838 (compute_header_macro): New.
19839 (defines_obstack_save): New. Use compute_header_macro.
19840 (output_files): Update. Use defines_obstack_save.
19841
f9a8293a
AD
198422001-08-15 Akim Demaille <akim@epita.fr>
19843
19844 * doc/bison.texinfo (Table of Symbols): Document
19845 YYSTACK_USE_ALLOCA.
19846
150ca7a7
AD
198472001-08-15 Akim Demaille <akim@epita.fr>
19848
19849 * missing: Update from CVS Automake.
19850 * config/config.guess, config/config.sub, config/texinfo.tex:
19851 Update from gnu.org.
19852
69b5cec4
AD
198532001-08-15 Akim Demaille <akim@epita.fr>
19854
19855 * Makefile.maint: Sync with CVS Autoconf.
19856
f2b5126e
PB
198572001-08-14 Pascal Bart <pascal.bart@epita.fr>
19858
69b5cec4 19859 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
19860 `fdl.texi'.
19861 * doc/fdl.texi: Add to package.
19862
4ecbf796
MA
198632001-08-14 Marc Autret <autret_m@epita.fr>
19864
19865 Turn on %{source,header}_extension features.
19866
69b5cec4 19867 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
19868 source_extension.
19869 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 19870 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
19871 between options.
19872
95fb5662
MA
198732001-08-14 Marc Autret <autret_m@epita.fr>
19874
19875 * src/files.c (compute_base_names): Add extensions computing when
19876 `--file-prefix' used.
19877 Standardize function calls.
19878
78d09da9
MA
198792001-08-13 Marc Autret <autret_m@epita.fr>
19880
69b5cec4 19881 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
19882 defining it (defined but null disables alloca).
19883
5a009f2c
MA
198842001-08-13 Marc Autret <autret_m@epita.fr>
19885
19886 * src/bison.simple (_yy_memcpy): CPP reformat.
19887
1e41465a
PB
198882001-08-13 Pascal Bart <pascal.bart@epita.fr>
19889
19890 * tests/atconfig.in (CPPFLAGS): Fix.
19891
c67a198d
PB
198922001-08-10 Pascal Bart <pascal.bart@epita.fr>
19893
79282c6c 19894 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
19895 `gpl.texi'.
19896 * doc/gpl.texi: Add to package.
19897
09a6de7e
MA
198982001-08-10 Marc Autret <autret_m@epita.fr>
19899
19900 * src/print_graph.h: Fix.
19901 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
19902
b77b9ee0
AD
199032001-08-10 Akim Demaille <akim@epita.fr>
19904
19905 * src/system.h: Provide default declarations for stpcpy, strndup,
19906 and strnlen.
19907
3e259915
MA
199082001-08-10 Robert Anisko <anisko_r@epita.fr>
19909
19910 * doc/bison.texinfo (Locations): Update @$ stuff.
19911
ca96bc2d
MA
199122001-08-09 Robert Anisko <anisko_r@epita.fr>
19913
19914 * src/bison.simple (YYLLOC_DEFAULT): Update.
19915 (yyparse): Adjust.
19916
fdc6758b
MA
199172001-08-08 Marc Autret <autret_m@epita.fr>
19918
b77b9ee0 19919 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
19920 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
19921 Reported by Fabrice Bauzac.
957d4dbf 19922
600cad3b
MA
199232001-08-08 Marc Autret <autret_m@epita.fr>
19924
19925 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
19926 * src/vcg.c (output_node): Fix.
19927 * src/vcg.h: Cleanup.
19928 * src/print_graph.c: Add comments.
b77b9ee0 19929 (node_output_size): New global variable. Simplify the formatting of
600cad3b 19930 the VCG graph output.
b77b9ee0 19931 (print_actions): Unused code is now used. It notifies the final state
600cad3b 19932 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 19933 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
19934 blue.
19935 Get the current node name and node_obstack by argument.
19936 (node_obstack): New variable.
19937 (print_state): Manage node_obstack.
19938 (print_core): Use node_obstack given by argument.
19939 A node is not only computed here but in print_actions also.
19940 (print_graph): CPP out useless code instead of commenting it.
19941
976e528f
AD
199422001-08-07 Pascal Bart <pascal.bart@epita.fr>
19943
19944 * tests/atconfig.in (CPPFLAGS): Fix.
19945
20e8e5ca
AD
199462001-08-07 Akim Demaille <akim@epita.fr>
19947
19948 * src/print_graph.c (quote): New.
19949 (print_core): Use it.
19950
957d4dbf 199512001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 19952
3e3da797
AD
19953 * src/vcg.c (complain.h): Include it.
19954 Unepitaize `return' invocations.
c4b66126 19955 [NDEBUG] (main): Remove.
79282c6c 19956 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
19957 * src/files.c (open_files): Initialize graph_obstack.
19958 * src/print_graph.c (print_actions): CPP out useless code.
19959 (print_core): Don't output the last `\n' in labels.
19960 Use `quote'.
19961 * src/files.c (output_files): Output the VCG file.
19962 * src/main.c (main): Invoke print_graph ();
3e3da797 19963
957d4dbf 199642001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
19965
19966 Automaton VCG graph output.
19967 Using option ``-g'' or long option ``--graph'', you can generate
19968 a gram_filename.vcg file containing a VCG description of the LALR (1)
19969 automaton of your grammar.
19970
19971 * src/main.c: Call to print_graph() function.
19972 * src/getargs.h: Update.
19973 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
19974 (graph_flag): New flag.
19975 (longopts): Update.
19976 (getargs): Add case `g'.
19977 * src/files.c (graph_obstack): New obstack struct.
19978 (open_files): Initialize new obstack.
19979 (output_files): Saves graph_obstack if required.
19980 * src/files.h (graph_obstack): New extern declaration.
19981 * src/Makefile.am: Add new source files.
19982
927c1557 199832001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
19984
19985 * src/print_graph.c, src/print_graph.h (graph): New.
19986 * src/vcg.h: New file.
19987 * src/vcg.c: New file, VCG graph handling.
19988
7333d403
AD
199892001-08-06 Marc Autret <autret_m@epita.fr>
19990
19991 Add of %source_extension and %header_extension which specify
19992 the source or/and the header output file extension.
19993
19994 * src/files.c (compute_base_names): Remove initialisation of
19995 src_extension and header_extension.
19996 (compute_exts_from_gf): Update.
19997 (compute_exts_from_src): Update.
19998 (output_files): Update.
19999 * src/reader.c (parse_header_extension_decl): New.
20000 (parse_source_extension_decl): New.
20001 (read_declarations): New case statements for the new tokens.
20002 * src/lex.c (percent_table): Add entries for %source_extension
20003 and %header_extension.
20004 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20005
84163231
AD
200062001-08-06 Marc Autret <autret_m@epita.fr>
20007
20008 * configure.in: Bump to 1.28c.
20009 * doc/bison.texinfo: Texinfo thingies.
20010
8303fc42
AD
200112001-08-04 Pascal Bart <pascal.bart@epita.fr>
20012
20013 * tests/atconfig.in (CPPFLAGS): Add.
20014 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20015
70a84437
AD
200162001-08-03 Akim Demaille <akim@epita.fr>
20017
20018 Version 1.28b.
20019
2ce10144
AD
200202001-08-03 Akim Demaille <akim@epita.fr>
20021
20022 * tests/Makefile.am (check-local): Ship testsuite.
20023 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20024 Include `string.h'.
20025
1e3e4bc1
AD
200262001-08-03 Akim Demaille <akim@epita.fr>
20027
20028 * configure.in: Try using -Wformat when compiling.
20029
42b45b7f
AD
200302001-08-03 Akim Demaille <akim@epita.fr>
20031
20032 * configure.in: Bump to 1.28b.
20033
8f13fe33
AD
200342001-08-03 Akim Demaille <akim@epita.fr>
20035
20036 * src/complain.c: Adjust strerror_r portability issues.
20037
b37ba92c
AD
200382001-08-03 Akim Demaille <akim@epita.fr>
20039
20040 Version 1.28a.
20041
b0ce6046
AD
200422001-08-03 Akim Demaille <akim@epita.fr>
20043
20044 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20045 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20046 * src/getargs.c: Include complain.h.
20047 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20048 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20049
d01c415b
AD
200502001-08-03 Akim Demaille <akim@epita.fr>
20051
20052 * src/reader.c (readgram): Display hidden chars in error messages.
20053
459dd1a6
AD
200542001-08-03 Akim Demaille <akim@epita.fr>
20055
20056 Update to gettext 0.10.39.
20057
53b74c0c
AD
200582001-08-03 Akim Demaille <akim@epita.fr>
20059
20060 * lib/strspn.c: New.
20061
234a3be3
AD
200622001-08-01 Marc Autret <autret_m@epita.fr>
20063
20064 * doc/bison.texinfo: Update.
20065 * doc/bison.1 (mandoc): Update.
20066 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20067 * src/files.c: Support output files extensions computing.
20068 (src_extension): New static variable.
20069 (header_extension): New static variable.
20070 (tr): New function.
20071 (get_extension_index): New function, gets the index of an extension
20072 filename in a string.
20073 (compute_exts_from_gf): New function, computes extensions from the
20074 grammar file extension.
20075 (compute_exts_from_src): New functions, computes extensions from the
20076 C source file extension, file given by ``-o'' option.
20077 (compute_base_names): Update.
20078 (output_files): Update.
20079
847bf1f5
AD
200802001-08-01 Robert Anisko <anisko_r@epita.fr>
20081
d995fee7 20082 * doc/bison.texi: Document @$.
847bf1f5
AD
20083 (Locations): New section.
20084
d074a105
AD
200852001-07-18 Akim Demaille <akim@epita.fr>
20086
20087 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20088 * config/prev-version.txt, config/move-if-change: New.
20089 * Makefile.am: Adjust.
20090
3419715d
AD
200912001-07-08 Pascal Bart <pascal.bart@epita.fr>
20092
20093 * src/bison.simple (yyparse): Suppress warning `comparaison
20094 between signed and unsigned'.
20095
62ab6972
AD
200962001-07-05 Pascal Bart <pascal.bart@epita.fr>
20097
20098 * src/getargs.h (raw_flag): Remove.
20099 * src/getargs.c: Die on `-r'/`--raw'.
20100 * src/lex.c (parse_percent_token): Die on `%raw'.
20101 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20102 * tests/calc.at: Suppress test with option `--raw'.
20103
1e24cc5b
AD
201042001-07-14 Akim Demaille <akim@epita.fr>
20105
20106 * config/: New.
20107 * configure.in: Require Autoconf 2.50.
20108 Update to gettext 0.10.38.
20109
32dfccf8
AD
201102001-03-16 Akim Demaille <akim@epita.fr>
20111
20112 * doc/bison.texinfo: ANSIfy the examples.
20113
cd5bd6ac
AD
201142001-03-16 Akim Demaille <akim@epita.fr>
20115
20116 * getargs.c (skeleton): New variable.
20117 (longopts): --skeleton is a new option.
20118 (shortopts, getargs): -S is a new option.
20119 * getargs.h: Declare skeleton.
20120 * output.c (output_parser): Use it.
20121
5141b016
AD
201222001-03-16 Akim Demaille <akim@epita.fr>
20123
20124 * m4/strerror_r.m4: New.
20125 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20126 * lib/error.h, lib/error.c: Update.
20127
447992b9
AD
201282001-03-16 Akim Demaille <akim@epita.fr>
20129
20130 * src/getargs.c (longopts): Clean up.
20131
274d42ce
AD
201322001-02-21 Akim Demaille <akim@epita.fr>
20133
20134 * src/reader.c (gensym): `gensym_count' is your own.
20135 Use a static buf to create the symbol name, as token_buffer is no
20136 longer a buffer.
20137
22c821f3
AD
201382001-02-08 Akim Demaille <akim@epita.fr>
20139
20140 * src/conflicts.c (conflict_report): Be sure not to append to res
20141 between two calls, which could happen if both first sprintf were
20142 skipped, but not the first cp += strlen.
20143
18569462
AD
201442001-02-08 Akim Demaille <akim@epita.fr>
20145
20146 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20147 New, from fileutils 4.0.37.
20148 * configure.in: Require Autoconf 2.49c. I took some time before
20149 making this decision. This is the only way out for portability
20150 issues in Bison, it would mean way too much duplicate effort to
20151 import in Bison features implemented in 2.49c since 2.13.
20152 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20153
0d8f3c8a
AD
201542001-02-02 Akim Demaille <akim@epita.fr>
20155
20156 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 20157 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 20158
f17bcd1f
AD
201592001-01-19 Akim Demaille <akim@epita.fr>
20160
20161 Get rid of the ad hoc handling of token_buffer in the scanner: use
20162 the obstacks.
20163
20164 * src/lex.c (token_obstack): New.
20165 (init_lex): Initialize it. No longer call...
20166 (grow_token_buffer): this. Remove it.
20167 Adjust all the places which used it to use the obstack.
20168
511e79b3
AD
201692001-01-19 Akim Demaille <akim@epita.fr>
20170
20171 * src/lex.h: Rename all the tokens:
20172 s/\bENDFILE\b/tok_eof/g;
20173 s/\bIDENTIFIER\b/tok_identifier/g;
20174 etc.
20175 Let them be enums, not #define, to ease debugging.
20176 Adjust all the code.
20177
0d6508ef
AD
201782001-01-18 Akim Demaille <akim@epita.fr>
20179
20180 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20181 * src/lex.c (maxtoken, grow_token_buffer): Static.
20182
6deb4447
AD
201832001-01-18 Akim Demaille <akim@epita.fr>
20184
20185 Since we now use obstacks, more % directives can be enabled.
20186
20187 * src/lex.c (percent_table): Also accept `%yacc',
20188 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20189 `%debug'.
20190 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20191 instead of returning a token.
20192 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20193 * src/reader.c (read_declarations): Adjust.
20194 * src/files.c (open_files): Don't call `compute_base_names', don't
20195 compute `attrsfile' since they depend upon data which might be
20196 *in* the input file now.
20197 (output_files): Do it here.
20198 * src/output.c (output_headers): Document the fact that this patch
20199 introduces a guaranteed SEGV for semantic parsers.
20200 * doc/bison.texinfo: Document them.
20201 * tests/suite.at: Exercise these %options.
20202
ff4423cc
AD
202032000-12-20 Akim Demaille <akim@epita.fr>
20204
20205 Also handle the output file (--verbose) with obstacks.
20206
20207 * files.c (foutput): Remove.
20208 (output_obstack): New.
20209 Adjust all dependencies.
20210 * src/conflicts.c: Return a string.
20211 * src/system.h (obstack_grow_string): Rename as...
20212 (obstack_sgrow): this. Be ready to work with non literals.
20213 (obstack_fgrow4): New.
20214
956dba3a
AD
202152000-12-20 Akim Demaille <akim@epita.fr>
20216
20217 * src/files.c (open_files): Fix the computation of short_base_name
20218 in the case of `-o foo.tab.c'.
20219
337bab46
AD
202202000-12-20 Akim Demaille <akim@epita.fr>
20221
20222 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20223 (copy_dollar): Now that everything uses obstacks, get rid of the
20224 FILE * parameters.
20225
5d3214b8
AD
202262000-12-20 Akim Demaille <akim@epita.fr>
20227
20228 * src/files.c (open_files): Actually the `.output' file is based
20229 on the short_base_name, not base_name.
20230 * tests/suite.at (Checking output file names): Adjust.
20231
29092a57
AD
202322000-12-20 Akim Demaille <akim@epita.fr>
20233
20234 * src/bison.s1: Remove, we now use directly...
20235 * src/bison.simple: this.
20236 * src/Makefile.am: Use pkgdata instead of data.
20237
ea5607fd
AD
202382000-12-20 Akim Demaille <akim@epita.fr>
20239
20240 * src/files.c (guard_obstack): New.
20241 (open_files): Initialize it.
20242 (output_files): Dump it...
20243 * src/files.h: Export it.
20244 * src/reader.c (copy_guard): Use it.
20245
27110317
AD
202462000-12-19 Akim Demaille <akim@epita.fr>
20247
20248 * src/files.c (outfile, defsfile, actfile): Removed as global
20249 vars.
20250 (open_files): Don't compute them.
20251 (output_files): Adjust.
20252 (base_name, short_base_name): Be global.
20253 Adjust dependencies.
20254
19c50364
AD
202552000-12-19 Akim Demaille <akim@epita.fr>
20256
20257 * src/files.c (strsuffix): New.
20258 (stringappend): Be just like strcat but allocate.
20259 (base_names): Eve out from open_files.
20260 Try to simplify the rather hairy computation of base_name and
20261 short_base_name.
20262 (open_files): Use it.
20263 * tests/suite.at (Checking output file names): New test.
20264
573c1d9f
AD
202652000-12-19 Akim Demaille <akim@epita.fr>
20266
20267 * src/system.h (obstack_grow_literal_string): Rename as...
20268 (obstack_grow_string): this.
20269 * src/output.c (output_parser): Recognize `%% actions' instead of
20270 `$'.
20271 * src/bison.s1: s/$/%% actions/.
20272 * src/bison.hairy: Likewise.
20273
ef7ddedd
AD
202742000-12-19 Akim Demaille <akim@epita.fr>
20275
20276 * src/output.c (output_parser): Compute the `#line' lines when
20277 there are.
20278 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20279 Suggested by Hans Aberg.
20280
ff61dabd
AD
202812000-12-19 Akim Demaille <akim@epita.fr>
20282
20283 Let the handling of the skeleton files be local to the procedures
20284 that use it.
20285
20286 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20287 longer static.
20288 (fparser, open_extra_files): Remove.
20289 (open_files, output_files): Don't take care of fparser.
20290 * src/files.h: Adjust.
20291 * src/output.c (output_parser): Open and close the file to the
20292 skeleton.
20293 * src/reader.c (read_declarations): When %semantic_parser, open
20294 fguard.
20295
55b96341
AD
202962000-12-19 Akim Demaille <akim@epita.fr>
20297
20298 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20299 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20300
358c15b7
AD
203012000-12-19 Akim Demaille <akim@epita.fr>
20302
20303 * src/files.c (open_files): Yipee! We no longer need all the code
20304 looking for `/tmp' since we have no tmp file.
20305
7de3329e
AD
203062000-12-19 Akim Demaille <akim@epita.fr>
20307
20308 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20309 New macros.
20310 * src/files.c (open_files): Less dependency on MSDOS etc.
20311
3abcd459
AD
203122000-12-14 Akim Demaille <akim@epita.fr>
20313
20314 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20315 Provide a default definition.
20316 Use it when executing the default @ action.
20317 * src/reader.c (reader_output_yylsp): No longer include
20318 `timestamp' and `text' in the default YYLTYPE.
20319
2a91a95e
AD
203202000-12-12 Akim Demaille <akim@epita.fr>
20321
20322 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20323 (copy_guard): Quote the file names.
20324 Reported by Laurent Mascherpa.
20325
14d3eb9b
AD
203262000-12-12 Akim Demaille <akim@epita.fr>
20327
20328 * src/output.c (output_headers, output_program, output): Be sure
20329 to escape special characters when outputting filenames.
20330 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20331 (output_headers): Don't depend on them, Use ACTSTR.
20332
d7045ec6
AD
203332000-11-17 Akim Demaille <akim@epita.fr>
20334
20335 * lib/obstack.h: Formatting changes.
20336 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20337 prevents type checking.
20338 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20339 cast the value to (void *): assigning a `foo *' to a `void *'
20340 variable is valid.
20341 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20342 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20343 append characters.
20344
6fd54b73
AD
203452000-11-17 Akim Demaille <akim@epita.fr>
20346
20347 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20348 as...
20349 (suite.m4, regression.m4, calc.m4): these.
20350 * tests/atgeneral.m4: Update from CVS Autoconf.
20351
4c50eae6
AD
203522000-11-17 Akim Demaille <akim@epita.fr>
20353
20354 * tests/regression.m4 (%union and --defines): New test,
20355 demonstrating a current bug in the obstack implementation.
20356
a35f64ea
AD
203572000-11-17 Akim Demaille <akim@epita.fr>
20358
20359 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20360 macros.
20361 Use them to declare the variables which are global or local to
20362 `yyparse'.
20363
7de23534
AD
203642000-11-17 Akim Demaille <akim@epita.fr>
20365
20366 * acconfig.h: Remove, no longer used.
20367
aa7815f5
AD
203682000-11-07 Akim Demaille <akim@epita.fr>
20369
20370 * src: s/Copyright (C)/Copyright/g.
20371
5af1f549
AD
203722000-11-07 Akim Demaille <akim@epita.fr>
20373
20374 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20375 defining.
20376 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20377
553e2b22
AD
203782000-11-07 Akim Demaille <akim@epita.fr>
20379
20380 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20381 Merge in a single CPP if/else.
20382
8a4f41d6
AD
203832000-11-07 Akim Demaille <akim@epita.fr>
20384
20385 * src/output.c (output): Remove useless variables.
20386 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20387 argument `data' for consistency with the prototypes.
20388 Qualify it `const'.
20389 (obstack_copy, obstack_copy0): Rename the second argument as
20390 `address' for consistency. Qualify it `const'.
20391 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20392 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20393 `const' their input argument (`data' or `address').
20394 Adjust the corresponding macros to include `const' in casts.
20395
095a3fb5
AD
203962000-11-03 Akim Demaille <akim@epita.fr>
20397
20398 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20399 s/PFILE1/BISON_HAIRY/.
20400 Adjust dependencies.
20401
d1cdce7c
AD
204022000-11-03 Akim Demaille <akim@epita.fr>
20403
090c5ebf 20404 For some reason, this was not applied.
d1cdce7c
AD
20405
20406 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20407 `unlink': it's no longer used.
20408
9311529b
AD
204092000-11-03 Akim Demaille <akim@epita.fr>
20410
20411 * src/files.c (skeleton_find): New function, eved out of...
20412 (open_files, open_extra_files): here.
20413
d8880f69
AD
204142000-11-03 Akim Demaille <akim@epita.fr>
20415
20416 Don't use `atexit'.
20417
20418 * src/files.c (obstack_save): New function.
20419 (done): Rename as...
20420 (output_files): this.
20421 Use `obstack_save'.
20422 * src/main.c (main): Don't use `atexit' to register `done', since
20423 it no longer has to remove tmp files, just call `output_files'
20424 when there are no errors.
20425
0dbb648e
AD
204262000-11-02 Akim Demaille <akim@epita.fr>
20427
20428 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20429 `unlink': it's no longer used.
20430 * src/files.h: Formatting changes.
20431
896fe5c1
AD
204322000-11-02 Akim Demaille <akim@epita.fr>
20433
20434 Remove the last uses of mktemp and unlink/delete.
20435
20436 * src/files.c (fdefines, ftable): Removed.
20437 (defines_ostack, table_obstack): New.
20438 Adjust dependencies of the former into uses of the latter.
20439 * src/output.c (output_short_or_char_table, output_short_table):
20440 Convert to using obstacks.
20441 * src/reader.c (copy_comment2): Accept one FILE * and two
20442 obstacks.
20443 (output_token_defines, reader_output_yylsp): Use obstacks.
20444 * src/system.h (obstack_fgrow3): New.
1f65350a 20445 * po/POTFILES.in: Adjust.
896fe5c1 20446
dd60faec
AD
204472000-11-01 Akim Demaille <akim@epita.fr>
20448
20449 Change each use of `fattrs' into a use of `attrs_obstack'.
20450
20451 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20452 * src/files.c (fattrs): Remove.
20453 (attrs_obstack): New.
20454 Adjust all dependencies.
20455 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20456
8c7ebe49
AD
204572000-11-01 Akim Demaille <akim@epita.fr>
20458
20459 Introduce obstacks.
20460 Change each use of `faction' into a use of `action_obstack'.
20461
20462 * lib/obstack.h, lib/obstack.c: New files.
20463 * src/files.c (faction): Remove.
20464 (action_obstack): New.
20465 Adjust all dependencies.
20466
77aee789
AD
204672000-10-20 Akim Demaille <akim@epita.fr>
20468
20469 * lib/quote.h (PARAMS): New macro. Use it.
20470
43591cec
AD
204712000-10-16 Akim Demaille <akim@epita.fr>
20472
20473 * src/output.c (output_short_or_char_table): New function.
20474 (output_short_table, output_token_translations): Use it.
20475 (goto_actions): Use output_short_table.
20476
1e9798d5
AD
204772000-10-16 Akim Demaille <akim@epita.fr>
20478
20479 * src/symtab.c (bucket_new): New function.
20480 (getsym): Use it.
20481
20482 * src/output.c (output_short_table): New argument to display the
20483 comment associated with the table.
20484 Adjust dependencies.
20485 (output_gram): Use it.
20486 (output_rule_data): Nicer output layout for YYTNAME.
20487
f282676b
AD
204882000-10-16 Akim Demaille <akim@epita.fr>
20489
20490 * src/lex.c (read_typename): New function.
20491 (lex): Use it.
20492 * src/reader.c (copy_dollar): Likewise.
20493
550a72a3
AD
204942000-10-16 Akim Demaille <akim@epita.fr>
20495
20496 * src/reader.c (copy_comment2): Expect the input stream to be on
20497 the `/' which is suspected to open a comment, instead of being
20498 called after `//' or `/*' was read.
20499 (copy_comment, copy_definition, parse_union_decl, copy_action)
20500 (copy_guard): Adjust.
20501
131e2fef
AD
205022000-10-16 Akim Demaille <akim@epita.fr>
20503
20504 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20505 `read_signed_integer'.
20506
79282c5a
AD
205072000-10-16 Akim Demaille <akim@epita.fr>
20508
20509 * src/reader.c (copy_dollar): New function.
20510 (copy_guard, copy_action): Use it.
20511
ff4a34be
AD
205122000-10-16 Akim Demaille <akim@epita.fr>
20513
20514 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20515 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20516 New files, from Fileutils 4.0.27.
20517 * src/main.c (printable_version): Remove.
20518 * src/lex.c, src/reader.c: Use `quote'.
20519
205202000-10-04 Akim Demaille <akim@epita.fr>
20521
20522 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20523
14ded682
AD
205242000-10-04 Akim Demaille <akim@epita.fr>
20525
20526 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20527
8e03724b
AD
205282000-10-04 Akim Demaille <akim@epita.fr>
20529
20530 When a literal string is used to define two different tokens,
20531 `bison -v' segfaults.
20532 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20533
20534 * tests/regression.m4: New file.
20535 Include the core of the sample provided by Piotr Gackiewicz.
20536 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20537 properly.
20538
a9e64249
AD
205392000-10-04 Akim Demaille <akim@epita.fr>
20540
20541 * src/reader.c (parse_expect_decl): Keep `count' within the size
20542 of `buffer'.
20543 From Neil Booth.
20544
da9abf43
AD
205452000-10-02 Paul Eggert <eggert@twinsun.com>
20546
20547 * bison.s1 (yyparse): Assign the default value
20548 unconditionally, to avoid a GCC warning and make the parser a
20549 tad smaller.
20550
c33638bb
AD
205512000-10-02 Akim Demaille <akim@epita.fr>
20552
20553 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20554 options.
20555
444c570a
AD
205562000-10-02 Akim Demaille <akim@epita.fr>
20557
20558 * src/derives.c, src/print.c, src/reduce.c: To ease the
20559 translation, move some `\n' out of the translated strings.
20560
89cab50d
AD
205612000-10-02 Akim Demaille <akim@epita.fr>
20562
20563 The location tracking mechanism is precious for parse error
20564 messages. Nevertheless, it is enabled only when `@n' is used in
20565 the grammar, which is a different issue (you can use it in error
20566 message, but not in the grammar per se). Therefore, there should
20567 be another means to enable it.
20568
20569 * src/getargs.c (getargs): Support `--locations'.
20570 (usage): Report it.
20571 * src/getargs.h (locationsflag): Export it.
20572 * src/lex.c (percent_table): Support `%locations'.
20573 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20574 with `locationsflag'.
20575 * doc/bison.texinfo: Document `--locations' and `%locations'.
20576 Sort the options.
20577 * tests/calc.m4: Test it.
20578
20579 For regularity of the names, replace each
20580 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20581 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20582 In addition replace each `flag' with `_flag'.
20583
d6c2cba0
AD
205842000-10-02 Akim Demaille <akim@epita.fr>
20585
20586 Also test parse error messages, including with YYERROR_VERBOSE.
20587
20588 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20589 associative).
20590 Use it to check the computations.
20591 Use it to check `nonassoc' is honored.
20592 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20593 `--yyerror-verbose'.
20594 (_AT_CHECK_CALC): Adjust to this option.
20595 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20596
5a35a6cb
AD
205972000-10-02 Akim Demaille <akim@epita.fr>
20598
20599 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20600 the latter demonstrates a flaw in the handling of non debugging
20601 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20602 was used in order to simplify:
20603
20604 #if YYDEBUG
20605 if (yydebug)
20606 {
20607 ...
20608 }
20609 #endif
20610
20611 into
20612
20613 if (yydebug)
20614 {
20615 ...
20616 }
20617
20618 unfortunately this leads to a CPP conflict when
20619 `--name-prefix=foo' is used since it produces `#define yydebug
20620 foodebug'.
20621
20622 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20623 (YYDPRINTF): New macro.
20624 Spread its use.
20625 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20626 the bison options.
20627 Also test `--verbose', `--defines' and `--name-prefix'.
20628
71da9eea
AD
206292000-10-02 Akim Demaille <akim@epita.fr>
20630
20631 Improve the readability of the produced parsers.
20632
20633 * src/bison.s1: Formatting changes.
20634 Improve the comment related to the `$' mark.
20635 (yydefault): Don't fall through to `yyresume': `goto' there.
20636 * src/output.c (output_parser): When the `$' is met, skip the end
20637 of its line.
20638 New variable, `number_of_dollar_signs', to check there's exactly
20639 one `$' in the parser skeleton.
20640
95e36146
AD
206412000-10-02 Akim Demaille <akim@epita.fr>
20642
20643 * lib/xstrdup.c: New file, from the fileutils.
20644 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20645 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20646 instead of strlen + xmalloc + strcpy.
20647 * src/symtab.c (copys): Remove, use xstrdup instead.
20648
d7020c20
AD
206492000-10-02 Akim Demaille <akim@epita.fr>
20650
20651 * src/gram.h (associativity): New enum type which replaces the
20652 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20653 `right_assoc', `left_assoc' and `non_assoc'.
20654 Adjust all dependencies.
20655 * src/reader.c: Formatting changes.
20656 (LTYPESTR): Don't define it, use it as a literal in
20657 `reader_output_yylsp'.
20658 * src/symtab.h (symbol_class): New enum type which replaces the
20659 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20660 `sunknown', `stoken and `snterm'.
20661
1916f98e
AD
206622000-10-02 Akim Demaille <akim@epita.fr>
20663
20664 * src/getargs.c (fixed_outfiles): Rename as...
20665 (yaccflag): for consistency and accuracy.
20666 Adjust dependencies.
20667
d7913476
AD
206682000-10-02 Akim Demaille <akim@epita.fr>
20669
20670 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20671 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20672 difficult and introduced a lot of core dump. It turns out that
20673 Bison used an implementation of `xmalloc' based on `calloc', and
20674 at various places it does depend upon the initialization to 0. I
20675 have not tried to isolate the pertinent places, and all the former
20676 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20677 someone should address this issue.
20678
20679 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20680 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20681 files.
20682 Adjust dependencies.
20683 * src/warshall.h: New file.
20684 Propagate.
20685
340ef489
AD
206862000-10-02 Akim Demaille <akim@epita.fr>
20687
20688 Various anti-`extern in *.c' changes.
20689
20690 * src/system.h: Include `assert.h'.
20691
b2ca4022
AD
206922000-10-02 Akim Demaille <akim@epita.fr>
20693
20694 * src/state.h (nstates, final_state, first_state, first_shift)
20695 (first_reduction): Move their exportation from here...
20696 * src/LR0.h: to here.
20697 Adjust dependencies.
20698 * src/getargs.c (statisticsflag): New variable.
20699 Add support for `--statistics'.
20700 Adjust dependencies.
20701
20702 Remove a lot of now useless `extern' statements in most files.
20703
403b315b
AD
207042000-10-02 Akim Demaille <akim@epita.fr>
20705
20706 * src/LR0.h: New file.
20707 Propagate its use.
20708
07a58c13
AD
207092000-10-02 Akim Demaille <akim@epita.fr>
20710
20711 * src/print.h: New file.
20712 Propagate its use.
20713 * src/print.c: Formatting and ordering changes.
20714 (verbose, terse): Replace with...
20715 (print_results): this new function.
20716 Adjust dependencies.
20717
0619caf0
AD
207182000-10-02 Akim Demaille <akim@epita.fr>
20719
20720 * src/conflicts.c (conflict_report): New function.
20721 (conflict_log, verbose_conflict_log): Replace with...
20722 (print_conflicts): this function.
20723 Adjust dependencies.
20724 * src/conflicts.h: New file.
20725 Propagate its inclusion.
20726
3519ec76
AD
207272000-10-02 Akim Demaille <akim@epita.fr>
20728
20729 * src/nullable.h: New file.
20730 Propagate its inclusion.
20731 * src/nullable.c: Formatting changes.
20732
015acc48
AD
207332000-10-02 Akim Demaille <akim@epita.fr>
20734
20735 * src/reduce.h: New file.
20736 Propagate its inclusion.
20737 * src/reduce.c: Topological sort and other formatting changes.
20738 (bool, TRUE, FALSE): Move their definition to...
20739 * src/system.h: here.
20740
8963a27b
AD
207412000-10-02 Akim Demaille <akim@epita.fr>
20742
20743 * src/files.c: Formatting changes.
20744 (tryopen, tryclose, openfiles): Rename as...
20745 (xfopen, xfclose, open_files): this.
20746 (stringappend): static.
20747 * src/files.h: Complete the list of exported symbols.
20748 Propagate its use.
20749
a70083a3
AD
207502000-10-02 Akim Demaille <akim@epita.fr>
20751
20752 * src/reader.h: New file.
20753 Propagate its use instead of tedious list of `extern' and
20754 prototypes.
20755 * src/reader.c: Formatting changes, topological sort,
20756 s/register//.
20757
abadc117
AD
207582000-10-02 Akim Demaille <akim@epita.fr>
20759
20760 * src/lex.h: Prototype `lex.c' exported functions.
20761 * src/reader.c: Adjust.
20762 * src/lex.c: Formatting changes.
20763 (safegetc): Rename as...
20764 (xgetc): this.
20765
720d742f
AD
207662000-10-02 Akim Demaille <akim@epita.fr>
20767
20768 * src/lalr.h: New file.
20769 Propagate its inclusion instead of prototypes and `extern'.
20770 * src/lalr.c: Formatting changes, topological sorting etc.
20771
f2acea59
AD
207722000-10-02 Akim Demaille <akim@epita.fr>
20773
20774 * src/output.c (token_actions): Introduce a temporary array,
20775 YYDEFACT, that makes it possible for this function to use
20776 output_short_table.
20777
d019d655
AD
207782000-10-02 Akim Demaille <akim@epita.fr>
20779
20780 `user_toknums' is output as a `short[]' in `output.c', while it is
20781 defined as a `int[]' in `reader.c'. For consistency with the
20782 other output tables, `user_toknums' is now defined as a table of
20783 shorts.
20784
20785 * src/reader.c (user_toknums): Be a short table instead of an int
20786 table.
20787 Adjust dependencies.
20788
20789 Factor the short table outputs.
20790
20791 * src/output.c (output_short_table): New function.
20792 * src/output.c (output_gram, output_stos, output_rule_data)
20793 (output_base, output_table, output_check): Use it.
20794
6c89f1c1
AD
207952000-10-02 Akim Demaille <akim@epita.fr>
20796
20797 * src/output.c (output): Topological sort of the functions, in
20798 order to get rid of the `static' prototypes.
20799 No longer use `register'.
20800 * src/output.h: New file.
20801 Propagate its inclusion in files explicitly prototyping functions
20802 from output.c.
20803
d9efd181
AD
208042000-09-21 Akim Demaille <akim@epita.fr>
20805
20806 * src/atgeneral.m4: Update from Autoconf.
20807
c29240e7 208082000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
20809
20810 * src/closure.h: New file.
20811 * src/closure.c: Formatting changes, topological sort over the
20812 functions, use of closure.h.
20813 (initialize_closure, finalize_closure): Rename as...
20814 (new_closure, free_closure): these. Adjust dependencies.
20815 * src/LR0.c: Formatting changes, topological sort, use of
20816 cloture.h.
20817 (initialize_states): Rename as...
20818 (new_states): this.
20819 * src/Makefile.am (noinst_HEADERS): Adjust.
20820
499daa50
AD
208212000-09-20 Akim Demaille <akim@epita.fr>
20822
20823 * src/acconfig.h: Don't protect config.h against multiple
20824 inclusion.
20825 Don't define PARAMS.
20826 * src/system.h: Define PARAMS.
20827 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20828 purpose of config.h. system.h must not try to fix wrong
20829 definitions in config.h.
20830
cc84fd5d
AD
208312000-09-20 Akim Demaille <akim@epita.fr>
20832
20833 * src/derives.h: New file.
20834 * src/main.c, src/derives.h: Use it.
20835 Formatting changes.
20836 * src/Makefile.am (noinst_HEADERS): Adjust.
20837
db5b3a89
AD
208382000-09-20 Akim Demaille <akim@epita.fr>
20839
20840 * tests/atgeneral.m4: Update from Autoconf.
20841 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20842 (AT_CHECK_CALC): New macros.
20843 Use these macros to test bison with options `', `--raw',
20844 `--debug', `--yacc', `--yacc --debug'.
20845
ceed8467
AD
208462000-09-19 Akim Demaille <akim@epita.fr>
20847
20848 * src/output.c: Formatting changes.
20849 * src/machine.h: Remove, leaving its contents in...
20850 * src/system.h: here.
20851 Include stdio.h.
20852 Adjust all dependencies on stdio.h and machine.h.
20853 * src/getargs.h: New file.
20854 Let all `extern' declarations about getargs.c be replaced with
20855 inclusion of `getargs.h'.
20856 * src/Makefile.am (noinst_HEADERS): Adjust.
20857
20858 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20859 scope.
20860 (yyerror): Returns void, not int.
20861 * doc/bison.texinfo: Formatting changes.
20862
05a1d24b
AD
208632000-09-19 Akim Demaille <akim@epita.fr>
20864
20865 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20866 portable.
20867
cbd25751
AD
208682000-09-18 Akim Demaille <akim@epita.fr>
20869
20870 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20871 * src/Makefile.am (INCLUDES): Don't.
20872 Be ready to fetch headers in lib/.
20873
13863333
AD
208742000-09-18 Akim Demaille <akim@epita.fr>
20875
20876 * doc/bison.texinfo: Update the copyright.
20877 ANSIfy and GNUify the examples.
20878 Remove the old menu.
20879
0d533154
AD
208802000-09-18 Akim Demaille <akim@epita.fr>
20881
20882 First set of tests: use the `calc' example from the documentation.
20883
20884 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20885 is defined only when YYDEBUG is.
20886 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20887 * src/files.c (tryopen, tryclose): Formatting changes.
20888 Move to the top and be static.
20889 * src/reader.c (read_signed_integer): Likewise.
20890 * tests/calc.m4: New file.
20891 * Makefile.am, suite.m4: Adjust.
20892 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20893
e79137ac
AD
208942000-09-18 Akim Demaille <akim@epita.fr>
20895
20896 Add support for an Autotest test suite for Bison.
20897
20898 * m4/m4.m4, m4/atconfig.m4: New files.
20899 * m4/Makefile.am (EXTRA_DIST): Adjust.
20900 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
20901 files.
20902 * src/getargs.c: Display a more standard --version message.
20903 * src/reader.c (reader): Formatting changes.
20904 No longer depend upon VERSION_STRING.
20905 * configure.in: No longer use `dnl'.
20906 Set up the test suite and the new directory `tests/.
20907 (VERSION_STRING): Remove.
20908
27821bff
AD
209092000-04-14 Akim Demaille <akim@epita.fr>
20910
20911 * src/reader.c (copy_comment2): New function, same as former
20912 `copy_comment', but outputs into two FILE *.
20913 (copy_comment): Use it.
20914 (parse_union_decl): Use it.
20915 (get_type, parse_start_decl): Use the same `invalid' message.
20916 (parse_start_decl, parse_union_decl): Use the same `multiple'
20917 message.
20918 (parse_union_decl, copy_guard, copy_action): Use the same
20919 `unmatched' message.
20920 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
20921
cfe5fbc0
AD
209222000-03-31 Akim Demaille <akim@epita.fr>
20923
20924 * src/files.c (tryopen, tryclose): Move to the top.
20925 Be static.
20926
cb7db13e
AD
209272000-03-31 Akim Demaille <akim@epita.fr>
20928
20929 * src/main.c (main): Don't call `done', exit does it.
20930
a0f6b076
AD
209312000-03-31 Akim Demaille <akim@epita.fr>
20932
36281465
AD
20933 * allocate.c: s/return (foo)/return foo/.
20934 * lalr.c: Likewise.
20935 * LR0.c: Likewise.
20936 * output.c: Likewise.
20937 * reader.c: Likewise.
20938 * symtab.c: Likewise.
20939 * vmsgetargs.c: Likewise.
20940
209412000-03-31 Akim Demaille <akim@epita.fr>
20942
20943 Clean up the error reporting functions.
a0f6b076
AD
20944
20945 * src/report.c: New file.
20946 * src/report.h: Likewise.
20947 * src/Makefile.am: Adjust.
20948 * m4/error.m4: New file.
20949 * m4/Makefile.am: Adjust.
20950 * configure.in (jm_PREREQ_ERROR): Call it.
20951 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
20952 Remove.
20953 (fatal, fatals): Remove. All callers use complain.c::fatal.
20954 (warn, warni, warns, warnss, warnss): Remove. All callers use
20955 complain.c::complain.
20956 (toomany): Remove, use fatal instead.
20957 * src/files.c (done): No argument, use complain_message_count.
20958 * src/main.c (main): Register `done' to `atexit'.
20959
20960 * src/getargs.c (usage): More `fputs', less `fprintf'.
20961
18539825
AD
209622000-03-28 Akim Demaille <akim@epita.fr>
20963
20964 * lib/: New directory.
20965 * Makefile.am (SUBDIRS): Adjust.
20966 * configure.in: Adjust.
20967 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
20968 useless.
20969 * src/alloca.c: Moved to lib/.
20970 * src/getopt.c: Likewise.
20971 * src/getopt1.c: Likewise.
20972 * src/getopt.h: Likewise.
20973 * src/ansi2knr.c: Likewise.
20974 * src/ansi2knr.1: Likewise.
20975 * src/Makefile.am: Adjust.
20976 * lib/Makefile.am: New file.
20977
9f306f2a
AD
209782000-03-28 Akim Demaille <akim@epita.fr>
20979
20980 * src/getargs.c (usage): Refresh the help message.
20981
0ba347b6
AD
209822000-03-17 Akim Demaille <akim@epita.fr>
20983
20984 * src/getopt1.c: Updated from textutils 2.0e
20985 * src/getopt.c: Likewise.
20986 * src/getopt.h: Likewise.
20987
dbe7f271
AD
209882000-03-17 Akim Demaille <akim@epita.fr>
20989
20990 * src/Makefile.am (bison.simple): Fix the awk program: quote only
20991 the file name, not the whole `#line LINE FILE'.
20992
75bbe78d
AD
209932000-03-17 Akim Demaille <akim@epita.fr>
20994
20995 On syntax errors, report the token on which we choked.
20996
aa5fd0ee
AD
20997 * src/bison.s1 (yyparse): In the label yyerrlab, when
20998 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 20999
7b306f52
AD
210002000-03-17 Akim Demaille <akim@epita.fr>
21001
aa5fd0ee 21002 * src/reader.c (copy_at): New function.
7b306f52
AD
21003 (copy_guard): Use it.
21004 (copy_action): Use it.
21005
e87b5700
AD
210062000-03-17 Akim Demaille <akim@epita.fr>
21007
21008 Be kind to translators, save some useless translations.
21009
aa5fd0ee 21010 * src/main.c (banner): New function.
e87b5700
AD
21011 (fatal_banner): Use it.
21012 (warn_banner): Use it.
21013
ae3c3164
AD
210142000-03-17 Akim Demaille <akim@epita.fr>
21015
aa5fd0ee
AD
21016 * src/reader.c (copy_definition): Use copy_string and
21017 copy_comment. Removed now unused `match', `ended',
21018 `cplus_comment'.
ae3c3164
AD
21019 (copy_comment, copy_string): Moved, to be visible from
21020 copy_definition.
21021
4dc58e7c
AD
210222000-03-17 Akim Demaille <akim@epita.fr>
21023
aa5fd0ee
AD
21024 * src/reader.c (copy_string): Declare `static inline'. No
21025 problems with inline, since it is checked by configure.
4dc58e7c
AD
21026 (copy_comment): Likewise.
21027
0a6384c4
AD
210282000-03-17 Akim Demaille <akim@epita.fr>
21029
aa5fd0ee 21030 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 21031
3cef001a
AD
210322000-03-17 Akim Demaille <akim@epita.fr>
21033
aa5fd0ee 21034 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
21035 (copy_action): Use it. Removed now unused `match', `ended',
21036 `cplus_comment'.
21037 (copy_guard): Likewise.
21038
ca36d2ef
AD
210392000-03-17 Akim Demaille <akim@epita.fr>
21040
aa5fd0ee 21041 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
21042 (copy_action): Use it.
21043 (copy_guard): Likewise.
21044
6666f98f
AD
210452000-03-17 Akim Demaille <akim@epita.fr>
21046
21047 Change the handling of @s so that they behave exactly like $s.
21048 There is now a pseudo variable @$ (readble and writable), location
21049 of the lhs of the rule (by default ranging from the location of
21050 the first symbol of the rhs, to the location of the last symbol,
21051 or, if the rhs is empty, YYLLOC).
21052
21053 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21054 yyval.
21055 (yyparse): When providing a default semantic action, provide a
21056 default location action.
21057 (after the $): No longer change `*YYLSP', just stack YYLOC the
21058 same way you stack YYVAL.
21059 * src/reader.c (read_declarations): Use warns.
21060 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21061 (copy_action, case '@'): Likewise.
21062 Use a standard error message, to save useless work from
21063 translators.
21064
41aca2e0
AD
210652000-03-17 Akim Demaille <akim@epita.fr>
21066
aa5fd0ee
AD
21067 * src/bison.s1: Formatting and cosmetics changes.
21068 * src/reader.c: Likewise.
41aca2e0
AD
21069 Update the Copyright notice.
21070
dc08c1d5
AD
210712000-03-17 Akim Demaille <akim@epita.fr>
21072
aa5fd0ee
AD
21073 * src/bison.s1 (#line): All set to `#line' only, since the
21074 Makefile now handles them.
dc08c1d5 21075
9ee3c97b
AD
210762000-03-16 Akim Demaille <akim@epita.fr>
21077
21078 * src/output.c (output_rule_data): Output the documentation of
21079 some of the tables.
21080 (Copyright notice): Update.
21081 Formatting changes.
21082
0de741ca
AD
210832000-03-16 Akim Demaille <akim@epita.fr>
21084
21085 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21086 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21087 One `#if YYDEBUG' remains, since it uses variables which are
21088 defined only if `YYDEBUG != 0'.
21089
bb10be54
AD
210902000-03-16 Akim Demaille <akim@epita.fr>
21091
21092 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21093 and related variables so that the similarities are highlighted.
21094
b07b484a
AD
210952000-03-16 Akim Demaille <akim@epita.fr>
21096
21097 * src/bison.s1: Properly indent CPP directives.
21098
361f60b3
AD
210992000-03-16 Akim Demaille <akim@epita.fr>
21100
21101 * src/bison.s1: Properly indent the `alloca' CPP section.
21102
8c44d3ec
AD
211032000-03-16 Akim Demaille <akim@epita.fr>
21104
21105 Do not hard code values of directories in `configure.in'.
21106 Update the `configure' tool chain.
21107
21108 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21109 src/makefile.am.
21110 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21111 (AC_OUTPUT): Add m4/Makefile.
21112 Bump to bison 1.28a, 1.29 has never been released.
21113 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21114 handled via src/Makefile.am.
21115 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21116 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21117 autoheader.
21118 * Makefile.am (SUBDIRS): Add m4.
21119 (ACLOCAL_AM_FLAGS): New variable.
21120 (AUTOMAKE_OPTIONS): Add check-news.
21121 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21122 the proper line number and file name.
21123 (DEFS): Propagate the location of bison library files and of the
21124 locale files.
21125 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21126 builddir.
21127 * acinclude.m4: Remove, replaced by the directory m4.
21128 * m4/Makefile.am (EXTRA_DIST): New variable.
21129 * m4/gettext.m4: New file, from the fileutils.
21130 * m4/lcmessage.m4: Likewise
21131 * m4/progtest.m4: Likewise.
21132 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21133
f95997e7
AD
211342000-03-10 Akim Demaille <akim@epita.fr>
21135
21136 * src/closure.c:
21137 Formatting changes of various comments.
21138 Respect the GNU coding standards at various places.
21139 Don't use `_()' when no translation is needed.
21140
211411999-12-13 Jesse Thilo <jthilo@gnu.org>
21142
21143 * src/files.c:
21144 OS/2 honors TMPDIR environment variable.
21145
211461999-12-13 Jesse Thilo <jthilo@gnu.org>
21147
21148 * doc/bison.texinfo: Tweaked spelling and grammar.
21149 Updated ISBN.
21150 Removed reference to price of printed copy.
21151 Mention BISON_SIMPLE and BISON_HAIRY.
21152
211531999-12-13 Jesse Thilo <jthilo@gnu.org>
21154
21155 * configure.in, NEWS:
21156 Bison 1.29 released.
21157
211581999-10-27 Jesse Thilo <jthilo@gnu.org>
21159
21160 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21161 Added reference card.
21162
211631999-07-26 Jesse Thilo <jthilo@gnu.org>
21164
21165 * po/ru.po: Added Russian translation.
21166
211671999-07-26 Jesse Thilo <jthilo@gnu.org>
21168
21169 * configure.in: Added Russian translation.
21170
211711999-07-06 Jesse Thilo <jthilo@gnu.org>
21172
21173 * configure.in, NEWS, README:
21174 Released version 1.28.
21175
211761999-06-14 Jesse Thilo <jthilo@gnu.org>
21177
21178 * src/system.h:
21179 Squashed redefinition warning on some systems.
21180
21181 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21182 Have configure build version string instead of relying on ANSI string
21183 concatentation.
21184
211851999-06-14 Jesse Thilo <jthilo@gnu.org>
21186
21187 * po/POTFILES.in: Got rid of version.c.
21188
211891999-06-14 Jesse Thilo <jthilo@gnu.org>
21190
21191 * acconfig.h, configure.in:
21192 Have configure build version string instead of relying on ANSI string
21193 concatentation.
21194
211951999-06-08 Jesse Thilo <jthilo@gnu.org>
21196
21197 * doc/bison.1:
21198 Dropped mention of `+' for long-named options.
21199
212001999-05-30 Jesse Thilo <jthilo@gnu.org>
21201
21202 * src/files.c: Added <unistd.h> for unlink().
21203
21204 * src/Makefile.am, src/system.h:
21205 I18n fixes.
21206
212071999-05-30 Jesse Thilo <jthilo@gnu.org>
21208
21209 * README: Added a FAQ list.
21210
21211 * configure.in, acconfig.h:
21212 I18n fixes.
21213
212141999-05-30 Jesse Thilo <jthilo@gnu.org>
21215
21216 * doc/FAQ, doc/Makefile.am:
21217 Added a FAQ list.
21218
212191999-05-19 Jesse Thilo <jthilo@gnu.org>
21220
21221 * src/alloc.h, src/symtab.h, src/version.c:
21222 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21223
212241999-04-18 Jesse Thilo <jthilo@gnu.org>
21225
21226 * src/.cvsignore, src/Makefile.am:
21227 Reorganized: sources in `src', documentation in `doc'.
21228
21229 * src/lex.c (literalchar):
21230 fixed the code for escaping double quotes (thanks
21231 Jonathan Czisny.)
21232
212331999-04-18 Jesse Thilo <jthilo@gnu.org>
21234
21235 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21236 Adjusted paths to reflect directory reorganization.
21237
212381999-04-18 Jesse Thilo <jthilo@gnu.org>
21239
21240 * doc/.cvsignore, doc/Makefile.am:
21241 Reorganized: sources in `src', documentation in `doc'.
21242
212431999-04-18 Jesse Thilo <jthilo@gnu.org>
21244
21245 * configure.in:
21246 Updated AC_INIT file to reflect directory reorganization.
21247
21248 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21249 Reorganized: sources in `src', documentation in `doc'.
21250
212511999-04-13 Jesse Thilo <jthilo@gnu.org>
21252
21253 * src/allocate.c:
21254 Don't declare calloc() and realloc() if not necessary.
21255
212561999-04-13 Jesse Thilo <jthilo@gnu.org>
21257
21258 * configure.in, acconfig.h, acinclude.m4:
21259 Don't declare calloc() and realloc() if not necessary.
21260
212611999-03-23 Jesse Thilo <jthilo@gnu.org>
21262
21263 * po/.cvsignore: Added i18n support.
21264
212651999-03-23 Jesse Thilo <jthilo@gnu.org>
21266
21267 * acconfig.h, configure.in, Makefile.am:
21268 Added i18n support.
21269
212701999-03-22 Jesse Thilo <jthilo@gnu.org>
21271
21272 * src/bison.s1: Fixed #line numbers.
21273
212741999-03-15 Jesse Thilo <jthilo@gnu.org>
21275
21276 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21277 Added PO files from Translation Project.
21278
212791999-03-03 Jesse Thilo <jthilo@gnu.org>
21280
21281 * Makefile.am:
21282 Added support for non-ANSI compilers (ansi2knr).
21283
212841999-02-16 Jesse Thilo <jthilo@gnu.org>
21285
21286 * configure.in: Bumped version number to 1.27.
21287
21288 * Makefile.am:
21289 Added `bison.simple' to list of files removed by `make distclean'.
21290
212911999-02-12 Jesse Thilo <jthilo@gnu.org>
21292
21293 * src/files.c, src/files.h:
21294 Defined locations of parser files in config.h instead of Makefile.
21295
212961999-02-12 Jesse Thilo <jthilo@gnu.org>
21297
21298 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21299 Defined locations of parser files in config.h instead of Makefile.
21300
213011999-02-09 Jesse Thilo <jthilo@gnu.org>
21302
21303 * Makefile.am:
21304 Removed inappropriate use of $< macro.
21305
213061999-02-05 Jesse Thilo <jthilo@gnu.org>
21307
21308 * po/Makefile.in.in, po/POTFILES.in:
21309 Add `po' directory skeleton.
21310
213111999-01-27 Jesse Thilo <jthilo@gnu.org>
21312
21313 * README: Document help-bison list.
21314
21315 * configure.in: Add check for mkstemp().
21316
213171999-01-20 Jesse Thilo <jthilo@gnu.org>
21318
21319 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21320 Hush a few compiler warnings.
21321
21322 * src/files.c:
21323 Add tryclose(), which verifies that fclose was successful.
21324 Hush a couple of compiler warnings.
21325
213261999-01-20 Jesse Thilo <jthilo@gnu.org>
21327
21328 * Makefile.am, OChangeLog:
21329 ChangeLog is now automatically generated. Include the old version as
21330 OChangeLog.
21331
213321999-01-14 Jesse Thilo <jthilo@gnu.org>
21333
21334 * 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:
21335 Update FSF address.
21336
213371999-01-14 Jesse Thilo <jthilo@gnu.org>
21338
21339 * doc/bison.texinfo: Fix formatting glitch.
21340
21341 * doc/bison.texinfo: Update FSF address.
21342
213431999-01-14 Jesse Thilo <jthilo@gnu.org>
21344
21345 * acconfig.h: Update FSF address.
21346
213471999-01-08 Jesse Thilo <jthilo@gnu.org>
21348
21349 * src/system.h:
21350 Don't define PACKAGE here, since config.h defines it.
21351
213521998-12-30 Jesse Thilo <jthilo@gnu.org>
21353
21354 * src/reader.c: Update copyright date.
21355
21356 * src/main.c:
21357 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21358 favor of output directly to stderr (avoids buffer overruns).
21359
21360 * src/reader.c: Some checks for premature EOF.
21361
21362 * 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:
21363 Use prototypes if the compiler understands them.
21364
21365 * src/files.c: Honor TMPDIR on Unix hosts.
21366 Use prototypes if the compiler understands them.
21367
21368 * src/reader.c:
21369 Fix a couple of buffer overrun bugs.
21370 Use prototypes if the compiler understands them.
21371
21372 * src/system.h: Include unistd.h and ctype.h.
21373 Use #ifdef instead of #if for NLS symbols.
21374
213751998-12-30 Jesse Thilo <jthilo@gnu.org>
21376
21377 * doc/bison.texinfo:
21378 Delete comment "consider using @set for edition number, etc..." since
21379 we now are doing so.
21380
213811998-12-30 Jesse Thilo <jthilo@gnu.org>
21382
21383 * configure.in:
21384 Use prototypes if the compiler understands them.
21385
21386 * NEWS: Document 1.26 highlights.
21387
21388 * Makefile.am: Require Automake 1.3 or later.
21389
21390 * acconfig.h:
21391 Use prototypes if the compiler understands them.
21392
213931998-12-29 Jesse Thilo <jthilo@gnu.org>
21394
21395 * src/version.c:
21396 Use VERSION symbol from automake for version number.
21397
213981998-12-29 Jesse Thilo <jthilo@gnu.org>
21399
21400 * acconfig.h, configure.in, version.cin:
21401 Use VERSION symbol from automake for version number.
21402
214031998-11-28 Jesse Thilo <jthilo@gnu.org>
21404
21405 * Makefile.am:
21406 Distribute original version of simple parser (bison.s1), not built
21407 version (bison.simple).
21408
214091998-11-28 Jesse Thilo <jthilo@gnu.org>
21410
21411 * doc/bison.texinfo: Add info dir entry.
21412
21413 * doc/bison.texinfo:
21414 Let automake put version number into documentation.
21415
214161998-11-26 Jesse Thilo <jthilo@gnu.org>
21417
21418 * src/bison.cld, src/build.com, src/vmshlp.mar:
21419 Add non-RCS files from /gd/gnu/bison.
21420
214211998-11-26 Jesse Thilo <jthilo@gnu.org>
21422
21423 * doc/bison.1:
21424 Document the BISON_HAIRY and BISON_SIMPLE variables.
21425
214261998-11-25 Jesse Thilo <jthilo@gnu.org>
21427
21428 * src/version.c: Build version.c automatically.
21429
21430 * src/reader.c:
21431 Fix token numbering (used to start at 258, not 257).
21432
21433 * src/system.h: Include config.h.
21434
21435 * src/getargs.c: Update bug report address.
21436
21437 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21438 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21439
214401998-11-25 Jesse Thilo <jthilo@gnu.org>
21441
21442 * Makefile.am:
21443 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21444
21445 * configure.in, version.cin:
21446 Build version.c automatically.
21447
21448 * AUTHORS: Add AUTHORS file.
21449
21450 * README: Update bug report address.
21451
21452 * bison.simple:
21453 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21454
21455 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21456 Add automake stuff.
21457
214581998-11-25 Jesse Thilo <jthilo@gnu.org>
21459
21460 * doc/bison.texinfo: Clean up some formatting.
21461
214621998-05-05 Richard Stallman <rms@gnu.org>
21463
21464 * doc/bison.texinfo:
21465 Explain better why to make a pure parser.
21466
214671998-01-05 Richard Stallman <rms@gnu.org>
21468
21469 * src/files.c (openfiles):
21470 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21471 find a temporary directory, if possible. Do not unlink files while
21472 they are open.
21473
214741997-08-25 Richard Stallman <rms@gnu.org>
21475
21476 * src/reader.c (stack_offset;):
21477 Change some warni to warns.
21478
21479 * src/lex.c (literalchar): Use warns, not warni.
21480
214811997-06-28 Richard Stallman <rms@gnu.org>
21482
21483 * src/bison.s1: Add a Bison version comment.
21484
21485 * src/main.c (fatal, warn, berror):
21486 Use program_name.
21487
214881997-06-28 Richard Stallman <rms@gnu.org>
21489
21490 * Makefile.in (bison_version): New variable.
21491 (dist): Use that variable.
21492 (bison.s1): Substitute the Bison version into bison.simple.
21493
21494 * bison.simple: Add a Bison version comment.
21495
214961997-06-18 Richard Stallman <rms@gnu.org>
21497
21498 * src/main.c (fatal, warn, berror):
21499 Make error messages standard.
21500 (toomany): Improve error message text.
21501
21502 * 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:
21503 new.h renamed to alloc.h.
21504
215051997-06-18 Richard Stallman <rms@gnu.org>
21506
21507 * Makefile.in: new.h renamed to alloc.h.
21508
215091997-05-24 Richard Stallman <rms@gnu.org>
21510
21511 * src/lex.c (literalchar):
21512 Fix the code for escaping \, " and '.
21513
21514 (lex): Avoid trouble when there are many chars
21515 to discard in a char literal with just several chars in it.
21516
215171997-05-17 Richard Stallman <rms@gnu.org>
21518
21519 * src/bison.s1:
21520 Use malloc, if using alloca is troublesome.
21521 (YYSTACK_USE_ALLOCA): New flag macro.
21522 Define it for some systems and compilers.
21523 (YYSTACK_ALLOC): New macro.
21524 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21525 If it was malloc'd, free it.
21526
215271997-05-17 Richard Stallman <rms@gnu.org>
21528
21529 * bison.simple:
21530 Use malloc, if using alloca is troublesome.
21531 (YYSTACK_USE_ALLOCA): New flag macro.
21532 Define it for some systems and compilers.
21533 (YYSTACK_ALLOC): New macro.
21534 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21535 If it was malloc'd, free it.
21536
215371997-04-23 Richard Stallman <rms@gnu.org>
21538
21539 * src/bison.s1:
21540 (alloca) [__hpux]: Always define as __builtin_alloca.
21541
215421997-04-23 Richard Stallman <rms@gnu.org>
21543
21544 * bison.simple:
21545 (alloca) [__hpux]: Always define as __builtin_alloca.
21546
215471997-04-22 Richard Stallman <rms@gnu.org>
21548
21549 * src/bison.s1:
21550 [__hpux]: Include alloca.h (right for HPUX 10)
21551 instead of declaring alloca (right for HPUX 9).
21552
21553 * src/bison.s1 (__yy_memcpy):
21554 Declare arg `count' as unsigned int.
21555 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21556
215571997-04-22 Richard Stallman <rms@gnu.org>
21558
21559 * bison.simple:
21560 [__hpux]: Include alloca.h (right for HPUX 10)
21561 instead of declaring alloca (right for HPUX 9).
21562
21563 * bison.simple (__yy_memcpy):
21564 Declare arg `count' as unsigned int.
21565 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21566
215671997-01-03 Richard Stallman <rms@gnu.org>
21568
21569 * src/allocate.c: [__STDC__ or _MSC_VER]:
21570 Declare calloc and realloc to return void *.
21571
215721997-01-02 Richard Stallman <rms@gnu.org>
21573
21574 * src/system.h:
21575 [_MSC_VER]: Include stdlib.h and process.h.
21576 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21577
21578 * src/main.c (main): Return FAILURE as a value.
21579 (printable_version): Declare arg as int, not char.
21580
215811997-01-02 Richard Stallman <rms@gnu.org>
21582
21583 * Makefile.in (dist):
21584 Explicitly check for symlinks, and copy them.
21585
215861996-12-19 Richard Stallman <rms@gnu.org>
21587
21588 * src/files.c:
21589 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21590
215911996-12-18 Paul Eggert <eggert@gnu.org>
21592
21593 * src/bison.s1 (yyparse):
21594 If __GNUC__ and YYPARSE_PARAM are both defined,
21595 declare yyparse to have a void * argument.
21596
215971996-12-18 Paul Eggert <eggert@gnu.org>
21598
21599 * bison.simple (yyparse):
21600 If __GNUC__ and YYPARSE_PARAM are both defined,
21601 declare yyparse to have a void * argument.
21602
216031996-12-17 Richard Stallman <rms@gnu.org>
21604
21605 * src/reduce.c (nbits): Add some casts.
21606
216071996-08-12 Richard Stallman <rms@gnu.org>
21608
21609 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21610
216111996-08-12 Richard Stallman <rms@gnu.org>
21612
21613 * bison.simple: Test _MSDOS as well as _MSDOS_.
21614
216151996-07-31 Richard Stallman <rms@gnu.org>
21616
21617 * src/bison.s1:
21618 [__sun && __i386]: Include alloca.h.
21619
216201996-07-31 Richard Stallman <rms@gnu.org>
21621
21622 * bison.simple:
21623 [__sun && __i386]: Include alloca.h.
21624
216251996-07-30 Richard Stallman <rms@gnu.org>
21626
21627 * src/bison.s1: Comment change.
21628
21629 * src/bison.s1: Test _MSDOS_, not MSDOS.
21630
216311996-07-30 Richard Stallman <rms@gnu.org>
21632
21633 * bison.simple: Comment change.
21634
21635 * bison.simple: Test _MSDOS_, not MSDOS.
21636
216371996-06-01 Richard Stallman <rms@gnu.org>
21638
21639 * 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:
21640 Insert `_' macro around many string constants.
21641
21642 * src/main.c:
21643 Insert `_' macro around many string constants.
21644
21645 (main): Call setlocale, bindtextdomain and textdomain.
21646
21647 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21648 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21649 [ENABLE_NLS]: Include libintl.h.
21650 [ENABLE_NLS] (gettext): Define.
21651 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21652 (N_, PACKAGE, LOCALEDIR): New macros.
21653
216541996-06-01 Richard Stallman <rms@gnu.org>
21655
21656 * POTFILES.in: New file.
21657
21658 * Makefile.in (allocate.o):
21659 Define target explicitly.
21660
21661 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21662 (LDFLAGS): Set to @LDFLAGS@.
21663 (configure): Run autoconf only if preceding `cd' succeeds.
21664 (bison.s1): Redirect output to temporary file then move the
21665 temporary to the target, rather than redirecting directly to bison.s1.
21666 (clean): Remove config.status and config.log.
21667 (distclean): Don't remove config.status here.
21668
216691996-05-12 Richard Stallman <rms@gnu.org>
21670
21671 * src/bison.s1:
21672 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21673
216741996-05-12 Richard Stallman <rms@gnu.org>
21675
21676 * bison.simple:
21677 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21678
216791996-05-11 Richard Stallman <rms@gnu.org>
21680
21681 * src/bison.s1 (__yy_memcpy):
21682 Really reorder the args, as was supposedly done on Feb 14 1995.
21683 (yyparse): Calls changed accordingly.
21684
216851996-05-11 Richard Stallman <rms@gnu.org>
21686
21687 * Makefile.in (dist): Don't use $(srcdir).
21688
21689 * bison.simple (__yy_memcpy):
21690 Really reorder the args, as was supposedly done on Feb 14 1995.
21691 (yyparse): Calls changed accordingly.
21692
216931996-01-27 Richard Stallman <rms@gnu.org>
21694
21695 * src/output.c (output_rule_data):
21696 Test YYERROR_VERBOSE in the conditional
21697 around the definition of ttyname.
21698
216991995-12-29 Richard Stallman <rms@gnu.org>
21700
21701 * src/bison.s1:
21702 Fix line numbers in #line commands.
21703
217041995-12-29 Richard Stallman <rms@gnu.org>
21705
21706 * bison.simple:
21707 Fix line numbers in #line commands.
21708
217091995-12-27 Richard Stallman <rms@gnu.org>
21710
21711 * src/bison.s1 (YYPARSE_PARAM_DECL):
21712 In C++, make it always null.
21713 (YYPARSE_PARAM_ARG): New macro.
21714 (yyparse): Use YYPARSE_PARAM_ARG.
21715
217161995-12-27 Richard Stallman <rms@gnu.org>
21717
21718 * bison.simple (YYPARSE_PARAM_DECL):
21719 In C++, make it always null.
21720 (YYPARSE_PARAM_ARG): New macro.
21721 (yyparse): Use YYPARSE_PARAM_ARG.
21722
217231995-11-29 Richard Stallman <rms@gnu.org>
21724
21725 * doc/bison.texinfo:
21726 Describe literal string tokens, %raw, %no_lines, %token_table.
21727
217281995-11-29 Daniel Hagerty <hag@gnu.org>
21729
21730 * doc/bison.texinfo: Fixed update date
21731
217321995-10-16 Richard Stallman <rms@gnu.org>
21733
21734 * src/version.c: Version 1.25.
21735
217361995-10-16 Richard Stallman <rms@gnu.org>
21737
21738 * NEWS: *** empty log message ***
21739
217401995-10-16 Richard Stallman <rms@gnu.org>
21741
21742 * doc/bison.1, doc/bison.rnh:
21743 Add new options.
21744
217451995-10-15 Richard Stallman <rms@gnu.org>
21746
21747 * src/vmsgetargs.c, src/getargs.c:
21748 Added -n, -k, and -raw switches.
21749 (noparserflag, toknumflag, rawtoknumflag): New variables.
21750
21751 * src/symtab.h (SALIAS):
21752 New #define for adding aliases to %token.
21753 (struct bucket): Added `alias' field.
21754
21755 * src/reduce.c (reduce_grammar):
21756 Revise error message.
21757 (print_notices): Remove final `.' from error message.
21758
21759 * src/reader.c (reader_output_yylsp):
21760 New function.
21761 (readgram): Use `#if 0' around code that accepted %command
21762 inside grammar rules: The documentation doesn't allow it,
21763 and it will fail since the %command processors scan for the next %.
21764 (parse_token_decl): Extended the %token
21765 declaration to allow a multi-character symbol as an alias.
21766 (parse_thong_decl): New function.
21767 (read_declarations): Added %thong declarations.
21768 (read_declarations): Handle NOOP to deal with allowing
21769 % declarations as another means to specify the flags.
21770 (readgram): Allow %prec prior to semantics embedded in a rule.
21771 (skip_to_char, read_declarations, copy_definition)
21772 (parse_token_decl, parse_start_decl, parse_type_decl)
21773 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21774 (get_type_name, copy_guard, copy_action, readgram)
21775 (get_type, packsymbols): Revised most error messages.
21776 Changed `fatal' to `warnxxx' to avoid aborting for error.
21777 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21778 (read_declarations): Improve the error message for
21779 an invalid character. Do not abort.
21780 (read_declarations, copy_guard, copy_action): Use
21781 printable_version to avoid unprintable characters in printed output.
21782 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21783 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21784 Allow the type of a non-terminal can be given
21785 more than once, as long as all specifications give the same type.
21786
21787 * src/output.c:
21788 (output_headers, output_trailers, output, output_gram)
21789 (output_rule_data): Implement noparserflag variable.
21790 Implement toknumflag variable.
21791 (output): Call reader_output_yylsp to output LTYPESTR.
21792
21793 * src/main.c (main):
21794 If reader sees an error, don't process the grammar.
21795 (fatals): Updated to not use VARARGS1.
21796 (printable_version, int_to_string, warn, warni, warns, warnss)
21797 (warnsss): New error reporting functions. Avoid abort for error.
21798
21799 * src/lex.h:
21800 Added THONG and NOOP for alias processing.
21801 Added SETOPT for the new code that allows setting options with %flags.
21802
21803 * src/lex.c:
21804 Include getopt.h. Add some extern decls.
21805 (safegetc): New function to deal with EOF gracefully.
21806 (literalchar); new function to deal with reading \ escapes.
21807 (lex): Use literalchar.
21808 (lex): Implemented "..." tokens.
21809 (literalchar, lex, parse_percent_token): Made tokenbuffer
21810 always contain the token. This includes growing the token
21811 buffer while reading an integer.
21812 (parse_percent_token): Replaced if-else statement with percent_table.
21813 (parse_percent_token): Added % declarations as another
21814 way to specify the flags -n, -l, and -r. Also added hooks for
21815 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21816 major changes to files.c.
21817 (lex) Retain in the incoming stream a character following
21818 an incorrect '/'.
21819 (skip_white_space, lex): Revised most error messages
21820 and changed fatal to warn to avoid aborting.
21821 (percent_table): Added %thong declarations.
21822
21823 * src/gram.h: Comment changes.
21824
21825 * src/files.c (openfiles, open_extra_files, done):
21826 Add faction flag
21827 and actfile file. Handle noparserflag. Both for -n switch.
21828
21829 * src/conflicts.c (resolve_sr_conflict):
21830 Remove use of alloca.
21831
218321995-06-01 Jim Meyering <meyering@gnu.org>
21833
21834 * doc/bison.texinfo: *** empty log message ***
21835
218361995-05-06 Richard Stallman <rms@gnu.org>
21837
21838 * src/bison.s1: Comment change.
21839
218401995-05-06 Richard Stallman <rms@gnu.org>
21841
21842 * bison.simple: Comment change.
21843
218441995-05-03 Richard Stallman <rms@gnu.org>
21845
21846 * src/version.c: Version now 1.24.
21847
21848 * src/bison.s1: Change distribution terms.
21849
21850 * src/version.c: Version now 1.23.
21851
218521995-05-03 Richard Stallman <rms@gnu.org>
21853
21854 * doc/bison.texinfo:
21855 Rewrite "Conditions for Using Bison".
21856 Update version to 1.24.
21857
218581995-05-03 Richard Stallman <rms@gnu.org>
21859
21860 * bison.simple: Change distribution terms.
21861
218621995-02-23 Richard Stallman <rms@gnu.org>
21863
21864 * src/files.c: Test __VMS_POSIX as well as VMS.
21865
218661995-02-14 Jim Meyering <meyering@gnu.org>
21867
21868 * src/bison.s1 (__yy_memcpy):
21869 Renamed from __yy_bcopy to avoid
21870 confusion. Reverse FROM and TO arguments to be consistent with
21871 those of memcpy.
21872
218731995-02-14 Jim Meyering <meyering@gnu.org>
21874
21875 * bison.simple (__yy_memcpy):
21876 Renamed from __yy_bcopy to avoid
21877 confusion. Reverse FROM and TO arguments to be consistent with
21878 those of memcpy.
21879
218801994-11-10 David J. MacKenzie <djm@gnu.org>
21881
21882 * NEWS: reformat
21883
21884 * NEWS: New file.
21885
21886 * Makefile.in (DISTFILES): Include NEWS.
21887
21888 * Makefile.in (DISTFILES):
21889 Include install-sh, not install.sh.
21890
21891 * configure.in: Update to Autoconf v2 macro names.
21892
218931994-10-05 David J. MacKenzie <djm@gnu.org>
21894
21895 * Makefile.in: fix typo
21896
21897 * Makefile.in (prefix, exec_prefix):
21898 Let configure set them.
21899
219001994-09-28 David J. MacKenzie <djm@gnu.org>
21901
21902 * Makefile.in: Set datadir to $(prefix)/share.
21903
219041994-09-15 Richard Stallman <rms@gnu.org>
21905
21906 * src/bison.s1:
21907 Update copyright notice and GPL version.
21908
219091994-09-15 Richard Stallman <rms@gnu.org>
21910
21911 * bison.simple:
21912 Update copyright notice and GPL version.
21913
219141994-07-12 Richard Stallman <rms@gnu.org>
21915
21916 * src/reduce.c, src/reader.c:
21917 entered into RCS
21918
219191994-05-05 David J. MacKenzie <djm@gnu.org>
21920
21921 * Makefile.in: entered into RCS
21922
219231994-03-26 Richard Stallman <rms@gnu.org>
21924
21925 * src/bison.s1: entered into RCS
21926
219271994-03-26 Richard Stallman <rms@gnu.org>
21928
21929 * bison.simple: entered into RCS
21930
219311994-03-25 Richard Stallman <rms@gnu.org>
21932
21933 * src/main.c: entered into RCS
21934
219351994-03-24 Richard Stallman <rms@gnu.org>
21936
21937 * src/conflicts.c: entered into RCS
21938
219391994-01-02 Richard Stallman <rms@gnu.org>
21940
21941 * Makefile.in: *** empty log message ***
21942
219431993-11-21 Richard Stallman <rms@gnu.org>
21944
21945 * src/bison.s1: *** empty log message ***
21946
219471993-11-21 Richard Stallman <rms@gnu.org>
21948
21949 * doc/bison.texinfo: entered into RCS
21950
21951 * doc/bison.texinfo: *** empty log message ***
21952
219531993-11-21 Richard Stallman <rms@gnu.org>
21954
21955 * bison.simple: *** empty log message ***
21956
219571993-10-25 David J. MacKenzie <djm@gnu.org>
21958
21959 * doc/bison.texinfo: *** empty log message ***
21960
219611993-10-19 Richard Stallman <rms@gnu.org>
21962
21963 * src/bison.s1: *** empty log message ***
21964
219651993-10-19 Richard Stallman <rms@gnu.org>
21966
21967 * bison.simple: *** empty log message ***
21968
219691993-10-14 Richard Stallman <rms@gnu.org>
21970
21971 * src/bison.s1: *** empty log message ***
21972
219731993-10-14 Richard Stallman <rms@gnu.org>
21974
21975 * bison.simple: *** empty log message ***
21976
219771993-09-14 David J. MacKenzie <djm@gnu.org>
21978
21979 * doc/bison.texinfo: *** empty log message ***
21980
219811993-09-13 Noah Friedman <friedman@gnu.org>
21982
21983 * Makefile.in: *** empty log message ***
21984
219851993-09-10 Richard Stallman <rms@gnu.org>
21986
21987 * src/conflicts.c: *** empty log message ***
21988
21989 * src/system.h: entered into RCS
21990
219911993-09-10 Richard Stallman <rms@gnu.org>
21992
21993 * doc/bison.1: entered into RCS
21994
219951993-09-06 Noah Friedman <friedman@gnu.org>
21996
21997 * src/version.c: entered into RCS
21998
219991993-09-06 Noah Friedman <friedman@gnu.org>
22000
22001 * Makefile.in: *** empty log message ***
22002
220031993-07-30 David J. MacKenzie <djm@gnu.org>
22004
22005 * Makefile.in: *** empty log message ***
22006
220071993-07-24 Richard Stallman <rms@gnu.org>
22008
22009 * src/bison.s1: *** empty log message ***
22010
220111993-07-24 Richard Stallman <rms@gnu.org>
22012
22013 * bison.simple: *** empty log message ***
22014
220151993-07-08 David J. MacKenzie <djm@gnu.org>
22016
22017 * Makefile.in: *** empty log message ***
22018
220191993-07-04 Richard Stallman <rms@gnu.org>
22020
22021 * src/bison.s1: *** empty log message ***
22022
220231993-07-04 Richard Stallman <rms@gnu.org>
22024
22025 * bison.simple: *** empty log message ***
22026
220271993-06-26 David J. MacKenzie <djm@gnu.org>
22028
22029 * src/getargs.c: entered into RCS
22030
220311993-06-26 David J. MacKenzie <djm@gnu.org>
22032
22033 * doc/bison.texinfo: *** empty log message ***
22034
22035 * doc/bison.1: New file.
22036
220371993-06-25 Richard Stallman <rms@gnu.org>
22038
22039 * src/getargs.c: New file.
22040
220411993-06-16 Richard Stallman <rms@gnu.org>
22042
22043 * src/bison.s1: *** empty log message ***
22044
220451993-06-16 Richard Stallman <rms@gnu.org>
22046
22047 * bison.simple: *** empty log message ***
22048
220491993-06-03 Richard Stallman <rms@gnu.org>
22050
22051 * src/bison.s1: New file.
22052
220531993-06-03 Richard Stallman <rms@gnu.org>
22054
22055 * doc/bison.texinfo: *** empty log message ***
22056
220571993-06-03 Richard Stallman <rms@gnu.org>
22058
22059 * bison.simple: New file.
22060
220611993-05-19 Richard Stallman <rms@gnu.org>
22062
22063 * doc/bison.texinfo: New file.
22064
220651993-05-07 Noah Friedman <friedman@gnu.org>
22066
22067 * Makefile.in: *** empty log message ***
22068
220691993-04-28 Noah Friedman <friedman@gnu.org>
22070
22071 * src/reader.c: *** empty log message ***
22072
220731993-04-23 Noah Friedman <friedman@gnu.org>
22074
22075 * src/alloc.h: entered into RCS
22076
220771993-04-20 David J. MacKenzie <djm@gnu.org>
22078
22079 * src/version.c: *** empty log message ***
22080
22081 * src/files.c, src/allocate.c:
22082 entered into RCS
22083
22084 * src/reader.c: *** empty log message ***
22085
22086 * src/lex.c: entered into RCS
22087
22088 * src/conflicts.c: New file.
22089
22090 * src/symtab.c: entered into RCS
22091
22092 * src/alloc.h: New file.
22093
22094 * src/LR0.c: entered into RCS
22095
220961993-04-18 Noah Friedman <friedman@gnu.org>
22097
22098 * src/reader.c: New file.
22099
22100 * src/version.c: *** empty log message ***
22101
221021993-04-18 Noah Friedman <friedman@gnu.org>
22103
22104 * Makefile.in: *** empty log message ***
22105
221061993-04-17 Noah Friedman <friedman@gnu.org>
22107
22108 * Makefile.in: *** empty log message ***
22109
221101993-04-15 Richard Stallman <rms@gnu.org>
22111
22112 * src/main.c, src/files.c:
22113 New file.
22114
221151993-04-15 Noah Friedman <friedman@gnu.org>
22116
22117 * configure.in: entered into RCS
22118
22119 * configure.in: *** empty log message ***
22120
22121 * configure.in: New file.
22122
221231993-04-14 Richard Stallman <rms@gnu.org>
22124
22125 * Makefile.in: New file.
22126
221271993-04-13 Richard Stallman <rms@gnu.org>
22128
22129 * src/version.c: New file.
22130
221311993-03-25 Richard Stallman <rms@gnu.org>
22132
22133 * src/output.c: entered into RCS
22134
221351992-09-25 Richard Stallman <rms@gnu.org>
22136
22137 * configure.bat: entered into RCS
22138
221391992-06-22 Richard Stallman <rms@gnu.org>
22140
22141 * src/vmsgetargs.c: entered into RCS
22142
221431992-06-22 Richard Stallman <rms@gnu.org>
22144
22145 * doc/bison.rnh: entered into RCS
22146
221471992-04-20 David J. MacKenzie <djm@gnu.org>
22148
22149 * README: entered into RCS
22150
221511992-01-22 Richard Stallman <rms@gnu.org>
22152
22153 * src/machine.h: entered into RCS
22154
221551991-12-21 Richard Stallman <rms@gnu.org>
22156
22157 * src/lalr.c, src/closure.c:
22158 entered into RCS
22159
221601991-12-20 Richard Stallman <rms@gnu.org>
22161
22162 * src/state.h: entered into RCS
22163
221641991-12-18 Richard Stallman <rms@gnu.org>
22165
22166 * src/print.c, src/nullable.c, src/derives.c:
22167 entered into RCS
22168
221691991-11-03 David J. MacKenzie <djm@gnu.org>
22170
22171 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22172 entered into RCS
22173
221741988-09-09 Richard Stallman <rms@gnu.org>
22175
22176 * src/bison.hairy: entered into RCS
22177
221781987-12-16 Richard Stallman <rms@gnu.org>
22179
22180 * REFERENCES: entered into RCS
dc546b0f 22181
f294a2c2 22182
04098407 22183 -----
f294a2c2 22184
04098407 22185 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
f490771b
JD
22186 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
22187 2007, 2008, 2009 Free Software Foundation, Inc.
f294a2c2 22188
04098407
PE
22189 Copying and distribution of this file, with or without
22190 modification, are permitted provided the copyright notice and this
22191 notice are preserved.