]> git.saurik.com Git - bison.git/blame - ChangeLog
doc: fixes.
[bison.git] / ChangeLog
CommitLineData
c33bc800
AD
12009-08-19 Akim Demaille <demaille@gostai.com>
2
3 doc: fixes.
4 * doc/bison.texinfo: Fix minor Texinfo errors.
5
8fbbeba2
AD
62009-08-19 Akim Demaille <demaille@gostai.com>
7
8 doc: %initial-action to initialize yylloc.
9 Reported by Bill Allombert.
10 * doc/bison.texinfo: Set fill-column to 76.
11 (Location Type): Document the use of %initial-action to initialize
12 yylloc.
13
1874a474
JD
142009-08-18 Joel E. Denny <jdenny@clemson.edu>
15
16 maint: update for gnulib's recent update-copyright changes
17 * gnulib: Update.
18 * .x-update-copyright (COPYING): Add as it's no longer implied
19 when .x-update-copyright is present.
20 * cfg.mk (update-copyright-local): Remove, now ignored.
21 (update-copyright): Declare update-b4-copyright as a dependency.
22
f4bfd5a9
AD
232009-08-17 Akim Demaille <demaille@gostai.com>
24
25 build: require gettext 0.17.
26
27 Suggested by Bruno Haible.
28 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
29 * configure.ac: require gettext 0.17 to ensure compatibility with
30 gnulib.
31
2509eba6
AD
322009-08-17 Akim Demaille <demaille@gostai.com>
33
34 build: lower gettext requirements.
35
36 Bison was uselessly requiring the formatstring macros from
37 gettext, which resulted in mo files not being installed on systems
38 that perfectly supported Bison mo files. Lower the requirement.
39 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
40
41 * configure.ac: Require need-ngettext instead of
42 need-formatstring-macros.
43 Reported by Martin Jabocs.
44 Suggested by Bruno Haible.
45 * INSTALL: Restructure.
46 (Internationalization): New.
47
314542f9
JD
482009-08-14 Joel E. Denny <jdenny@clemson.edu>
49
50 maint: fix use of copyright year intervals.
51 * gnulib: Update.
52 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
53 as now recommended in gnulib/NEWS.
54 * build-aux/update-b4-copyright: Fix.
55 * cfg.mk (update-copyright-env): Configure update-copyright.
56
24985964
JD
572009-08-13 Joel E. Denny <jdenny@clemson.edu>
58
59 Make it easier to write deterministic tests.
60 Continues Akim's work from his 2009-06-10 commits.
61 * src/reader.c (check_and_convert_grammar): Don't add any
62 symbols after the first symbols_do invocation.
63 * src/symtab.c (symbols_sorted): New static global.
64 (user_token_number_redeclaration): Update comments.
65 (symbol_from_uniqstr): If a new symbol is being created, assert
66 that symbols_sorted hasn't been allocated yet.
67 (symbols_free): Free symbols_sorted.
68 (symbols_cmp, symbols_cmp_qsort): New functions.
69 (symbols_do): Sort symbol_table into symbols_sorted on first
70 invocation.
71 * tests/input.at (Numbered tokens): Recombine tests now that the
72 output should be deterministic across multiple numbers.
73
47076da5
AD
742009-08-12 Akim Demaille <demaille@gostai.com>
75
76 distcheck: fix.
77
78 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
79
36dfe466
JD
802009-08-10 Joel E. Denny <jdenny@clemson.edu>
81
82 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
83
07c0db18
JD
842009-08-10 Joel E. Denny <jdenny@clemson.edu>
85
86 Miscellaneous code readability improvements.
87
88 * src/reader.c (reader): Move %define front-end variable
89 defaults and checking into...
90 (prepare_percent_define_front_end_variables): ... this new
91 function.
92
93 * src/scan-gram.l (INITIAL): For consistency with string
94 literals, don't store open quote on character literal. It's
95 discarded before returning anyway.
96 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
97 Make length test more readable, and make the character stored
98 for an empty literal more obvious while consistent with the
99 previous behavior.
100
101 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
102 USER_NUMBER_HAS_STRING_ALIAS throughout.
103 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
104 that is repeated in symtab.h. Improve argument names to make it
105 clear which side of the symbol-string alias pair is which.
106 (symbol_check_alias_consistency): Improve local variable names
107 for the same purpose.
108 * src/symtab.h (struct symbol): Make comments about aliases
109 clearer.
110 (symbol_make_alias): Improve comments and argument name.
111 * src/output.c (token_definitions_output): Update for rename to
112 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
113
1a323c2f
AR
1142009-08-08 Alex Rozenman <rozenman@gmail.com>
115
116 Convert "misleading reference" messages to warnings.
117 * src/scan-code.l: New function 'show_sub_messages', more
118 factoring.
119 * tests/named-ref.at: Adjust tests.
120
38609c34
JD
1212009-08-06 Joel E. Denny <jdenny@clemson.edu>
122
123 maint: run "make update-copyright"
124
642f240e
JD
1252009-08-06 Joel E. Denny <jdenny@clemson.edu>
126
127 maint: make update-b4-copyright easier to use
128 * build-aux/update-b4-copyright: In warnings, report line
129 numbers rather than character positions.
130 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
131 that update-copyright runs it.
132 * gnulib: Update.
133
d0caad01
JD
1342009-08-05 Joel E. Denny <jdenny@clemson.edu>
135
136 maint: clean up update-b4-copyright code
137 * build-aux/update-b4-copyright: Do not accept 2-digit
138 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
139 Don't accept a `[' in a b4_copyright argument.
140 Format code more consistently.
141 Don't assume b4*copyright never occurs.
142
ac2def56
JD
1432009-08-04 Joel E. Denny <jdenny@clemson.edu>
144
145 maint: automate b4_copyright updates.
146 * Makefile.am (update-b4-copyright): New target rule.
147 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
148 * build-aux/update-b4-copyright: New.
149 * data/yacc.c: Remove stray characters around b4_copyright
150 invocations.
151
dbbb64f0
JD
1522009-08-04 Joel E. Denny <jdenny@clemson.edu>
153
154 maint: automate annual package-wide copyright-year update.
155 * .x-update-copyright: New.
156 * Makefile.am (EXTRA_DIST): Remove maint.mk.
157 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
158 update-copyright. Remove gnumakefile, which is implied by
159 maintainer-makefile.
160 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
161 * gnulib: Update.
162 * maint.mk: Remove, now copied from gnulib.
163 * examples/extexi: Add missing "(C)" in copyright statement so
164 update-copyright can recognize it.
165 * src/LR0.h: Likewise.
166 * src/print.h: Likewise.
167 * src/print_graph.h: Likewise.
168 * src/gram.c: Add missing comma in copyright statement.
169 * src/gram.h: Likewise.
170
bfa018d4
JD
1712009-08-04 Joel E. Denny <jdenny@clemson.edu>
172
173 Fix "make distcheck".
174 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
175 of just calc.stamp.
176
4521fcdf
JD
1772009-08-01 Joel E. Denny <jdenny@clemson.edu>
178
179 Pacify "gcc -Wunused" for the input function from Flex.
180 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
181 and later.
182 * src/scan-code.l: Add "%option noinput", which I cannot find in
183 the Flex manual, but which Flex has supported since at least as
184 far back as 2.5.4. However, if any of our developers still use
185 Flex 2.5.4, they'll need to stop configuring with
186 --enable-gcc-warnings because "%option noinput" didn't work
187 correctly until Flex 2.5.6.
188 * src/scan-gram.l: Likewise.
189 * src/scan-skel.l: Likewise.
190
992e874a
AR
1912009-07-31 Alex Rozenman <rozenman@gmail.com>
192
193 Fix --enable-gcc-warnings problems.
194 * src/reader.c: Adjust variable names.
195 * src/scan-code.l: Fix prototypes and adjust names.
196 * src/named-ref.c: Remove redundant "if".
197
a1ed2b71
JD
1982009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
199
200 Fix a --enable-gcc-warnings problem.
201 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
202 variable.
203
cbc6a70e 2042009-07-24 Alex Rozenman <rozenman@gmail.com>
1e20ad11
AR
205
206 Fix some memory leaks.
207 * src/named-ref.c: Add a pointer check (named_ref_free).
208 * src/scan-code.l: New function (variant_table_free). Called in
209 code_scanner_free.
210 * src/symlist.c: Call to named_ref_free (symbol_list_free).
211
ac9b0e95
JD
2122009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
213
214 Warn about character literals not of length one.
215 * NEWS (2.5): Document.
216 * src/scan-gram.l (INITIAL): Remove comment that we don't check
217 the length.
218 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
219 * tests/input.at (Bad character literals): New test group.
220
2de160e1
JD
2212009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
222
223 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
224
cba97506
JD
2252009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
226
227 Some M4 cleanup in the testsuite.
228 Suggested by Eric Blake at
229 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
230 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
231 complicate the code by distinguishing between a missing value
232 and an empty string value for an optional argument. This fix is
233 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
234 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
235 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
236 arguments are not needed because of the following changes.
237 Fix stale comments.
238 Bison developers should use GNU M4 and should not use
239 POSIXLY_CORRECT when building the test suite, so do not
240 complicate the code by avoiding $10 and above.
241 Do not quote an empty string value for an optional argument, and
242 do not distinguish between a missing value and an empty string
243 value.
244
62eb2d1b
JD
2452009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
246
247 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
248
620b2e36
JD
2492009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
250
251 Revert unnecessary column realignment in --help output.
252 Reported by Akim Demaille at
253 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
254 * src/getargs.c (usage): Here.
255
cbc6a70e 2562009-07-04 Alex Rozenman <rozenman@gmail.com>
dad6544d
AR
257
258 Alphabetical order in src/Makefile.am.
259 * src/Makefile.am: Adjust.
260
cbc6a70e 2612009-07-04 Alex Rozenman <rozenman@gmail.com>
d5e8574b
AR
262
263 Style changes and factoring.
264 * src/named-ref.h: Add comments.
265 * src/parse-gram.y: Readability and style changes.
266 * src/reader.c: Factoring: assign_named_ref function.
267 * src/scan-code.l: Factoring and style changes. Rename
268 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
269 Use "unsigned" type for variant index. Improve readablity.
270 * src/scan-gram.l: Change error messages and add comments.
271 * src/symlist.h: symbol_list_null: New function decl.
272 * src/symlist.c: symbol_list_null: Implement here.
273 * tests/named-refs.at: Adjust for new error messages.
274
ae09ec85
EB
2752009-06-29 Eric Blake <ebb9@byu.net>
276
277 scan-code: avoid compiler warnings
278 * src/scan-code.l (parse_named_ref): Use correct specifiers.
279
80d653fd
AD
2802009-06-29 Akim Demaille <demaille@gostai.com>
281
282 build: avoid concurrent extraction of calc++.
283 * examples/calc++/Makefile.am (calc.stamp): New.
284 Depend on it to create the sources of calc++ so that concurrent
285 builds don't launch several "extexi" in parallel.
286 Not only this is inefficient, this also builds incorrect sources
287 with several extractions mixed together.
288
7685e2f7
AR
2892009-06-27 Alex Rozenman <rozenman@gmail.com>
290
291 Implement support for named symbol references.
292 * src/parse-gram.y: Add new syntax (named_ref.opt).
293 * src/reader.c: Store named refs in symbol lists.
294 * src/reader.h: New argument for symbol_append and
295 action_append functions.
296 * src/scan-code.h: Add new field (named_ref) into
297 code_props data structure. Keeps named ref of midrule
298 actions.
299 * src/scan-code.l: Support for named refs in semantic
300 action code. New function 'parse_named_ref'.
301 * src/scan-gram.l: Support bracketed id.
302 * src/symlist.c: Store named refs in symbol lists.
303 * src/symlist.h: New field in symbol list: named_ref.
304 * src/named-ref.h: New file, a struct for named_ref.
305 * src/named-ref.cp: New file, named_ref_new function.
306 * src/local.mk: Add two new files.
307 * tests/testsuite.at: Include new test group:
308 * tests/named-refs.at: this new file.
309
67f8cf51
AD
3102009-06-25 Akim Demaille <demaille@gostai.com>
311
312 hash: check insertion for memory exhaustion.
313 * src/uniqstr.c (uniqstr_new): New.
314
83b66ddd
AD
3152009-06-11 Akim Demaille <demaille@gostai.com>
316
317 style changes.
318 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
319 * src/print-xml.c: Style changes.
320 * tests/conflicts.at: Comment changes.
321
517cb0ad
AD
3222009-06-11 Akim Demaille <demaille@gostai.com>
323
324 xml: beware of user strings used to give a %prec to rules.
325 * tests/conflicts.at (%prec with user strings): New.
326 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
327 XML output.
328
75c7a52a
AD
3292009-06-11 Akim Demaille <demaille@gostai.com>
330
331 hash: check insertion for memory exhaustion.
332 * src/muscle-tab.c (muscle_insert, muscle_grow)
333 * src/state.c (state_hash_insert): Check the return value of
334 hash_insert.
335
66ed9753
AD
3362009-06-10 Akim Demaille <demaille@gostai.com>
337
338 deterministic test suite.
339 Some consistency checks on symbols are performed after all the
340 symbols were read, by an iteration over the symbol table. This
341 traversal is nondeterministic, which can be a problem for test
342 cases.
343 Avoid this.
344 Addresses another form of nondeterminism reported by Joel E. Denny.
345 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
346
347 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
348 test in two.
349 Use different file names for the three tests to make the
350 maintenance easier.
351
ed15d907
AD
3522009-06-10 Akim Demaille <demaille@gostai.com>
353
95d176ff
AD
354 deterministic user-token-number redeclaration errors.
355 Address nondeterminism reported by Joel E. Denny.
356 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
357
358 * src/uniqstr.h: Comment changes.
359 * src/location.h (boundary_cmp, location_cmp): New.
360 * src/symtab.c (user_token_number_redeclaration): New.
361 (symbol_translation): Use it.
362 * tests/input.at (Numbered tokens): Adjust the expected output.
363
3642009-05-25 Akim Demaille <demaille@gostai.com>
365
ed15d907
AD
366 gnulib: update.
367 * gnulib: Update to latest.
368 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
369 * m4/.gitignore: Regen.
370 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
371 Call xalloc_die on hash_insert failures.
372 Requested by the new __warn_unused_result__ attribute of
373 hash_insert.
374
e3a33f7c
JD
3752009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
376
377 Convert multiple variable definition warnings to complaints.
378 * NEWS (2.5): Add a new entry for that change.
379 * doc/bison.texinfo (Decl Summary): Update %define entry.
380 (Bison Options): Update -D/--define/-F/--force-define entry.
381 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
382 * src/muscle_tab.h (muscle_percent_define_insert): Update
383 comments.
384 * tests/input.at (`%define errors'): Update.
385 (`%define, --define, --force-define'): Update.
386
34d41938
JD
3872009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
388
389 -F/--force-define and relative %define/-D/--define priorities.
390 * NEWS (2.5): Add documentation to -D/--define entry.
391 * build-aux/cross-options.pl: Hard-code association of
392 --force-define with %define.
393 * doc/bison.texinfo (Decl Summary): In %define entry,
394 cross-reference command-line options.
395 (Bison Options): Add documentation to -D/--define entry.
396 (Option Cross Key): Widen column for --force-define row.
397 * src/getargs.c (usage): Document -F/--force-define. Realign
398 options in output.
399 (short_options, long_options, getargs): Parse -F/--force-define,
400 and update muscle_percent_define_insert invocation.
401 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
402 (muscle_percent_define_insert): Add argument with that type.
403 * src/muscle_tab.c (muscle_percent_define_insert): Implement
404 -F/--force-define behavior and priorities.
405 * src/parse-gram.y (prologue_declaration): Update
406 muscle_percent_define_insert invocations.
407 * tests/input.at (`%define, --define'): Rename to...
408 (`%define, --define, --force-define'): ... this and extend.
409
246c4efa
JD
4102009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
411
412 Update some comments to make sense for -D.
413 * data/bison.m4 (b4_check_user_names): In header comments, say
414 "user occurrence" instead of "grammar occurrence".
415 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
416 (muscle_percent_code_grow): Likewise just for consistency.
417
531683e7
JD
4182009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
419
420 * data/c++.m4: Update copyright year.
421
e7bfa8b7
JD
4222009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
423
424 * data/c++.m4 (b4_namespace_close): Simplify slightly.
425
8c221795
JD
4262009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
427
428 Handle a trailing `:' in a user-supplied C++ namespace better.
429 * data/c++.m4 (b4_namespace_close): Don't let it be printed
430 among the closing braces here. This fix might make the
431 generated code easier to debug, but otherwise it should be
432 insignificant because a trailing `:' is a C++ error already.
433
c8bf65f0
AD
4342009-05-19 Akim Demaille <demaille@gostai.com>
435
436 remove useless variable.
437 * src/getargs.c (skeleton_arg): Remove now useless variable.
438 Should help the compiler see that this printf-like call is sane.
439
7ac45a46
AD
4402009-05-11 Akim Demaille <demaille@gostai.com>
441
442 doc: use C++ headers.
443 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
444 headers.
445
601bdfab
AD
4462009-05-05 Akim Demaille <demaille@gostai.com>
447
448 fix hexadecimal token number support.
449 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
450
d19123e6
AD
4512009-05-05 Akim Demaille <demaille@gostai.com>
452
453 tests: check token numbers.
454 * tests/input.at (Numbered tokens): New.
455
ecdfea9a
AD
4562009-05-04 Akim Demaille <demaille@gostai.com>
457
458 bison: catch bad symbol names.
459 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
460 * tests/input.at: Adjust.
461
43e6aea5
AD
4622009-05-04 Akim Demaille <demaille@gostai.com>
463
464 space changes.
465 * src/scan-gram.l: Untabify to be robust to zealous editors.
466
c046698e
AD
4672009-05-04 Akim Demaille <demaille@gostai.com>
468
469 identifiers: dashes are letters.
470 Dashes can now start identifiers (symbols and directives).
b10dd689 471
c046698e
AD
472 * src/scan-gram.l ({letter}): Add dash.
473 ({id}): Remove it.
474 * tests/input.at (Symbols): Adjust.
475 Remove stray comment.
476 * tests/regression.at (Invalid inputs): Adjust error message.
477 * doc/bison.texinfo (Symbols): Update.
478
966aba65
JD
4792009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
480
481 Declare %code to be a permanent feature.
482 * NEWS (2.4.2): Here.
483 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
484 experimental.
485 (Decl Summary): Likewise.
486
812775a0
JD
4872009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
488
489 Convert underscores to dashes in some %define variable names.
490 For now, just api.push-pull and lr.keep-unreachable-states.
491 Maintain old names for backward compatibility.
492 * NEWS (2.5): Document.
493 * data/c.m4 (b4_identification): Update comment.
494 * data/yacc.c: Update access.
495 * doc/bison.texinfo: Update.
496 * etc/bench.pl.in (bench_grammar): Update use.
497 * src/files.c (tr): Move to...
498 * src/getargs.c, src/getargs.h (tr): ... here because I can't
499 think of a better place to expose it. My logic is that, for all
500 uses of tr so far, command-line arguments can be involved, and
501 getargs.h is already included.
502 * src/main.c (main): Update access.
503 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
504 variable names to new variable names before assigning value.
505 * src/reader.c (reader): Update setting default.
506 * tests/calc.at: Update uses.
507 * tests/conflicts.at (Unreachable States After Conflict
508 Resolution): Update use.
509 * tests/input.at (%define enum variables): Update use.
510 (%define backward compatibility): New test group.
511 * tests/push.at: Update uses.
512 * tests/reduce.at: Update uses.
513 * tests/torture.at: Update uses.
514
1c4aa81d
JD
5152009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
516
517 Set all front-end %define defaults in one place.
518 * src/main.c (main): Move lr.keep_unreachable_states default...
519 * src/reader.c (reader): ... to here.
520
1d0f55cc
JD
5212009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
522
523 Rename lr.default_reductions to lr.default-reductions.
524 * NEWS (2.5): Here.
525 * doc/bison.texinfo: Here.
526 * src/lalr.c (initialize_LA): Here.
527 * src/print.c (print_reductions): Here.
528 * src/reader.c (reader): Here.
529 * src/tables.c (action_row): Here.
530 * tests/input.at (%define enum variables): Here.
531 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
532
0b593457
JD
5332009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
534
535 Pacify ./configure --enable-gcc-warnings.
536 * tests/input.at (Symbols): Prototype yyerror and yylex.
537
0939aa2d
AD
5382009-04-21 Akim Demaille <demaille@gostai.com>
539
540 tests: check the use of dashes and periods in symbols.
541 * tests/input.at (Symbol): New test group.
542
0b593457 5432009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
ae618dcc
JD
544
545 Document how `%define "var" "value"' is not M4-friendly.
546 * src/parse-gram.y (variable): In comments here.
547
0b593457 5482009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
6789b8bd
JD
549
550 Add copyright updates missed during previous cherry pick.
551 * src/output.c: Here.
552 * src/parse-gram.y: Here.
553 * src/scan-gram.l: Here.
554
663ce7bb
AD
5552009-04-20 Akim Demaille <demaille@gostai.com>
556
557 variables: accept dashes.
558 * src/scan-gram.l ({id}): Also accept dashes after the initial
559 letter.
560 ({directive}): Use {id}.
561 * src/parse-gram.y: Comment and formatting changes.
562 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
563 symbols.
564 * src/complain.h, src/complain.c (yacc_at): New.
565 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
566 symbol names.
567 * src/output.c (token_definitions_output): Do not #define token
568 names with dashes.
569
379261b3
JD
5702009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
571
572 Clean up recent patches a little.
573 Reported by Akim Demaille.
574 * doc/bison.texinfo (Understanding): Fix typos.
575 * src/print.c (print_reductions): Don't use negated variable.
576
25029e16
JD
5772009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
578
579 List accepted values for a %define enum variable with an invalid value.
580 Suggested by Akim Demaille at
581 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
582 * data/bison.m4 (_b4_percent_define_check_values): Implement.
583 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
584 * tests/input.at (%define lr.default_reductions invalid values): Merge
585 into...
586 (%define enum variables): ... here, and update output.
587
620b5727
JD
5882009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
589
590 Rename "default rule" to "default reduction".
591 This includes changing variable names in code, changing
592 comments, and renaming %define lr.default_rules to %define
593 lr.default_reductions.
594 * NEWS (2.5): Update IELR documentation.
595 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
596 Adjust YYDEFACT and yydefact_ documentation.
597 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
598 and lr.type documentation. Make some other wording
599 improvements.
600 (Glossary): Adjust cross-references and Default Reduction
601 definition.
602 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
603 Remove a confusing comment pointed out by Akim Demaille.
604 (initialize_LA): Adjust code.
605 * src/print-xml.c (print_reductions): Adjust code.
606 * src/print.c (print_reductions): Adjust code.
607 * src/reader.c (reader): Adjust code.
608 * src/tables.c (action_row): Adjust code.
609 (token_actions): Adjust code.
610 * src/tables.h: Adjust YYDEFACT documentation.
611 * tests/input.at (%define lr.default_rules invalid values):
612 Rename test group to...
613 (%define lr.default_reductions invalid values): ... this, and
614 update grammar file and expected output.
615 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
616 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
617
34a6c2d1
JD
6182009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
619
620 Document %define lr.type and lr.default_rules.
621 * NEWS (2.5): Add an entry.
622 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
623 besides just LALR(1) and GLR(1).
624 * doc/bison.texinfo (Introduction): Likewise.
625 (Language and Grammar): Bison is no longer limited to LALR(1)
626 restrictions.
627 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
628 when trying to distinguish from GLR. Talk about LR(1) grammars
629 rather than LALR(1) grammars.
630 (Decl Summary): In %define api.push_pull entry, say it applies
631 to deterministic parsers in C rather than LALR(1) parsers in C.
632 Add lr.default_rules entry.
633 Add lr.type entry.
634 (Mystery Conflicts): Bison is no longer limited to LALR(1)
635 restrictions.
636 (Generalized LR Parsing): Same changes as for the previous GLR
637 section.
638 (Memory Management): Say deterministic rather than LALR(1).
639 (Understanding): Correct some bison output.
640 Index discussion of "accepting state".
641 Say deterministic rather than LALR(1).
642 (Bison Options): In --yacc entry, say deterministic rather than
643 LALR(1).
644 In --report, --graph, and --xml entries, just don't mention
645 LALR(1).
646 (C++ Parsers): Say deterministic rather than LALR(1).
647 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
648 (Glossary): Add Accepting State, Consistent State, Default Rule,
649 and IELR(1) definitions.
650 In Generalized LR (GLR) definition, make same changes as in
651 previous GLR sections.
652 In LALR(1) definition, say Bison uses LALR(1) by default rather
653 than implying Bison is limited to LALR(1).
654 (LocalWords): Add IELR.
655
f805dfcb
JD
6562009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
657
658 Finish implementing %define lr.type.
659 Its value can be "LALR", "IELR", or "canonical LR".
660 * lib/timevar.def (TV_IELR_PHASE1): New var.
661 (TV_IELR_PHASE2): New var.
662 (TV_IELR_PHASE3): New var.
663 (TV_IELR_PHASE4): New var.
664 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
665 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
666 Sbitset.h, ielr.h, and ielr.c.
667 * src/getargs.h, src/getargs.c (enum trace, trace_args,
668 trace_types): Add trace_ielr.
669 * src/lalr.h, src/lalr.c (ngotos): Export it.
670 (F): Rename to...
671 (goto_follows): ... this, update all uses, and export it.
672 (set_goto_map): Export it.
673 (map_goto): Export it.
674 (compute_lookahead_tokens): Don't free goto_follows yet. Now
675 handled in ielr.
676 (initialize_LA): Export it. Move lookback allocation to...
677 (lalr): ... here because, for canonical LR, initialize_LA must
678 be invoked but lookback and much of the rest of LALR isn't
679 needed.
680 * main.c (main): Instead of lalr, invoke ielr, which invokes
681 lalr.
682 * src/reader.c (reader): Default lr.type to "LALR".
683 Default lr.default_rules to "accepting" if lr.type is "canonical
684 LR". Leave the default as "all" otherwise.
685 Check for a valid lr.type value.
686 * src/state.h, src/state.c (struct state_list): Add state_list
687 member.
688 (state_new): Initialize state_list member to NULL.
689 (state_new_isocore): New function, exported.
690 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
691 exercises all values of lr.type.
692 (GNU AWK Grammar): Rename test group to...
693 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
694 AT_TEST_EXISTING_GRAMMAR.
695 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
696 (GNU pic Grammar): Rename test group to...
697 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
698 AT_TEST_EXISTING_GRAMMAR.
699 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
700 all values of lr.type.
701 (Single State Split): New test groups using AT_TEST_LR_TYPE.
702 (Lane Split): Likewise.
703 (Complex Lane Split): Likewise.
704 (Split During Added Lookahead Propagation): Likewise.
705
166366b2
JD
7062009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
707
708 Add new files for IELR and canonical LR implementation.
709 * src/AnnotationList.c: New.
710 * src/AnnotationList.h: New.
711 * src/InadequacyList.c: New.
712 * src/InadequacyList.h: New.
713 * src/Sbitset.c: New.
714 * src/Sbitset.h: New.
715 * src/ielr.c: New.
716 * src/ielr.h: New.
717
03c07b03
JD
7182009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
719
720 Implement %define lr.default_rules.
721 Its value describes the states that are permitted to contain
722 default rules: "all", "consistent", or "accepting".
723 * src/reader.c (reader): Default lr.default_rules to "all".
724 Check for a valid lr.default_rules value.
725 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
726 is "accepting", then only mark the accepting state as
727 consistent.
728 (initialize_LA): Tell state_lookahead_tokens_count whether
729 lr.default_rules is "accepting".
730 * src/tables.c (action_row): If lr.default_rules is not "all",
731 then disable default rules in inconsistent states.
732 * src/print.c (print_reductions): Use this opportunity to
733 perform some assertions about whether lr.default_rules was
734 obeyed correctly.
735 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
736 helps with checking the parser tables for a grammar.
737 * tests/input.at (%define lr.default_rules invalid values): New
738 test group.
739 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
740 AT_TEST_TABLES_AND_PARSE.
741 (`no %define lr.default_rules'): New test group generated by
742 AT_TEST_LR_DEFAULT_RULES.
743 (`%define lr.default_rules "all"'): Likewise.
744 (`%define lr.default_rules "consistent"'): Likewise.
745 (`%define lr.default_rules "accepting"'): Likewise.
746
44c124a3
AD
7472009-04-20 Akim Demaille <demaille@gostai.com>
748
749 Consistently refer to Yacc, not YACC.
750 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
751
42660736
JD
7522009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
753
754 Pacify make maintainer-check-posix.
755 * tests/input.at (%define, --define): Move bison command-line
756 options before grammar file name.
757
a2d05674
JD
7582009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
759
760 Document semicolon warnings.
761 * NEWS (2.5): Here.
762
c4fae1ef
AD
7632008-12-08 Akim Demaille <demaille@gostai.com>
764
765 Fix portability issue in the test suite.
766 * tests/local.at (AT_MATCHES_CHECK): New.
767 Based on Perl instead of Sed. Sed has too many portability
768 pitfalls, not ever Sed is GNU Sed.
769 * tests/actions.at (Fix user actions without a trailing semicolon):
770 Use it.
771
42f4393a
DJ
7722008-12-07 Di-an Jan <dianj@freeshell.org>
773
774 Implement the FIXME that ends an user action with a semicolon
775 if it seems necessary.
776 * src/scan-code.l (flex rules section): Flag cpp directive from
777 any `#' to the first unescaped end-of-line. Semicolon is not
778 needed after `;', `{', '}', or cpp directives and is needed after
779 any other token (whitespaces and comments have no effect).
780 * tests/actions.at (Fix user actions without a trailing semicolon):
781 New test.
782 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
783 to make user actions complete statements.
784 Adjust column numbers in error messages.
785 * tests/regression.at (Fix user actions without a trailing semicolon):
786 Remove. Covered by new test.
787
bd5df716
AD
7882009-04-14 Akim Demaille <demaille@gostai.com>
789
790 doc: minor fixes.
791 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
792 (Table of Symbols): Remove duplicate entry for %debug.
793
7ba0d59d
EB
7942009-04-10 Eric Blake <ebb9@byu.net>
795
796 submodules: update to latest
797 * submodules/autoconf: Use latest upstream Autoconf.
798
b4d71a96
EB
7992009-04-06 Eric Blake <ebb9@byu.net>
800
801 Work around autoconf 2.63b bug in testsuite.
802 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
803 autoconf bug related to # in test.
804
4ecd3681
JD
8052009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
806
807 * NEWS (2.5): Describe new -D/--define feature.
808
c65e5292
AD
8092008-11-10 Akim Demaille <demaille@gostai.com>
810
811 --trace=muscles
812 * src/getargs.h, src/getargs.c (trace_muscle): New.
813 (trace_types, trace_args): Support it.
814 * src/output.c (output_skeleton): Use it.
815
96002de2
AD
8162008-11-10 Akim Demaille <demaille@gostai.com>
817
818 muscles_output.
819 * src/output.c (muscles_output): New, extracted from...
820 (output_skeleton): here.
821 Adjust.
822
fadb13b5
AD
8232008-11-21 Akim Demaille <demaille@gostai.com>
824
825 Display the changes in cross-options.texi.
826 * build-aux/cross-options.pl ($sep): New, to separate items.
827 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
828 the changes.
829
72183df4
DJ
8302008-11-20 Di-an Jan <dianj@freeshell.org>
831
832 Improves options in the manual.
833 * doc/bison.texinfo (-g, -x): Add space before argument.
834 (Option Cross Key): Implement FIXME: listing directives also.
835 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
836 (Short Option): Special case -d. Put arguments inside @option.
fadb13b5 837 (Bison Directive): Add column, automatically extracted from
72183df4
DJ
838 src/scan-gram.l (actual name passed as the first argument)
839 with special case for %define.
840 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
841 to build-aux/cross-options.pl.
842 * src/getargs.c (usage): Document limitations of cross-options.pl.
843 * src/scan-gram.l: Likewise.
844
e80b068c
AD
8452009-02-25 Akim Demaille <demaille@gostai.com>
846
847 Copyright years.
848 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
849
e3ee30b8
AD
8502008-12-08 Akim Demaille <demaille@gostai.com>
851
852 Install autoconf as a submodule to get m4sugar.
853 * .gitmodules: Add submodules/autoconf.
854 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
855 submodules/autoconf.
856
c4eb1e84
JD
8572008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
858
859 Simplify last patch slightly.
860 * src/getargs.c (getargs): Here.
861
10fa0146
JD
8622008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
863
864 Fix last warning from --enable-gcc-warnings.
865 * src/getargs.c (getargs): Don't assign const address to non-const
866 pointer.
867
6f5be1ab
DJ
8682008-11-17 Di-an Jan <dianj@freeshell.org>
869
870 Handle --enable-gcc-warnings.
871 * src/getargs.c (command_line_location): Set parameters to void.
872
11c4e57d
AD
8732008-11-11 Akim Demaille <demaille@gostai.com>
874
875 AT_FULL_COMPILE.
876 * tests/actions.at, tests/regression.at: Use it.
877
e186a284
AD
8782008-11-07 Akim Demaille <demaille@gostai.com>
879
880 Pass command line location to skeleton_arg and language_argmatch.
881 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
882 The location argument is now mandatory.
883 Adjust all dependencies.
884 (getargs): Use command_line_location.
885
e14c6831
AD
8862008-11-07 Akim Demaille <demaille@gostai.com>
887
888 -D, --define.
889 * src/getargs.c (usage): Document -D.
890 Fix help string for --locations.
891 (command_line_location): New.
892 (short_options, long_options, getargs): Support -D, --define.
893 (getargs): Move -d support at the right place.
894 * doc/bison.texinfo (Bison Options): Update.
895 * tests/input.at (%define, --define): New.
896
75c21b61
AD
8972008-11-07 Akim Demaille <demaille@gostai.com>
898
899 Initialize the muscle table before parsing the command line.
900 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
901 (getargs): Define file_name.
902 * src/main.c (main): Initialize muscle_tab before calling
903 getargs.
904 * src/muscle_tab.c (muscle_init): No longer define file_name, as
905 its value is not available yet.
906
33d2a860
AD
9072008-11-09 Akim Demaille <demaille@gostai.com>
908
909 Require the generation of parse-gram.output.
910 * src/Makefile.am (YACC): Pass --report=all.
911
006faedf
JD
9122009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
913
914 * NEWS (2.5): New stub.
915
ecd1b61c
JD
9162009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
917
918 Fix options documentation.
919 * build-aux/cross-options.pl: As in --help output, write optional
920 arguments as [=ARG] not =[ARG].
921 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
922
f67c4037
AD
9232008-11-07 Akim Demaille <demaille@gostai.com>
924
925 Fix --help.
926 * src/getargs.c (usage): Fix help string for -W.
927
0213d651
AD
9282008-11-07 Akim Demaille <demaille@gostai.com>
929
930 Handle more general types of option arguments.
931 * build-aux/cross-options.pl: The argument ends at the first
932 space, not the first non-symbol character.
933 Use @var for each word appearing the argument description.
934
c19178bf
JD
9352009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
936
937 Remove spurious initial empty lines.
938 * data/location.cc: End the @output lines with an @.
939
0d2b2ab0
AD
9402008-11-04 Akim Demaille <demaille@gostai.com>
941
942 Remove spurious initial empty lines.
943 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
944 * data/yacc.c: End the @output lines with an @.
945
8ba62e3e
JD
9462009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
947
948 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
949 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
950 requirements for a correct m4 are stricter.
951 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
952 * configure.ac: Update to use AC_PROG_GNU_M4.
953 Reported by Eric Blake.
954
5bc993d9
JD
9552009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
956
957 Help with updating web manual.
958 * HACKING: Incorporate instructions from gnulib/doc/README.
959 * bootstrap.conf (gnulib_modules): Add gendocs.
960
580c075d
JD
9612009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
962
963 Fix strange %define locations for default values.
964 Reported by Akim Demaille at
965 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
966 and discussed again starting at
967 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
968 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
969 because location information is bogus.
970 Use angle brackets to delimit fake file name because square brackets
971 look like underexpanded m4. Choose a better fake file name.
972 Use negative line numbers.
973 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
974 * src/location.c (location_print): If line for a boundary is negative,
975 only print that boundary's file name.
976 * src/location.h: Document that.
977 * tests/skeletons.at (%define Boolean variables: invalid skeleton
978 defaults): Update output.
979
5d3a1ecb
AD
9802008-11-07 Akim Demaille <demaille@gostai.com>
981
982 Locations without columns for command line arguments.
983 * src/location.c (location_print): Don't display negative columns.
984 * src/location.h: Document this.
985
015e86a7
JD
9862009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
987
988 Add reminder about uploading public key to keys.gnupg.net.
989 * HACKING (Release Procedure): Here.
990
c1455bab
AD
9912009-03-31 Akim Demaille <demaille@gostai.com>
992
993 bootstrap: --help to stdout.
994 * bootstrap (usage): Don't send --help to stderr.
995 Use a here doc instead of a long string.
996
2075a82a
AD
9972009-03-31 Akim Demaille <demaille@gostai.com>
998
999 bootstrap: README-hacking no longer exists
1000 * bootstrap (checkout_only_file): Set to HACKING.
1001
26fccd4d
AD
10022009-03-26 Akim Demaille <demaille@gostai.com>
1003
1004 doc: merge HACKING and README-hacking.
1005 Two files is confusing.
1006 Reported by Alexandre Duret-Lutz.
5bc993d9 1007
26fccd4d
AD
1008 * README-hacking: Merge into...
1009 * HACKING (Working from the repository): here.
1010
6469c4d7
AD
10112009-03-26 Akim Demaille <demaille@gostai.com>
1012
1013 doc: update README-hacking.
1014 * README-hacking: We now use git and git submodules.
1015 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1016
b328890a
AD
10172009-03-26 Akim Demaille <demaille@gostai.com>
1018
1019 lalr1.cc: avoid GCC 4.3 warnings.
1020 GCC 4.3 now warns about "a || b && c" and asks for explicit
1021 parentheses.
1022 Reported by Alexandre Duret-Lutz.
1023 * data/location.cc: Update copyright years.
1024 (Position::operator==): Use parens to make precedence explicit.
1025 Compare lines and columns first, as they are more likely to be
1026 different, and they are faster to compare.
1027
f3079439
AD
10282009-03-26 Akim Demaille <demaille@gostai.com>
1029
1030 gnulib: update.
1031 * gnulib: Update to latest.
1032 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
1033 use +=.
1034
8defe11b
AD
10352009-01-08 Akim Demaille <demaille@gostai.com>
1036
1037 Fix grep portability issues.
1038 Grep on Solaris does not support -q.
1039 Reported by Summum Bonum.
5bc993d9 1040
8defe11b
AD
1041 * NEWS: Add a stub for 2.4.2.
1042 * THANKS: Add Summum Bonum.
1043 * tests/atlocal.in (EGREP): New.
1044 (CC, CXX, XSLTPROC): Make it possible to override them via
1045 envvars.
1046 * tests/java.at: Use $EGREP instead of egrep.
1047 Use AT_CHECK's ignore instead of grep's -q.
1048
41930e7a
JD
10492008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1050
1051 Version 2.4.1.
1052 * NEWS: Set version and date.
1053 * lib/Makefile.am: Update copyright year.
1054 * tests/atlocal.in: Update copyright year.
1055
d07932ef
JD
10562008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1057
1058 Semicolon feature removal is not about future language support.
1059 * NEWS: The semicolon feature is no longer active for newer languages,
1060 so don't claim that it causes trouble for them.
1061
0364b334
JD
10622008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1063
1064 * gnulib: Update submodule to HEAD.
1065
876fd835
AD
10662008-12-09 Akim Demaille <demaille@gostai.com>
1067
1068 Update data/README.
1069 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1070
bee1df15
EB
10712008-12-05 Eric Blake <ebb9@byu.net>
1072
1073 Build testsuite with newer autoconf.
1074 * tests/output.at (m4_expand): Don't override in newer autoconf,
1075 where the underlying implementation changed.
1076 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1077 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1078 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1079 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1080 since some of them contain unbalanced ')'.
1081
7e6d1e22
JD
10822008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1083
1084 * NEWS: Clarify a little.
1085
a957d06c
JD
10862008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1087
1088 * NEWS: Update for recent changes.
1089
462503f8
JD
10902008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1091
1092 Fix unexpanded macros in GLR defines file.
1093 Reported by Csaba Raduly at
1094 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1095 * THANKS (Csaba Raduly): Add.
1096 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1097 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1098 lexer in a separate module that includes the defines file.
1099 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
1100 source.
1101 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1102 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1103 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1104 (AT_DATA_SOURCE_PROLOGUE): New.
1105 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1106 (AT_DATA_SOURCE): New.
1107 (AT_FULL_COMPILE): New, copied from master branch and extended to
1108 support an additional source file.
1109
bf151b75
JD
11102008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1111
1112 Don't let maintainer-*-check targets force a version update.
1113 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1114 handled.
1115
f56274a8
DJ
11162008-11-17 Di-an Jan <dianj@freeshell.org>
1117
1118 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1119 Align menus. Adjust word wrapping. Use node names for menu names.
1120 (Examples): Don't abbreviate node names.
1121 (LocalWords): Remove abbreviations.
1122 (Copying): Make description a sentence.
bf151b75 1123 (Java Action Features): Remove period to match the rest of menu.
f56274a8 1124
b5775a81
PB
11252008-11-11 Paolo Bonzini <bonzini@gnu.org>
1126
1127 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1128 * configure.ac: Adjust usage.
1129 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1130 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1131 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1132
7ed73f82
JD
11332008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1134
1135 Don't add a semicolon to actions for %skeleton or %language.
1136 It breaks Java test cases as reported by Akim Demaille.
1137 * src/scan-code.l: Implement.
1138
4b1ebc49
JD
11392008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1140
1141 Clean up %skeleton and %language priority implementation.
1142 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1143 remove static qualifier because others will soon need to see it.
1144 (language_prio): Likewise.
1145 (getargs): Use command_line_prio rather than 0.
1146 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1147 enum fields.
1148 (skeleton_prio): Extern it.
1149 (language_prio): Extern it.
1150 * src/parse-gram.y: Use grammar_prio rather than 1.
1151
738cde3e
AD
11522008-11-04 Akim Demaille <demaille@gostai.com>
1153
1154 * NEWS: Mention the trailing semicolon in action.
1155
d6fb461d
AD
11562008-11-04 Akim Demaille <demaille@gostai.com>
1157
1158 Reformat NEWS.
1159 * NEWS: Use more outline-mode markup.
1160 Suggested by Jim Meyering.
1161
14da0cdd
JD
11622008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1163
1164 Fix user actions without a trailing semicolon.
1165 Reported by Sergei Steshenko at
1166 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1167 * THANKS (Sergei Steshenko): Add.
1168 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1169 * tests/regression.at (Fix user actions without a trailing semicolon):
1170 New test case.
1171
c9ba9e59
JD
11722008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1173
1174 Initiate further development.
1175 * NEWS: Create an empty section for new entries.
1176 * gnulib: Update submodule to HEAD.
1177
bfb40910
JD
11782008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1179
1180 * NEWS: Version 2.4.
1181
241fda7a
JD
11822008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1183
1184 Prepare for next release.
1185 * NEWS: Briefly mention changes since 2.3b.
1186 * README: Say GNU m4 1.4.6, which we've been requiring in release
1187 announcements already, not 1.4.3, which breaks the build.
1188
ed4d67dc
JD
11892008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1190
1191 Say %language is experimental.
1192 We're thinking of extending it's effect on output file naming. See the
1193 thread at
1194 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1195 * NEWS: Say it's experimental.
1196 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1197 recommend it over %skeleton for now.
1198 (Bison Options): Likewise.
1199 (C++ Bison Interface): Use %skeleton not %language.
1200 (Calc++ Parser): Use %skeleton not %language.
1201 * src/getargs.c (usage): Say it's experimental.
1202
e254a580
DJ
12032008-11-01 Di-an Jan <dianj@freeshell.org>
1204 Paolo Bonzini <bonzini@gnu.org>
1205
1206 Support all Java parser class modifiers.
1207 * data/java.m4 (b4_percent_define_get3): New.
1208 (b4_final_if, b4_strictfp_if): New.
1209 * data/lalr1.java (final, strictfp, extends, implements): Support.
1210 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1211 documentation.
1212 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1213 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1214 (AT_CHECK_JAVA_GREP): New.
1215 (Java parser class modifiers): New test.
1216 (Java parser class extends and implements): New test.
1217
1218 Model exception propagation better with throws and lex_throws.
1219 * data/java.m4 (b4_list2): New.
1220 (throws): Change default.
1221 * data/lalr1.java (yyaction): Add throws.
1222 (parse): Add lex_throws in addition to throws.
1223 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1224 * tests/java.at (Java throws specifications): New test.
1225
1226 Improve documentation for Java parsers.
1227 * doc/bison.texinfo (Java Parsers): Add subsections.
1228 Don't quote first argument of %define.
1229 (Java Bison Interface): Document output files. Move documentation
1230 of parser class and merge into Java Parser Interface. Document
1231 features that error out. Document directives with no effect.
1232 Move note about Javadoc higher.
1233 (Java Semantic Values): Explicitly mention stype.
1234 Document that generic types cannot be used.
1235 (Java Location Values): Use @deftypeivar. Document constructors.
1236 Correct return value for toString.
1237 (Java Parser Interface): List undocumented constants/fields.
1238 Move documentation of fields added by %parse-param closer to list
1239 of members. Document that token names are added as fields.
1240 Document constructors accurately. Remove error method.
1241 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1242 Interface. Describe %code lexer and yylex accutately.
1243 Remove documentation that does not match the code.
1244 (Java Action Features): New.
1245 (Java Differences): Add reference. Add item on semantic values.
1246 Add note about @{ ... @}. Clarify %% epilogue placement.
1247 (Java Declarations Summary): New.
1248
1249 Fix Java skeleton.
1250 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1251 (b4_remove_comma): Quote test argument.
1252 (b4_identification): Remove "bison" field.
1253 * tests/java.at (Java parser class and package names): New test.
1254 (Java %parse-param and %lex-param): New test.
1255 (Java stype, position_class and location_class): New test.
1256
f259e4e6
PB
12572008-10-31 Di-an Jan <dianj@freeshell.org>
1258
1259 * data/lalr1.jave: Update copyright years.
1260 (YYParser): Correct name of "generated from" file in Javadoc:
1261 use b4_file_name instead of @ofile@.
1262 (Location constructor): Correct Javadoc parameter name.
1263 (yylloc): Add missing opening m4 quote after b4_location_if.
1264 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1265 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1266 (YYParser constructor): Correct Javadoc parameter name.
1267
cae5057f
JD
12682008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1269
1270 Always put auxiliary code files in the same dir as other output files.
1271 * src/files.c (compute_file_name_parts): When the user specifies
1272 --output but not --file-prefix, extract the directory prefix from the
1273 file prefix not from the grammar file name. This affects the location
1274 of files like location.hh generated by the C++ skeleton. The includes
1275 in the other output files require this fix.
1276 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1277 for expected output files.
1278 (Output files): Add a test for the above.
1279
4af432ba
JD
12802008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1281
1282 * gnulib: Update submodule to HEAD.
1283
e26d4e43
JD
12842008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1285
1286 Update copyright year.
1287 * src/files.c: Here.
1288
c0ee9e21
DJ
12892008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1290
1291 Don't overwrite the input file.
1292 * src/files.c (output_file_name_check): Fatal error if using input file
1293 for output.
1294 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1295 argument.
1296 (Conflicting output files): Add test.
1297
482dc52f
AD
12982008-10-28 Akim Demaille <demaille@gostai.com>
1299
1300 Space changes.
1301 * data/lalr1.cc: Formatting changes.
1302
52cbbe84
AD
13032008-10-28 Akim Demaille <demaille@gostai.com>
1304
1305 Don't define debugging functions when !YYDEBUG.
1306 * data/lalr1.cc (debug_stream, set_debug_stream)
1307 (debug_level_type, debug_level, set_debug_level): Don't
1308 declare them when YYDEBUG is not defined.
1309 The implementation are already YYDEBUG-aware.
1310
0925d5bf
AD
13112008-10-28 Akim Demaille <demaille@gostai.com>
1312
1313 Prefer "continue" for empty loop bodies.
1314 * etc/bench.pl.in: Use "continue" instead of {}.
1315
cf98343c
AD
13162008-10-28 Akim Demaille <demaille@gostai.com>
1317
1318 Space and comments changes.
1319 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1320 * data/c.m4, data/lalr1.cc: Space changes.
1321
9f467b7d
AD
13222008-10-28 Akim Demaille <demaille@gostai.com>
1323
1324 Make gnulib a submodule.
1325 * gnulib: New.
1326 * .gitmodules (gnulib): New.
1327
0f0e1ace
JD
13282008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1329
1330 Fix yyerror_range for user-defined location type in C++. Reported by
1331 Georg Sauthoff at
1332 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1333 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1334 * THANKS (Georg Sauthoff): Add.
1335
548e2104
JD
13362008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1337
1338 Update several administrative files mainly to facilitate releasing.
1339 * HACKING (Administrivia): Make the git-merge-changelog notes more
1340 helpful.
1341 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1342 (Release Procedure): Update for git and add numerous details that were
1343 previously missing.
1344 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1345 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1346 that announcements don't claim we bootstrapped with whatever bison
1347 happened to be in PATH. Add flex as a bootstrap tool.
1348 * Makefile.maint: Remove, previously replaced by maint.mk.
1349 * Makefile.cfg: Remove, and migrate settings to...
1350 * cfg.mk: ... here for the sake of `make announcement'.
1351 * bootstrap.conf (gnulib_modules): Add announce-gen.
1352 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1353 Berry.
1354
ddf17a6e
PB
13552008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1356
1357 Small but important bugfixes for the Java skeleton.
1358 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1359 (yy_symbol_print): Call toString on yyvaluep.
1360
e1145ad8
AD
13612008-08-29 Akim Demaille <demaille@gostai.com>
1362
1363 Clarify UPDATED use.
bee1df15 1364 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 1365 not to the release date of Bison.
bee1df15 1366 Reported by Joel E. Denny.
e1145ad8 1367
0df72d78
AD
13682008-08-29 Akim Demaille <demaille@gostai.com>
1369
1370 * README: Update FAQ pointer.
1371 Reported by Joel E. Denny.
1372
9a90b6bb
EB
13732008-08-27 Eric Blake <ebb9@byu.net>
1374
1375 Resync m4sugar from autoconf.
1376 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1377 (m4_init): Adjust to latest m4.git changes.
1378 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1379 effects.
1380 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1381 (_m4_list_cmp): Reduce side effects.
1382
65015668
AD
13832008-08-27 Akim Demaille <demaille@gostai.com>
1384
1385 Check yyerrok in calc.at.
bee1df15
EB
1386 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1387 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1388 expected.
65015668 1389
98e26a92
AD
13902008-08-27 Akim Demaille <demaille@gostai.com>
1391
1392 Support yyerrok in lalr1.cc.
1393 YYBACKUP is still to import back into lalr1.cc.
bee1df15 1394 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 1395
86c0e784
JD
13962008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1397
1398 For maintainer-check*, don't recompile for a $(VERSION) update.
1399 * cfg.mk: New file.
1400 (_is-dist-target): Override the one in GNUmakefile.
1401 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1402
88511166
JD
14032008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1404
1405 Update for recent change to gnulib.
1406 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1407 string.h now.
1408
6bbb2ed5
EB
14092008-08-15 Eric Blake <ebb9@byu.net>
1410
d67c52e8
EB
1411 Remaining m4sugar merge from autoconf.
1412 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1413 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1414 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1415 * src/output.c (output_skeleton): Tell m4 how to find it.
1416
6bbb2ed5
EB
1417 Partial m4sugar merge from autoconf: m4_map.
1418 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1419 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1420 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1421 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1422 for empty list.
1423 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1424 Likewise.
1425 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1426 declares it.
1427
8dce3875
JD
14282008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1429
1430 Keep .version and PACKAGE_VERSION in sync.
1431 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1432 dependency, and add comments justifying this in more detail. Discussed
1433 starting at
1434 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1435
882a1fbf
EB
14362008-08-06 Eric Blake <ebb9@byu.net>
1437
a3764451
EB
1438 Partial m4sugar merge from autoconf: m4_shiftn.
1439 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1440 (m4_shift2, m4_shift3): New macros.
1441 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1442 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1443 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1444 * data/java.m4 (b4_remove_comma): Likewise.
1445
882a1fbf
EB
1446 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1447 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1448 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1449 (m4_init): Consolidate wrapped text into single m4_wrap.
1450 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1451 in wrapped text.
1452
a30e920d
EB
14532008-08-05 Eric Blake <ebb9@byu.net>
1454
dfcc5959
EB
1455 Partial m4sugar merge from autoconf: builtins, version.m4.
1456 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1457 (m4_prepend): Remove, as it is unused and inherently quadratic,
1458 whereas m4_append is linear in newer m4.
1459 (m4_mkstemp): New builtin.
1460 (m4_symbols): Make rename conditional.
1461 (m4_version_prereq): Ensure fatal error if used in bison, which
1462 intentionally lacks version.m4.
1463
a30e920d
EB
1464 Fix comments in m4sugar.
1465 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1466
445b7470
JD
14672008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1468
1469 Update for recent .gitignore fix in Gnulib.
1470 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1471 anchored .gitignore entries.
1472
a1e50014
JD
14732008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1474
1475 Set gnu or gnits strictness.
1476 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1477 development and gnits strictness for releases. Based on Eric Blake's
1478 suggestion at
1479 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1480
d43f77e7
PB
14812008-07-31 Paolo Bonzini <bonzini@gnu.org>
1482
1483 * NEWS: Clarify documentation of %language.
1484
fee2ed87
PB
14852008-07-31 Paolo Bonzini <bonzini@gnu.org>
1486
1487 Support usage of git-merge-changelog.
1488 * .gitattributes: New.
1489 * HACKING: Document usage of git-merge-changelog.
1490 * bootstrap: Install git-merge-changelog entries in .git/config
1491 if appropriate.
1492
78029cd5
JD
14932008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1494
1495 Remove remaining dependence on CVS Id keyword.
1496 * ChangeLog: For the sake of people still using CVS, don't use dollars
1497 when mentioning Id.
1498 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1499 unusual anyway.
1500 * data/xslt/xml2dot.xsl: Likewise.
1501 * data/xslt/xml2text.xsl: Likewise.
1502 * data/xslt/xml2xhtml.xsl: Likewise.
1503 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1504 * doc/Makefile.am (neutralize): Remove, no longer needed.
1505 (.x.1): Don't use neutralize.
1506 (edit): Don't substitute for ID.
1507 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1508
c53d18b1
JD
15092008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1510
1511 Fix dependence on computed configure variables.
1512 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1513 $(top_srcdir)/configure.ac so that changes to computed variables, such
1514 as PACKAGE_VERSION, are seen.
1515 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1516
5523ac79
JD
15172008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1518
1519 Update copyright dates for recent changes.
1520 * Makefile.am: Here.
1521 * src/Makefile.am: Here.
1522 * src/reduce.c: Here.
1523 * tests/reduce.at: Here.
1524
8fa36911
JD
15252008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1526
1527 Use git-version-gen for version names between releases.
1528 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1529 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1530 * .prev-version: New.
1531 * .version.in: Remove.
78029cd5 1532 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
1533 revision.
1534 * GNUmakefile: Remove, now copied from Gnulib.
1535 * Makefile.am: Add code suggested by comments in
1536 build-aux/git-version-gen.
1537 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1538 .prev-version, and .version.
1539 * NEWS (2.3b+): Rename to...
1540 (?.?): ... this because we're dropping the "+" version naming scheme,
1541 but, in general, we still can't be sure of our next release name.
1542 * bootstrap: Add a quick hack to remove from .gitignore the
1543 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1544 entry. This should really be fixed in gnulib instead.
1545 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1546 * configure.ac (AC_INIT): Set version name by invoking
1547 build-aux/git-version-gen.
1548 (AC_CONFIG_FILES): Remove .version, now generated by
1549 build-aux/git-version-gen.
1550 * maint.mk: New, copied from coreutils.
1551 * doc/.cvsignore (bison.1): Add.
1552 * doc/.gitignore (/bison.1): Add.
1553 * doc/bison.1: Remove, generated.
1554 * src/.cvsignore (revision.c): Remove.
1555 * src/.gitignore (/revision.c): Remove.
1556 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1557 (BUILT_SOURCES): Remove revision.c.
1558 (revision.c): Remove.
1559 * src/getargs.c (version): Don't print revision after the VERSION.
1560 * src/revision.h: Remove.
1561
bcf07cb7
JD
15622008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1563
1564 Fix untranslatable composition of sentences. Reported by Goran
1565 Uddeborg at
1566 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1567 * THANKS (Goran Uddeborg): Add.
1568 * src/reduce.c (reduce_print): Report the number of nonterminals and
1569 rules useless in the grammar in separate sentences.
1570 * tests/reduce.at (Useless Rules): Update output.
1571 (Reduced Automaton): Likewise.
1572 (Underivable Rules): Likewise.
1573 (Empty Language): Likewise.
1574
9aacab9a
JD
15752008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1576
1577 Fix some .gitignore and .cvsignore problems.
1578 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1579 (insert_vc_ignore): ... this new function, which prepends `/' to all
1580 .gitignore entries before passing them to insert_sorted_if_absent.
1581 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1582 .cvsignore files are maintained even though Bison developers run
1583 bootstrap while using Git.
1584 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1585 unneeded by Bison.
1586 (gnulib): Add.
1587 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1588 unneeded. Reported by Eric Blake.
1589 * lib/.gitignore (/*~): Add.
1590 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1591 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1592 Blake.
1593 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1594
a9fc7990
JD
15952008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1596
1597 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1598 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1599 * bootstrap.conf (gnulib_modules): Add unsetenv.
1600 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1601 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1602 (/setenv.m4): Add.
1603 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1604 the first argument because it may become position-dependent, and unset
1605 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1606 Add comments explaining these issues in more detail.
1607
0f1d6f10
JD
16082008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1609
1610 Add .gitignore everywhere based on .cvsignore.
1611 * .gitignore: New.
1612 * build-aux/.gitignore: New.
1613 * data/.gitignore: New.
1614 * doc/.gitignore: New.
1615 * etc/.gitignore: New.
1616 * examples/.gitignore: New.
1617 * examples/calc++/.gitignore: New.
1618 * lib/.gitignore: New.
1619 * m4/.gitignore: New.
1620 * po/.gitignore: New.
1621 * runtime-po/.gitignore: New.
1622 * src/.gitignore: New.
1623 * tests/.gitignore: New.
1624
7bd1665a
JD
16252008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1626
1627 * NEWS (2.3b+): New section, empty for now.
1628 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1629
72c5b982
JD
16302008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1631
1632 * NEWS (2.3b): Update release date since there has been a delay in
1633 getting the announcements and tarballs out.
1634
bd02cd5d
JD
16352008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1636
1637 * NEWS: Version 2.3b.
1638 * configure.ac (AC_INIT): Likewise.
1639 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1640
9126263e
JD
16412008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1642
1643 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1644 been doing it for years.
1645 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1646 (Release Procedure): Add FIXME about make alpha being unmaintained.
1647
fa6aa7b3
JD
16482008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1649
1650 * data/yacc.c: Reformat m4 a little for readability.
1651 * src/lalr.c (build_relations): Correct comment.
1652
d30b312d
JMG
16532008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1654
1655 DJGPP specific issue.
1656 * djgpp/config.sed: Fixes required to run configure scripts generated
1657 by autoconf 2.62.
1658
138d4cd9
JD
16592008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1660
1661 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1662 coordinator@translationproject.org.
1663
8f7e2e1f
JD
16642008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1665
1666 * THANKS: Add Eric Blake.
1667
f55efa38
JD
16682008-04-23 Eric Blake <ebb9@byu.net>
1669
1670 Revert prior patch, by working around autoconf regression.
1671 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1672 ("Output file name: ("): Uncomment test.
1673 ("Output file name: )"): Likewise.
1674 Based on an idea from Noah Misch.
1675
096c9f9d
JD
16762008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1677
1678 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1679 2.61. Reported by Juan Manuel Guerrero at
1680 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1681 * tests/output.at ("Output file name: ("): Comment out test case for
1682 now.
1683 ("Output file name: )"): Likewise.
1684
0f664b89
JD
16852008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1686
1687 * GNUmakefile: Update git-version-gen invocation so make dist
1688 succeeds.
1689
1cfe6375
JD
16902008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1691
1692 Update to the current gnulib CVS repository, and fix trigraph handling
1693 in Bison.
1694 * bootstrap: Update gnulib CVS repository URL.
1695 (symlink_to_dir): Encapsulate the code that guarantees the destination
1696 directory exists into...
1697 (check_dst_dir): ... this new function, and...
1698 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1699 fail when copying files into lib/uniwidth/.
1700 * src/output.c (prepare_symbols): When writing yytname muscles, where
1701 symbol names will be encoded in C-string literals, tell quotearg to
1702 escape trigraphs. This used to be the default in gnulib.
1703 * tests/regression.at (Token definitions): Because of the change in
1704 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1705 escapes trigraphs in symbol names. Thus, yytname no longer has
1706 trigraphs unnecessarily doubly escaped. Update test case output.
1707 Extend test case to be sure Bison's own error messages will no longer
1708 have trigraphs in symbol names unnecessarily escaped once.
1709
74c52fc8
JD
17102008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1711
1712 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1713 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1714 * .cvsignore: Add .version.
1715 * .version.in: New.
1716 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1717 * configure.ac (AC_CONFIG_FILES): Add .version.
1718 * build-aux/.cvsignore: Add git-version-gen.
1719
8e55b3aa
JD
17202008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1721
1722 * NEWS (2.3a+): Mention that -g now takes an argument.
1723 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1724 consistency. Update the -g and -x entries now that they take
1725 arguments. Use brackets to indicate optional arguments.
1726 * src/getargs.c (usage): Explain the relationship between arguments of
1727 long and short options more completely. Document --defines and -d
1728 separately since the former takes an argument but, for POSIX Yacc, the
1729 latter does not.
1730 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 1731 (getargs): Sort cases.
8e55b3aa 1732
59c5ac72
AD
17332008-02-28 Akim Demaille <demaille@gostai.com>
1734
1735 * doc/bison.texinfo: Fix a few typos.
1736
118d4978
AD
17372008-02-28 Akim Demaille <akim@epita.fr>
1738
1739 * doc/bison.texinfo (Bison Options): Document -W.
1740 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1741
7020f1e9
AD
17422008-02-28 Akim Demaille <akim@epita.fr>
1743
1744 * src/getargs.c (short_options): Split and sort for readability.
1745 -g and -x take optional arguments, just like their long options.
1746 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1747 understand.
1748 Fix the handling of $opt which resulted in all the argument to be
1749 considered as optional.
1750
59da312b
JD
17512008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1752
1753 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1754 say its interface is experimental.
1755 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1756 Java.
1757 (Bison Options): In the -L and --language entry, mention Java.
1758 (Java Bison Interface): Say the interface is experimental.
1759 * src/getargs.c (usage): Mention -L and --language.
1760
1761 * NEWS (2.3a+): Say the push parsing interface is experimental.
1762 * doc/bison.texinfo (Push Decl): Likewise.
1763 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1764 (Push Parser Function): Likewise.
1765 (Pull Parser Function): Likewise.
1766 (Parser Create Function): Likewise.
1767 (Parser Delete Function): Likewise.
1768 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1769 yypull_parse, and yypush_parse entries.
1770
1771 * NEWS (2.3a+): Mention XML support, and say the schema is
1772 experimental.
1773 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1774 * src/getargs.c (usage): Say the XML schema is experimental.
1775
1776 * NEWS (2.3a+): Say option instead of flag.
1777
2bb3ebec
WP
17782008-02-21 Wojciech Polak <polak@gnu.org>
1779
1780 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1781 text.
1782
333e670c
JD
17832008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1784
1785 Fix impure push parser compile error reported by Bob Rossi at
1786 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1787 * data/yacc.c: Clean up whitespace in the output a little.
1788 (yypstate_allocated): Define for impure push parsers regardless of
1789 whether the pull interface is also requested.
1790 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1791 check impure push parsers without the pull interface.
1792
1793 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1794 yyerror takes arguments specified by %parse-param while yypstate_new
1795 does not.
1796 * doc/bison.texinfo (Parser Create Function): Document that
1797 yypstate_new returns 0 for multiple impure parser instances.
1798 * tests/push.at (Push Parsing: Multiple impure instances): Update
1799 expected stderr output.
1800
798096e1
JD
18012008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1802
1803 * runtime-po/POTFILES.in (push.c): Remove.
1804
9ca7f077
JD
18052008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1806
1807 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1808 * data/push.c: Rename to...
1809 * data/yacc.c: ... this, overwriting it.
1810 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1811 `%push-pull-parser' -> `%define api.push_pull "both"'.
1812 Remove old yacc.c tests, and update push.c tests to yacc.c.
1813
42ee26bb
JD
18142008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1815
1816 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1817 `"%code top" blocks' instead of `%code "top" blocks'.
1818 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1819 Clean up whitespace in the output a little.
1820
b1cc23c4
JD
18212008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1822
1823 Fix documentation problems reported by Tim Josling at
1824 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1825 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1826 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1827 integers. Explain the effect of literal string aliases on error
1828 messages. Copy token 0 documentation from the C++ skeleton
1829 documentation.
1830
ab7f29f8
JD
18312008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1832
1833 Accept a token number in a %left, %right, or %nonassoc for POSIX
1834 conformance. Reported by Tim Josling at
1835 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1836 * NEWS (2.3a+): Mention.
1837 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1838 and code numbers are treated by precedence declarations.
1839 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1840 of symbols.1.
1841 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1842 of symbol.
1843 (symbol.prec): New, just like symbol but allows INT.
1844 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1845 longer holds.
1846 * tests/regression.at (Token number in precedence declaration): New
1847 test case.
1848
a924ef36
JMG
18492008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1850
1851 DJGPP specific issues.
1852 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1853 be changed. Copyright timestamp adjusted.
1854 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1855 be changed. Copyright timestamp adjusted.
1856 * djgpp/config.site: Copyright timestamp adjusted.
1857 * djgpp/config_h.sed: Copyright timestamp adjusted.
1858 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1859 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1860 filename translation list.
1861 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1862 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1863 files shall be created. Before trying to use the temp dir where the
1864 environment variable points to check that the dir really exists. If
1865 not default to the cwd as temp dir. Copyright timestamp adjusted.
1866 * djgpp/subpipe.h: Copyright timestamp adjusted.
1867 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1868
389c8cfd
PE
18692008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1870
1871 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
1872
5d1cfef4
PE
18732008-01-09 Paul Eggert <eggert@cs.ucla.edu>
1874
1875 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
1876 Problem reported by Claudio Saavedra in
1877 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
1878
e2dcf996
WP
18792008-01-05 Wojciech Polak <polak@gnu.org>
1880
1881 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
1882 document's title with the input grammar file name.
1883
da730230
JD
18842007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
1885
1886 Automate regression testing of the XML/XSLT implementation. Discussed
1887 starting at
1888 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
1889 * configure.ac (XSLTPROC): New substitution.
1890 * Makefile.am (maintainer-xml-check): New phony target invoking...
1891 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
1892 invoking make maintainer-check with BISON_TEST_XML=1.
1893 * tests/atlocal.in (XSLTPROC): New.
1894 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
1895 not to report reachable memory when Bison is expected to have a
1896 non-zero exit status and (2) to compare XML/XSLT output with --graph
1897 and --report=all output for every working grammar when
1898 BISON_TEST_XML=1.
1899 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
1900 (AT_BISON_CHECK_XML): New.
1901 (AT_QUELL_VALGRIND): New.
1902 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
1903 (AT_CHECK): ... don't redefine this since this was the old way to
1904 quell Valgrind.
1905 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
1906 AT_BISON_CHECK invocations.
1907 * tests/c++.at: Likewise.
1908 * tests/calc.at: Likewise.
1909 * tests/conflicts.at: Likewise.
1910 * tests/cxx-type.at: Likewise.
1911 * tests/existing.at: Likewise.
1912 * tests/glr-regression.at: Likewise.
1913 * tests/headers.at: Likewise.
1914 * tests/input.at: Likewise.
1915 * tests/java.at: Likewise.
1916 * tests/output.at: Likewise.
1917 * tests/push.at: Likewise.
1918 * tests/reduce.at: Likewise.
1919 * tests/regression.at: Likewise.
1920 * tests/sets.at: Likewise.
1921 * tests/skeletons.at: Likewise.
1922 * tests/synclines.at: Likewise.
1923 * tests/torture.at: Likewise.
1924 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
1925 tends to hang xsltproc.
1926 (Big horizontal): Likewise.
1927
408476bc
JD
19282007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1929
1930 In XML output, remove redundant class attribute on symbol element.
1931 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
1932 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
1933 look up a symbol to determine whether it's a nonterminal or terminal.
1934 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
1935 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
1936
1937 Add prec/assoc information to XML output.
1938 * src/gram.c (grammar_rules_print_xml): For each rule that has a
1939 %prec, add a percent_prec attribute.
1940 * src/print-xml.c (print_grammar): For each terminal that has a
1941 precedence or associativity, add a prec or assoc attribute.
1942 (xml_indent): New.
1943 (xml_puts): Use xml_indent.
1944 (xml_printf): Use xml_indent.
1945 * src/print-xml.h (xml_indent): Prototype.
1946
1947 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
1948 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
1949
d4a26c48
JD
19502007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1951
1952 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
1953 (bison:ruleByNumber): ... this for clarity.
1954 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
1955 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
1956 (xsl:template match="reduction"): Update.
1957 (xsl:template match="item"): Update.
1958 (xsl:template match="reduction"): Update.
1959
1960 In the XML output, don't print the list of rules where symbols appear.
1961 Compute it in XSLT instead. Discussed at
1962 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
1963 * data/xslt/bison.xsl (bison:ruleByLhs): New.
1964 (bison:ruleByRhs): New.
1965 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
1966 bison:ruleByRhs.
1967 (xsl:template match="terminal/rule"): Remove.
1968 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1969 bison:ruleByRhs.
1970 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1971 Remove.
1972 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
1973 bison:ruleByRhs and mode="number-link" for rule template.
1974 (xsl:template match="terminal/rule"): Remove.
1975 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1976 bison:ruleByRhs and mode="number-link" for rule template.
1977 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1978 Rewrite as...
1979 (xsl:template match="rule" mode="number-link"): ... this.
1980 * src/print-xml.c (print_grammar): Don't print the list of rules.
1981
ef1b4273
JD
19822007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1983
1984 Don't let --report affect XML output; always print all information.
1985 Discussed at
1986 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
1987 * src/conflicts.c (log_resolution): Implement.
1988 * src/print-xml.c (print_core): Implement.
1989 (print_state): Implement.
1990 (print_xml): Implement.
1991
1992 * NEWS (2.3a+): Fix quotes.
1993 * src/parse-gram.y (prologue_declaration): For consistency with -v,
1994 don't let %verbose clear the list specified by --report.
1995
0f6cd9e3
AD
19962007-11-26 Akim Demaille <akim@epita.fr>
1997
1998 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
1999
d80fb37a
JD
20002007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2001
2002 In the XML output, list useless and unused symbols and rules with the
2003 useful ones and add a "usefulness" attribute. Discussed starting at
2004 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2005 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2006 (grammar_rules_print_xml): Print all rules instead of just those
2007 useful in the grammar, and add a "usefulness" attribute.
2008 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2009 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2010 (print_grammar): Print all nonterminals instead of just useful ones,
2011 and add a "usefulness" attribute to nonterminals and terminals.
2012 (print_xml): Don't print a separate "reductions" or
2013 "rules-useless-in-parser" element.
2014 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2015 (reduce_xml): Remove.
2016 (reduce_token_unused_in_grammar): New.
2017 (reduce_nonterminal_useless_in_grammar): New.
2018 * src/reduce.h (reduce_xml): Remove prototype.
2019 (reduce_token_unused_in_grammar): Add prototype.
2020 (reduce_nonterminal_useless_in_grammar): Add prototype.
2021 * data/xslt/xml2text.xsl: Update for XML changes.
2022 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2023 * tests/reduce.at (Useless Terminals): Update output.
2024 (Useless Rules): Update output.
2025 (Reduced Automaton): Update output.
2026
2027 Say "Terminals unused in grammar" instead of "Unused terminals".
2028 * NEWS (2.3a+): Update.
2029 * doc/bison.texinfo (Understanding): Update example output.
2030 * src/reduce.c (reduce_output): Implement.
2031 * data/xslt/xml2text.xsl: Implement.
2032 * data/xslt/xml2xhtml.xsl: Implement.
2033
1bb2bd75
JD
20342007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2035
2036 Accept --report-file=FILE to override the default `.output' filename.
2037 * NEWS (2.3a+): Mention.
2038 * doc/bison.texinfo (Bison Options): Add an entry.
2039 * src/files.c (compute_output_file_names): Don't override
2040 spec_verbose_file if already set.
2041 * src/getargs.c (usage): Document --report-file.
2042 (REPORT_FILE_OPTION): New anonymous enum member.
2043 (long_options): Add entry for it.
2044 (getargs): Add case for it setting spec_verbose_file.
2045
2046 * build-aux/cross-options.pl: Don't record a short option just because
2047 there's an arg.
2048 * doc/.cvsignore: Add yacc.1.
2049
a005a9c4
AD
20502007-11-14 Akim Demaille <akim@epita.fr>
2051
2052 * doc/yacc.1.in: New.
2053 * configure.ac, doc/Makefile.am: Adjust.
2054 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2055 config.h symbol.
2056 Use AC_SUBST for assignments too.
2057 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2058
cff03fb2
JD
20592007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2060
2061 * src/gram.c: Remove comments that duplicate comments in gram.h.
2062
2063 When reporting useless rules and nonterminals, say "useless in grammar"
2064 instead of "useless", and say "useless in parser" instead of "never
2065 reduced". Discussed starting at
2066 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2067 * NEWS (2.3a+): Mention this change.
2068 * data/xslt/xml2text.xsl: Update output text and expected input XML
2069 element names to match changes below.
2070 * data/xslt/xml2xhtml.xsl: Likewise.
2071 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2072 Contents: "Rules useless in parser due to conflicts".
2073 * doc/bison.texinfo (Decl Summary): Reword a little.
2074 (Understanding): Update example output for changes below.
2075 * src/gram.c: (rule_useful_p): Rename to...
2076 (rule_useful_in_grammar_p): ... this.
2077 (rule_useless_p): Rename to...
2078 (rule_useless_in_grammar_p): ... this.
2079 (rule_never_reduced_p): Rename to...
2080 (rule_useless_in_parser_p): ... this.
2081 (grammar_rules_print): Update for renames.
2082 (grammar_rules_print_xml): Update for renames.
2083 (grammar_rules_never_reduced_report): Rename to...
2084 (grammar_rules_useless_report): ... this since it is used for either
2085 kind of useless rule.
2086 * src/gram.h: Reword comments and update function names in prototypes.
2087 * src/main.c (main): Say "rule useless in parser due to conflicts".
2088 * src/print-xml.c (print_rules_never_reduced): Rename to...
2089 (print_rules_useless_in_parser): ... this, and rename output XML
2090 element "rules-never-reduced" to "rules-useless-in-parser".
2091 (print_xml): Update for rename.
2092 * src/print.c (print_results): Say "Rules useless in parser due to
2093 conflicts".
2094 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2095 (nonterminals_reduce): Say "nonterminal useless in grammar".
2096 (reduce_output): Say "Nonterminals useless in grammar".
2097 Say "Rules useless in grammar".
2098 (reduce_xml): Rename output XML element "useless" to
2099 "useless-in-grammar".
2100 (reduce_print): Don't report the count of grammatically useless rules
2101 as "rules never reduced" just because %yacc is specified.
2102 In the correct report of this count, say nonterminal(s) and rule(s)
2103 "useless in grammar".
2104 * tests/conflicts.at (S/R in initial): Update expected output.
2105 (Defaulted Conflicted Reduction): Likewise.
2106 (Unreachable States After Conflict Resolution): Likewise.
2107 * tests/existing.at (GNU pic Grammar): Likewise.
2108 * tests/reduce.at (Useless Nonterminals): Likewise.
2109 (Useless Rules): Likewise.
2110 (Reduced Automaton): Likewise.
2111 (Underivable Rules): Likewise.
2112 (Empty Language): Likewise.
2113
66f0441d
JD
21142007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2115
2116 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2117 here document and before the EOF so that BSD's implementation of Bourne
2118 shell doesn't parse the delimiter as part of the here document.
2119 * doc/.cvsignore: Add cross-options.texi.
2120 * src/getargs.c (usage): Add a blank line after the warning categories.
2121
d0ee4105
PB
21222007-11-08 Paolo Bonzini <bonzini@gnu.org>
2123
2124 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2125
e8b1fb9b
AD
21262007-11-05 Akim Demaille <akim@epita.fr>
2127
2128 Remove Id: from bison.1.
2129 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2130 (perl -0777 -pi -e 's/\.PP\nId): New.
2131 (.x.1): Use it to ignore the version control revision.
2132
2f7a96b5
AD
21332007-11-05 Akim Demaille <demaille@gostai.com>
2134
2135 * build-aux/Makefile.am: Ship cross-options.pl.
2136 * doc/Makefile.am: Always refer to cross-options.texi with
2137 $(srcdir).
2138 (MAINTAINERCLEANFILES): Add it.
2139
f4101aa6
AD
21402007-11-04 Akim Demaille <demaille@gostai.com>
2141
2142 Generate the long/short option cross-table.
2143 * build-aux/cross-options.pl: New.
2144 * doc/Makefile.am (cross-options.texi): New.
2145 * doc/bison.texinfo: Use it.
2146
727a1401
AD
21472007-11-04 Akim Demaille <demaille@gostai.com>
2148
2149 Generate bison.1 using help2man.
2150 * doc/common.x, doc/bison.x: New.
2151 * doc/Makefile.am (bison.1, .x.1): New.
2152 The code is taken from autoconf-2.61/man/Makefile.am.
2153 * configure.ac: Look for help2man.
2154
6aeb9c57
AD
21552007-11-04 Akim Demaille <demaille@gostai.com>
2156
2157 Complete --help.
2158 * src/getargs.c (usage): Document -W, make it clear that -d,
2159 -g and -x have optional arguments.
2160
d7be4085
AD
21612007-11-04 Akim Demaille <demaille@gostai.com>
2162
2163 Find sha1sum when named gsha1sum.
2164 * bootstrap (find_tool): New.
2165 ($SHA1SUM): New.
2166
d9df47b6
JD
21672007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2168
2169 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2170 at
2171 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2172 * NEWS (2.3a+): Mention.
2173 * data/bison.m4 (b4_pure_if): Don't define it here.
2174 * data/c.m4 (b4_identification): Depend on individual skeletons to
2175 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2176 values of the %define variables api.pure or api.push_pull. Define
2177 YYPURE, YYPUSH, and YYPULL accordingly.
2178 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2179 glr.cc has already defined b4_pure_flag.
2180 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2181 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 2182 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
2183 * doc/bison.texinfo (Pure Decl): Update.
2184 (Push Decl): Update.
2185 (Decl Summary): Add api.pure to %define entry.
2186 In %pure-parser entry, say it's deprecated and reference %define.
2187 (Pure Calling): Update.
2188 (Error Reporting): Update.
2189 (C++ Scanner Interface): Update.
2190 (How Can I Reset the Parser): Update.
2191 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2192 reference %define.
2193 * src/getargs.c (pure_parser): Remove global variable.
2194 * src/getargs.h (pure_parser): Remove extern.
2195 * src/output.c (prepare): Don't define pure_flag muscle.
2196 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2197 wrapper around `%define api.pure'.
2198 * tests/calc.at (Simple LALR Calculator): Update.
2199 (Simple GLR Calculator): Update.
2200 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2201 Update.
2202 (GLR: Resolve ambiguity, pure, locations): Update.
2203 (GLR: Merge conflicting parses, pure, no locations): Update.
2204 (GLR: Merge conflicting parses, pure, locations): Update.
2205 * tests/glr-regression.at (Uninitialized location when reporting
2206 ambiguity): Update
2207 * tests/input.at (Unused %define api.pure): New test case.
2208 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2209 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2210 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2211
c373bf8b
JD
22122007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2213
2214 %define push_pull -> %define api.push_pull. Discussed starting at
2215 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2216 * data/push.c: Expect the new name.
2217 * data/yacc.c: Likewise.
2218 * doc/bison.texinfo (Push Decl): Update.
2219 (Decl Summary): Update %define entry.
2220 (Push Parser Function): Update.
2221 (Pull Parser Function): Update.
2222 (Parser Create Function): Update.
2223 (Parser Delete Function): Update.
2224 * tests/calc.at (Simple LALR Calculator): Update.
2225 * tests/input.at (%define enum variables): Update.
2226 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2227 (Push Parsing: Multiple impure instances): Update.
2228 (Push Parsing: Unsupported Skeletons): Update.
2229 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2230 (Exploding the Stack Size with Malloc): Update.
2231
2232 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2233 other entries some.
2234
32f19b6b
JD
22352007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2236
2237 For the XML output's terminal element, rename @number to @token-number,
2238 and add @symbol-number. In the nonterminal element, rename @number to
2239 @symbol-number. Discussed starting at
2240 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2241 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2242 renames.
2243 (xsl:template match="nonterminal"): Likewise.
2244 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2245 (xsl:template match="nonterminal"): Likewise.
2246 * src/print-xml.c (print_grammar): Implement.
2247
255a6b90
JD
22482007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2249
2250 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2251 2007-10-11 change, the child elements here are items not rules.
408476bc 2252 (xsl:template match="item"): New.
255a6b90
JD
2253 (xsl:template match="rule"): Update for new reduced itemset.
2254 (xsl:template match="point"): Remove.
2255 (xsl:template match="empty"): For consistency with --graph, don't
2256 output "/* empty */".
2257 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2258 line-wrap, don't pass a negative value as first-line-length since this
2259 won't work with the following changes.
2260 (xsl:template name="line-wrap"): Simplify slightly.
2261 (xsl:template name="ws-search"): Eliminate recursion.
2262 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2263 set next to an item whose dot is not at the end of the RHS even if it
2264 happens to be associated with the same rule.
2265
88c78747
JD
22662007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2267
31984206
JD
2268 Add %define lr.keep_unreachable_states.
2269 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2270 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2271 * src/main.c (main): Implement it.
2272 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2273 Extend to test it, and fix a typo.
2274
22752007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2276
2277 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
2278 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2279 the example .output text.
2280 * tests/regression.at (Extra lookahead sets in report): Improve wording
2281 of comments.
2282
b7a70162
WP
22832007-10-17 Wojciech Polak <polak@gnu.org>
2284
2285 * src/print-xml.c (print_grammar): Renamed
2286 <terminal> and <nonterminal> attributes:
2287 "type" to "number" and "symbol" to "name".
2288 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2289 Use new attribute names.
2290 (xsl:template match="nonterminal"): Likewise.
2291 * data/xslt/xml2xhtml.xsl: Likewise.
2292
a0de5091
JD
22932007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2294
2295 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2296 (Option Cross Key): Likewise.
2297
2298 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2299 next to an item whose dot is not at the end of the RHS even if it
2300 happens to be associated with the same rule.
2301 * src/print.c (print_core): Likewise.
2302 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2303 (Resolved SR Conflicts): Update output.
2304 * tests/regression.at (Extra lookahead sets in report): New test case.
2305
4c20d18d
WP
23062007-10-11 Wojciech Polak <polak@gnu.org>
2307
2308 * src/print-xml.c (print_core): Remove item set
2309 redundancy.
2310 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2311 Improve processing time. Suggested by Joel E. Denny.
2312 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2313 Write xsl:param "required" attribute as comment.
2314 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2315 (xsl:template match="rule"): Support new reduced itemset.
2316 (xsl:template match="point"): Remove.
2317 * data/xslt/xml2xhtml.xsl: Likewise.
2318
f506ad1c
JD
23192007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2320
2321 * src/getargs.c (version): Update copyright year.
2322
21f1b063
JD
23232007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2324
2325 Make xml2dot.xsl and --graph produce the same output.
2326 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2327 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2328 escaped later.
2329 (xsl:template name="output-node"): Use the new escape template instead
2330 of the string-replace template directly.
2331 (xsl:template name="output-edge"): Likewise.
2332 (xsl:template name="escape"): New, escapes backslashes and newlines in
2333 addition to quotation marks.
2334 * src/graphviz.c (start_graph, output_node, output_edge): Add
2335 whitespace to output for legibility.
2336
2337 Make xml2text.xsl and --report produce the same output, and remove the
2338 XML "conflicts" element since a conflict summary is easily extracted
2339 from the automaton.
2340 * data/xslt/bison.xsl: New.
2341 (xsl:template match="state" mode="bison:count-conflicts): New.
2342 * data/xslt/xml2text.xsl: Import bison.xsl.
2343 (xsl:template match="bison-xml-report"): Instead of styling the
2344 "conflicts" element, style the "automaton" element with mode
2345 "conflicts". Unlike the former, the latter lists S/R and R/R
2346 conflicts for a state on the same line.
2347 (xsl:template match="conflicts"): Remove.
2348 (xsl:template match="conflict"): Remove.
2349 (xsl:template match="terminal"): Line-wrap the list of rules in which
2350 the terminal is used.
2351 (xsl:template match="nonterminal"): Likewise for nonterminals.
2352 (xsl:template match="automaton" mode="conflicts"): New.
2353 (xsl:template match="state" mode="conflicts"): New.
2354 (xsl:template name="line-wrap"): New.
2355 (xsl:template name="ws-search"): New.
2356 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2357 (xsl:template match="bison-xml-report"): Instead of styling the
2358 "conflicts" element, style the "automaton" element with mode
2359 "conflicts."
2360 (xsl:template match="conflicts"): Remove.
2361 (xsl:template match="conflict"): Remove.
2362 (xsl:template match="automaton" mode="conflicts"): New.
2363 (xsl:template match="state" mode="conflicts): New.
2364 * src/conflicts.c (conflicts_output_xml): Remove.
2365 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2366 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2367 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2368 the corresponding XSLT is easier. Also, never wrap between a word and
2369 the comma that follows it.
2370
793fbca5
JD
23712007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2372
2373 Improve C++ namespace support. Discussed starting at
2374 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2375 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2376 b4_namespace_close): New macros that interpret the %define variable
2377 "namespace" so its value can contain "::" to indicate nested
2378 namespaces.
2379 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2380 the above macros.
2381 * data/lalr1.cc (b4_namespace): Likewise.
2382 * data/location.cc (b4_namespace): Likewise.
2383 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2384 inside a new table in the general %define entry. Document `%define
2385 namespace' there as well. Point the %name-prefix entry to it since it
2386 explains it more completely in the case of C++.
2387 (C++ Bison Interface): Mention `%define namespace' instead of
2388 %name-prefix.
2389 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2390 entry suffices.
2391 * tests/c++.at (Relative namespace references): New test case.
2392 (Absolute namespace references): New test case.
2393 (Syntactically invalid namespace references): New test case.
2394 * tests/input.at (C++ namespace reference errors): New test case.
2395
35b8730d
JD
23962007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2397
2398 Add syncline support and location accessor to internal %define
2399 interfaces.
2400 * data/bison.m4 (b4_percent_define_get_loc): New.
2401 (b4_percent_define_get_syncline): New.
2402 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2403 (b4_percent_define_default): Record defining location as line 1 rather
2404 than 0 for the sake of synchronizing #line's, and define
2405 b4_percent_define_syncline(VARIABLE).
2406 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2407 * src/muscle_tab.c (muscle_syncline_grow): New.
2408 (muscle_code_grow): Use muscle_syncline_grow.
2409 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2410 define b4_percent_define_syncline(VARIABLE).
2411 (muscle_percent_define_get_loc): New.
2412 (muscle_percent_define_get_syncline): New.
2413 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2414 remove some unused variables.
2415 (muscle_percent_define_default): Record defining location as line 1
2416 rather than 0 for the sake of synchronizing #line's, and define
2417 b4_percent_define_syncline(VARIABLE).
2418 (muscle_percent_define_check_values): Use
2419 muscle_percent_define_get_loc.
2420 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2421 (muscle_percent_define_get_syncline): Prototype.
2422 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2423 defaults): Update output for location change.
2424 (Complaining during macro argument expansion): Extend to test
2425 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2426
7dc4a694
JD
24272007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2428
2429 Fix some error-reporting macro bugs.
2430 * data/bison.m4 (b4_cat): New.
2431 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2432 to stdout so they don't become arguments to other macros. Update
2433 comments and add examples.
2434 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2435 add examples.
2436 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2437 after printing the error directive so that M4 doesn't report subsequent
2438 problems that are induced by this problem.
2439 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2440 instead of just in them. Recognize @\n in both places. Both expand to
2441 the empty string. Needed by b4_cat.
2442 * tests/skeletons.at (Complaining during macro argument expansion):
2443 New test case.
2444 (Fatal errors make M4 exit immediately): New test case.
2445
d4bd2295
JD
24462007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2447
2448 Implement --print-datadir.
2449 * src/getargs.c (usage): Mention.
2450 (PRINT_DATADIR_OPTION): New anonymous enum member.
2451 (long_options): Add entry for it.
2452 (getargs): Add case for it calling compute_pkgdatadir.
2453 * src/output.c (output_skeleton): Encapsulate data directory
2454 computation from here...
2455 (prepare): ... and from here...
2456 (compute_pkgdatadir): ... into this new function.
2457 * src/output.h (compute_pkgdatadir): Prototype.
2458
34cdeddf
JD
24592007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2460
2461 * src/print-xml.c (escape_bufs): New static global variable
2462 replacing...
2463 (xml_escape_n): ... the static local variable buf here.
2464 (print_xml): Free memory for escape_bufs.
2465 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2466
d782395d
JD
24672007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2468
2469 Replace `%push-parser' and `%push-pull-parser' with
2470 `%define push_pull "push"' and `%define push_pull "both"'.
2471 `%define push_pull "pull"' is the default.
2472 * doc/bison.texinfo (Push Decl, Push Parser Function,
2473 Pull Parser Function, Parser Create Function, Parser Delete Function):
2474 Update declarations.
2475 (Decl Summary, Table of Symbols): Replace %push-parser and
2476 %push-pull-parser entries with a %define push_pull entry.
2477 * data/bison.m4 (b4_percent_define_check_values): New macro.
2478 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2479 definitions...
2480 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2481 definitions...
2482 * data/push.c: ... to here and compute them from the value of the
2483 %define variable push_pull.
2484 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2485 parsing requests here...
2486 * data/yacc.c: ... hack this to switch to push.c any time
2487 b4_use_push_pull_flag or the %define variable push_pull is set. This
2488 will go away when we mv push.c yacc.c.
2489 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2490 push parsing is not supported since unused %define variables are
2491 reported anyway.
2492 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2493 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2494 comments for consistency with b4_percent_define_check_values.
2495 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2496 muscles.
2497 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2498 Remove.
2499 (prologue_declaration): Remove %push-parser and %push-pull-parser
2500 rules.
2501 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2502 * tests/calc.at: Update declarations.
2503 * tests/input.at (%define enum variables): New test case.
2504 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2505 declaration.
2506 (Push Parsing: Multiple impure instances): Update declaration.
2507 (Push Parsing: Unsupported Skeletons): New test case.
2508 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2509 declaration.
2510 (Exploding the Stack Size with Malloc): Update declaration.
2511
3f999f78
WP
25122007-09-24 Wojciech Polak <polak@gnu.org>
2513
2514 Add XSLT transformations.
2515
2516 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2517 * data/xslt/xml2text.xsl: Transform XML into plain text.
2518 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2519 * data/Makefile.am (xsltdir): New variable.
2520 (dist_xslt_DATA): Add xslt/*.xsl files.
2521
a4f75309
PE
25222007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2523
2524 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2525 Problem reported by Wojciech Polak.
2526 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2527 (xml_printf): Undo change I made on 21 September; that is,
2528 indent 2 spaces, not 1.
2529
ad5feac4
JD
25302007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2531
2532 Pacify ./configure --enable-gcc-warnings.
2533 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2534 `char const *' instead of `char *'.
2535 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2536 local variable `sep'.
2537
41d7a5f2
PE
25382007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2539
2540 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2541 elsewhere.
2542 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2543 (xml_printf): Indent just 1 space for level.
2544 (e_char, xlate_char): Remove.
2545 (xml_escape_string): Rewrite to avoid undefined behavior (used
2546 storage that was freed from the stack).
2547 (xml_escape_n): Don't bother checking for subscript error.
2548
3f999f78
WP
25492007-09-21 Wojciech Polak <polak@gnu.org>
2550
2551 Add Bison XML Automaton Report.
41d7a5f2
PE
2552
2553 Add support for an -x option to generate an XML report.
2554 It is not documented yet.
2555 * src/print-xml.c: New file.
2556 * src/print-xml.h: Likewise.
2557 * lib/timevar.def (TV_XML): New var.
2558 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2559 * src/conflicts.c: Include print-xml.h.
2560 (solved_conflicts_xml_obstack): New var.
2561 (log_resolution, conflicts_solve, conflicts_free):
2562 Add support for XML report.
2563 (conflicts_output_val): New function.
2564 * src/conflicts.h (conflicts_output_val): New decl.
2565 * src/files.c (spec_xml_file): New var.
2566 (compute_output_file_names, output_file_names_free): Add XML support.
2567 * src/files.h (spec_xml_file): New decl.
2568 * src/getargs.c (xml_flag): New var.
2569 (usage, short_options, long_options, getargs): Add XML support.
2570 * src/getargs.h (xml_flag): New decl.
2571 * src/gram.c: Include print-xml.h.
2572 (rule_lhs_print_xml, rule_rhs_print_xml):
2573 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2574 New functions.
2575 * src/gram.h: Declare external ones.
2576 * src/main.c: Include print-xml.h.
2577 (main): Add XML support.
2578 * src/reduce.c: Include print-xml.h.
2579 (reduce_xml): New function.
2580 * src/reduce.h: Declare it.
2581 * src/state.c: Include print-xml.h.
2582 (state_new): Add XML support.
2583 (state_rule_lookahead_tokens_print_xml): New function.
2584 * src/state.h: Declare it.
2585 (struct state): New member solved_conflicts_xml.
2586 * src/symtab.c (symbol_class_get_string): New function.
2587 * src/symtab.h: Declare it.
2588
6d8e724d
PE
25892007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2590
2591 * GNUmakefile: Switch to coreutils's version.
2592 * bootstrap: Likewise.
2593 * Makefile.cfg: Adjust to new GNUmakefile.
2594 * README-hacking: Likewise.
2595
2596 Import from gnulib:
2597
2598 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2599 Bruno Haible <bruno@clisp.org>
2600
2601 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2602 and is a script that invokes bison. Tighten the code. Add comments.
2603
922bdd7f
JD
26042007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2605
2606 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2607 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2608 * doc/bison.texinfo (Decl Summary): Fix.
2609 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2610 * tests/input.at (Boolean %define variables): Update output.
2611 * tests/skeletons.at (%define boolean variables: invalid skeleton
2612 defaults): Rename to...
2613 (%define Boolean variables: invalid skeleton defaults): ... this and
2614 update output.
2615
1b17b01d
JD
26162007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2617
2618 In impure push mode, don't allow more than one yypstate to be allocated
2619 since multiple impure parsers would corrupt yynerrs.
2620 * data/push.c (yypstate_allocated): New static global variable
2621 initialized to 0.
2622 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2623 exhaustion if yypstate_allocated is 1, but still return 2.
2624 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2625 already 1. Otherwise, set it to 1.
2626 (yypstate_delete): Set it to 0.
2627 * tests/push.at (Push Parsing: Multiple impure instances): New test
2628 case.
2629
9987d1b3
JD
26302007-08-17 Bob Rossi <bob@brasko.net>
2631
2632 * doc/bison.texinfo (Push Decl): Document the push parser.
2633 (Table of Symbols): Ditto.
2634 (Pure Decl): Ditto.
2635 (Decl Summary): Ditto.
2636 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2637 Parser Create Function, Parser Delete Function):
2638 Add new push parser symbols.
2639 (Table of Symbols): Document push-parser, push-pull-parser,
2640 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2641
f16b0819
PE
26422007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2643
2644 Update to GPLv3.
2645 * doc/gpl-3.0.texi: New file.
2646 * doc/gpl.texi: Remove.
2647 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2648 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2649 * README-hacking, TODO, bootstrap, bootstrap.conf:
2650 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2651 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2652 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2653 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2654 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2655 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2656 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2657 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2658 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2659 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2660 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2661 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2662 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2663 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2664 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2665 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2666 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2667 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2668 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2669 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2670 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2671 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2672 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2673 * src/complain.c, src/complain.h, src/conflicts.c:
2674 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2675 * src/files.h, src/flex-scanner.h, src/getargs.c:
2676 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2677 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2678 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2679 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2680 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2681 * src/print.c, src/print.h, src/print_graph.c:
2682 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2683 * src/reduce.h, src/relation.c, src/relation.h:
2684 * src/revision.h, src/scan-code.h, src/scan-code.l:
2685 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2686 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2687 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2688 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2689 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2690 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2691 * tests/existing.at, tests/glr-regression.at:
2692 * tests/headers.at, tests/input.at, tests/java.at:
2693 * tests/local.at, tests/output.at, tests/push.at:
2694 * tests/reduce.at, tests/regression.at, tests/sets.at:
2695 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2696 * tests/torture.at:
2697 Update to GPLv3.
2698
728c4be2
JD
26992007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2700
2701 Get rid of broken %no-parser, -n, and --no-parser implementation and
2702 documentation.
2703 * TODO: Don't mention them.
2704 * doc/bison.1: Likewise.
2705 * doc/bison.texinfo (Decl Summary): Likewise.
2706 (Bison Options): Likewise.
2707 (Option Cross Key): Likewise.
2708 * src/getargs.c (no_parser_flag): Remove global variable.
2709 (usage): Don't print description of -n and --no-parser.
2710 (long_options): Remove --no-parser entry here.
2711 (getargs): Remove -n case in the switch here.
2712 * src/getargs.h (no_parser_flag): Remove extern.
2713 * tests/regression.at (Web2c Actions): Remove comment that mentions
2714 --no-parser.
2715
5d31a216
JD
27162007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2717
2718 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2719 name user variables starting with `yy'. Just pass NULL instead of a
2720 dummy local &yylval to yypush_parse.
2721 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2722 starting with `yy'.
2723
a2ea208d
JD
27242007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2725
2726 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2727 true since it's then always used regardless of whether yyoverflow is
2728 defined. Reported by Christian Burger at
2729 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2730 * THANKS: Add Christian Burger.
2731
91661ebb
JD
2732 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2733 node names: say "Decl Summary" not "Bison Declaration Summary".
2734
cbd50549
JD
27352007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2736
2737 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2738 determine whether this function has already complained about an invalid
2739 value for a %define boolean variable, don't check whether Bison has
2740 ever examined the value. As written, the check was a tautology.
2741 Instead, record and check for this complaint using a separate muscle.
2742
eb1b0740
JD
27432007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2744
2745 Fix push parsing memory leak reported by Brandon Lucia at
2746 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2747 * THANKS: Add Brandon Lucia.
2748 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2749 but the parse never completed and thus freed it.
2750 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2751 * tests/testsuite.at: Include push.at.
2752 * test/push.at: New.
2753 (Push Parsing: Memory Leak for Early Deletion): New test case.
2754
9d774aff
JD
27552007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2756
2757 Improve handling of multiple S/R conflicts in the same state and of S/R
2758 conflicts involving multiple reductions.
2759 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2760 set for a state here or Bison will abort if it is reassigned on a
2761 later conflicted reduction in the same state.
2762 Similarly, don't finalize and assign the solved conflicts report here
2763 or it will be lost if it is reassigned on a later conflicted reduction
2764 in the same state.
2765 (set_conflicts): Instead, assign them both here after all S/R conflicts
2766 in the state have been fully examined.
2767 * src/print.c (shift_set): Rename to...
2768 (no_reduce_set): ... this.
2769 (print_reductions): Update for rename, and add %nonassoc error action
2770 tokens to no_reduce_set so that, when printing the first remaining
2771 reduction on an error action token, the reduction is enclosed in
2772 brackets.
2773 (print_results): Update for rename.
2774 * tests/conflicts.at (Solved conflicts report for multiple reductions
2775 in a state): New test case.
2776 (%nonassoc error actions for multiple reductions in a state): New test
2777 case.
2778
2779 * src/main.c (main): Don't depend on C99 features.
2780
10159d2a
JD
27812007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2782
2783 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
2784 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2785 uniwidth.
10159d2a 2786
953b3935
JD
27872007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2788
2789 * bootstrap (slurp): Create target directories that don't exist.
2790 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2791
6ce2d93a
JD
27922007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2793
2794 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2795 than item number.
2796 * closure.c (closure): Likewise.
2797 * state.h (reductions): Comment sorting of rules.
2798 (state): Comment sorting of items.
2799
ce3448d5
JD
28002007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2801
2802 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2803 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2804 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2805 definition in order to avoid Gnulib headers since we don't use config.h
2806 here.
2807 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2808 rather than AT_DATA so that config.h is included.
2809
8a86eef0
JD
28102007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2811
2812 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2813 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2814 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2815 and so that YYFPRINTF is guaranteed to be defined here.
2816
b1a81613
JD
28172007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2818
2819 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2820 with...
2821 (muscle_percent_define_check_values): ... this more helpful function.
2822 Again, it's not used yet, but it will be.
2823 * src/muscle_tab.h: Likewise.
2824
71b61d4d
JD
2825 Improve some comments in parser table construction.
2826 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2827 (generate_states): Don't mention ruleset, which is internal to closure.
2828 * src/closure.c (closure): Explain sorting of core and itemset, which
2829 is required for this function to behave correctly.
2830 * src/closure.h (closure): Mention sorting.
2831
2a6b783d
JD
28322007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2833
2834 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2835 move the check for disabled transitions to an aver since conflict
2836 resolution hasn't happened yet.
2837
2838 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2839 labels a state as inconsistent just because it has error transitions.
2840 The original form of this check appeared in revision 1.1 of lalr.c,
2841 which was committed on 1991-12-21. Now (at least), changing the
2842 consistency label on such a state appears to have no useful effect in
2843 any of the places it is examined, which I enumerate below. The key
2844 point to understanding each item in this enumeration is that a state
2845 with an error transition is labelled consistent in the first place only
2846 if it has no rules, so the check cannot matter for states that have
2847 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2848 to try to identify its conflicts, and a state must have *rules* to have
2849 conflicts. (2) Labelling a state as inconsistent will affect how
2850 action_row sets the default *rule* for the state. (3) Labelling a
2851 state as inconsistent will cause build_relations to add lookback edges
2852 to *rules* in that state.
2853 * src/state.h (struct state): Word the comment for member consistent
2854 more carefully.
2855
14462c2b
JD
28562007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2857
2858 Don't depend on C99 features.
2859 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2860 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2861 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2862 * src/state.c (state_mark_reachable_states): Fix for-loop.
2863 (state_remove_unreachable_states): Fix for-loop.
2864
2865 Don't widen struct state with member reachable just to temporarily
2866 record reachability. Instead, use a local bitset.
2867 * src/state.h (struct state): Remove member.
2868 * src/state.c (state_new): Don't initialize it.
2869 (state_mark_reachable_states): Rename to...
2870 (state_record_reachable_states): ... this, and use bitset.
2871 (state_remove_unreachable_states): Use bitset.
2872
5a43d418
JD
28732007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2874
2875 * src/Makefile.am (yacc): Quote target action commands properly so
2876 that the yacc script isn't corrupt. Reported by Hans Aberg at
2877 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
2878
0c650a20
JD
2879 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
2880 the case of pure parsers. Reported by Frans Englich at
2881 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
2882 * THANKS: Add Frans Englich.
2883
61fee93e
JD
2884 * NEWS (2.3a+): In the %code entry, reference section `Bison
2885 Declaration Summary' from the manual now since the %code summary has
2886 moved there.
2887 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
2888 in the rules section must be terminated by semicolons.
2889
f124d423
JD
28902007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2891
2892 Extend the front-end API for %define variables to more completely
2893 mirror the back-end. This will be useful in the future.
2894 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
2895 Update comments to mention the new front-end counterparts of these
2896 macros.
2897 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
2898 for muscle_string_decode and muscle_location_decode.
2899 (muscle_string_decode): New static function.
2900 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
2901 (muscle_percent_define_get, muscle_percent_define_ifdef): New
2902 functions.
2903 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
2904 muscle_percent_define_get to mimic the b4_percent_define_flag_if
2905 implementation more closely.
2906 (muscle_percent_define_invalid_value): New function.
2907 * src/muscle_tab.h (muscle_percent_define_get,
2908 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
2909 Prototype.
2910
75ad86ee
JD
29112007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2912
2913 * NEWS (2.3a+): Mention yesterday's state-removal change.
2914 (2.3a): Remove the %language entry, which was added after 2.3a.
2915 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
2916 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
2917 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
2918 tests/existing.at: Update copyright date.
2919
5967f0cf
JD
29202007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2921
2922 If conflict resolution makes states unreachable, remove those states,
2923 report rules that are then unused, and don't report conflicts in those
2924 states.
2925 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
2926 New global function.
2927 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
2928 function.
2929 * src/main.c (main): After conflict resolution, remove the unreachable
2930 states and update all data structures that reference states by number.
2931 * src/state.c (state_new): Initialize each state's reachable member to
2932 false.
2933 (state_mark_reachable_states): New static function.
2934 (state_remove_unreachable_states): New global function.
2935 * src/state.h (struct state): Add member bool reachable.
2936 (state_remove_unreachable_states): Prototype.
2937 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2938 New test case.
2939 * tests/existing.at (GNU pic Grammar): Update test case output now that
2940 an unused rule is discovered.
2941
b09f4f48
JD
29422007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2943
2944 Minor code cleanup in parser table construction.
2945 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
2946 (new_itemsets, save_reductions): Update for rename to nitemset.
2947 * src/closure.c (nritemset): Rename to...
2948 (nitemset): ... this since the "r" appears to meaningless and isn't
2949 used in the comments.
2950 (closure): Update for rename.
2951 * src/closure.h (nritemset): Update extern to...
2952 (nitemset): ... this.
2953 * src/lalr.c (LA): Fix a typo in comments.
2954 * src/print.c (print_core): Update for rename to nitemset.
2955 * src/print_graph.c (print_graph): Likewise.
2956 * src/state.h: Fix some typos in header comments.
2957
bbb44d83
PE
29582007-04-04 Paul Eggert <eggert@cs.ucla.edu>
2959
9b33de72
PE
2960 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
2961 still sticks to ASCII. Sorry!
2962
bbb44d83
PE
2963 * README-hacking: New file, taken mostly from coreutils, with changes
2964 for Bison. Contains much of the contents of:
2965 * README-cvs: Remove.
2966 * bootstrap: Sync from gnulib.
2967 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
2968 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
2969
29553547
JD
29702007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
2971
2972 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
2973 Setzer.
2974 (Java Differences): Fix some typos.
2975 * THANKS: Add Sebastian Setzer.
2976
01b477c6
PB
29772007-03-07 Paolo Bonzini <bonzini@gnu.org>
2978
730739e4
AD
2979 * data/java.m4 (b4_single_class_if): Remove.
2980 (b4_abstract_if): Look at "%define abstract".
2981 (b4_lexer_if): New.
2982 (b4_union_name): Rename...
2983 (b4_yystype): ... to this. Map to "%define stype".
2984 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
2985 b4_maybe_throws): Fix quoting.
2986 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
2987 * data/lalr1.java (Lexer interface): Always define.
2988 (Lexer interface within parser class): Remove.
2989 (YYLexer class): New, used when "%code lexer" is present.
2990 (constructor): When "%code lexer" is used, pass %lex-param
2991 to the lexer constructor.
2992 (yylex, yyparse): Remove %lex-param from method invocations
2993 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
2994
2995 * doc/bison.texinfo (Java Bison Interface): Mention "%define
2996 abstract". Rename "%define union_name" to "%define stype".
2997 Rename method names according to previous patch.
2998 (Java Scanner Interface): Describe "%code lexer" instead of
2999 "%pure-parser" and "%define single_class".
3000 (Java Differences): Mention "%code lexer".
3001
3002 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3003 Include scanner here, using macros from tests/local.at.
3004 (AT_DATA_CALC_Y): Remove final argument.
3005 (_AT_CHECK_JAVA_CALC): Likewise.
3006 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3007 of %locations and %error-verbose.
3008 (main): Test with and without %lex-param.
3009 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3010 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 3011
122bea3a
JMG
30122007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3013
3014 DJGPP spefic issue. Inhibit the use of disallowed characters for
3015 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3016 and concern testsuite case 46.
3017 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3018 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3019 * djgpp/config.bat: Inhibit the use of disallowed characters.
3020
9611cfa2
JD
30212007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3022
3023 Miscellaneous %define and %code cleanup.
3024 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3025 values are interpreted.
3026 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3027 documentation a little more.
3028 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3029 muscle_percent_define_insert, muscle_percent_code_grow): New
3030 functions/macros.
3031 * src/muscle_tab.h (muscle_percent_define_insert,
3032 muscle_percent_code_grow): Prototype.
3033 * src/parse-gram.y (prologue_declaration): Use
3034 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3035 %define and %code directives.
3036
3037 Make it easy to share %define boolean variables between the front-end
3038 and back-end. Though not used yet, this will be useful in the future.
3039 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3040 Bison uses of names rather than just skeleton uses of names.
3041 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3042 b4_percent_define_skeleton_variables(VARIABLE) to
3043 b4_percent_define_bison_variables(VARIABLE).
3044 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3045 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3046 b4_percent_code_bison_qualifiers(QUALIFIER).
3047 (b4_check_user_names_wrap): Update for renames.
3048 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3049 muscle_percent_define_default): New functions mimicking
3050 b4_percent_define_flag_if and b4_percent_define_default.
3051
3052 For %define variables, report locations for invalid values and
bbb44d83 3053 redefinitions.
9611cfa2
JD
3054 * data/bison.m4 (b4_percent_define_flag_if): Read
3055 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3056 value for VARIABLE.
3057 (b4_percent_define_default): Save a special location in
3058 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3059 must later be reported as invalid.
3060 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3061 functions.
3062 (muscle_percent_define_insert): Record the location of VARIABLE in
3063 muscle percent_define_loc(VARIABLE), and use it to report the previous
3064 location for a redefinition.
3065 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3066 (muscle_percent_define_default): Update like b4_percent_define_default.
3067 (muscle_grow_user_name_list): Rename to...
3068 (muscle_user_name_list_grow): ... this for consistency and use
3069 muscle_location_grow.
3070 * src/muscle_tab.h (muscle_location_grow): Prototype.
3071 * tests/input.at (%define errors): Update expected output.
3072 * tests/skeletons.at (%define boolean variables: invalid skeleton
3073 defaults): New test case.
3074
0bf92491
JD
30752007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3076
3077 * src/print.c (lookahead_set, state_default_rule): Remove.
3078 (print_reductions): Replace state_default_rule invocation with
3079 equivalent use of yydefact, which was computed in token_actions in
3080 tables.c.
3081 (print_results): Don't allocate lookahead_set.
3082
d3b12988
PB
30832007-02-27 Paolo Bonzini <bonzini@gnu.org>
3084
3085 * data/lalr1.java: Prefix all private members with yy.
3086
f57a7536
JD
30872007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3088
3089 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 3090 Sebastien Fricker at
f57a7536 3091 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 3092 * THANKS: Add Sebastien Fricker.
f57a7536
JD
3093 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3094 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3095 accept a variable number of arguments.
3096
6404a5bf
JD
30972007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3098
3099 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3100
e4e09639
JMG
31012007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3102
3103 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3104 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3105 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3106
d7e0a1a7
PE
31072007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3108
3109 Undo my 2007-02-07 change, switching back to the c-strcase module
3110 introduced in the 2007-02-03 change. Bruno Haible reported that
3111 the 2007-02-07 change would be dangerous in Turkish if we add a
3112 language whose name contains "i", since "i" is not lowercase "I"
3113 in Turkish.
3114 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3115 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3116 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3117 * m4/.cvsignore: Remove strcase.m4.
3118 * src/getargs.c: Revert 2007-02-07 change, as follows.
3119 Include c-strcase.h.
3120 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3121
deee93a1
JD
31222007-02-11 Bruno Haible <bruno@clisp.org>
3123
3124 Enable the Java related testsuite tests when the only Java compiler
3125 found is a gcj < 4.3. Discussed at
3126 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3127 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3128
574add85
JD
31292007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3130
3131 * data/Makefile.am: Update copyright date.
3132 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3133 yypstate_new returns NULL.
3134 (yypstate_new): Return NULL if malloc does.
3135 * src/reader.c (packgram): Move translation of rule actions from the
3136 beginning of packgram to...
3137 (check_and_convert_grammar): ... here right before packgram is invoked
3138 so it's easier to write more complete comments, and remove redundant
3139 code.
3140
e785ccf7
JD
31412007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3142
3143 As in semantic actions, make @$ in %initial-action, %destructor, and
3144 %printer imply %locations.
3145 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3146 scanning @$.
3147 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3148 (@$ in %initial-action implies %locations,
3149 @$ in %destructor implies %locations,
3150 @$ in %printer implies %locations): ... these new test cases.
3151
1cfe1ed7
PE
31522007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3153
3154 Undo most of the 2007-02-03 change, switching to the strcase module
3155 now that gnulib strcase has been fixed.
3156 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3157 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3158 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3159 * m4/.cvsignore: Add strcase.m4.
3160 * src/getargs.c: Revert 2007-02-03 change, as follows.
3161 Don't include c-strcase.h.
3162 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3163 strcasecmp has "unspecified behavior" outside the POSIX locale,
3164 but it works fine in practice if at least one argument is ASCII,
3165 as is the case in Bison.
3166
0049ec86
PB
31672007-02-07 Paolo Bonzini <bonzini@gnu.org>
3168
3169 * tests/java.at: Skip tests if only one of javac/java is present.
3170 Reported by Joel E. Denny.
3171 * tests/atlocal.in: Adjust copyright years.
3172
31732007-02-05 Paolo Bonzini <bonzini@gnu.org>
3174
3175 * data/lalr1.java (Stack): Work around old verifiers that disallow
3176 access to the private fields of an inner class, from the outer class.
3177 We can make Stack's fields public because user code doesn't have access
3178 to the instance of Stack used by parse(). Reported by Paul Eggert.
3179
2c2b7220
PE
31802007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3181
3182 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3183 the right spot for these files?
3184 * bootstrap.conf (gnulib_modules): Add c-strcase.
3185 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3186 c-strncasecmp.c.
3187 * src/getargs.c: Include c-strcase.h.
3188 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3189 to avoid unspecified behavior.
3190
b2b81dae
JD
31912007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3192
3193 * doc/bison.texinfo (Decl Summary): Correct typo.
3194
c1d19e10
PB
31952007-01-30 Paolo Bonzini <bonzini@gnu.org>
3196
3197 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3198 Complain if the value does not match empty, "true" or "false".
3199 * data/c++.m4: Adjust default definitions of %define variables.
3200 * data/java.m4: Adjust default definitions of %define variables.
3201 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3202 to above behavior.
3203 * tests/input.at (Boolean %define variables): Test new behavior.
3204
8405b70c
PB
32052007-01-29 Paolo Bonzini <bonzini@gnu.org>
3206
3207 * NEWS: Mention java.
3208 * TODO: Remove things that are done.
3209 * bootstrap.conf: Add javacomp-script and javaexec-script.
3210 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3211
3212 * data/Makefile.am: Add new files.
3213 * data/java-skel.m4: New.
3214 * data/java.m4: New.
3215 * data/lalr1.java: New.
3216
3217 * doc/bison.texinfo: Put "A Complete C++ Example" under
3218 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3219 under Other Languages.
3220
3221 * src/getargs.c (valid_languages): Add Java.
3222 * src/getargs.h (struct bison_language): Update size of string fields.
3223
3224 * tests/Makefile.am: Add java.at.
3225 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3226 * tests/java.at: New.
3227 * tests/testsuite.at: Include it.
3228
3eb82471
JD
32292007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3230
3231 Clean up.
3232 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3233 at_directive_argv arguments so these no longer have to be global
3234 variables. Also, update the implementation for the following changes.
3235 (fail_for_at_directive_too_many_args,
3236 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3237 (at_directive_name): Remove as at_directive_argv[0] will be used for
3238 this now.
3239 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3240 for the directive name.
3241 (at_directive_argc, at_directive_argv): Make these local within
3242 skel_lex instead of global.
3243 (INITIAL): Update directive start action for above changes.
3244 (SC_AT_DIRECTIVE_ARG): Rename to...
3245 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3246 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3247 (scan_skel): Move yylex_destroy to...
3248 (skel_scanner_free): ... here.
3249 * tests/skeletons.at (installed skeleton file name): Rename to...
3250 (installed skeleton file names): ... this.
3251
148d66d8
JD
32522007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3253
3254 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3255 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3256 Summary" not "Directives".
3257 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3258 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3259 since the former is now the more complete one.
3260 (Prologue Alternatives): Likewise and do the same for %defines.
3261 (Table of Symbols): Add summary of %code, add summary of %define, and
3262 move full %code documentation to...
3263 (Decl Summary): ... here for consistency with other entries in these
3264 sections.
3265 Move %define entry in order to keep this list alphabetized.
3266 Reword %define entry a little to put less emphasis on the skeleton
3267 concept, which most users shouldn't have to think about.
3268
665f0c24
PE
32692007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3270
3271 Adjust to recent gnulib changes.
3272 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3273 Add string.h, string_.h, unistd_.h, wchar_.h.
3274 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3275 * src/system.h: Don't include <stpcpy.h>; this is now done by
3276 <string.h>.
3277
592d0b1e
PB
32782007-01-23 Paolo Bonzini <bonzini@gnu.org>
3279
3280 Simplify implementation of unqualified %code, implement macros for
3281 uniform treatment of boolean %define flags. Document %define.
3282 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3283 b4_percent_code_ifdef): New.
3284 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3285 * data/c++.m4: Define default value for global_tokens_and_yystype.
3286 * data/glr.cc: Likewise.
3287 * data/location.cc: Use b4_percent_define_flag_if.
3288
148d66d8 3289 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
3290
3291 * src/parse-gram.y (Unqualified %code): Change muscle name to
3292 b4_percent_code().
3293 (content.opt): Default to empty.
3294
a7867f53
JD
32952007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3296
3297 Implement support for relative and absolute skeleton file names.
3298 Discussed starting at
3299 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3300 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3301 (Bison Options): Document in --skeleton entry.
3302 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3303 full_skeleton can't necessarily hold all of pkgdatadir.
3304 If the specified skeleton file name contains a `/', don't prepend
3305 pkgdatadir.
3306 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3307 file name contains a `/', prepend the grammar file directory.
3308 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3309 * skeletons.at: New file.
3310 (relative skeleton file names): New test case.
3311 (installed skeleton file names): New test case.
3312 * tests/testsuite.at: Include skeletons.at.
3313
3314 * bootstrap: Update copyright to 2007.
3315
830c9b18
PB
33162007-01-17 Paolo Bonzini <bonzini@gnu.org>
3317
3318 * bootstrap: Remove occurrences of .#bootmp from the files.
3319
a8c2e813
AD
33202007-01-17 Akim Demaille <akim@epita.fr>
3321
3322 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3323 nonterminals.
3324 Use per-type %printer.
3325
279cabb6
JD
33262007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3327
3328 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3329 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3330 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3331 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3332 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3333 tests/glr-regression.at, tests/input.at, tests/local.at,
3334 tests/output.at, tests/torture.at: Update copyright to 2007.
3335
bb32f4f2
AD
33362007-01-16 Akim Demaille <akim@epita.fr>
3337
3338 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3339 error code.
3340 (Calc++ Scanner): Exit with failure if we can't open the input
3341 file.
3342 Accept "-" standing for stdin.
3343 (Calc++ Top Level): Print the result only if the parsing was
3344 successful.
3345
7cff04b5
AD
33462007-01-16 Akim Demaille <akim@epita.fr>
3347
3348 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3349
a4e25e1d
JD
33502007-01-15 Paolo Bonzini <bonzini@gnu.org>
3351 and Joel E. Denny <jdenny@ces.clemson.edu>
3352
3353 Clean up %define and %code implementation in M4 some. Most
3354 importantly, rename all related macros to be in the b4_percent_define
3355 and b4_percent_code namespaces. Also, complete support for `.' in
3356 %define variable names and %code qualifiers.
3357 * data/bison.m4 (b4_check_user_names): Check for special
3358 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3359 m4_foreach loops.
3360 (b4_get_percent_define, b4_get_percent_code): Rename to...
3361 (b4_percent_define_get, b4_percent_code_get): ... these.
3362 Extend documentation with examples.
3363 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3364 b4_percent_define_skeleton_variables and
3365 b4_percent_code_skeleton_qualifiers.
3366 Expect any value for the %define variable `foo' to be stored in the
3367 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3368 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3369 expect any unqualified %code blocks to be stored in a macro named
3370 `b4_percent_code_unqualified'.
3371 Use m4_indir so that %define variable names and %code qualifiers can
3372 contain `.', which is allowed by the grammar parser.
3373 (b4_percent_define_default): New macro to set a default value for a
3374 %define variable.
3375 (m4_wrap): Update wrapped code, and fix some underquoting.
3376 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3377 Expect grammar uses of %define variables and %code qualifiers to be
3378 defined in b4_percent_define_user_variables and
3379 b4_percent_code_user_qualifiers.
3380 * data/c++.m4: Use b4_percent_define_default rather than
3381 m4_define_default. Fix some underquoting. Skeleton usage of %define
3382 variable define_location_comparison now implies skeleton usage of
3383 %define variable filename_type.
3384 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3385 data/push.c, data/yacc.c: Update macro names.
3386 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3387 muscle names.
3388
e37c665c
JMG
33892007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3390
3391 DJGPP specific issues.
3392
3393 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3394 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3395
7d2d521f
JD
33962007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3397
3398 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3399 run parsers in all tests so that Valgrind is invoked during
3400 maintainer-check-valgrind.
3401 (Duplicate representation of merged trees): Free all semantic values.
3402 (Duplicated user destructor for lookahead): Likewise.
3403
e0ac9b4b
JD
34042007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3405
3406 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3407 command-line prefix.
3408 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3409 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3410 miss Valgrind messages.
3411 (Exploding the Stack Size with Malloc): Likewise.
3412
78143faa
JD
34132007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3414
3415 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3416 locals. Reported by Juan Manuel Guerrero at
3417 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3418 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3419 Fix some indentation also.
3420 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3421 explaining this issue.
3422
7ecec4dd
JD
34232007-01-09 Paolo Bonzini <bonzini@gnu.org>
3424 and Joel E. Denny <jdenny@ces.clemson.edu>
3425
3426 Simplify union and prologue handling, and escape union and lex/parse
3427 params with digraphs.
3428 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3429 values to the empty string since these are no longer guaranteed
3430 initialized by the front-end.
3431 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3432 braces around b4_user_stype since this is no longer done by the
3433 front-end.
3434 * src/files.c, src/files.h (pre_prologue_obstack,
3435 post_prologue_obstack): Remove.
3436 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3437 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3438 with digraphs. This fixes lex params and parse params.
3439 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3440 * src/output.c (prepare): Remove muscle insertion of the prologues.
3441 (output): Remove freeing of pre_prologue_obstack and
3442 post_prologue_obstack.
3443 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3444 than prologue_augment for prologue parsing so you don't need prologue
3445 obstacks.
5c80250c
JD
3446 (grammar_declaration): For %union RHS, use `braceless' instead of
3447 "{...}" so that braces are already stripped and code is escaped with
3448 digraphs.
7ecec4dd
JD
3449 * src/reader.c (prologue_augment): Remove.
3450 (reader): Remove initialization of pre_prologue_obstack and
3451 post_prologue_obstack.
3452 * src/reader.h (prologue_augment): Remove.
3453
3454 * data/c.m4: Remove stray parenthesis.
3455
16dc6a9e
JD
34562007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3457
3458 Remove quotes from variables names in %define directives and from
3459 qualifiers in %code directives, and restrict the characters that are
3460 allowed in them to M4-friendly ones. For %define, continue to support
3461 the quoted form as a deprecated feature. Discussed starting at
3462 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3463 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3464 %code.
3465 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
3466 (Decl Summary): In %defines entry, update mention of `%code requires'
3467 and `%code provides'.
16dc6a9e
JD
3468 (C++ Location Values): Update %define uses.
3469 (Calc++ Parser Interface): Likewise.
3470 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 3471 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
3472 * src/parse-gram.y (prologue_declaration): For %define variables, use
3473 `variable' instead of `STRING'.
3474 (grammar_declaration): For %code qualifiers, use `ID' instead of
3475 `STRING'.
3476 (variable): New nonterminal that takes an `ID' or a `STRING'.
3477 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3478 and %define uses.
3479 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3480 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3481 (%define errors): Update %define uses.
3482
e9813cd4
JD
34832007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3484
3485 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3486 instead of muscle_insert for %define values so that M4-special
3487 characters are replaced with digraphs.
3488 * tests/input.at (%define errors): Extend to check weird values.
3489
6afc30cc
JD
34902007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3491
3492 Instead of having skeletons declare all valid %define variables and
3493 %code qualifiers, provide macros that retrieve the associated values
3494 and build these lists automatically. Thus Bison will now warn when a
3495 variable or qualifier is not used by the skeleton in the current
3496 invocation regardless of whether it might sometimes be used by that
3497 skeleton in other invocations. Also, move all %define value macros to
3498 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3499 form, which is replaced by %code.
3500 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3501 (b4_check_user_names): ... this, and change the series of valid name
3502 arguments to a single list argument for names used in the skeleton
3503 similar to the existing list argument for names used in the grammar.
3504 Warn instead of complaining.
3505 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3506 values and %code code, to format %code code properly, and to build
3507 lists of all %define variables and %code qualifiers used in the
3508 skeleton: b4_skeleton_percent_define_variables and
3509 b4_skeleton_percent_code_qualifiers.
3510 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3511 Remove, and...
3512 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3513 the skeleton names lists can finish building first. In place of
3514 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3515 expect the lists b4_user_percent_define_variables and
3516 b4_user_percent_code_qualifiers.
3517 * data/c++.m4: Where setting default values for b4_parser_class_name,
3518 b4_location_type, b4_filename_type, b4_namespace, and
3519 b4_define_location_comparison, update their names to the
3520 b4_percent_define_ namespace.
3521 * data/glr.c: Don't use b4_check_percent_define_variables and
3522 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3523 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3524 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 3525 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
3526 * data/location.cc: Use b4_get_percent_define.
3527 * data/push.c: Don't use b4_check_percent_define_variables and
3528 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3529 * data/yacc.c: Likewise, and don't call m4_exit in
3530 b4_use_push_for_pull_if or m4_wrap code will never execute.
3531 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3532 Rename to...
3533 (muscle_grow_user_name_list): ... this for consistency with the
3534 terminology used in bison.m4.
3535 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3536 %define variable names, and rename muscle used_percent_define_variables
3537 to user_percent_define_variables.
3538 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3539 user_percent_code_qualifiers.
3540 (content): Remove.
3541 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3542 {CODE} form is no longer accepted.
3543 * tests/input.at (Reject bad %code qualifiers): Rename to...
3544 (Reject unused %code qualifiers): ... this, and update test output.
3545 (%define error): Update test output.
3546
7eb8a0bc
JD
35472007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3548
3549 Check for unrecognized %define variables similar to checking for
3550 unrecognized %code qualifiers. Check for redefined %define variables.
3551 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3552 generalizes...
3553 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3554 (b4_check_percent_define_variables): New, also wraps it.
3555 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3556 variables using b4_check_percent_define_variables.
3557 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3558 all those exercised in the test suite and all those listed in the
3559 `Default values' section of c++.m4. Are there others?
3560 * data/push.c, data/yacc.c: Declare no valid %define variables.
3561 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3562 similar to muscle_find, but it works even when the muscle stores a
3563 const value.
3564 (muscle_grow_used_name_list): New function for constructing the used
3565 name list muscles that b4_check_for_unrecognized_names requires.
3566 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3567 %define'd more than once. Define the b4_used_percent_define_variables
3568 muscle with muscle_grow_used_name_list.
3569 (grammar_declaration): Abbreviate %code code with
3570 muscle_grow_used_name_list.
3571 * tests/input.at (%define errors): New.
3572
3fc65ead
JD
35732007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3574
3575 Provide warn_at, complain_at, and fatal_at function callbacks to the
3576 skeletons, and use this for %code qualifier complaints.
3577 * data/bison.m4 (b4_error_at): New, invoked by...
3578 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3579 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3580 @fatal_at(...@) directives.
3581 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3582 qualifiers in b4_used_percent_code_qualifiers and to use
3583 b4_complain_at.
3584 * src/location.c, src/location.h (boundary_set_from_string): New global
3585 function.
3586 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3587 function.
3588 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3589 to b4_used_percent_code_qualifiers.
3590 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3591 function.
3592 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3593 (lineno): Rename to...
3594 (out_lineno): ... this so I don't misunderstand it again.
3595 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3596 here; these newlines are in the input but not the output file.
3597 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3598 (at_directive_perform): ... this new static function, and add handling
3599 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3600 directives.
3601 * tests/input.at (Reject bad %code qualifiers): Update test output with
3602 locations and extend.
3603
3604 * tests/output.at (Output file name: [, Output file name: ]): Remove
3605 bogus comment about these tests failing.
3606
1c7b7e1d
JD
36072007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3608
3609 Clean up b4_check_percent_code_qualifiers a little.
3610 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3611 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3612 documentation and add examples.
3613 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3614 qualifiers here.
3615
08af01c2
JD
36162007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3617
3618 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3619 unreliable -- especially when they're hidden inside another macro.
3620 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3621 data/c.m4: Remove m4_divert(-1).
3622 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3623 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3624 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 3625 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
3626 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3627 pushed and popped by m4sugar, should be first on the stack.
3628
3629 Provide warn, complain, and fatal function callbacks to the skeletons.
3630 This provides more flexibility than m4_fatal, improves the error
3631 message format, and captures messages for translation. Discussed
3632 starting at
3633 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3634 * data/bison.m4 (b4_error): New, invoked by...
3635 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3636 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3637 directives. Because these M4 macros might be called when the current
3638 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3639 the previous removal of uses of m4_divert, which caused trouble.
3640 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3641 m4_fatal to report unrecognized %code qualifiers.
3642 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3643 push parser requests.
3644 * data/glr.c: Use b4_complain instead of m4_fatal to report
3645 non-deterministic push parser requests.
3646 Update @output usage to @output(...@) form.
3647 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3648 report missing %defines. Update @output usage to @output(...@) form.
3649 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3650 @output(...@) form.
3651 * src/main.c (main): Invoke skel_scanner_free.
3652 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3653 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3654 obstack_for_string from flex-scanner.h.
3655 (YY_DECL): Use to declare skel_lex static.
3656 (decode_at_digraphs): Remove; now handled in the new
3657 SC_AT_DIRECTIVE_ARG start condition.
3658 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3659 functions.
3660 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3661 at_directive_argv): New static globals.
3662 (INITIAL): Use fail_for_invalid_at.
3663 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3664 recognize the start of a generalized `@directive(...@)' form and
3665 start...
3666 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3667 directive args (using the new obstack_for_string), to decode the
3668 contained @ diagraphs, and to perform the directive. It recognizes
3669 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3670 @output(...@).
3671 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3672 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3673 `@,'.
3674 (scan_skel): Initialize obstack_for_string on the first call.
3675 (skel_scanner_free): New function to free obstack_for_string.
3676 * tests/input.at (Reject bad %code qualifiers): Update test output.
3677
8e0a5e9e
JD
36782007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3679
3680 Consolidate the 4 prologue alternative directives (%code, %requires,
3681 %provides, and %code-top) into a single %code directive with an
3682 optional qualifier field. Discussed at
3683 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3684 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3685 alternatives.
3686 * doc/bison.texinfo (Prologue Alternatives): Update.
3687 (Decl Summary): Update to %code "requires" and %code "provides".
3688 (Calc++ Parser): Update to %code "requires".
148d66d8 3689 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
3690 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3691 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3692 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3693 which are skeleton-specific.
3694 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3695 declare what %code qualifiers it supports and to complain if any other
3696 qualifiers were used in the grammar.
3697 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3698 and b4_user_code([b4_percent_code_provides]) in place of
3699 b4_user_requires and b4_user_provides.
3700 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3701 Add b4_user_code([b4_percent_code_top]) and
3702 b4_user_code([b4_percent_code]).
3703 Invoke b4_check_percent_code_qualifiers.
3704 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3705 PERCENT_REQUIRES): Remove.
3706 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3707 %requires. Rewrite the %code RHS as the unqualified form defining the
3708 muscle b4_percent_code. Add another RHS for the qualified %code form,
3709 which defines muscles of the form b4_percent_code_QUALIFIER and the
3710 b4_used_percent_code_qualifiers muscle.
3711 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3712 PERCENT_REQUIRES): Remove.
3713 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3714 %code "requires" and %code "provides".
3715 * tests/input.at (Reject bad %code qualifiers): New.
3716
95021767
JD
37172007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3718
3719 Use the new code_props interface for destructors and printers.
3720 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3721 printer_location members, and change the type of the destructor and
3722 printer members to code_props.
3723 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3724 symbol_printer_get, semantic_type_destructor_set,
3725 semantic_type_printer_set, default_tagged_destructor_set,
3726 default_tagless_destructor_set, default_tagged_printer_set,
3727 default_tagless_printer_set): Use code_props in arguments and return
3728 types in place of char const * and location.
3729 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3730 since the locations are now contained in the return of
3731 symbol_destructor_get and symbol_printer_get.
3732 * src/output.c (symbol_destructors_output, symbol_printers_output):
3733 Replace with...
3734 (symbol_code_props_output): ... this to eliminate duplicate code.
3735 (output_skeleton): Update to use symbol_code_props_output.
3736 * src/reader.c (symbol_should_be_used): Update use of
3737 symbol_destructor_get.
3738 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3739 Update uses of the various _destructor_set and _printer_set functions.
3740 * src/symtab.c: (default_tagged_destructor_location,
3741 default_tagless_destructor_location, default_tagged_printer_location,
3742 default_tagless_printer_location): Remove since we...
3743 (default_tagged_destructor, default_tagless_destructor,
3744 default_tagged_printer, default_tagless_printer): ... change the type
3745 of these to code_props.
3746 (symbol_new, semantic_type_new, symbol_destructor_set,
3747 semantic_type_destructor_set, symbol_destructor_get,
3748 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3749 symbol_check_alias_consistency, default_tagged_destructor_set,
3750 default_tagless_destructor_set, default_tagged_printer_set,
3751 default_tagless_printer_set): Update.
3752 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3753 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3754 code_props members.
3755 (symbol_print): Use SYMBOL_CODE_PRINT.
3756
f6857bbf
JD
37572007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3758
3759 Use the new code_props interface for rule actions.
3760 * src/symlist.h (symbol_list): Replace action, action_location, and
3761 used members with a code_props action_props member.
3762 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3763 grammar_midrule_action, grammar_current_rule_merge_set,
3764 grammar_current_rule_symbol_append, packgram): Update.
3765 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3766 * src/scan-code.l (handle_action_dollar): Update.
3767 (translate_rule_action): Remove, no longer used.
3768 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3769
7c0c6181
JD
37702007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3771
3772 Use the new code_props interface in parse-gram.y.
3773 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3774 Update all uses of translate_* functions to use the new code_props
3775 interface and to use gram_scanner_last_string_free and
3776 code_scanner_last_string_free where possible.
3777 (grammar_declaration): symbol_list_destructor_set and
3778 symbol_list_printer_set now perform the translation, so don't do it
3779 here. Use gram_scanner_last_string_free where possible.
3780 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3781 translate_code): Remove, no longer used.
3782 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3783 symbol_list_printer_set): Perform code translation here rather than
3784 depending on the caller to do so.
3785
3786 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3787 * src/scan-gram.h (gram_last_string): Remove declaration.
3788 * src/scan-gram.l (last_string): Declare it static.
3789
28e52c0d
JD
37902007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3791
3792 Encapsulate code properties and related functionality for the various
3793 destructors, printers, and actions into a code_props structure and
3794 interface. This patch merely implements code_props in scan-code.h and
3795 scan-code.l. Future patches will rewrite other modules to use it.
3796 Discussed starting at
3797 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3798 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3799 consistently initialize const structs that have an empty location
3800 field.
3801 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3802 to ensure consistency.
3803 * src/scan-code.h (code_props): New structure.
3804 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3805 function, macro, and const global variable for initializing a
3806 code_props with no code.
3807 (code_props_plain_init, code_props_symbol_action_init,
3808 code_props_rule_action_init, code_props_translate_code): The rest of
3809 the new code_props functional interface. Among other things, the init
3810 functions set the code_props kind field so that
3811 code_props_translate_code will know whether to behave like
3812 translate_symbol_action, translate_rule_action, or translate_code.
3813 These old translate functions must remain until all other modules are
3814 updated to use the new code_props interface.
3815 (code_scanner_last_string_free): New function similar to
3816 gram_scanner_last_string_free.
3817 (code_scanner_free): Add documentation.
3818 * src/scan-code.l: Implement the new interface.
3819 (code_lex): Make it static, add a code_props* argument, and remove the
3820 rule argument.
3821 (last_string): New static global similar to the one in scan-gram.l.
3822 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3823 instead of rule.
3824 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3825 code_props since Bison may one day use this information for destructors
3826 and printers.
3827 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3828 (handle_action_dollar): Use symbol_list_n_get and set used flag
3829 directly since symbol_list_n_used_set is removed.
3830 (translate_action): Add a code_props* argument and remove the rule,
3831 action, and location arguments. Pass the code_props* on to code_lex.
3832 (translate_rule_action, translate_symbol_action, translate_code):
3833 Rewrite as wrappers around the new code_props interface.
3834 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3835 it would eventually need to break the encapsulation of code_props.
3836
96034983
JD
38372007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3838
3839 * etc/.cvsignore: New.
3840
945e396c
JD
38412007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3842
3843 Add maintainer-push-check to run maintainer-check using push parsing in
3844 place of pull parsing where available.
3845 * Makefile.am (maintainer-push-check): New.
3846 * data/bison.m4 (b4_use_push_for_pull_if): New.
3847 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3848 appropriately based on their existing values.
3849 (yypush_parse): Don't print push-parser-specific diagnostics if push
3850 parsing is being used in place of pull parsing.
3851 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3852 push.c.
3853 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3854 variable, and insert b4_use_push_for_pull_flag into muscles.
3855 * tests/Makefile.am (maintainer-push-check): New.
3856
7d596384
JD
38572006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3858
3859 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3860 (whether successful or failed) so that yypush_parse can be invoked
3861 again to start a new parse using the same yypstate.
3862 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3863 check multiple yypull_parse invocations on the same yypstate. For pull
3864 mode, extend to check multiple yyparse invocations.
3865 (Exploding the Stack Size with Alloca): Extend to try with
3866 %push-pull-parser.
3867 (Exploding the Stack Size with Malloc): Likewise.
3868
3869 * tests/calc.at (Simple LALR Calculator): Don't specify
3870 %skeleton "push.c" since %push-pull-parser implies that now.
3871 * tests/headers.at (export YYLTYPE): Don't check for the push
3872 declarations. Otherwise, this test case can't be used to see if push
3873 mode can truly emulate pull mode.
3874 * tests/input.at (Torturing the Scanner): Likewise.
3875 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
3876 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
3877 AT_YACC_IF, which now includes the case of push mode since %skeleton
3878 need not be used for push mode. This will be more intuitive once
3879 push.c is renamed to yacc.c.
3880
7172e23e
JD
38812006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3882
3883 For push mode, convert yyparse from a macro to a function, invoke yylex
3884 instead of passing a yylexp argument to yypull_parse, and don't
3885 generate yypull_parse or yyparse unless %push-pull-parser is declared.
3886 Discussed starting at
3887 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
3888 * data/bison.m4 (b4_pull_if): New.
3889 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
3890 * data/push.c: Improve M4 quoting a little.
3891 (b4_generate_macro_args, b4_parenthesize): Remove.
3892 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
3893 any time a pull parser is requested.
3894 Don't #define this as a wrapper around yypull_parse. Instead, when
3895 both push and pull are requested, make it a function that does that
3896 same thing.
3897 (yypull_parse): If there's a b4_prefix, #define this to
3898 b4_prefix[pull_parse] when both push and pull are requested.
3899 Don't define this as a function unless both push and pull are
3900 requested.
3901 Remove the yylexp argument and hard-code yylex invocation instead.
3902 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
3903 %push-parser.
3904 * src/getargs.c (pull_parser): New global initialized to true.
3905 * getargs.h (pull_parser): extern it.
3906 * src/output.c (prepare): Insert pull_flag muscle.
3907 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
3908 (prologue_declaration): Set both push_parser and pull_parser = true for
3909 %push-pull-parser. Set push_parser = true and pull_parser = false for
3910 %push-parser.
3911 * src/scan-gram.l: Don't accept %push_parser as an alternative to
3912 %push-parser since there's no backward-compatibility concern here.
3913 Scan %push-pull-parser.
3914 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
3915 instead of %push-parser.
3916 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
3917 prototype it in the module that calls yyparse.
3918 * tests/input.at (Torturing the Scanner): Likewise.
3919 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
3920
2e7944cb
JD
39212006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
3922
3923 Update etc/bench.pl. Optimize push mode a little (the yyn change
3924 deserves most of the credit).
3925 * Makefile.am (SUBDIRS): Add etc subdirectory.
3926 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
3927 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
3928 yytoken, yyval, and yyloc declarations to...
3929 (yyparse or yypush_parse): ... here to improve performance. For
3930 yypush_parse invocations after the first, be sure to assign yyn its old
3931 value again.
3932 (yypstate_new): Don't bother initializing the yyresult field since the
3933 initial value isn't used.
3934 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
3935 remove the #define that, in push mode, set it to yyps->NAME.
3936 * etc/Makefile.am: New.
3937 * etc/bench.pl: Remove and build it instead from...
3938 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
3939 "tests/bison" from the build directory by default rather than just
3940 invoking "bison" from $PATH.
3941 (calc_grammar): Update push parser code: don't declare yylval globally,
3942 don't define yyparse_wrapper, and don't #define yyparse.
3943 (bench_grammar): Update to check all working combinations of yacc.c,
3944 push.c, impure, pure, pull, and push.
3945
c3d50342
JD
39462006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3947
3948 For push mode, add pull wrappers around yypush_parse.
3949 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
3950 (yypull_parse): New function wrapping yypush_parse.
3951 (yyparse): New #define wrapping yypull_parse.
3952 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
3953 is declared.
3954 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
3955 prototype yylex in the module that calls yyparse, and don't prototype
3956 yyparse there. Otherwise, the yyparse expansion won't compile.
3957 * tests/input.at (Torturing the Scanner): Likewise.
3958
94ebeba5
JD
39592006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3960
3961 Enable push parsers to operate in impure mode. Thus, %push-parser no
3962 longer implies %pure-parser. The point of this change is to move
3963 towards being able to test the push parser code by running the entire
3964 test suite as if %push-parser had been declared.
3965 * data/push.c (yypush_parse): For impure mode, remove the
3966 yypushed_char, yypushed_val, and yypushed_loc arguments.
3967 Instead, declare these as local variables initialized to the global
3968 yychar, yylval, and yylloc.
3969 For the first yypush_parse invocation only, restore the initial values
3970 of these global variables when it's time to read a token since they
3971 have been overwritten.
3972 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
3973 %push-parser.
3974 * tests/calc.at (Simple LALR(1) Calculator): Always declare
3975 %pure-parser along with %push-parser since this test case was designed
3976 for pure push parsers.
3977 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
3978 (AT_YACC_OR_PUSH_IF): New.
3979 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
3980 add a note that it's still wrong for some cases (as it has been for a
3981 while).
3982 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
3983 %push-parser no longer implies %pure-parser.
3984
a0633178
JD
39852006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3986
3987 Remove some unnecessary differences between the pull parser code and
3988 the push parser code. This patch enables yynerrs in push mode.
3989 * data/push.c: Reformat M4 a little.
3990 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
3991 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
3992 because push mode is on. Instead, if pure mode is on, move yynerrs
3993 to...
3994 (b4_declare_parser_state_variables): ... here.
3995 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
3996 to yyps->NAME so it can be used in yypush_parse.
3997 (yypush_parse): Don't omit uses of yynerrs in push mode.
3998
8646b6a3
JD
39992006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4000
4001 Fix bug such that the first pushed token's value and location are
4002 sometimes overwritten (sometimes by %initial-action) before being used.
4003 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4004 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4005 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4006 more closely mimic the pull parser logic.
4007 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4008 time to read a token, which is after any initialization of yylval and
4009 yylloc.
4010 (gottoken): Rename label to...
4011 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4012 user namespace.
4013
9baf4d74
JD
40142006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4015
4016 Rearrange initialization of the parser state variables so that the
4017 skeleton doesn't have to have a copy for pull mode and another for push
4018 mode. This patch also fixes at least a bug such that yylloc was not
4019 initialized (with b4_location_initial_line and
4020 b4_location_initial_column) upon calling yypush_parse. However, that
4021 initialization now overwrites the first token's location;
4022 %initial-action assigning @$ already did the same thing, and both bugs
4023 will be fixed in a later patch.
4024 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4025 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4026 yyss, yyvs, yyls, and yystacksize.
4027 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4028 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4029 yylsp.
4030 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4031 yyps->NAME so it can be used in yypush_parse.
4032 (yyparse or yypush_parse): For yypush_parse, don't print the
4033 "Starting parse" diagnostic for invocations after the first.
4034 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4035 yypush_parse, only do it for the first invocation.
4036 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4037 initialization to occur in yypush_parse but only on the first
4038 invocation.
4039
23522164
JD
40402006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4041
4042 * data/push.c: Add CPP guards around push parser declarations in both
4043 the header and the code file.
4044 In the code file, move the push parser declarations to the same place
4045 they appear in the header file.
4046 Clean up the M4 some, especially the inconsistent underquoting in
4047 some b4_c_function_def and b4_c_function_decl uses.
4048
bb010fe5
JD
40492006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4050
4051 Encapsulate the push parser state variables into an M4 macro so the
4052 push skeleton doesn't have to list them again for pull mode's yyparse.
4053 For push mode, remove yypush_parse's local equivalents of these
4054 variables to eliminate unnecessary copying between the two sets at
4055 run-time. This patch also fixes at least a bug related to multiple
4056 %initial-action invocations in push mode.
4057 * data/push.c (b4_declare_parser_variables): Rename to...
4058 (b4_declare_scanner_communication_variables): ... this for clarity and
4059 update both uses.
4060 (b4_declare_yyparse_variables): Remove and move its contents to the one
4061 spot where it was invoked.
4062 (b4_declare_parser_state_variables): New macro containing the parser
4063 state variables required by push mode.
4064 (struct yypstate): Replace all fields but yynew with
4065 b4_declare_parser_state_variables.
4066 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4067 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4068 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4069 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4070 parser state variable declarations with
4071 b4_declare_parser_state_variables.
4072 Don't initialize parser state variables when calling yypush_parse since
4073 yypstate_new already does that.
4074 Invoke the user's initial action only upon the first yypush_parse
4075 invocation.
4076 Remove all code that copies between the local parser state variables
4077 and the yypstate.
4078
2d212f8c
JD
40792006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4080
4081 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4082 prevent a name collision in a future patch where these names will
4083 sometimes be #define'd.
4084 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4085 since it no longer has the same name as the existing argument.
4086 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4087
e6e704dc
JD
40882006-12-19 Paolo Bonzini <bonzini@gnu.org>
4089 and Joel E. Denny <jdenny@ces.clemson.edu>
4090
4091 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4092 that the argument is case-insensitive, and there's no `=' here.
4093 For the %skeleton entry, mention that %language is better.
4094 (Bison Options): Likewise for --language and --skeleton. Move the
4095 --skeleton entry so that the `Tuning the parser' section is sorted
4096 alphabetically on long options.
4097 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4098 %language directive in detail here; cross-reference the %language
4099 documentation instead.
4100 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4101 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 4102 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
4103 * examples/extexi (normalize): Instead of replacing every %require
4104 argument with the current Bison version, just substitute for
4105 `@value{VERSION}'. This guarantees that we're testing what actually
4106 appears in the documentation.
4107 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4108 rather than `@VERSION@'.
4109
0e021770
PE
41102006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4111
fd575f05
PE
4112 * NEWS: Reword the %language news a bit, and put it earlier.
4113
0e021770
PE
4114 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4115 Rewrite to simplify the logic.
4116 (language_argmatch): Likewise.
fd575f05
PE
4117 (program_name): We now own this var.
4118 * src/getargs.h (struct bison_language): Use char[] rather than
4119 const char *.
0e021770
PE
4120
4121 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4122 Java is supported.
4123 * src/complain.c (program_name): Remove decl; no longer needed.
4124 * src/main.c (program_name): Remove; now belongs to getargs.
4125
41262006-12-18 Paolo Bonzini <bonzini@gnu.org>
4127
4128 * NEWS: Document %language.
4129
4130 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4131
4132 * data/c-skel.m4, data/c++-skel.m4: New files.
4133 * data/glr.c: Complain on push parsers.
4134
4135 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4136 over %skeleton.
148d66d8 4137 (Decl Summary): Document %language and %skeleton.
0e021770
PE
4138 (Command line): Document -L.
4139
4140 * examples/extexi: Rewrite %require directive.
4141 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4142
4143 * src/files.c (compute_exts_from_gc): Look in language structure
4144 for .y extension.
4145 (compute_file_name_parts): Check whether .tab should be added.
4146 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4147 (language, skeleton_arg, language_argmatch): New.
4148 (long_options): Add --language.
4149 (getargs): Use skeleton_arg, add -L/--language.
4150 * src/getargs.h: Include location.h.
4151 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4152 * src/output.c (prepare): Pick default skeleton from struct language.
4153 Don't dispatch C skeletons here.
4154 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4155 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4156 * src/scan-gram.l ("%language"): New rule.
4157
4158 * tests/calc.at: Test %skeleton and %language.
4159 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4160 (AT_GLR_IF): Look for %skeleton "glr.cc".
4161 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4162 (AT_YACC_IF): Reject %language.
4163
5691bf57
PE
41642006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4165
db06f0ce
PE
4166 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4167 since it wasn't used; only the typedef name 'semantic_type' is needed.
4168 Also, omit trailing white space.
4169
5691bf57
PE
4170 * bootstrap: Sync from coreutils.
4171 (gnulib_extra_files): Add build-aux/announce.gen.
4172 (slurp): Adjust .gitignore files like .cvsignore files.
4173 * build-aux/announce-gen: Remove from CVS, since bootstrap
4174 now creates this.
4175
791934e4
JD
41762006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4177
4178 Make %push-parser imply %pure-parser. This fixes several bugs; see
4179 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4180 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4181 pure_parser = true.
4182 * data/push.c: Don't bother testing b4_push_if when deciding whether
4183 to expand b4_declare_parser_variables globally.
4184 (yypush_parse): Likewise in here.
4185
4186 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4187 (yy_reduce_print): Reformat M4 for readability.
4188
ee5abb37
JD
41892006-12-15 Bob Rossi <bob@brasko.net>
4190 and Joel Denny <jdenny@ces.clemson.edu>
4191
4192 * data/push.c (yypstate): Add typedef, and update all uses of
4193 struct yypstate to just yypstate.
4194 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4195
16ca01f9
JD
41962006-12-14 Bob Rossi <bob@brasko.net>
4197
4198 * data/push.c (yypush_parse): Declare prototype regardless of
4199 %locations option.
4200
ab8e7e1a
JD
42012006-12-14 Bob Rossi <bob@brasko.net>
4202
4203 * data/push.c (yyparse): Remove the prototype and the #define when in
4204 push-parser mode.
4205
9bf32be3
JD
42062006-12-13 Bob Rossi <bob@brasko.net>
4207
4208 * data/push.c (yypstate_init): Rename to...
4209 (yypstate_new): ... this and use b4_c_function_def.
4210 (yypstate_delete): New.
4211 (yypush_parse): Change parameters yynval and yynlloc to be const.
4212 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4213 yypstate_delete functions.
4214
f02e2948
JD
42152006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4216
4217 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4218 strange test case titles. Reported by Bob Rossi.
4219
38eb7751
PE
42202006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4221
4222 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4223 of potential ambiguities in GLR grammers.
4224
bd9d212b
JD
42252006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4226
4227 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4228 `bison ', use m4_index instead of m4_substr since chopping up a string
4229 containing M4-special characters causes problems here.
4230
4231 Fix a couple of bugs related to special characters in user-specified
4232 file names, and make it easier for skeletons to compute output file
4233 names with the same file name prefix as Bison-computed output file
4234 names.
4235 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4236 b4_parser_file_name and b4_spec_defines_file instead of
4237 @output_parser_name@ and @output_header_name@, which are now redundant.
4238 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4239 b4_parser_file_name, b4_spec_defines_file, and the new
4240 @basename(FILENAME@) instead of @output_parser_name@ and
4241 @output_header_name@, which inappropriately escaped the file names as
4242 C string literals.
4243 * src/files.c (all_but_ext): Remove static qualifier.
4244 (compute_output_file_names): Move `free (all_but_ext)' to...
4245 (output_file_names_free): ... here since all_but_ext is needed later.
4246 * src/files.h (all_but_ext): Extern.
4247 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4248 exactly what MUSCLE_INSERT_STRING used to do.
4249 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4250 characters are escaped properly.
4251 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4252 all_but_ext.
4253 For pkgdatadir muscle, maintain previous functionality by using
4254 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4255 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4256 digraphs would never be expanded. Hopefully no one has M4-special
4257 characters in his Bison installation path.
4258 * src/scan-skel.l: Don't parse @output_header_name@ and
4259 @output_parser_name@ anymore since they're now redundant.
4260 In @output, use decode_at_digraphs.
4261 Parse a new @basename command that invokes last_component.
4262 (decode_at_digraphs): New.
4263 (BASE_QPUTS): Remove unused.
4264 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4265 (Output file name): New tests.
4266
3f7ca628
JD
42672006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4268
4269 Warn about output files that are generated by the skeletons and that
4270 conflict with other output files.
4271 * data/glr.c: Don't generate the header file here when glr.cc does.
4272 * src/files.c (file_names, file_names_count): New static globals.
4273 (compute_output_file_names): Invoke output_file_name_check for files
4274 not generated by the skeletons and remove existing checks.
4275 (output_file_name_check): New function that warns about conflicting
4276 output file names.
4277 (output_file_names_free): Free file_names.
4278 * src/files.h (output_file_name_check): Declare.
4279 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4280 the skeletons.
4281 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4282 (Conflicting output files): New tests.
4283
178e123e
PE
42842006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4285
4286 * doc/bison.texinfo: Fix a couple of typos.
4287
42882006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
4289
4290 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4291 Rename to...
4292 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4293 update all uses.
4294 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4295 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4296 local pv.
4297 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4298 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4299
ea17f233
JD
43002006-12-07 Bob Rossi <bob@brasko.net>
4301 and Joel Denny <jdenny@ces.clemson.edu>
4302
4303 * data/push.c (yypvarsinit): Change return type from void* to struct
4304 yypvars*. No longer cast to void* on return.
4305 (struct yypvars): Remove yylen since it need not be remembered between
4306 yypushparse invocations.
4307 (yypushparse): Don't copy between yylen and pv->yylen.
4308
55a30bda
JD
43092006-12-05 Bob Rossi <bob@brasko.net>
4310
4311 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4312 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4313 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4314 (struct yypvars): Remove b4_declare_parser_variables.
4315 (yypvarsinit): Remove init code for removed variables.
4316 (global scope): Do not declare b4_declare_parser_variables if
4317 push or pure mode.
4318 (yypushparse): Add b4_declare_parser_variables.
4319 Init new local variables, and remove init code for removed
4320 yypvars variables.
4321 (yyparse): Delete.
4322 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4323 and yyparse for other modes.
4324 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4325 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4326 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4327 (AT_PURE_LEX_IF): True if pure or push parser.
4328
85894313
JD
43292006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4330
4331 Document Yacc prologue alternatives and default %destructor's and
4332 %printer's as experimental. Don't mention Java yet. Discussed at
4333 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4334 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4335 (2.3a): Annotate this entry to say the old forms of these features were
4336 also experimental.
4337 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 4338 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
4339 of Java (we'll want this back eventually).
4340
02975b9a
JD
43412006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4342
4343 Support a file name argument to %defines. Deprecate `=' in
4344 %file-prefix, %name-prefix, and %output. Discussed at
4345 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4346 * NEWS (2.3a+): Mention.
148d66d8 4347 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
4348 form of %defines, and remove `=' from entries for %file-prefix,
4349 %name-prefix, and %output.
4350 * src/parse-gram.y (prologue_declaration): Implement.
4351 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4352 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4353 all but one occurrence of %name-prefix.
4354 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4355 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4356 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4357 occurrence of each of %file-prefix and %output. Add check for %defines
4358 with argument.
4359 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4360 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4361 Remove the `=' from %output.
4362
287b314e
JD
43632006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4364
4365 Don't escape $ in test case titles since Autoconf 2.61 now does that
4366 correctly.
4367 * tests/actions.at (Default %printer and %destructor are not for error
4368 or $undefined): Here.
4369 (Default %printer and %destructor are not for $accept): Here.
4370 * tests/input.at (Invalid $n and @n): Here.
4371
3ebecc24
JD
43722006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4373
4374 Rename <!> to <>. Discussed starting at
4375 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4376 * NEWS (2.3a+): Update.
148d66d8 4377 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
4378 Update.
4379 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4380 * src/scan-gram.l (INITIAL): Implement.
4381 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4382 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4383 comment.
4384 * tests/actions.at (Default tagless %printer and %destructor,
4385 Default tagged and per-type %printer and %destructor,
4386 Default %printer and %destructor are not for error or $undefined,
4387 Default %printer and %destructor are not for $accept,
4388 Default %printer and %destructor for mid-rule values): Update.
4389 * tests/input.at (Default %printer and %destructor redeclared,
4390 Unused values with default %destructor): Update.
4391
26b8a438
JD
43922006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4393
4394 Don't let %prec take a nonterminal.
4395 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4396 token.
4397 * tests/input.at (%prec takes a token): New test checking that %prec
4398 won't take a nonterminal.
4399
07c39ae9
JD
44002006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4401
405d53b7
JD
4402 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4403 it was double-quoted.
07c39ae9
JD
4404 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4405 grammar is maintained with Bison's highest standards.
4406 * src/getargs.c: Fix some typos in Doxygen comments.
4407
580b8926
JD
44082006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4409
4410 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4411 later. Reported by Paul Eggert in
4412 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4413 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4414 * src/scan-code.l (translate_action): Don't bother invoking
4415 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4416 (code_scanner_free): Instead of invoking
4417 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4418 which frees more.
4419 * src/scan-gram.l (gram_scanner_free): Likewise.
4420 * src/scan-skel.l (scan_skel): Likewise.
4421
4502eadc
JD
44222006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4423
4424 * src/files.c (tr): Change return type to void.
4425 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4426 has been called previously for the same key.
4427 (muscle_find): Return storage instead of value so that
4428 --enable-gcc-warnings doesn't produce warnings that the return discards
4429 const. aver that the value and storage are the same since storage
4430 could potentially be NULL when value is not.
4431 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4432 same as 0.
4433
7746c8f6
PE
44342006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4435
4436 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4437 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4438 us a slightly cleaner distribution, and also works.
4439 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4440 gnulib changes.
4441
eb095650
PE
44422006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4443 and Paul Eggert <eggert@cs.ucla.edu>
4444
4445 Don't let Bison leak memory except when it complains.
4446 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4447 (spec_defines_file, dir_prefix): Now char *, not const char *,
4448 since they are freed.
4449 * src/files.c: Likewise.
4450 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4451 Likewise.
4452 (tr): Now operates in-place. All uses changed.
4453 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4454 values.
4455 (compute_file_name_parts, compute_output_file_names): Don't store
4456 read-only data in variables that will be freed.
4457 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4458 src_extension, and header_extension.
4459 (output_file_names_free): New public function to free
4460 spec_verbose_file, spec_graph_file, spec_defines_file,
4461 parser_file_name, and dir_prefix.
4462 * src/getargs.c (getargs): Don't store read-only data in variables that
4463 will be freed.
4464 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4465 (which previously existed but was unused), and quotearg_free.
4466 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4467 * src/muscle_tab.c: Likewise.
4468 (muscle_entry): Make the value char const *,
4469 and add a new storage member that is char * and can be freed.
4470 (muscle_entry_free): New private function.
4471 (muscle_init): Use it instead of free.
4472 (muscle_insert, muscle_grow): Update and use new storage member.
4473 (muscle_code_grow): Free the string passed to muscle_grow
4474 since it's not needed anymore.
4475 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4476 add a new `char *code' member.
4477 ("{...}"): Declare semantic type as code.
4478 * src/scan-code.h (translate_rule_action):
4479 (translate_symbol_action, translate_code, translate_action): Return
4480 `char const *' rather than `char *' since external code should not free
4481 these strings.
4482 * src/scan-code.l: Likewise.
4483 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4484 which is "{...}" in the parser.
4485 * tests/Makefile.am (maintainer-check-valgrind): Set
4486 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4487 Valgrind.
4488 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4489 complain.
4490 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4491 expecting a non-zero exit status sets --leak-check=summary and
4492 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4493 this case, and we don't want to hear about it.
4494
ac564be4
PE
44952006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4496
4497 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4498 instead of from the template, to simplify configuration a bit.
4499 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4500 and m4/wint_t.m4, as they are needed with the latest gnulib.
4501
17bd8a73
JD
45022006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4503
4504 Disable unset/unused mid-rule value warnings by default, and recognize
4505 --warnings=midrule-values to enable them. Discussed starting at
4506 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4507 * NEWS (2.3a+): Mention.
4508 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4509 warnings): Add entry for midrule-values subargument.
4510 * src/reader.c (symbol_should_be_used): Don't return true just because
4511 the value is a set/used mid-rule value unless
4512 --warnings=midrule-values was specified.
4513 * tests/input.at (Unused values, Unused values before symbol
4514 declarations): Run tests with and without --warnings=midrule-values.
4515
4516 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4517 than LIST_FREE directly.
4518
89eb3c76
JD
45192006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4520
4521 Finish implementing --warnings=error, which should not be implied by
4522 --warnings=all (or by its synonyms -W and --warnings without
4523 subarguments).
4524 * src/complain.c (set_warning_issued): New function to report that
4525 warnings are being treated as errors and to record an error if so.
4526 Invoke...
4527 (warn_at, warn): ... here.
4528 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4529 "error - warnings are errors" does not appear above "all - all of the
4530 above".
4531 (getargs): For -W and --warnings without subarguments, don't let
4532 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4533 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4534
ba7560e2
JD
45352006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4536
4537 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4538 empty subargument list. For example: `bison --warnings= parser.y'.
4539
31283fc3
JD
45402006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4541
4542 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4543 the parser header file so that gcc doesn't warn.
4544
12e35840
JD
45452006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4546
4547 Split the default %destructor/%printer into two kinds: <*> and <!>.
4548 Discussed starting at
4549 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4550 * NEWS (2.3a+): Mention.
4551 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4552 previous change today related to mid-rules.
148d66d8 4553 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 4554 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
4555 (TYPE_TAG_ANY): Add as <*>.
4556 (TYPE_TAG_NONE): Add as <!>.
4557 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4558 for <*> and <!>.
4559 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4560 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4561 * src/symlist.c (symbol_list_default_new): Split into tagged and
4562 tagless versions.
4563 (symbol_list_destructor_set, symbol_list_printer_set): Split
4564 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4565 SYMLIST_DEFAULT_TAGLESS.
4566 * src/symlist.h: Update symbol_list_default*_new prototypes.
4567 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4568 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4569 * src/symtab.c (default_destructor, default_destructor_location,
4570 default_printer, default_printer_location): Split each into tagged and
4571 tagless versions.
4572 (symbol_destructor_get, symbol_destructor_location_get,
4573 symbol_printer_get, symbol_printer_location_get): Implement tagged
4574 default and tagless default cases.
4575 (default_destructor_set, default_printer_set): Split each into tagged
4576 and tagless versions.
4577 * src/symtab.h: Update prototypes.
4578 * tests/actions.at (Default %printer and %destructor): Rename to...
4579 (Default tagless %printer and %destructor): ... this, and extend.
4580 (Per-type %printer and %destructor): Rename to...
4581 (Default tagged and per-type %printer and %destructor): ... this, and
4582 extend.
4583 (Default %printer and %destructor for user-defined end token): Extend.
4584 (Default %printer and %destructor are not for error or $undefined):
4585 Update.
4586 (Default %printer and %destructor are not for $accept): Update.
4587 (Default %printer and %destructor for mid-rule values): Extend.
4588 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4589 (Unused values with default %destructor): Extend.
4590
f91b1629
JD
45912006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4592
4593 Don't apply the default %destructor/%printer to an unreferenced midrule
4594 value. Mentioned at
4595 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4596 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4597 like $@n instead of just @n so that the default %destructor/%printer
4598 logic doesn't see them as user-defined symbols.
4599 (symbol_is_dummy): Check for both forms of the name.
4600 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4601 name for which the midrule value is referenced in any action.
4602 * tests/actions.at (Default %printer and %destructor for mid-rule
4603 values): New test.
4604 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4605 for change to dummy symbol names.
4606
519d0004
JD
46072006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4608
4609 Warn about unset midrule $$ if the corresponding $n is used.
4610 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4611 $n usage.
4612 (packgram): Before invoking grammar_rule_check on any rule, make sure
4613 all actions have already been scanned in order to set `used' flags.
4614 Otherwise, checking that a midrule's $$ is set will not always work
4615 properly because the midrule check must forward-reference the midrule's
4616 parent rule.
4617 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4618 warning.
4619
a501eca9
JD
46202006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4621
4622 More improvements to the documentation of the prologue alternatives:
4623 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4624 Bison manual.
4625 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4626 some text to clarify the relative importance of the new directives and
4627 to show how these directives may be viewed as code labels.
4628
2cbe6b7f
JD
46292006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4630
4631 Similar to the recently removed %before-header, add %code-top as the
4632 alternative to the pre-prologue. Mentioned at
4633 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4634 Also, let the prologue alternatives appear in the grammar section.
4635 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4636 (prologue_declaration): Move the existing prologue alternatives to...
4637 (grammar_declaration): ... here and add %code-top.
4638 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4639
4640 Clean up and extend documentation for the prologue alternatives.
4641 * NEWS (2.3a+): Describe prologue alternatives.
4642 * doc/bison.texinfo (Prologue): Move discussion of prologue
4643 alternatives to...
4644 (Prologue Alternatives): ... this new section, and extend it to discuss
4645 all 4 directives in detail.
148d66d8
JD
4646 (Table of Symbols): Clean up discussion of prologue alternatives and
4647 add %code-top.
2cbe6b7f 4648
e557d3ea
JMG
46492006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4650
4651 DJGPP specific issues.
4652
4653 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4654 config.bat accordingly.
4655 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4656 * djgpp/config.site: Likewise.
4657
136a0f76
PB
46582006-10-16 Paolo Bonzini <bonzini@gnu.org>
4659
27bd5d67
PB
4660 Replace %*-header with %provides, %requires, %code. See discussion at
4661 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4662
136a0f76
PB
4663 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4664 (b4_user_start_header): Remove.
4665 * data/glr.c: Use new macros instead of b4_*start_header
4666 and b4_*end_header.
4667 * data/glr.cc: Likewise.
4668 * data/lalr1.cc: Likewise.
4669 * data/push.c: Likewise.
4670 * data/yacc.c: Likewise.
4671
4672 * doc/bison.texinfo: Remove %before-header, rename
4673 %{start,end,after}-header to %requires, %provides, %code.
4674
4675 * src/parse-gram.y: Likewise (also rename token names accordingly).
4676 * src/scan-gram.l: Likewise.
4677 * tests/actions.at: Likewise.
4678
10f429ef
PE
46792006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4680
4681 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4682 Problem reported by Joel E. Denny.
4683
46842006-10-14 Jim Meyering <jim@meyering.net>
4685
4686 (Sync from coreutils.)
4687 Work also when the working directory (with e.g. coreutils sources)
4688 is version controlled with git, rather than CVS.
4689 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4690 rather than CVS.
4691 In messages and comments, say e.g., "checked-out sources",
4692 rather than "CVS sources".
4693 (version_controlled_file): New function. Work for git as well as
4694 for CVS. Don't use grep's -q option.
4695 (slurp): Call it here, in place of CVS-specific code.
4696
c4bd5bf7
JD
46972006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4698
4699 Fix testsuite for ./configure --enable-gcc-warnings:
4700 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4701 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4702 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4703 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4704 * test/regression.at (Diagnostic that expects two alternatives):
4705 Likewise.
4706
46356ea4
PE
47072006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4708
231ed89a
PE
4709 * bootstrap.conf (gnulib_modules): Add config-h.
4710 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4711 worry about HAVE_CONFIG_H.
4712 * lib/abitset.c: Likewise.
4713 * lib/bitset.c: Likewise.
4714 * lib/bitset_stats.c: Likewise.
4715 * lib/bitsetv-print.c: Likewise.
4716 * lib/bitsetv.c: Likewise.
4717 * lib/ebitset.c: Likewise.
4718 * lib/get-errno.c: Likewise.
4719 * lib/lbitset.c: Likewise.
4720 * lib/subpipe.c: Likewise.
4721 * lib/timevar.c: Likewise.
4722 * lib/vbitset.c: Likewise.
4723 * lib/bitset.c: Include "bitset.h" first, to test interface.
4724 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4725 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4726 * lib/bitsetv.c: Include "bitsetv.h" first.
4727 * lib/get-errno.c: Include "get-errno.h" first.
4728 * m4/.cvsignore: Add config-h.m4.
4729 * tests/actions.at (Default %printer and %destructor for ...):
4730 Adjust expected line numbers in output to reflect removal of #if
4731 HAVE_CONFIG_H lines.
4732 * tests/glr-regression.at (Missed %merge type warnings when ...):
4733 Likewise.
4734 * tests/regression.at (Braced code in declaration in rules section):
4735 Likewise.
4736 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4737 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4738 Include <config.h> unconditionally.
4739
46356ea4
PE
4740 * bootstrap: Sync from coreutils, as follows:
4741
4742 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4743
4744 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4745 variable was sometimes used without being initialized. This
4746 messed up the installation of the INSTALL file in some cases.
4747
4748 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4749
4750 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4751 --copy. Inspired by a suggestion from Bruno Haible.
4752
4753 2006-10-03 Jim Meyering <jim@meyering.net>
4754
4755 * bootstrap: Undo last change to this file, since now gnulib-tool
4756 sticks with the automake default in generating dependencies.
4757
dd4bf078
PE
47582006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4759
cf2a5f7c
PE
4760 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4761 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4762
4763 * doc/bison.1: Add copyright notice.
4764
4765 * data/glr.c: Don't include <stdarg.h>; not used.
4766
35fe0834
PE
4767 * NEWS: The -g and --graph options now output graphs in Graphviz
4768 DOT format, not VCG format.
4769 * doc/bison.1: Likewise.
4770 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
4771 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4772 of this change in
4773 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
4774 * TODO: Remove Graphviz entry.
4775 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4776 remove vcg.c, vcg.h, vcg_defaults.h.
4777 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4778 * src/graphviz.c, src/graphviz.h: New files.
4779 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4780 * src/files.h: Make comment more generic.
4781 * src/main.c (main): Likewise.
4782 * src/print_graph.h: Likewise.
4783 * src/getargs.c (usage): Make usage description more generic.
4784 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4785 (static_graph, fgraph): Remove. All uses changed to pass
4786 arguments instead of sharing a static var.
4787 (print_core, print_actions, print_state, print_graph):
4788 Output graphviz format rather than VCG format.
4789 * tests/.cvsignore: Remove *.vcg; add *.dot.
4790 * tests/output.at: Expect *.dot files, not *.vcg files.
4791
dd4bf078
PE
4792 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4793 accommodates the 2006-10-08 change.
4794
efdd7421
PE
47952006-10-11 Bob Rossi <bob@brasko.net>
4796
4797 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4798 (b4_yyssa, b4_yyerror_range): New macros.
4799 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4800 (yypvarsinit): Remove init of removed fields.
4801 (yypushparse): Remove use of removed fields; use new macros instead.
4802
96a1981a
PE
48032006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4804
4805 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4806 in a push parser. Reindent slightly to match yacc.c better.
4807
48082006-10-11 Bob Rossi <bob@brasko.net>
4809
46356ea4
PE
4810 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4811 yymsg_alloc fields.
4812 (yypvarsinit, yypushparse): Remove init of removed fields.
4813 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 4814
c1630a8b
PE
48152006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4816
4817 * THANKS: Add Paolo Bonzini and Bob Rossi.
4818
90b9908d
PB
48192006-10-08 Paolo Bonzini <bonzini@gnu.org>
4820
4821 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4822 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4823 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4824 b4_define_user_cde and uses): Remove.
4825 (b4_comment, b4_prefix, b4_sync_start): New.
4826 * data/bison.m4: New file, with most of the content removed from c.m4.
4827 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4828 * src/output.c (output_skeleton): Pass bison.m4.
4829 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4830 only if specified.
4831
cf806753
PE
48322006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4833
4834 Fix test failure reported by Tom Lane in
4835 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4836 and try to make such failures easier to catch in the future.
4837 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4838 that's now the caller's responsibility.
4839 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4840 Set yychar = YYEOF if it's negative.
4841 * tests/actions.at (yylex): Abort if asked to read past EOF.
4842 * tests/conflicts.at (yylex): Likewise.
4843 * tests/cxx-type.at (yylex): Likewise.
4844 * tests/glr-regression.at (yylex): Likewise.
4845 * tests/input.at (yylex): Likewise.
4846 * tests/regression.at (yylex): Likewise.
4847 * tests/torture.at (yylex): Likewise.
4848
0e2f006a
PE
48492006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4850
4851 Fix problems with translating English-language diagnostics.
4852 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4853 respect to bison-runtime pot generation. The YY_ stuff
4854 wasn't being captured.
4855 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4856 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4857 * runtime-po/POTFILES.in: Add data/push.c.
4858
e3ddc1e3
PE
48592006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4860
4861 Merge bootstrap changes from coreutils.
4862
4863 2006-09-28 Jim Meyering <jim@meyering.net>
4864
4865 Automatically generated dependencies are important even
4866 when all of the sources in a directory come from gnulib.
4867 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4868 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4869
4870 2006-09-23 Jim Meyering <jim@meyering.net>
4871
4872 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
4873
4874 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4875
4876 * bootstrap: Add support for --force.
4877 (usage): New function. Describe usage less tersely.
4878 (CVS_only_file): New var.
4879
01e972b3
PE
48802006-09-21 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4883 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
4884 Adjust white space and comments to match GNU style better.
4885
c63d3e90
PE
48862006-09-20 Bob Rossi <bob@brasko.net>
4887
4888 * data/push.c (yyresult_get): Remove function.
4889 (YYPUSH_MORE): Add #define.
4890 (yypushparse): Modify return value.
4891
e70f46d1
PE
48922006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4893
4894 * stamp-h.in: Remove; no longer needed.
4895 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
4896 Remove config.h, config.hin, intl (no longer created).
4897 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
4898 stamp-h1.
4899
4900 Sync bootstrap from coreutils, as follows:
4901
4902 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
4903
4904 * bootstrap (symlink_to_gnulib): New function.
4905 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
4906 to copies-of-gnulib.
4907 (cp_mark_as_generated, slurp, gnulib_files):
4908 Avoid making a copy if it's the same as the old version.
4909 (gnulib_files): Add support for this variable (used by Bison).
4910
a92be413
PE
49112006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4912
4913 * src/getargs.c (usage): Rework to use conventions similar to
4914 coreutils, to make translation a bit easier and the code a bit
4915 smaller. Problem reported by Tim Van Holder.
4916
4f82b42a
PE
49172006-09-15 Paul Eggert <eggert@cs.ucla.edu>
4918
3b2942e6
PE
4919 Use some of gnulib's new modules, taken from coreutils.
4920
4921 * bootstrap: Sync from coreutils, except add support for gnulib_files.
4922 * bootstrap.conf: New file.
4923 (gnulib_modules): Add configmake, inttypes, unistd.
4924 (XGETTEXT_OPTIONS): Add complain, complain_at,
4925 fatal, fatal_at, warn, warn_at, unexpected_end.
4926 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
4927 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
4928 (gl_EARLY): Add.
4929 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
4930 (gl_INIT): Add
4931 (GNULIB_AUTOCONF_SNIPPET): Remove.
4932 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
4933 the pickiest.
4934 * lib/.cvsignore: Add inttypes_.h.
4935 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
4936 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
4937 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
4938 no-longer-necessary initializations.
4939 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
4940 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
4941 use the unistd module.
4942 * src/system.h: Likewise.
4943 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
4944 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
4945 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
4946 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
4947 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
4948 * src/system.h: Include inttypes.h unconditionally, now that we
4949 use the inttypes module. Don't bother to include stdint.h, since
4950 inttypes.h now does that for us.
4951 (LOCALEDIR): Remove, now that we use the configmake module.
4952 * src/getargs.c: Include configmake.h.
4953 * src/main.c: Likewise.
4954 * src/output.c: Likewise.
4955 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
4956 not from $abs_top_builddir, since config.h moved.
4957
4958
4f82b42a
PE
4959 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
4960 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
4961
4962 * src/parse-gram.y (symbol_declaration): Don't put statements
4963 before declarations; it's not portable to C89.
4964 * src/scan-code.l (handle_action_at): Likewise.
4965
4966 * src/scan-code.l: Always initialize braces_level; the old code
4967 left it uninitialized and therefore had undefined behavior.
4968
4969 Don't attempt to redefine 'assert', since it runs afoul of
4970 systems where standard headers (mistakenly) include <assert.h>.
4971 Instead, define and use our own alternative, called 'aver'.
4972 * src/reader.c: Don't include assert.h, since we no longer
4973 use assert.
4974 * src/scan-code.l: Likewise.
4975 * src/system.h (assert): Remove, replacing with....
4976 (aver): New function, taking a bool arg. All uses changed.
4977 * src/tables.c (pack_vector): Ensure that aver arg is bool,
4978 not merely an integer.
4979
31c10e38
PE
49802006-09-15 Bob Rossi <bob@brasko.net>
4981
4982 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
4983 * data/c.m4 (YYPUSH): New.
4984 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
4985 * src/getargs.c (push_parser): New var.
4986 * src/getargs.h (push_parser): New declaration.
4987 * src/output.c (prepare): Add macro insertion of `push_flag'.
4988 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
4989 (prologue_declaration): Parse %push-parser.
4990 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
4991 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
4992 list of removed lines from the traces observed.
4993 (AT_CHECK_CALC_LALR): Added push parser tests.
4994
fa7b79c0
PE
49952006-09-13 Paul Eggert <eggert@cs.ucla.edu>
4996
21fe08ca
PE
4997 * NEWS: Version 2.3a.
4998 * configure.ac (AC_INIT): Likewise.
4999
e8ec4d9b
PE
5000 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5001 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5002 due to header ordering dependencies. I don't know why the #define
5003 was there.
5004
fa7b79c0
PE
5005 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5006 runtime cost when YYDEBUG is not defined, and so that some tests
5007 that used to fail now work. Problem and initial suggestion by
5008 Paolo Bonzini.
5009 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5010 * data/glr.cc (b4_parser_class_name):
5011 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5012 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5013 (yydebug_) [YYDEBUG]: New member.
5014 (yycdebug_): Now defined only if YYDEBUG.
5015 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5016 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5017 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5018 if YYYDEBUG.
5019 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5020 Define only if YYDEBUG.
5021 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5022 set_debug_level.
5023 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5024 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5025 AT_CHECK_CALC_GLR_CC that are working now.
5026
4ec13d60
PE
50272006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5028
5029 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5030 We don't need them in glr.cc, and glr.c defines them.
5031 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5032 assumes that defining it to anything is the same as defining
5033 it to 1. Problem reported by Paolo Bonzini.
5034
8e1687ae
PE
50352006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5036
5037 * data/c.m4 (b4_null, b4_case): Define.
5038 * src/output.c (prepare_symbols): Use b4_null.
5039 (user_actions_output): Use b4_case.
5040
3dc5e96b
PE
50412006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5042
aef3da86
PE
5043 * data/glr.c (b4_shared_declarations): Put start-header first,
5044 before any #includes that we generate, so that feature-test
5045 macros work. Problem reported by Michael Deutschmann in
5046 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5047 * data/lalr1.cc: Likewise.
5048 * doc/bison.texinfo (Prologue): Document that feature-test macros
5049 should be defined before any Bison declarations.
5050 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5051 that depend on location.hh after, not before, Bison decls, since
5052 we now include location.hh after the first user prologue.
5053
3dc5e96b
PE
5054 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5055 Sander Brandenburg in
5056 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5057 Also, fix minor white space and comment issues.
aef3da86
PE
5058 (Prologue): Mention that it's better to define feature-test macros
5059 before Bison declarations. Problem reported by Michael Deutschmann.
5060
5061 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5062 by Jim Meyering.
5063 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5064 This adjusts to recent gnulib changes.
3dc5e96b 5065
b2a0b7ca
JD
50662006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5067
5068 Finish implementation of per-type %destructor/%printer. Discussed
5069 starting at
5070 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5071 and
5072 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5073 * NEWS (2.3+): Add a description of this feature to the default
5074 %destructor/%printer description.
5075 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5076 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5077 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5078 list node contains a semantic type.
5079 * src/symtab.c, src/symtab.h: Extend with a table that associates
5080 semantic types with their %destructor's and %printer's.
5081 (semantic_type_from_uniqstr, semantic_type_get,
5082 semantic_type_destructor_set, semantic_type_printer_set): New functions
5083 composing the public interface of that table.
5084 (symbol_destructor_get, symbol_destructor_location_get,
5085 symbol_printer_get, symbol_printer_location_get): If there's no
5086 per-symbol %destructor/%printer, look up the per-type before trying
5087 the default.
5088 * tests/actions.at (Per-type %printer and %destructor): New test case.
5089 * tests/input.at (Default %printer and %destructor redeclared):
5090 Extend to check that multiple occurrences of %symbol-default in a
5091 single %destructor/%printer declaration is an error.
5092 (Per-type %printer and %destructor redeclared, Unused values with
5093 per-type %destructor): New test cases.
5094
3be03b13
JD
50952006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5096
5097 Require default %destructor/%printer to be declared using
5098 %symbol-default instead of an empty symbol list, and start working on
5099 new per-type %destructor/%printer. Discussed at
5100 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5101 * NEWS (2.3+): Add %symbol-default to example.
5102 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 5103 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
5104 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5105 (generic_symlist, generic_symlist_item): New nonterminals for creating
5106 a list in which each item is a symbol, semantic type, or
5107 %symbol-default.
5108 (grammar_declaration): Use generic_symlist in %destructor and %printer
5109 declarations instead of symbols.1 or an empty list.
5110 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5111 for changes to symbol_list.
5112 * src/reader.c: Update for changes to symbol_list.
5113 * src/scan-code.l: Likewise.
5114 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5115 * src/symlist.c, src/symlist.h: Extend such that a list node may
5116 represent a semantic type or a %symbol-default in addition to just an
5117 ordinary symbol. Add switched functions for setting %destructor's and
5118 %printer's.
5119 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5120 %destructor/%printer declarations.
5121
3508ce36
JD
51222006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5123
5124 Whether the default %destructor/%printer applies to a particular symbol
5125 isn't a question of whether the user *declares* that symbol (in %token,
5126 for example). It's a question of whether the user by any means
5127 *defines* the symbol at all (by simply using a char token, for
5128 example). $end is defined by Bison whereas any other token with token
5129 number 0 is defined by the user. The error token is always defined by
5130 Bison regardless of whether the user declares it with %token, but we
5131 may one day let the user define error as a nonterminal instead.
5132 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5133 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5134 the meaning of "user-defined".
5135 * tests/actions.at (Default %printer and %destructor for user-declared
5136 end token): Rename to...
5137 (Default %printer and %destructor for user-defined end token): ...
5138 this.
5139
5140 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5141 computation of whether to apply the default, don't maintain a list of
5142 every Bison-defined symbol. Instead, just check for a first character
5143 of '$', which a user symbol cannot have, and check for the error token.
5144
9350499c
JD
51452006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5146
5147 Don't apply the default %destructor or %printer to the error token,
5148 $undefined, or $accept. This change fits the general rule that the
5149 default %destructor and %printer are only for user-declared symbols,
5150 and it solves several difficulties that are described in the new test
5151 cases listed below.
5152 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5153 * tests/actions.at (Default %printer and %destructor are not for error
5154 or $undefined, Default %printer and %destructor are not for $accept):
5155 New test cases.
5156
4d7370cb
JD
51572006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5158
5159 Allow %start after the first rule.
5160 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5161 when parsing the first rule.
5162 (check_and_convert_grammar): Search for it here after all grammar
5163 declarations have been parsed. Skip midrules, which have dummy LHS
5164 nonterminals.
5165 * src/symtab.c (symbol_is_dummy): New function.
5166 * src/symtab.h (symbol_is_dummy): Declare it.
5167 * tests/input.at (%start after first rule): New test.
5168
6d0ef4ec
JD
51692006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5170
5171 Redo some of the previous commit: add back the ability to use
5172 non-aliased/undeclared string literals since it might be useful to
5173 those declaring %token-table.
5174 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5175 commit: don't worry about complaints from symbols_pack.
5176 * src/symtab.c (symbol_new, symbol_class_set,
5177 symbol_check_alias_consistency): Undo changes in previous commit: count
5178 each string literal as a new symbol and token, assign it a symbol
5179 number, and don't complain about non-aliased string literals.
5180 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5181 and token counts but does still set aliased tokens to the same number,
5182 symbol_pack_processor now leaves empty slots in the symbols array.
5183 Remove those slots.
5184 * tests/regression.at (Undeclared string literal): Remove test case
5185 added in previous commit since non-aliased string literals are allowed
5186 again.
5187 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5188 remove unnecessary string literal declarations.
5189 * tests/sets.at (Firsts): Likewise.
5190
965537bc
JD
51912006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5192
5193 Don't allow an undeclared string literal, but allow a string literal to
5194 be used before its declaration.
5195 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5196 symbols_pack complained.
5197 * src/symtab.c (symbol_new): Don't count a string literal as a new
5198 symbol.
5199 (symbol_class_set): Don't count a string literal as a new token, and
5200 don't assign it a symbol number since symbol_make_alias does that.
5201 (symbol_make_alias): It's not necessary to decrement the symbol and
5202 token counts anymore. Don't assume that an alias declaration occurs
5203 before any uses of the identifier or string, and thus don't assert that
5204 one of them has the highest symbol number so far.
5205 (symbol_check_alias_consistency): Complain if there's a string literal
5206 that wasn't declared as an alias.
5207 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5208 symbol_pack asserts that every token has been assigned a symbol number
5209 although undeclared string literals have not.
5210 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 5211 string literal): New test cases.
965537bc
JD
5212 (Characters Escapes, Web2c Actions): Declare string literals as
5213 aliases.
5214 * tests/sets.at (Firsts): Likewise.
5215
47aee066
JD
52162006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5217
5218 In the grammar scanner, STRING_FINISH unclosed constructs and return
5219 them to the parser in order to improve error messages.
5220 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5221 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5222 * tests/input.at (Unclosed constructs): New test case.
5223 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5224 seen.
5225
5226 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5227 unused global.
5228
1f6b3679
JD
52292006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5230
5231 Handle string aliases for character tokens correctly.
5232 * src/symtab.c (symbol_user_token_number_set): If the token has an
5233 alias, check and set its alias's user token number instead of its own,
5234 which is set to indicate the alias. Previously, every occurrence of
5235 the character token in the grammar overwrote that alias indicator with
5236 the character code.
5237 * tests/input.at (String aliases for character tokens): New test.
5238
219741d8
JD
52392006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5240
5241 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5242
11daa4e7
PE
52432006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5244
5245 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5246 to prevent failures when building on older platforms.
5247 Check for autopoint failure.
5248 Set XGETTEXT_OPTIONS to values that check for C format strings,
5249 so that translators are warned about them (this also helps
5250 prevent core dumps).
5251
5252 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5253 function, since it simplifies our code a bit.
5254
5255 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5256 rather than -W, so we don't get bogus warnings about sign comparisons.
5257 Add -Wpointer-arith, since that warning is useful (it reports code
5258 that does not conform to C89 and that some compilers reject).
5259 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5260 since it's no longer needed.
5261
f9bfc42a
JD
52622006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5263
5264 Clean up scanners a bit.
5265 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5266 definitions so gcc won't warn when obstack_for_string is unused.
5267 * src/scan-code.l: config.h and system.h are already #include'd by
5268 scan-code-c.c, so get rid of them here.
5269 * src/scan-gram.l: Likewise.
5270 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5271 definitions rather than duplicating the rest of it.
5272 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5273
06e8700a
JD
52742006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5275
5276 Suppress signed/unsigned comparison warnings for yycheck.
5277 * data/c.m4 (b4_safest_int_type): New macro.
5278 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5279 a signed int type, cast it to b4_safest_int_type first.
5280 * data/yacc.c: Likewise.
5281 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5282 also overwritten.
5283
9c437126
PE
52842006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5285
5286 * doc/bison.texinfo: Fix some typos.
5287
284d8a13
PE
52882006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5289
5290 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5291 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5292
5293 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5294 the latest gnulib does this a different way.
5295 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5296 translation was patched, so stop omitting it.
5297
ec5479ce
JD
52982006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5299
5300 Enable declaration of default %printer/%destructor. Make the parser
5301 use these for all user-declared grammar symbols for which the user does
5302 not declare a specific %printer/%destructor. Thus, the parser uses it
5303 for token 0 if the user declares it but not if Bison generates it as
5304 $end. Discussed starting at
5305 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5306 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5307 and
5308 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5309 * NEWS (2.3+): Mention.
5310 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5311 declare a %destructor for a mid-rule's semantic value. It's just
5312 impossible to declare one specific to it.
5313 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5314 code. Describe default %destructor form.
5315 * src/parse-gram.y (grammar_declaration): Parse default
5316 %printer/%destructor declarations.
5317 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5318 and symbol_destructor_location_get rather than accessing the destructor
5319 and destructor_location members of struct symbol.
5320 (symbol_printers_output): Likewise but for %printer's.
5321 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5322 again.
5323 * src/symtab.c (default_destructor, default_destructor_location,
5324 default_printer, default_printer_location): New static global
5325 variables to record the default %destructor and %printer.
5326 (symbol_destructor_get, symbol_destructor_location_get,
5327 symbol_printer_get, symbol_printer_location_get): New functions to
5328 compute the appropriate %destructor and %printer for a symbol.
5329 (default_destructor_set, default_printer_set): New functions to set the
5330 default %destructor and %printer.
5331 * src/symtab.h: Prototype all those new functions.
5332 * tests/actions.at (Default %printer and %destructor): New test to
5333 check that the right %printer and %destructor are called, that they're
5334 not called for $end, and that $$ and @$ work correctly.
5335 (Default %printer and %destructor for user-declared end token): New
5336 test to check that the default %printer and %destructor are called for
5337 a user-declared end token.
5338 * tests/input.at (Default %printer and %destructor redeclared, Unused
5339 values with default %destructor): New tests to check related grammar
5340 warnings and errors.
5341
868d2d96
JD
53422006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5343
5344 Clean up handling of %destructor for the end token (token 0).
5345 Discussed starting at
5346 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5347 and
5348 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5349
5350 Make the skeletons consistent in how they pop the end token and invoke
5351 its %destructor.
5352 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5353 state, which has token number 0, since this would invoke the
5354 %destructor for the end token.
5355 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5356 until after shifting the end token, or else it won't be popped.
5357 * data/yacc.c (yyparse): Likewise.
5358
5359 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5360 it's the end token. Upon termination, destroy an unshifted lookahead
5361 even when it's the end token.
5362 * data/lalr1.cc (yy::parser::parse): Likewise.
5363 * data/yacc.c (yyparse): Likewise.
5364
5365 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5366 value warnings for the end token when the user gives the end token a
5367 %destructor.
5368
5369 * tests/actions.at (Printers and Destructors): Test all the above.
5370
62a9592d
PE
53712006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5372
5373 Update to latest gnulib and gettext versions.
5374 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5375 Add fopen-safer.
5376 (gnulib_files): Add m4/warning.m4. Don't worry about files
5377 overwritten by autopoint.
5378 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5379 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5380 rejects them.
5381 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5382 so that we can remove the intl files at a better time.
5383 (intl_files_to_remove): Remove aclocal.m4, since it gets
5384 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5385 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5386 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5387 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5388 Remove datarootdir hack; no longer needed.
5389 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5390 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5391 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5392 strdup.h.
5393 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5394 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5395
10d6970f
PE
53962006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5397
5398 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5399 it with --assume-autoconf='latest-stable'.
5400
50a33993
JD
54012006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5402
5403 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5404 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5405 YYSTYPE' and `{'.
5406 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5407 those from muscle_tab.c since the old ones are misleading.
5408
2ce4ed68
AD
54092006-07-13 Akim Demaille <akim@epita.fr>
5410
5411 Support %define "KEY" {VALUE}.
5412 * src/scan-code.h, src/scan-code.l (translate_action)
5413 (translate_rule_action, translate_symbol_action, translate_code):
5414 Return char *, not const char *.
5415 * src/parse-gram.y (declaration): Rename as...
5416 (prologue_declaration): this.
5417 (string_content): Remove this nonterminal, use STRING.
5418 (braceless, content, content.opt): New nonterminal.
5419 Use them.
5420 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5421 as value.
5422 * src/scan-gram.l (getargs.h): Don't include it.
5423
db7e5eb5
PE
54242006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5425
5426 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5427 rather than a for-loop that declares a local bool variable. This
5428 should work around a compatibility problem with a Cray x1e C++
5429 compiler reported by Hung Nguyen in
5430 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5431 The for-loop was introduced in the 2004-11-17 change but I don't
5432 know why it was needed.
5433
a5d80ba5
AD
54342006-07-12 Akim Demaille <akim@epita.fr>
5435
5436 * data/c.m4: Comment changes.
5437
23eb2a69
AD
54382006-07-10 Akim Demaille <akim@lrde.epita.fr>
5439
5440 * src/complain.c (error_message, ERROR_MESSAGE): New.
5441 To factor...
5442 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5443 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5444
ddc8ede1
PE
54452006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5446
5447 * NEWS: Instead of %union, you can define and use your own union type
5448 YYSTYPE if your grammar contains at least one <type> tag.
5449 Your YYSTYPE need not be a macro; it can be a typedef.
5450 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5451 (Union Decl, Decl Summary): Document this.
5452 * data/glr.c (YYSTYPE): Implement this.
5453 * data/glr.cc (YYSTYPE): Likewise.
5454 * data/lalr1.cc (YYSTYPE): Likewise.
5455 * data/yacc.c (YYSTYPE): Likewise.
5456 * src/output.c (prepare): Output tag_seen_flag.
5457 * src/parse-gram.y (declaration, grammar_declaration):
5458 Use 'union_seen' rather than 'typed' to determine whether
5459 %union has been seen, since grammars can now be typed without
5460 %union.
5461 (symbol_declaration, type.opt, symbol_def):
5462 Keep track of whether a tag has been seen.
5463 * src/reader.c (union_seen, tag_seen): New vars.
5464 (typed): remove.
5465 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5466 * src/scan-code.l (untyped_var_seen): New variable.
5467 (handle_action_dollar): Adjust to above changes.
5468 (handle_action_dollar, handle_action_at):
5469 Improve overflow checking for outlandish numbers.
5470 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5471 avoid new diagnostics generated by above changes.
5472 * tests/regression.at (YYSTYPE typedef): Add test to check
5473 for type tags without %union.
5474
5475 * src/symlist.c (symbol_list_length): Return int, not unsigned
5476 int, since callers expect int. This may need to get revisited
5477 once we have proper integer overflow checking.
5478
5479 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5480 object is now static.
5481
5482 * src/getargs.c (flags_argmatch): Return void, not int,
5483 to pacify ./configure --enable-gcc-warnings.
5484
5485 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5486 since last_string is already defined to FLEX_PREFIX (last_string).
5487
7b42569e
AD
54882006-07-09 Akim Demaille <akim@lrde.epita.fr>
5489
5490 Implement --warnings/-W.
5491 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5492 replaced by...
5493 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5494 Adjust callers.
5495 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5496 (warnings_args, warnings_types): New.
5497 (getargs, short_options, long_options): Accept -W/--warnings.
5498 Sort the options by alphabetical order, upper case letter right
5499 before its lower case.
5500
3b452f4e
JD
55012006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5502
5503 Change %merge result type clash warnings to errors. Discussed at
5504 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5505 * src/reader.c (record_merge_function_type): Use complain_at.
5506 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5507 declared later): Update test case results.
5508
b8a41559
AD
55092006-07-09 Akim Demaille <akim@lrde.epita.fr>
5510
5511 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5512 to be in alphabetical order.
5513 (trace_args): Spelling fixes.
5514
cd9e1ba2
PE
55152006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5516
5517 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5518 so they don't collide with user-defined macros.
5519 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5520 this was never guaranteed, and now that we're using gnulib stdint,
5521 which defines int_fast16_t to long int, the problem is exposed.
5522
cb48f191
PE
55232006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5524
b8445a15
PE
5525 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5526 need the full POSIX semantics (and weren't implementing them
5527 anyway).
5528
cb48f191
PE
5529 Adjust to Autoconf 2.60 and today's gnulib.
5530 * bootstrap (gnulib_modules): Add stdint.
5531 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5532 no longer copies it.
5533 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5534 since stdint needs the former and wcwidth (which is now required
5535 by mbswidth) needs the latter.
5536 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5537 work around a compatibility glitch between gettext 0.14.6 and
5538 Autoconf 2.60.
5539 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5540 Do not check for uintptr_t, since new stdint module does the right
5541 thing.
5542 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5543 Add stdint.h, stdint_.h, wcwidth.h.
5544 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5545 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5546 stdint.m4, wchar_t.m4, wcwidth.m4.
5547 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5548 usual order for ../lib/*.h files.
5549 (file_name_split): Use last_component, not base_name, to adjust
5550 to gnulib changes.
5551 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5552 for ../lib/*.h files.
5553 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5554 Define unconditionally, since we now assume the stdint module.
5555 * src/scan-skel.l: Include <dirname.h>.
5556 (BASE_QPUTS): Use last_component, not base_name.
5557 * src/system.h: Include <unlocked-io.h> in the usual order
5558 for ../lib/*.h files. Include <stdint.h> unconditionally,
5559 since we now use the stdint module.
5560 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5561 HAVE_UINTPTR_T, since we now use the stdint module.
5562 (base_name): Remove decl, since files now include <dirname.h>
5563 to get the decl.
5564
cd48d21d
AD
55652006-07-08 Akim Demaille <akim@lrde.epita.fr>
5566
5567 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5568 New, default to 1.
5569 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5570 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5571 default.
5572 * tests/calc.at: Adjust.
5573
8ec0a172
AD
55742006-07-08 Akim Demaille <akim@lrde.epita.fr>
5575
b8445a15 5576 * data/c.m4 (b4_basename): New.
8ec0a172
AD
5577 (b4_syncline): Also output the location of its invocation (from
5578 the skeleton).
5579 (b4_user_action, b4_define_user_action, b4_user_actions)
5580 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5581 (b4_user_stype): New.
5582 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5583
4a678af8
JD
55842006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5585
5586 In the grammar file, the first column is 1 not 0 on the first line as
5587 on every other line.
5588 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5589 * tests/input.at (Torturing the Scanner): Update output.
5590
5591 * src/scan-gram.l (scanner_cursor): Declare it static.
5592
dd60572a
JD
55932006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5594
5595 In warnings, say "previous declaration" rather than "first
5596 declaration".
5597 * src/symtab.c (redeclaration): Do that here.
5598 * src/reader.c (record_merge_function_type): In the case of a result
5599 type clash, report the previous declaration rather than the very first
5600 one in the grammar file.
5601 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5602 declared later): Add a third declaration to check this behavior.
5603 * tests/input.at (Incompatible Aliases): Update output.
5604
2073e1b6
AD
56052006-06-27 Akim Demaille <akim@epita.fr>
5606
5607 * doc/Doxyfile.in: New.
5608 * doc/Makefile.am: Use it.
5609 * src/lalr.h, src/symtab.h: Initial doxygenation.
5610
8ee5b538
JD
56112006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5612
5613 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
5614 declared after the %merge. This continues the effort of the previous
5615 patch.
8ee5b538
JD
5616 * src/reader.c (get_merge_function): Don't set the merger type yet.
5617 (record_merge_function_type): New function for setting the merger type
5618 and checking for clashes.
5619 (grammar_current_rule_merge_set): Set the location of the %merge for
5620 the current rule.
5621 (packgram): Invoke record_merge_function_type for each rule now that
5622 all symbol type declarations have been parsed.
5623 * src/reader.h (merger_list.type_declaration_location): New member
5624 storing the location of the first %merge from which the type for this
5625 merging function was derived.
5626 * src/symlist.h (symbol_list.merger_declaration_location): New member
5627 storing the location of a rule's %merge, if any.
5628 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5629 declared later): New test to catch the error fixed by the above patch.
5630
ffa4ba3a
JD
56312006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5632
5633 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
5634 declarations appear after the rules. Discussed at
5635 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5636 and
5637 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5638 Don't mistake the type of $$ in a midrule to be that of its parent
5639 rule's $$.
ffa4ba3a
JD
5640 * src/reader.c (grammar_current_rule_end): Don't invoke
5641 grammar_rule_check yet since not all symbol declarations may have been
5642 parsed yet.
5643 (grammar_midrule_action): Likewise.
5644 Don't record whether the midrule's $$ has been used yet since actions
5645 haven't been translated yet.
5646 Record the midrule's parent rule and its RHS index within the parent
5647 rule.
5648 (grammar_current_rule_action_append): Don't translate the action yet
5649 since not all symbol declarations may have been parsed yet and, thus,
5650 warnings about types for $$, $n, @$, and @n can't be reported yet.
5651 (packgram): Translate the action and invoke grammar_rule_check now that
5652 all symbol declarations have been parsed.
5653 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5654 after parsing the entire grammar file, the symbol list here in the case
5655 of a midrule is actually the midrule's empty RHS, so reference its
5656 parent rule's RHS where necessary.
5657 On the other hand, now that you can already know it's a midrule, you
5658 aren't forced to think $$ has the same type as its parent rule's $$.
5659 (handle_action_at): In the case of a midrule, reference the parent rule
5660 where necessary.
5661 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5662 members.
5663 (symbol_list_length): Now that this is invoked after all rules have
5664 been parsed, a NULL symbol (rather than a NULL symbol list node)
5665 terminates a rule. symbol_list_print already does this correctly.
5666 * src/symlist.h (symbol_list.midrule_parent_rule,
5667 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5668 remember their relationships with their parents.
5669 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5670 fixed by the above patch.
5671 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5672 implementing...
5673 (Unused values): ... this old test case and...
5674 (Unused values before symbol declarations): ... this new test case.
5675 This one is the same as `Unused values' except that all symbol
5676 declarations appear after the rules in order to catch the rest of the
5677 errors fixed by the above patch.
5678
e256e17f
JD
56792006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5680
300a1930
JD
5681 More cleanup.
5682 * src/reader.c (current_rule): Declare it static since it's no longer
5683 used outside this file.
5684 (grammar_current_rule_action_append): Remove redundant arguments from
5685 translate_rule_action invocation.
5686 * src/reader.h (current_rule): Remove this unused extern.
5687 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5688 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 5689
381ecb06
JD
56902006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5691
5692 Clean up yesterday's patch.
5693 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5694 to...
5695 * src/reader.c (grammar_current_rule_action_append): ... here for
5696 consistency with grammar_current_rule_symbol_append.
5697 * tests/regression.at (Braced code in declaration in rules section):
5698 Make yyerror and yylex static as usual.
5699
4210cd0b
JD
57002006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5701
5702 Fix bug that mistakes braced code in a declaration in the rules section
5703 to be a rule action. Mentioned at
5704 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5705 * src/scan-gram.l: Move midrule action detection from the start of the
5706 scanning of any braced code to...
5707 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5708 action. For readability, use $2 and @2 rather than the equivalent
5709 global variables.
5710 * tests/regression.at (Braced code in declaration in rules section):
5711 New test to catch the error fixed by the above patch.
5712
5713 Work on code readability some.
5714 * src/scan-code.l (current_rule): Get rid of this misleading and
5715 redundant declaration: it's actually extern'ed in reader.h.
5716 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5717 translate_action): Add a rule argument and use it instead of the global
5718 current_rule.
5719 (translate_rule_action): This already receives current_rule through an
5720 argument, so pass it on to translate_action instead of assigning
5721 current_rule to current_rule.
5722 (translate_symbol_action, translate_code): Pass rule = NULL to
5723 translate_action.
5724
34f98f46
JD
57252006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5726
5727 Rename %before-definitions to %start-header and %after-definitions to
5728 %end-header. Don't use these declarations to separate pre-prologue
5729 blocks from post-prologue blocks. Add new order-independent
5730 declarations %before-header and %after-header as alternatives to the
5731 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5732 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5733 * NEWS (2.3+): Update for these changes.
5734 * data/glr.c (b4_before_definitions): Update to...
5735 (b4_start_header): ... this.
5736 (b4_after_definitions): Update to...
5737 (b4_end_header): ... this.
5738 * data/glr.cc: Likewise.
5739 * data/lalr1.cc: Likewise.
5740 * data/yacc.c: Likewise.
5741 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5742 prologue blocks with %*-header declarations.
5743 (Calc++ Parser): Likewise.
91661ebb 5744 (Decl Summary): Update names.
148d66d8 5745 (Table of Symbols): Update description.
34f98f46
JD
5746 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5747 (PERCENT_END_HEADER): ... this.
5748 (PERCENT_BEFORE_DEFINITIONS): Update to...
5749 (PERCENT_START_HEADER): ... this.
5750 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5751 (declaration): Update token names and m4 macro names.
5752 When parsing %end-header and %start-header, invoke translate_code
5753 before muscle_code_grow, and no longer set global booleans to remember
5754 whether these declarations have been seen.
5755 Parse new %after-header and %before-header.
5756 * src/reader.c (before_definitions, after_definitions): Remove.
5757 (prologue_augment): Accept a new bool argument to specify whether to
5758 augment the pre-prologue or post-prologue.
5759 * src/reader.h (before_definitions, after_definitions): Remove these
5760 extern's.
5761 (prologue_augment): Add new bool argument.
5762 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5763 (PERCENT_END_HEADER): ... this.
5764 (PERCENT_BEFORE_DEFINITIONS): Update to...
5765 (PERCENT_START_HEADER): ... this.
5766 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5767 * tests/actions.at (Printers and Destructors): Update names.
5768
31b2b07e
JD
57692006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5770
5771 Add comparison operators for C++ location classes. Discussed at
5772 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5773 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5774 declaration indicating whether filename_type has an operator==. If
5775 filename_type is `std::string', it defaults to `1', `0' otherwise.
5776 * data/location.cc: Iff b4_define_location_comparison is `1', add
5777 operator== and operator!= for class position and for class location.
5778
5779 Some minor fixes.
5780 * src/scan-action.l: Remove unused file.
5781 * src/symtab.c (symbol_printer_set): Use printer_location not
5782 destructor_location.
5783 * src/symtab.h (struct symbol): Replace incorrect source comment for
5784 printer members.
5785 * tests/input.at (Incompatible Aliases): Update output with correct
5786 printer location.
5787
9bc0dd67
JD
57882006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5789
5790 Don't put the pre-prologue in the header file. For the yacc.c code
5791 file and the glr.c header and code files, move the pre-prologue before
5792 the token definitions. Add new %before-definitions and
5793 %after-definitions to declare code that will go in both the header file
5794 and code file. Discussed at
5795 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5796 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5797 and
5798 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5799 * NEWS (2.3+): Describe these changes.
5800 * data/glr.c (b4_pre_prologue): Move from within to before...
5801 (b4_shared_declarations): ... this.
5802 Add new b4_before_definitions before b4_token_enums.
5803 Add new b4_after_definitions at the end.
5804 * data/glr.cc (b4_pre_prologue): Replace with...
5805 (b4_before_definitions): ... this in the header file.
5806 (b4_after_definitions): New near the end of the header file.
5807 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5808 code file right before including the header file.
5809 (b4_before_definitions): New in the previous position of
5810 b4_pre_prologue in the header file.
5811 (b4_after_definitions): New near the end of the header file.
5812 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5813 (b4_token_enums_defines): In the code file, move to right before
5814 YYSTYPE for consistency with the header file.
5815 (b4_before_definitions): New right before b4_token_enums_defines in
5816 both the header and code file.
5817 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5818 header and code file.
5819 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5820 of prologues for %union dependencies.
91661ebb
JD
5821 (Decl Summary): In %defines description, mention the effect of
5822 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
5823 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5824 than in the pre-prologue so that make check succeeds.
148d66d8 5825 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
5826 %after-definitions.
5827 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5828 %before-definitions.
5829 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5830 (declaration): Parse those declarations and append to
5831 b4_before_definitions and b4_after_definitions, respectively.
5832 * src/reader.c (before_definitions, after_definitions): New bools to
5833 track whether those declarations have been seen.
5834 (prologue_augment): Add to the post-prologue if %union,
5835 %before-definitions, or %after-definitions has been seen.
5836 * src/reader.h (before_definitions, after_definitions): New extern's.
5837 * src/scan-gram.l: Scan the new declarations.
5838 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5839 prologue block in a %before-definitions or a %after-definitions based
5840 on whether the %union is declared.
5841 * tests/regression.at (Early token definitions with --yacc, Early token
5842 definitions without --yacc): Move tests for token definitions into the
5843 post-prologue since token names are no longer defined in the
5844 pre-prologue.
5845
203b9274
AD
58462006-06-20 Akim Demaille <akim@epita.fr>
5847
5848 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5849 (symbol_get): Use it.
5850 * src/parse-gram.y: Use it.
5851
a7ee59cf
JD
58522006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5853
5854 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5855 build succeeds when configured with --enable-gcc-warnings.
5856
5a2baae7
PE
58572006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5858
33ad1a9c
PE
5859 * src/parse-gram.y (char_name): New function.
5860 (CHAR, STRING, string_content): For %printer, properly escape.
5861 (ID): Prefer fputs to fprintf.
5862 (id): Reindent to be consistent with other rules.
5863 Properly quote char.
5864
5a2baae7
PE
5865 The Translation Project changed its way of publishing translations
5866 to maintainers. I haven't received any responses to my request
5867 for supporting the old way, or for documenting the new way. I
5868 have modified 'bootstrap' to use screen scraping
5869 (in this case, HTML scraping). This is unreliable and inelegant,
5870 but I don't see any better way. Yuck.
5871 * bootstrap (TP_URL, WGET_COMMAND): New vars.
5872 (get_translations): New function, which uses HTML scraping to
5873 deduce locations of latest translations.
5874 Use this function to grab both bison and bison-runtime .po files.
5875 Don't bother priming the pump for the runtime-po domain any more,
5876 as it's now translated better than bison is.
5877
58d7a1a1
AD
58782006-06-19 Akim Demaille <akim@epita.fr>
5879
5880 * src/scan-gram.l: No longer "parse" things after `%union' until
5881 `{'. Rather, return a single "%union" token.
5882 No longer make symbols: return strings, and leave the conversion
5883 to symbols to the parser.
5884 (SC_PRE_CODE, token_type): Remove.
5885 * src/parse-gram.y (%union): New field `character'.
5886 Sort tokens.
5887 (CHAR): New token.
5888 (ID, ID_COLON): Now that the scanner no longer makes them
5889 identifiers, adjust all uses to invoke symbol_get.
5890 (id_colon): New, wraps the conversion from string to symbol.
5891 (%union): Accept a possible union_name.
5892 (symbol): Now can be a char.
5893 * data/c.m4 (b4_union_name): Leave a default value.
5894 * data/glr.c, data/yacc.c: Use it.
5895
b931235e
JD
58962006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
5897
5898 For associating token numbers with token names for "yacc.c", don't use
5899 #define statements unless `--yacc' is specified; always use enum
5900 yytokentype. Most important discussions start at:
5901 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
5902 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
5903 and
5904 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
5905 * NEWS (2.3+): Mention.
5906 * data/c.m4 (b4_yacc_if): New.
5907 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
5908 token #define's.
5909 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
5910 on token name definitions.
5911 * src/getargs.c (usage): Capitalize `Yacc' in English.
5912 * src/output.c (prepare): Define b4_yacc_flag.
5913 * tests/regression.at (Early token definitions): Test that tokens names
5914 are defined before the pre-prologue not just before the post-prologue.
5915 Remove this test case and copy to...
5916 (Early token definitions with --yacc): ... this to test #define's.
5917 (Early token definitions without --yacc): ... and this to test enums.
5918
9e6e7ed2
PE
59192006-06-11 Paul Eggert <eggert@cs.ucla.edu>
5920
5921 * NEWS: Reword the post-2.3 change to not be so optimistic about
5922 removing the old "look-ahead" spelling.
5923 Update previous look-ahead/lookahead change reports.
5924 * REFERENCES: look-ahead -> lookahead (since that's
5925 what he actually wrote).
5926 * doc/refcard.tex: look ahead -> lookahead,
5927 look-ahead -> lookahead
5928
742e4900
JD
59292006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
5930
5931 For consistency, use `lookahead' instead of `look-ahead' or
5932 `look_ahead'. Discussed starting at
5933 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
5934 and then at
5935 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
5936 * NEWS: For the next release, note the change to `--report'.
5937 * TODO, doc/bison.1: Update English.
5938 * doc/bison.texinfo: Update English.
5939 (Understanding Your Parser, Bison Options): Document as
5940 `--report=lookahead' rather than `--report=look-ahead'.
5941 * src/conflicts.c: Update English in comments.
5942 (lookahead_set): Rename from look_ahead_set.
5943 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
5944 (resolve_sr_conflict): Rename local look_ahead_tokens to
5945 lookahead_tokens, and update other uses.
5946 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
5947 count_rr_conflicts, conflicts_free): Update uses.
5948 * src/getargs.c (report_args): Move "lookahead" before alternate
5949 spellings.
5950 (report_types): Update uses.
5951 (usage): For `--report' usage description, state `lookahead' spelling
5952 rather than `look-ahead'.
5953 * src/getargs.h (report.report_lookahead_tokens): Rename from
5954 report_look_ahead_tokens.
5955 * src/lalr.c: Update English in comments.
5956 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
5957 (state_lookahead_tokens_count): Rename from
5958 state_look_ahead_tokens_count.
5959 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5960 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
5961 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5962 Update other uses.
5963 Update English in output.
5964 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
5965 * src/print.c: Update English in comments.
5966 (lookahead_set): Rename from look_ahead_set.
5967 (print_reduction): Rename argument lookahead_token from
5968 look_ahead_token.
5969 (print_core, state_default_rule, print_reductions, print_results):
5970 Update uses.
5971 * src/print_graph.c: Update English in comments.
5972 (print_core): Update uses.
5973 * src/state.c: Update English in comments.
5974 (reductions_new): Update uses.
5975 (state_rule_lookahead_tokens_print): Rename from
5976 state_rule_look_ahead_tokens_print, and update other uses.
5977 * src/state.h: Update English in comments.
5978 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
5979 (state_rule_lookahead_tokens_print): Rename from
5980 state_rule_look_ahead_tokens_print.
5981 * src/tables.c: Update English in comments.
5982 (conflict_row, action_row): Update uses.
5983 * tests/glr-regression.at
5984 (Incorrect lookahead during deterministic GLR,
5985 Incorrect lookahead during nondeterministic GLR): Rename
5986 print_look_ahead to print_lookahead.
5987 * tests/torture.at: Update English in comments.
5988 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
5989 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
5990 (Many lookahead tokens): Update uses.
5991 * data/glr.c: Update English in comments.
5992 * lalr1.cc: Likewise.
5993 * yacc.c: Likewise.
5994 * src/conflicts.h: Likewise.
5995 * src/lalr.h: Likewise.
5996 * src/main.c: Likewise.
5997 * src/output.c: Likewise.
5998 * src/parse-gram.c: Likewise.
5999 * src/tables.h: Likewise.
6000 * tests/calc.at: Likewise.
6001
3c40d0b5
JD
60022006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6003
6004 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6005
5d278082
PE
60062006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6007
6008 * TODO: Add request from Nelson H. F. Beebe to be able to install
6009 Bison without installing the yacc script.
6010
9e668899
JD
60112006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6012
6013 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6014 and yytext if they're already #define'd.
6015 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6016 * src/scan-code-c.c: ... here.
6017 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6018 <config.h>.
6019
0c8e079f
JD
60202006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6021
6022 Get Bison to build again when configured with --enable-gcc-warnings.
6023 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6024 missing #include's.
6025 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6026 loc argument as it shadows a global.
6027 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6028 invocation.
6029
6030 * src/.cvsignore: Add scan-code.c.
6031
2346344a
AD
60322006-06-07 Akim Demaille <akim@epita.fr>
6033
6034 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6035 to...
6036 * src/scan-code.l: here.
6037 * tests/input.at (Torturing the Scanner): Fix another location
6038 error.
6039
4862bdfd
AD
60402006-06-07 Akim Demaille <akim@epita.fr>
6041
6042 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6043
e9071366
AD
60442006-06-06 Akim Demaille <akim@epita.fr>
6045
6046 Extract the parsing of user actions from the grammar scanner.
6047 As a consequence, the relation between the grammar scanner and
6048 parser is much simpler. We can also split "composite tokens" back
6049 into simple tokens.
6050 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6051 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6052 rename as...
6053 * src/location.h, src/location.c (add_column_width)
6054 (location_compute): these.
6055 Fix the column count: the initial column is 0.
6056 (location_print): Be robust to ending column being 0.
6057 * src/location.h (boundary_set): New.
6058 * src/main.c: Adjust to scanner_free being renamed as
6059 gram_scanner_free.
6060 * src/output.c: Include scan-code.h.
6061 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6062 Use boundary_set.
6063 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6064 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6065 which is now, again, a separate token.
6066 Adjust all dependencies.
6067 Whereever actions with $ and @ are used, use translate_code.
6068 (action): Remove this nonterminal which is now useless.
6069 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6070 (grammar_current_rule_action_append): Use translate_code.
6071 (packgram): Bound check ruleno, itemno, and rule_length.
6072 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6073 (last_string, last_braced_code_loc, max_left_semantic_context)
6074 (scanner_initialize, scanner_free, scanner_last_string_free)
6075 (gram_out, gram_lineno, YY_DECL_): Move to...
6076 * src/scan-gram.h: this new file.
6077 (YY_DECL): Rename as...
6078 (GRAM_DECL): this.
6079 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6080 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6081 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6082 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6083 Move these declarations, and...
6084 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6085 these to...
6086 * src/flex-scanner.h: this new file.
6087 * src/scan-gram.l (rule_length, rule_length_overflow)
6088 (increment_rule_length): Remove.
6089 (last_braced_code_loc): Rename as...
6090 (gram_last_braced_code_loc): this.
6091 Adjust to the changes of the parser.
6092 Move all the handling of $ and @ into...
6093 * src/scan-code.l: here.
6094 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6095 (handle_action_dollar, handle_action_at): Move to...
6096 * src/scan-code.l: here.
6097 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6098 scan-code.h, scan-code-c.c, scan-gram.h.
6099 (EXTRA_bison_SOURCES): Add scan-code.l.
6100 (BUILT_SOURCES): Add scan-code.c.
6101 (yacc): Be robust to white spaces.
6102
6103 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6104 * tests/regression.at: Adjust the column numbers.
6105 * tests/regression.at: Adjust the error message.
7891a7c4 6106
184e42f0
JD
61072006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6108
6109 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6110 Use Akim's wording from
6111 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6112
7891a7c4
JD
61132006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6114
6115 Between Bison releases, manually append `+' to the previous Bison
6116 release number, and use that as a signal to automatically print the
6117 ChangeLog's CVS Id keyword from --version. Discussed starting at
6118 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6119 * ChangeLog: Add Id header.
6120 * configure.ac (AC_INIT): Append `+' to `2.3'.
6121 * src/.cvsignore: Add revision.c.
6122 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6123 (BUILT_SOURCES): Add revision.c.
6124 (revision.c): New target rule. This file defines a new global variable
6125 named revision. It initializes it with either the Id from ChangeLog
6126 or, if VERSION doesn't contain `+', with the empty string.
6127 * src/getargs.c (version): Print the value of revision.
6128 * src/revision.h: Extern revision.
6129
4ad3ed84
PE
61302006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6131
6132 * NEWS: Version 2.3.
6133 * configure.ac (AC_INIT): Likewise.
6134
02103984
PE
61352006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6136
6137 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6138 with no arguments, not as an object-like macro. This is for
6139 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6140 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6141 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6142 Document this.
6143
2c08afa5
JD
61442006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6145
6146 * src/getargs.c (usage): Back out yesterday's modification of the
6147 --help output so that we don't have to wait for translation before
6148 releasing 2.3.
6149
6077da58
PE
61502006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6151
6152 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6153 Problem reported by Akim Demaille.
6154
2a26b6c2
JD
61552006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6156
6157 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6158
aefef0d6
PE
61592006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6160
6161 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6162 generated source code. Problem reported by Frans Englich in
6163 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6164
fcd8e201
PE
61652006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6166
6167 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6168 shell, not within 'make', so that 'make' by an ordinary builder
6169 (using GNU make) does not worry about configuring gzip. This also
6170 works around a bug reported independently by Keith Thompson and by
6171 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6172 stderr rather than stdout, messing up the build logs.
6173
7b5cdcbd
JD
61742006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6175
6176 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6177 to make sure that YYID will never be unused. This fixes a 'make
6178 maintainer-check' failure caused by the recent changes to the 'Trivial
6179 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6180 not used.
6181 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6182
5ad0a449
JD
61832006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6184
6185 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6186 state before an empty RHS is always resolved here. Only the location
6187 of that state is guaranteed to be resolved, and that's enough. This
6188 fixes the remaining bug reported by Derek M. Jones in
6189 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6190 * tests/glr-regression.at (Uninitialized location when reporting
6191 ambiguity): Test the above case.
6192 Also, the embedded comments in this test case claim it checks the case
6193 of an empty RHS that has inherited the initial location. However, the
6194 corresponding LHS was already resolved, so yyresolveLocations didn't
6195 actually have reason to modify it. Fix this by forcing
6196 nondeterministic operation at the beginning of the parse.
6197
50cce58e
PE
61982006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6199
6200 * data/c.m4 (b4_yy_symbol_print_generate):
6201 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6202 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6203 of the bugs reported today by Derek M Jones in
6204 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6205 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6206 defined to be a type name without parens or brackets.
6207 (Location Type): Similarly for YYLTYPE.
6208 * tests/regression.at (Trivial grammars): Put in a test for this
6209 bug that will be caught by 'make maintainer-check' (though not,
6210 alas, by 'make check' unless your compiler is picky).
6211
ab8d9dc5
PE
62122006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6213
0d2c8934 6214 * NEWS: Version 2.2.
ab8d9dc5
PE
6215 * configure.ac (AC_INIT): Likewise.
6216
9138c575
JD
62172006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6218
6219 * data/glr.c (yyreportTree): Make room in yystates for the state
6220 preceding the RHS. This fixes the segmentation fault reported by Derek
6221 M. Jones in
6222 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6223 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6224 to the user. Reported for yyreportTree by Derek M. Jones later in the
6225 same thread.
6226 * THANKS: Add Derek M. Jones.
6227 Update my email address.
6228 Fix typo in Steve Murphy's name.
6229
276f48df
PE
62302006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6231
d6645148
PE
6232 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6233 checking against YYLAST that caused the parser to miss a potential
6234 alternative in its diagnostic.
6235 Problem reported by Maria Jose Moron Fernandez in
6236 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6237 * data/lalr1.cc (yysyntax_error_): Likewise.
6238 * data/yacc.c (yysyntax_error): Likewise.
6239 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6240 tokens, in case we run into an older C compiler.
6241 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6242 Use them to check for the off-by-one error fixed above.
6243
276f48df
PE
6244 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6245 YYSIZE_T, not size_t.
6246 * tests/regression.at (Trivial grammars): New test, to catch
6247 the error fixed by the above patch.
6248
cd8b5791
AD
62492006-05-14 Akim Demaille <akim@lrde.epita.fr>
6250
6251 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6252 scheme.
6253 Reported by Steve Murphy.
6254
34376418
AD
62552006-05-14 Akim Demaille <akim@lrde.epita.fr>
6256
6257 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6258 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6259
327afc7c
AD
62602006-05-14 Akim Demaille <akim@lrde.epita.fr>
6261
6262 Implement --trace=m4.
6263 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6264 * src/output.c (output_skeleton): When set, pass -dV to m4.
6265
6266 Factor the handling of flags in m4.
6267 * src/output.c (prepare): Rename the muscle names debug, defines,
6268 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6269 * data/c.m4: Adjust.
6270 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6271 Use b4_define_flag_if to define other b4_FLAG_if macros.
6272 (b4_location_if): As a consequence, rename as...
6273 (b4_locations_if): this, for consistency.
6274 Adjust all the skeletons.
6275
ba9ecd19
AD
62762006-05-14 Akim Demaille <akim@lrde.epita.fr>
6277
6278 * etc/bench.pm: Shorten bench names.
6279
4e83ea15
AD
62802006-05-14 Akim Demaille <akim@lrde.epita.fr>
6281
6282 * src/output.h, src/output.c (error_verbose): Move to...
6283 * src/getargs.h, src/getargs.c: here.
6284 Sort the flags.
6285 Adjust dependencies.
6286
6e93d810
PE
62872006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6288
6289 * data/c.m4 (b4_copyright): Put the special exception for Bison
6290 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
6291 uses changed. Suggested by Akim Demaille. Also, wrap the
6292 copyright notice, in case it is longer than 80 columns. Replace
6293 comma by newline after title.
6e93d810 6294
eaea13f5
PE
62952006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6296
6297 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6298 incompatibility, not a bug. Mention that it wasn't fixed as of
6299 flex 2.5.33.
6300
3cf084ec
AD
63012006-05-11 Akim Demaille <akim@lrde.epita.fr>
6302
6303 * examples/extexi: Enforce the precedence of concatenation over
6304 >>.
0a9f1c7d 6305 Reported by Tommy Nordgren.
3cf084ec 6306
32c96bd7
AD
63072006-05-11 Akim Demaille <akim@lrde.epita.fr>
6308
6309 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6310 with the member "token".
f94705b2 6311 Reported by Martin Nylin.
32c96bd7 6312
eaea13f5
PE
63132006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6314
6315 * data/glr.c: Switch to Bison 2.2 special-exception language in
6316 the copyright notice. Use more-regular format for titles and
6317 copyright notices.
6318 * data/glr.cc: Likewise.
6319 * data/location.cc: Likewise.
6320 * data/yacc.cc: Likewise.
6321 * doc/bison.texinfo (Conditions): Document this.
6322 * NEWS: likewise. Upgrade version to 2.2.
6323
6e2d1146
AD
63242006-04-27 Akim Demaille <akim@lrde.epita.fr>
6325
6326 * data/glr.cc: Remove dead code.
6327
47671055
PE
63282006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6329
6330 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6331 that variable and the line breaks the bootstrap. Problem reported
6332 by Juan M. Guerrero.
6333
ed2e6384
AD
63342006-04-24 Akim Demaille <akim@lrde.epita.fr>
6335
6336 * doc/bison.texinfo (Multiple start-symbols): New.
6337
3cedc2dc
AD
63382006-04-24 Akim Demaille <akim@lrde.epita.fr>
6339
6340 * etc/README, etc/bench.pl: New.
6341
b2ddc3f3
AD
63422006-04-03 Akim Demaille <akim@lrde.epita.fr>
6343
6344 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6345 rule.
6346 Reported by Mickael Labau.
6347 * tests/input.at (Torturing the Scanner): Test it.
6348
91e3ac9a
PE
63492006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6350
6351 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6352 Problem reported by Bob Rossi.
6353
63542006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6355
6356 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6357 and didn't really work.
6358 For the index, use @ifnotinfo, not @iftex.
6359 Minor cleanups of spacing and terminology.
6360
5cf61e93
AD
63612006-03-12 Akim Demaille <akim@lrde.epita.fr>
6362
6363 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6364 of AT_NAME_PREFIX when %name-prefix is not used.
6365
aa08666d
AD
63662006-03-12 Akim Demaille <akim@lrde.epita.fr>
6367
6368 Apply --prefix to C++ skeletons too: they change the namespace.
6369 The test suite already exercize these cases.
6370 * data/c++.m4 (b4_namespace): New.
6371 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6372 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6373 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6374 * doc/bison.texinfo: Document it.
6375 (Option Cross Key): Use @multitable in all formats. It looks
6376 nicer, even in TeX outputs.
6377 (Rules): Use the same code whatever the output type is.
6378 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6379 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6380 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 6381
45567173
AD
63822006-03-10 Akim Demaille <akim@lrde.epita.fr>
6383
6384 * TODO: Remove dead items.
6385
e9d8f881 63862006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
6387
6388 * doc/FAQ: Remove, merged into...
6389 * doc/bison.texinfo (FAQ): this.
6390 * doc/Makefile.am (EXTRA_DIST): Adjust.
6391
c095d689
AD
63922006-03-10 Akim Demaille <akim@lrde.epita.fr>
6393
6394 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6395 even if empty.
6396 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6397 * doc/bison.texinfo (Calc++ Scanner): Use it.
6398
6e0f8287
PE
63992006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6400
6401 Fix two nits reported by twlevo, plus one more that I discovered.
6402
6403 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6404 this is the usual Bison style.
6405 * src/location.h (location_print): Likewise.
6406
6407 * src/reader.h (token_name): Likewise.
6408
d6b771c3
PE
64092006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6410
6411 Fix some nits reported by twlevo.
6412 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6413 and "POSIX". Use more-modern syntax for URLs. Mention C++
6414 and ask for Java. Don't hardwire OS version numbers. Add
6415 copyright notice.
6416 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6417 * src/conflicts.c (solved_conflicts_obstack): Now static.
6418
1e137b71
JD
64192006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6420
6421 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6422 page. Say "you can use it" not "you may use it" as on the web page;
6423 we're describing capabilities not granting permission.
6424
73f2e47e
PE
64252006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6426
6d05403d
PE
6427 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6428 shadowing warnings. Use usual patter for iterating through RHS.
6429 * tests/glr-regression.at
6430 (Uninitialized location when reporting ambiguity):
6431 Modify yylex so that it uses its argument, rather than trying
6432 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6433 const char -> char const.
6434
73f2e47e
PE
6435 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6436 Don't use tabs inside commands; it messes up 'ps'.
6437 Problem reported by twlevo.
6438
8710fc41
JD
64392006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6440
6441 * tests/glr-regression.at (Uninitialized location when reporting
6442 ambiguity): New test case.
6443 * data/glr.c (yyresolveLocations): New function, which uses
6444 YYLLOC_DEFAULT.
6445 (yyresolveValue): Invoke yyresolveLocations before reporting an
6446 ambiguity.
6447 * doc/bison.texinfo (Default Action for Locations): Note
6448 YYLLOC_DEFAULT's usage for ambiguity locations.
6449 (GLR Semantic Actions): Cross-reference those notes.
6450
ae952af2
JD
64512006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6452
6453 * tests/glr-regression.at (Leaked semantic values when reporting
6454 ambiguity): Remove unnecessary union and type declarations.
6455 (Leaked lookahead after nondeterministic parse syntax error): New test
6456 case.
6457 * data/glr.c (yyparse): Check for zero stacks remaining before
6458 attempting to shift the lookahead so that you don't lose it.
6459
35ee866a
JD
64602006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6461
6462 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6463 * tests/glr-regression.at (Leaked semantic values when reporting
6464 ambiguity): New test case.
6465 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6466 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6467 now unnecessary yystackp parameter.
6468 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6469 destructors can be called.
6470
6471 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6472 in existing testcases.
6473
520181ab
JD
64742006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6475
6476 Don't leak semantic values for parent RHS when a user action cuts the
6477 parser, and clean up related code a bit.
6478 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
6479 cuts parse): Rename to...
6480 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
6481 for leaked parent RHS values.
6482 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6483 between an unresolved state (non-empty chain of semantic options) and
6484 an incomplete one (signaled by an empty chain).
ae952af2 6485 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
6486 successfully or unsuccessfully resolved yyGLRState to...
6487 (yyresolveValue): ... here so that yyresolveValue always leaves a
6488 yyGLRState with consistent data and thus is easier to understand.
6489 Remove the yyvalp and yylocp parameters since they are always just
6490 taken from the yys parameter. When reporting a discarded merged value
6491 in debugging output, note that it is incompletely merged. Document the
6492 interface.
6493 (yyresolveAction): If resolving any of the RHS states fails, destroy
6494 them all rather than leaking them. Thus, as long as user actions are
6495 written to clean up the RHS correctly, yyresolveAction always cleans up
6496 the RHS of a semantic option. Document the interface.
6497
18d9185c
PE
64982006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6499
6500 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6501 led to a segmentation fault in GNU Pascal. Problem reported
6502 by Waldek Hebisch.
6503
841a7737
JD
65042006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6505
6506 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6507 mid-rule action inside a nonterminal symbol in order to declare a
6508 destructor for its semantic value.
6509
fc3f467f
PE
65102006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6511
6512 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6513 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6514 __cplusplus && ! defined _STDLIB_H && !
6515 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6516 defined free))]: Include <stdlib.h> rather than rolling our own
6517 declarations of malloc and free, to avoid problems with
6518 incompatible declarations (using 'throw') C++'s stdlib.h. This
6519 should fix Debian bug 340012
6520 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6521 reported by Guillaume Melquiond.
6522
a3af26dd
PE
65232006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6524
4d7bc38c
PE
6525 * NEWS: Clarify symbols versus types in unused-value warnings.
6526
a3af26dd
PE
6527 * configure.ac (AC_INIT): Bump version number.
6528
4e26c69e
PE
65292006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6530
6531 * NEWS: Version 2.1a.
6532 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6533 since C99 requires this.
6534
498e897c
PE
65352006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6536
6537 * m4/c-working.m4: New file.
6538 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6539
57bb17ca
PE
65402006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6541
6542 * Makefile.maint: Merge from coreutils.
6543
0be105dc
PE
65442006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6545
6546 More portability fixes for problems summarized by Nelson H. F. Beebe.
6547
6548 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6549 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6550 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6551 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6552 messes up because C++ code is compiled in 32-bit mode but linked
6553 in 64-bit mode.
6554
6fc0c024
PE
65552006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6556
6557 More portability fixes for problems summarized by Nelson H. F. Beebe.
6558
7870f699
PE
6559 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6560 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6561
6fc0c024
PE
6562 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6563 nodist_PROGRAMS, since we don't need to actually compile the
6564 example if we're just doing a plain 'make'. This avoids bothering
6565 the installer unnecessarily about problems due to weird C++
6566 compilers.
6567
fe6c2fde
PE
65682006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6569
6570 More portability fixes for problems summarized by Nelson H. F. Beebe.
6571
6572 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6573 than #include "...", and compile with -I'.'. The old method was
6574 not portable, according to Posix and the C standard, and it does
6575 not work with Sun C 5.7, where previous #line directives affect
6576 the working directory used in later #include "..." directives.
6577
927b425b
JMG
65782006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6579
6580 Various DJGGP specific issues in /djgpp
6581
d9735e9e
PE
65822006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6583
6584 More portability fixes for problems summarized by Nelson H. F. Beebe.
6585
6586 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6587 '#include <map>' works and that you can apply ++ to iterators.
6588
5a6755af
PE
65892006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6590
67a0dc4f
PE
6591 Work around portability problems summarized by Nelson H. F. Beebe in
6592 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6593
8c86f0ef
PE
6594 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6595 that '#include <string>' works.
6596
de35dd59
PE
6597 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6598 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6599 "warning: sorry: semantics of inline function static data `const
6600 unsigned char translate_table[262]' are wrong (you'll wind up with
6601 multiple copies)".
6602
67a0dc4f
PE
6603 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6604 or, xor to not_, and_, or_, and xor_, respectively. This works
6605 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6606 random system header somewhere that includes the equivalent of
6607 <iso646.h>.
6608
5a6755af
PE
6609 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6610 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 6611 Suite Version 2.0.
5a6755af 6612
3f001415
JD
66132006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6614
6615 During deterministic GLR operation, user actions should be able to
6616 influence the parse by changing yychar. To make this easier to fix and
6617 to make glr.c easier to evolve in general, don't maintain yytoken in
6618 parallel with yychar; just compute yytoken when needed.
6619 * tests/glr-regression.at (Incorrect lookahead during deterministic
6620 GLR): Check that setting yychar in a user action has the intended
6621 effect.
6622 * data/glr.c (yyGLRStack): Remove yytokenp member.
6623 (yyclearin): Don't set *yytokenp.
6624 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6625 yychar rather than *yytokenp to determine the current lookahead.
6626 Compute yytoken locally when needed.
6627 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6628 point to.
6629
6630 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6631 after `--report' documentation.
6632
e2a8c0f5
PE
66332006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6634
6635 * src/parse-gram.y (grammar_declaration): Location of printer
6636 symbol is @1, not list->location. Bug reported by twlevo.
6637 * tests/input.at (Incompatible Aliases): Adjust to above change.
6638
6b702268
PE
66392006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6640
27622431
PE
6641 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6642 all the test at once. This makes the output easier to read in the
6643 normal case.
6644
6b702268
PE
6645 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6646 got from <http://bro-ids.org/download.html>. The bug is that
6647 when two actions appeared in succession, the second one was
6648 scanned before the first one was added to the grammar rule
6649 as a midrule action. Bison then output the incorrect warning
6650 "parse.y:905.17-906.36: warning: unused value: $3".
6651 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6652 associated with a value.
6653 (rhs): Don't invoke grammar_current_rule_action_append.
6654 (action): Invoke it here instead.
6655 * src/reader.c (grammar_midrule_action): Now extern.
6656 (grammar_current_rule_action_append): Don't invoke
6657 grammar_midrule_action; that is now the scanner's job.
6658 * src/reader.h (last_string, last_braced_code_loc):
6659 (grammar_midrule_action): New decls.
6660 * src/scan-gram.l (last_string): Now extern, sigh.
6661 (last_braced_code_loc): New extern variable.
6662 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6663 rule already has an action.
6664 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6665 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6666 Add some tests to check that the above changes fixed the bug.
6667
d40ba6c2
PE
66682006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6669
6670 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6671 All used changed. Check whether the symbol has a destructor,
6672 not whether it is typed.
6673 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6674 that the values are still reported as unused. All line numbers
6675 adjusted.
6676
401aace6
PE
66772006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6678
6679 Work around a bug in bro 0.8, which underparenthesizes its
6680 definition of YYLLOC_DEFAULT.
6681 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6682 their arguments.
6683 * data/lalr1.cc: Likewise.
6684 * data/yacc.cc: Likewise.
6685
06f01bc4
PE
66862006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6687
401aace6
PE
6688 Work around a bug in Pike 7.0, and give the Pike folks a
6689 better way to override the usual int widths.
6690 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6691 user can override the types.
6692 (short): #undef, to work around a bug in Pike 7.0.
6693 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6694 (union yyalloc.yyss): Use yytype_int16 rather than short.
6695 All uses changed.
6696 (yysigned_char): Remove.
6697 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6698 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6699 * tests/regression.at (Web2c Actions): Adjust to above changes.
6700
6701 * src/reader.c (check_and_convert_grammar): New function.
6702 (reader): Close the input file even if something went wrong during
6703 parsing. Minor file descriptor leak reported by twlevo.
6704
06f01bc4
PE
6705 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6706 to pacify gcc -Wswitch-default.
6707 * src/scan-gram.l (adjust_location): Use a default: break; case
6708 to pacify gcc -Wswitch-default.
6709 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6710 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6711 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6712 Move these decls to scan-skel.l, since they don't need to be
6713 visible elsewhere.
6714 * src/scan-skel.l: Accept the above decls.
6715 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6716 is used.
6717
02650b7f
PE
67182006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6719
6720 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6721 since we don't want to insist on a version number at the start
6722 of the changelog every time.
6723 * Makefile.maint: Sync from coreutils a bit better.
6724 (sc_trailing_blank): Renamed from sc_trailing_space.
6725 All uses changed.
6726 (sc_no_if_have_config_h, sc_require_config_h):
6727 (sc_prohibit_assert_without_use): New rules.
6728 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6729 (sc_dd_max_sym_length): Fix leading spaces in rule.
6730 (sc_system_h_headers): Prefix with @.
6731 (sc_useless_cpp_parens, m4-check): Output line numbers.
6732 (changelog-check): Allow version only in head.
6733 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6734 satisfy new Makefile.maint rule.
6735 * data/glr.c: Likewise.
6736 * data/glr.cc: Likewise.
6737 * data/lalr1.cc: Likewise.
6738 * data/yacc.c: Likewise.
6739 * lib/ebitsetv.c: Likewise.
6740 * lib/lbitset.c: Likewise.
6741 * lib/subpipe.c: Likewise.
6742 * lib/timevar.c: Likewise.
6743 * src/system.h: Likewise.
6744 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6745 * djgpp/Makefile.maint: Add copyright notice.
6746 * djgpp/README.in: Likewise.
6747 * djgpp/config.bat: Likewise.
6748 * djgpp/config.site: Likewise.
6749 * djgpp/config_h.sed: Likewise.
6750 * djgpp/djunpack.bat: Likewise.
6751 * djgpp/config.sed: Fix copyright notice to match standard format.
6752 * djgpp/subpipe.h: Likewise.
6753 * lib/bitsetv-print.c: Likewise.
6754 * lib/bitsetv.c: Likewise.
6755 * lib/subpipe.h: Likewise.
6756 * lib/timevar.c: Likewise.
6757 * lib/timevar.h: Likewise.
6758 * djgpp/subpipe.c: Use standard recipe for config.h.
6759 * lib/abitset.c: Likewise.
6760 * lib/bitset.c: Likewise.
6761 * lib/bitset_stats.c: Likewise.
6762 * lib/bitsetv-print.c: Likewise.
6763 * lib/bitsetv.c: Likewise.
6764 * lib/ebitsetv.c: Likewise.
6765 * lib/get-errno.c: Likewise.
6766 * lib/lbitset.c: Likewise.
6767 * lib/subpipe.c: Likewise.
6768 * lib/timevar.c: Likewise.
6769 * lib/vbitset.c: Likewise.
6770 * tests/local.at: Likewise.
6771 * src/scan-gram.l: Don't include verify.h, since system.h does
6772 that for us.
6773 * .x-sc_require_config_h: New file.
6774 * .x-sc_unmarked_diagnostics: New file.
6775
287c78f6
PE
67762006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6777
287c78f6
PE
6778 Be a bit more systematic about using 'abort'.
6779 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6780 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6781 Put 'default: abort ();' before some other case, to satisfy older
6782 pedantic compilers.
6783 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6784 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6785 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6786 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
6787 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6788 (get_decision_str, get_orientation_str, get_node_alignment_str):
6789 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6790 (get_linestyle_str, get_arrowstyle_str): Likewise.
6791 * src/conflicts.c (resolve_sr_conflict):
6792 Use a default case rather than one for the one remaining enum
6793 value, to catch invalid enum values as well.
6794 * src/lalr.c (set_goto_map, map_goto):
6795 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6796 * src/nullable.c (nullable_compute, token_definitions_output):
6797 Likewise.
6798 * src/reader.c (packgram, reader): Likewise.
6799 * src/state.c (transitions_to, state_new, state_reduction_find):
6800 Likewise.
6801 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6802 (symbol_pack): Likewise.
6803 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
6804 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6805 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
6806 * src/system.h: Don't include <assert.h>.
6807 (assert): New macro.
6808
6809 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6810 (Destructor Decl, Parser Function, Pure Calling):
6811 Describe rules for braces inside C code more carefully.
287c78f6 6812
c66dfadd
PE
68132006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6814
c21493b8
PE
6815 Fix some porting glitches found by Nelson H. F. Beebe.
6816 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6817 compilers that don't understand that abort () does not return.
6818 * src/state.c (transitions_to): Likewise.
6819 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6820 that '#include <cstdlib>' works.
6821 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6822 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6823 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6824 for the benefit of some pre-C99 compilers.
6825
b6e3facf
PE
6826 * bootstrap: Undo changes to gnulib files that autoreconf made.
6827
c66dfadd
PE
6828 Minor fixups to get 'make maintainer-check' to work.
6829 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6830 with the new verify.h implementation.
6831 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6832 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6833 * data/yacc.c (YYUSE): Likewise.
6834 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6835 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6836 * src/parse-gram.y (declaration): Don't pass a string constant
6837 to a function that expects char *, since GCC might complain
6838 about the constant value.
6839 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6840 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6841 before #defining them.
6842 * tests/glr-regression.at
6843 (Incorrectly initialized location for empty right-hand side in GLR):
6844 In yyerror, use the msg arg.
6845 (Corrupted semantic options if user action cuts parse):
6846 (Incorrect lookahead during deterministic GLR):
6847 (Incorrect lookahead during nondeterministic GLR):
6848 Don't name a local var 'index'; it shadows string.h's 'index'.
6849
ed94ef2a
AD
68502006-01-19 Akim Demaille <akim@epita.fr>
6851
6852 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6853 location, not just parts of it.
6854
e9ad4aec
PE
68552006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6856
d6ca7905
PE
6857 * NEWS: Document the fact that multiple %unions are now allowed.
6858 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
6859 * TODO: This feature is now implemented, so remove it from
6860 the wishlist.
d6ca7905 6861
ef1b70e0
PE
6862 * Makefile.maint: Merge with coreutils Makefile.maint.
6863 (CVS_LIST): Use build-aux version if available.
6864 (VERSION_REGEXP): New macro.
6865 (syntax-check-rules): Add sc_no_if_have_config_h,
6866 sc_prohibit_assert_without_use, sc_require_config_h,
6867 sc_useless_cpp_parens.
6868 (sc_obsolete_symbols): Check for O_NDELAY.
6869 (sc_dd_max_sym_length): Track coreutils.
6870 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6871 (sc_useless_cpp_parens): New rule.
6872 (news-date-check): Look for version or today's date.
6873 (changelog-check): Don't require version number near head.
6874 (copyright-check): Use current year instead of hardwiring 2005.
6875 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
6876 (announcement): Add --gpg-key-ID.
6877
6878 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
6879 with "file system".
6880
2073ce56 6881 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
6882 array. Problem reported by twlevo.
6883 * src/reader.c (packgram): Prepend a new sentinel before ritem.
6884 * src/lalr.c (build_relations): Rely on new sentinel.
6885 * src/gram.c (gram_free): Adjust to new sentinel.
6886
b7691f15
JD
68872006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
6888
6889 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
6890 yylookaheadNeeds. All uses updated.
6891 (yysplitStack): Rename local yynewLookaheadStatuses to
6892 yynewLookaheadNeeds.
6893 * data/glr-regression.at (Incorrect lookahead during nondeterministic
6894 GLR): In comments, change `lookahead status' to `lookahead need'.
6895
ddee1b06
PH
68962006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6897
6898 * data/glr.c (yysplitStack): A little stylistic rewrite.
6899
12f4614d
PH
69002006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6901
6902 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
6903
32c29292
JD
69042006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
6905
6906 * doc/bison.texinfo: Fix some typos.
6907 (GLR Semantic Actions): New subsection discussing special
6908 considerations because GLR semantic actions might be deferred.
6909 (Actions): Mention look-ahead usage of yylval.
6910 (Actions and Locations): Mention look-ahead usage of yylloc.
6911 (Special Features for Use in Actions): Add YYEOF entry and mention it
6912 in the yychar entry.
6913 In the yychar entry, remove mention of the local yychar case (pure
6914 parser) since this is irrelevant information when writing semantic
148d66d8 6915 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
6916 yychar is otherwise described as an external variable.
6917 In the yychar entry, don't call it the `current' look-ahead since it
6918 isn't when semantic actions are deferred.
6919 In the yychar and yyclearin entries, add note about deferred semantic
6920 actions.
6921 Add yylloc and yylval entries discussing look-ahead usage.
6922 (Look-Ahead Tokens): When discussing yychar, don't call it the
6923 `current' look-ahead, and do mention yylval and yylloc.
6924 (Error Recovery): Cross-reference `Action Features' when mentioning
6925 yyclearin.
148d66d8 6926 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
6927 look-ahead.
6928 In the yylloc and yylval entries, mention look-ahead usage.
6929
de366a2f 69302006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
6931
6932 * tests/glr-regression.at: Update copyright year to 2006.
6933
bf70fa87
JD
69342006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6935
6936 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
6937 use during nondeterministic operation to track which stacks have
6938 actually needed the current lookahead.
6939 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
6940 Allocate, deallocate, resize, and otherwise shuffle space for
6941 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
6942 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
6943 appropriately during nondeterministic operation.
6944 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
6945 members to store the current lookahead to be used by the deferred
6946 user action.
6947 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
6948 from which the RHS is taken. Set the lookahead members of the new
6949 yySemanticOption according to the lookahead status for stack yyk.
6950 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
6951 yyaddDeferredAction.
6952 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
6953 members of yySemanticOption before invoking yyuserAction, and then set
6954 them back to their current values afterward.
6955 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
6956 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
6957 * tests/glr-regression.at: Remove `.' from the ends of recent test case
6958 titles for consistency.
6959 (Leaked merged semantic value if user action cuts parse): In order to
6960 suppress lint warnings, use arguments in merge function, and assign
6961 char value < 128 in main.
6962 (Incorrect lookahead during deterministic GLR): New test case.
6963 (Incorrect lookahead during nondeterministic GLR): New test case.
6964
05449a2c
JD
69652006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6966
de366a2f 6967 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
6968 !yyvaluep as signal that no semantic value is available to print.
6969 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
6970 to print a semantic value.
6971
4158e0a1 69722006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 6973
4158e0a1
JD
6974 * tests/glr-regression.at: For consistency with my newer test cases,
6975 don't thank myself.
6976
d659304d
JD
69772006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6978
6979 * data/glr.c (yyresolveValue): When merging semantic options, if at
6980 least one user action succeeds but a later one cuts the parse, then
6981 destroy the semantic value before returning rather than leaking it.
6982 (yyresolveStates): If a user action cuts the parse and thus
6983 yyresolveValue fails, ignore the (unset) semantic value rather than
6984 corrupting the yyGLRState, and empty the semantic options list since
6985 the user actions should have called all necessary destructors.
6986 Simplify code with YYCHK.
6987 * tests/glr-regression.at (Corrupted semantic options if user action
6988 cuts parse): New test case.
6989 (Undesirable destructors if user action cuts parse): New test case.
6990 Before applying any of this patch, this test case never actually failed
6991 for me... but only because the corrupted semantic options usually
6992 masked this bug.
6993 (Leaked merged semantic value if user action cuts parse): New test
6994 case.
6995
6ec2c0f2
AD
69962006-01-05 Akim Demaille <akim@epita.fr>
6997
6998 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
6999
1b9c21fb
PE
70002006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7001
7002 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7003 _MSC_VER. Problem reported by Cenzato Marco.
7004 (b4_c_function_def): Use it.
7005 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7006 b4_c_modern.
7007 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7008 than rolling our own.
7009
84866159
AD
70102006-01-04 Akim Demaille <akim@epita.fr>
7011
7012 Also warn about non-used mid-rule values.
7013 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7014 member.
7015 (symbol_list_new): Adjust.
7016 * src/reader.c (symbol_typed_p): New.
7017 (grammar_rule_check): Use it.
7018 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7019 Check its rule.
7020 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7021 Use it.
7022 * tests/actions.at (Exotic Dollars): Adjust.
7023
378f4bd8
AD
70242006-01-04 Akim Demaille <akim@epita.fr>
7025
7026 * src/reader.c (grammar_midrule_action): If $$ is set in a
7027 mid-rule, move the `used' bit to its lhs.
7028 * tests/input.at (Unused values): New.
7029 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7030
e2a21b6f
PE
70312006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7032
54662697
PE
7033 * doc/bison.texinfo (Bison Options): Say more accurately what
7034 --yacc does.
7035 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7036 about declarations in the grammar when in Yacc mode, as POSIX does
7037 not require a diagnostic when the grammar uses extensions.
7038
7039 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7040
073f9288
PE
7041 Warn about dubious constructions like "%token T T".
7042 Reported by twlevo.
7043 * src/symtab.h (struct symbol.declared): New member.
7044 * src/symtab.c (symbol_new): Initialize it to false.
7045 (symbol_class_set): New arg DECLARING, specifying whether
7046 this is a declaration that we want to warn about, if there
7047 is more than one of them. All uses changed.
7048
1221b78a
PE
7049 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7050 Allow multiple %union directives, whose contents concatenate.
7051 * src/parse-gram.y (grammar_declaration): Likewise.
7052 Use muscle_code_grow, so that we don't need stype_line any more.
7053 All uses changed.
7054
7055 * src/muscle_tab.c (muscle_grow): Fix comment.
7056
e2a21b6f
PE
7057 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7058 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7059 Update copyright year to 2006.
7060
8f7e3cf9
AD
70612006-01-03 Akim Demaille <akim@epita.fr>
7062
7063 Have glr.cc pass (some of) the calc.at tests.
7064 * data/glr.cc (b4_parse_param_orig): New.
7065 (b4_parse_param): Improve its definition, and bound it more
7066 clearly in the skeleton.
7067 (b4_epilogue): Append, instead of prepending, in order to keep
7068 #line consistency.
7069 Simplify the generation of auxiliary functions: locations and
7070 purity are mandated.
7071 (b4_global_tokens_and_yystype): Honor it.
7072 * data/location.cc (c++.m4): Don't include it.
7073 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7074 and AT_SKEL_CC_IF.
7075 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7076 AT_LALR1_CC_IF.
7077 Be sure to initialize the first position's filename.
7078 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7079 mandated anyway.
7080 (AT_CHECK_CALC_GLR_CC): New.
7081 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7082
3953ed88
AD
70832006-01-02 Akim Demaille <akim@epita.fr>
7084
7085 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7086 c.m4.
0a96ba81 7087 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
7088 * data/glr.cc: Do not include stack.hh.
7089
9ecafbbf
AD
70902006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7091
7092 * data/glr.c: Reformat whitespace with tabs.
7093 (b4_lpure_formals): Remove this unused m4 macro.
7094 * tests/cxx-type.at: Reformat whitespace with tabs.
7095 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7096 since it's a member. Rename type to isNterm for clarity.
7097
c4d497a0
AD
70982005-12-29 Akim <akim@sulaco.local>
7099
7100 Let glr.cc catch up with symbol_value_print.
7101 * data/glr.cc (b4_yysymprint_generate): Replace by...
7102 (b4_yy_symbol_print_generate): this.
7103 (yy_symbol_print, yy_symbol_value_print): Declare them.
7104
4517da37
PE
71052005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7106
7107 * src/location.h (boundary): Note that a line or column equal
7108 to INT_MAX indicates an overflow.
7109 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7110 (rule_length_overflow, increment_rule_length, add_column_width):
7111 New functions.
7112 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7113 (<SC_BRACED_CODE>"}"):
7114 Use increment_rule_length rather than incrementing it by hand.
7115 (adjust_location, handle_syncline): Diagnose overflow.
7116 (handle_action_dollar, handle_action_at):
7117 Fix bug with monstrosities like $-2147483648.
7118 Remove now-unnecessary checks.
7119 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7120 (convert_ucn_to_byte): Verify assumptions.
7121 (handle_syncline): New arg LOC. All callers changed.
7122 Don't store through a value derived from char const * pointer.
7123
7124 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7125 GCC warnings.
7126
e3233bf6
PE
71272005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7128
7129 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7130 Remove unnecessary forward static decls.
7131
8f3596a6
AD
71322005-12-27 Akim Demaille <akim@epita.fr>
7133
7134 * src/reader.c (grammar_current_rule_check): Also check that $$
7135 is used.
7136 Take the rule to check as argument, hence rename as...
7137 (grammar_rule_check): this.
7138 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7139 Rename as...
7140 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7141 (grammar_midrule_action, grammar_symbol_append): Now static.
7142 * tests/torture.at (input): Don't rely on the default action
7143 being always performed.
7144 * tests/calc.at: "Set" $$ even when the action is "cut" with
7145 YYERROR or other.
7146 * tests/actions.at (Exotic Dollars): Instead of using unused
7147 values, check that the warning is issued.
7148
721be13c
PE
71492005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7150
7151 * NEWS: Improve wording for unused-value warnings.
7152
a0af42fc
AD
71532005-12-22 Akim Demaille <akim@epita.fr>
7154
7155 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7156 (b4_yysymprint_generate): Rename as...
7157 (b4_yy_symbol_print_generate): this.
7158 Generate yy_symbol_print instead of yysymprint.
7159 Generate also yy_symbol_value_print, and use it.
7160
affac613
AD
71612005-12-22 Akim Demaille <akim@epita.fr>
7162
721be13c 7163 * NEWS: Warn about unused values.
affac613
AD
7164 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7165 a `used' member.
7166 (symbol_list_n_get, symbol_list_n_used_set): New.
7167 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7168 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7169 * src/reader.c (grammar_current_rule_check): Check that values are
7170 used.
7171 * src/symtab.c (symbol_print): Accept 0.
7172 * tests/existing.at: Remove the type information.
7173 Empty the actions.
7174 Remove useless actions (beware of mid-rule actions: perl -000
7175 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7176 * tests/actions.at (Exotic Dollars): Use unused values.
7177 * tests/calc.at: Likewise.
7178 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7179 Likewise.
7180
7181 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7182 rule_useful_p.
7183
9d9b8b70
PE
71842005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7185
8bb4c753
PE
7186 Undo 2005-12-01 tentative license wording change. The wording is
7187 still being reviewed by the lawyers, and we don't want to wait for
7188 them before publishing a test release. For now, revert to the
7189 previous wording.
7190 * NEWS: Undo 2005-12-01 change.
7191 * data/glr.c: Revert to previous license wording.
7192 * data/glr.cc: Likewise.
7193 * data/lalr1.cc: Likewise.
7194 * data/location.cc: Likewise.
7195 * data/yacc.c: Likewise.
7196
9d9b8b70
PE
7197 * NEWS: Reword %destructor vs YYABORT etc.
7198 * data/glr.c: Use American spacing, for consistency.
7199 * data/glr.cc: Likewise.
7200 * data/lalr1.cc: Likewise.
7201 * data/yacc.c: Likewise.
7202 * data/yacc.c: Reformat comments slightly.
7203 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7204 for consistency. Fix some spelling errors and reword recently-included
7205 text slightly.
7206 * tests/cxx-type.at: Cast results of malloc, for C++.
7207
2c3b392a
AD
72082005-12-21 Joel E. Denny <address@hidden>
7209
7210 * tests/cxx-type.at: Construct a tree, count the parents of shared
7211 nodes, and free each node once and only once. Previously, the memory
7212 for semantic values was leaked instead.
7213
d6cff4dc
AD
72142005-12-21 Joel E. Denny <address@hidden>
7215
7216 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7217 (yylval, yylloc): If pure, #define to yystackp->yyval and
7218 yystackp->yyloc similar to yychar and yynerrs.
7219 (yyparse): If pure, remove local yylval and yylloc. Add local
7220 yystackp to accommodate pure definitions of yylval and yylloc.
7221 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7222 yylvalp and yyllocp to &yylval and &yylloc.
7223 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7224 namespace. Previously, nerrs and char were missing, but lval and lloc
7225 weren't necessary.
7226 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7227 yylvalp and yyllocp parameters since, if pure, these are now always
7228 accessible through yystackp. If not pure, they are still accessible
7229 globally.
7230 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7231 `if (YYID (N))' to pacify lint.
7232
a85284cf
AD
72332005-12-21 Akim Demaille <akim@epita.fr>
7234
7235 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7236 destroy the RHS symbols of a rule.
7237 * data/yacc.c (yylen): Initialize to 0.
7238 Keep its value to the number of items to possibly shift.
7239 In particular, a regular successful parse that ends on YYFINAL by
7240 a (internal) YYACCEPT must not have yylen != 0.
7241 (yyerrorlab, yyreturn): Pop the RHS.
7242 Reorder a bit to emphasize the `shifting' bits of code.
7243 (YYPOPSTACK): Now accept a number of items to pop.
7244 * data/lalr1.cc: Likewise.
7245 * data/glr.c: Formatting changes.
7246 Use goto instead of fall through.
7247 * doc/bison.texinfo (Destructor Decl): Complete.
7248
d508c281
JMG
72492005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7250
7251 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7252 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7253 * djgpp/config.bat: Replace every occurence of the file name
7254 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7255 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7256 * djgpp/config.sed: Replace every occurence of the file name
7257 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7258 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7259 * djgpp/djunpack.bat: DJGPP specific file.
7260 * djgpp/fnchange.lst: DJGPP specific file.
7261 * djgpp/README.in: Add new information about how to unpack the bison
7262 source on MSDOS and other systems which have 8.3 file name restrictions
7263 using djunpack.bat and fnchange.lst.
7264
3e7a2cd9
PE
72652005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7266
7267 * bootstrap (build_cvs_prefix): Remove; unused.
7268 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7269 when getting gnulib.
7270
72712005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7272
7273 * data/glr.c: Reorder typedef declarations for structs to match order
7274 of struct declarations.
7275 Rename yystack everywhere to yystackp except in yyparse where it's not
7276 a pointer.
7277 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7278 consistency.
7279 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7280 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7281 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7282 lint.
7283
877519f8
PE
72842005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7285
0eca5a39
PE
7286 * tests/sets.at (Accept): Fix typos in regular expression used to
7287 sed out the final state number.
7288
2cec9080
PE
7289 Work around portability problem on Solaris 10: flex-generated
7290 files include <stdio.h> before <config.h>, which messes up
7291 because the latter defines __EXTENSIONS__. Address the problem
7292 by creating two new little files that include <config.h> first,
7293 then include the flex-generated files. Rewrite everyone else
7294 to include <config.h> first, as well.
7295 * lib/timevar.c: Always include "config.h".
7296 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7297 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7298 (EXTRA_bison_SOURCES): New macro.
7299 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7300 * src/system.h: Don't include config.h.
7301 * src/LR0.c: Include <config.h> first.
7302 * src/assoc.c: Likewise.
7303 * src/closure.c: Likewise.
7304 * src/complain.c: Likewise.
7305 * src/conflicts.c: Likewise.
7306 * src/derives.c: Likewise.
7307 * src/files.c: Likewise.
7308 * src/getargs.c: Likewise.
7309 * src/gram.c: Likewise.
7310 * src/lalr.c: Likewise.
7311 * src/location.c: Likewise.
7312 * src/main.c: Likewise.
7313 * src/muscle_tab.c: Likewise.
7314 * src/nullable.c: Likewise.
7315 * src/output.c: Likewise.
7316 * src/parse-gram.y: Likewise.
7317 * src/print.c: Likewise.
7318 * src/print_graph.c: Likewise.
7319 * src/reader.c: Likewise.
7320 * src/reduce.c: Likewise.
7321 * src/relation.c: Likewise.
7322 * src/state.c: Likewise.
7323 * src/symlist.c: Likewise.
7324 * src/symtab.c: Likewise.
7325 * src/tables.c: Likewise.
7326 * src/uniqstr.c: Likewise.
7327 * src/vcg.c: Likewise.
7328
877519f8
PE
7329 * src/parse-gram.y: Fix minor problems uncovered by lint.
7330 (current_lhs, current_lhs_location): Now static.
7331 (current_assoc): Remove unused variable.
7332
7333 Cleanups so that Bison-generated parsers have less lint.
7334 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7335 Prepend /*ARGSUSED*/, for lint's sake.
7336 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7337 definition if 'lint' is defined.
7338 (YYID): New macro (or function, if lint).
7339 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7340 * data/yacc.c: Likewise.
7341 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7342 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7343 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7344 is C++ only.
7345 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7346 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7347 Use YYID(0) rather than 0, for lint.
7348 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7349 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7350
f5228370
PE
73512005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7352
7353 * tests/glr-regression.at
7354 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7355 Close memory leak reported by twlevo.
7356
69ce078b
PE
73572005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7358
6ff99711
PE
7359 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7360 all stacks.
7361 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
7362 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7363 New test case.
7364 (Duplicated user destructor for lookahead): This test now is expected
7365 to succeed.
7366
af3412cd
PE
73672005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7368
32b5b719 7369 * NEWS: Document the following change.
af3412cd
PE
7370 * data/yacc.c: Say "parser skeleton" rather than "file", since
7371 it's no longer just a file.
7372 * data/glr.c: Grant a special exception for C GLR parsers, that
7373 reads like the already-existing exception for C LALR(1) parsers.
7374 * data/glr.cc: Likewise.
7375 * data/lalr1.cc: Likewise.
7376 * data/location.cc: Likewise.
7377 * data/yacc.c: Reword the "written by" statement to clarify that
7378 it was the parser skeleton, not the entire output file.
7379 * data/glr.c: Written by Paul Hilfinger.
7380 * data/glr.cc: Written by Akim Demaille.
7381 * data/lalr1.cc: Likewise.
7382
035aa4a0
PE
73832005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7384
d9963c85
PE
7385 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7386 Fix typos in previous change that broke 'make check'.
7387 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7388 supported in C.
7389 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7390 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7391 We can revert this once things settle down.
7392
035aa4a0
PE
7393 * src/conflicts.c (conflicts_print): Don't print file name twice
7394 when %expect fails because there were no conflicts.
7395 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7396 change.
7397 * tests/conflicts.at (%expect not enough, %expect too much):
7398 (%expect with reduce conflicts): Adjust to new behavior.
7399
74002005-11-18 Akim Demaille <akim@epita.fr>
7401
7402 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7403 errors.
7404 * NEWS: Document this.
7405 * doc/bison.texinfo (Expect Decl): Likewise.
7406
d1ff7a7c
AD
74072005-11-16 Akim Demaille <akim@epita.fr>
7408
7409 Generalize the display of semantic values and locations in traces.
7410 * data/glr.c (yy_reduce_print): Fix indices (again).
7411 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7412 literal integers.
7413 * data/lalr1.cc (yyreduce_print): Rename as...
7414 (yy_reduce_print): this.
7415 Display values and locations.
7416 * data/yacc.c (yy_reduce_print): Likewise.
7417 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7418 (yysymprint): Move higher to be visible from yy_reduce_print).
7419 (yyparse): Adjust.
7420 * tests/calc.at: Adjust the expected length of the traces.
7421
6de5398d
AD
74222005-11-14 Akim Demaille <akim@epita.fr>
7423
7424 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7425 from 1 to N, while values and location start at 0.
7426 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7427
a1373f55
AD
74282005-11-14 Akim Demaille <akim@epita.fr>
7429
7430 * data/glr.c (yy_reduce_print): Fix the $ number.
7431
613d8952
AD
74322005-11-14 Akim Demaille <akim@epita.fr>
7433
7434 "Use" parse parameters.
7435 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7436 * data/glr.c, data/glr.cc: Use them.
7437 * data/glr.c (YYUSE): Have a C++ definition that supports
7438 non-pointer types.
7439
b2741627
AD
74402005-11-14 Akim Demaille <akim@epita.fr>
7441
7442 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7443
5059b5c8
AD
74442005-11-14 Akim Demaille <akim@epita.fr>
7445
42249483
AD
7446 * data/glr.cc: New.
7447 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 7448
4626a15d
AD
74492005-11-12 Akim Demaille <akim@epita.fr>
7450
7451 Let position and location be PODs.
7452 * data/location.cc (position::initialize, location::initialize): New.
7453 (position::position, location::location): Define only if
7454 b4_location_constructors is defined.
7455 * data/lalr1.cc (b4_location_constructors): Define it for backward
7456 compatibility.
7457 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7458
74592005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
7460
7461 * data/lalr1.cc: Move the body of the ctor and dtor into the
7462 parser file (instead of the header).
7463 Wrap the implementations in a "namespace yy".
7464
74652005-11-12 Akim Demaille <akim@epita.fr>
7466
7467 Have glr.c include its header file when created.
7468 * data/glr.c (b4_shared_declarations): New.
7469 Output them verbatim in the parser if !%defines, otherwise
7470 output then in the header file, and include it instead.
7471
1989d947
AD
74722005-11-11 Akim Demaille <akim@epita.fr>
7473
7474 * data/glr.c: Comment changes.
7475
74762005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
7477
7478 When yydebug, report semantic and location values for reductions.
7479 * data/glr.c (yy_reduce_print): Report the semantic values and the
7480 locations.
7481 (YY_REDUCE_PRINT): Adjust.
7482 (yyglrReduce): Use them.
7483 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7484 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7485 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7486 traces.
7487
02998094
AD
74882005-11-10 Akim Demaille <akim@epita.fr>
7489
7490 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7491 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7492 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7493
5210672f
PE
74942005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7495
7496 * m4/cxx.m4, examples/Makefile.am: Don't build
7497 examples/calc++ if no C++ compiler is available. (trivial change)
7498
a8991a1d
AD
74992005-11-09 Akim Demaille <akim@epita.fr>
7500
7501 * src/scan-skel.l: Use a couple of asserts.
7502
36b5e963
AD
75032005-11-03 Akim Demaille <akim@epita.fr>
7504
7505 In some (weird) cases, the final state number is incorrect.
7506 Reported by Alexandre Duret-Lutz.
7507 * src/LR0.c (state_list_append): Remove the computation of
7508 final_state.
7509 (save_reductions): Do it here.
7510 (get_state): Alpha conversion.
7511 (generate_states): Use a for loop.
7512 * src/gram.h (item_number_is_rule_number)
7513 (item_number_is_symbol_number): New.
7514 * src/state.c: Use assert.
7515 * src/system.h: Include assert.h.
7516 * tests/sets.at (Accept): New.
7517
44e7ead1
PH
75182005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7519
7520 * data/glr.c (yyfill): Adjust comment.
36b5e963 7521 (yyresolveAction): Initialize default location properly
44e7ead1
PH
7522 for empty right-hand sides.
7523 (yydoAction): Ditto.
7524 Add comment explaining apparently dead code.
36b5e963
AD
7525 * tests/glr-regression.at
7526 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 7527 New test.
36b5e963 7528
e10a80ee
PE
75292005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7530
7531 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7532 gnulib when interrupted. This fixes some race conditions and
7533 works around some portability problems (one noted by Paul
7534 Hilfinger).
7535
067b32ee
AD
75362005-10-22 Akim <akim@epita.fr>
7537
7538 * Makefile.cfg: Adjust to config -> build-aux.
7539 Reported by twledo.
7540
4b367315
AD
75412005-10-21 Akim Demaille <akim@epita.fr>
7542
7543 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7544 the %parse-params.
7545 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7546 * data/yacc.c (b4_Pure_if): Rename as...
7547 (b4_yacc_pure_if): this.
7548 (YY_SYMBOL_PRINT, yyparse): Adjust.
7549 * doc/bison.texinfo: Formatting changes.
7550
24cc23d9
AD
75512005-10-21 Akim Demaille <akim@epita.fr>
7552
7553 Finish the transition config -> build-aux.
7554 * configure.ac, Makefile.am: Use build-aux.
7555 * config/prev-version, config/announce-gen, config/Makefile.am:
7556 Move to...
7557 * build-aux/prev-version, build-aux/announce-gen,
7558 * build-aux/Makefile.am: here.
7559
d4476375
AD
75602005-10-14 Akim Demaille <akim@epita.fr>
7561
7562 * examples/calc++/test: Use set -x only when VERBOSE.
7563
302c0aee
PE
75642005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7565
7566 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7567 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7568
7625ec2c
AD
75692005-10-13 Akim Demaille <akim@epita.fr>
7570
7571 * src/scan-skel.l: Output the base name parts of the parser and
7572 header file names.
302c0aee 7573 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
7574 additional checks.
7575 Use this to exercise C++ outputs in subdirs.
7576 Reported by Oleg Smolsky.
7577
ba0fe3c7
PE
75782005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7579
7580 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7581 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7582 Problem reported by John P. Hartmann.
7583 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7584 already defined it.
7585
9b8a5ce0
AD
75862005-10-12 Akim Demaille <akim@epita.fr>
7587
7588 * src/parse-gram.y (version_check): Exit 63 to please missing
7589 (stands for "version mismatch).
7590 * tests/input.at, doc/bison.texinfo: Adjust.
7591
4f6e011e
PE
75922005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7593
7594 Work around portability problems with Visual Age C compiler
7595 (xlc and xlC_r) reported by John P. Hartmann.
7596 * data/location.cc (initial_column, initial_line): Remove.
7597 All uses replaced by 0 and 1.
7598 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7599 that xlc complains about.
7600 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 7601 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 7602 as __STDC__.
4d7aa45e
PE
7603 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7604 __STDC_VERSION__. Use it everywhere instead of looking at
7605 __STDC__ and __cplusplus.
4f6e011e 7606
a1b3bf8c
AD
76072005-10-10 Akim Demaille <akim@epita.fr>
7608
7609 * examples/calc++/test: Be quiet unless VERBOSE.
7610
412e44aa
PE
76112005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7612
2a4647a3
PE
7613 * data/c.m4 (yydestruct, yysymprint):
7614 Use YYUSE instead of casting to void.
7615 * data/glr.c (YYUSE): New macro.
7616 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7617 Use it instead of rolling our own.
7618 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7619 (YYCHK1):
7620 Use /*CONSTCOND*/ to suppress lint warnings.
7621 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7622 (YY_STACK_PRINT): Use 'false' not '0'.
7623 (YYUSE): New macro.
7624 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7625 * data/yacc.c (YYUSE): New macro.
7626 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7627 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7628 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7629
7630
412e44aa
PE
7631 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7632 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7633
88c6637f
PE
76342005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7635
2f4f028d
PE
7636 Undo the parts of the unlocked-I/O change that substituted
7637 putc or puts for printf. This might hurt performance a bit,
7638 but some people prefer the printf style.
7639 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7640 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7641 All uses replaced by YYFPRINTF and YYDPRINTF.
7642 * data/yacc.c: Likewise.
7643 * lib/bitset.c (bitset_print): Likewise.
7644 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7645 putc and puts.
7646 * lib/lbitset.c (debug_lbitset): Likewise.
7647 * src/closure.c (print_firsts, print_fderives): Likewise.
7648 * src/gram.c (grammar_dump): Likewise.
7649 * src/lalr.c (look_ahead_tokens_print): Likewise.
7650 * src/output.c (escaped_output): Likewise.
7651 (user_actions_output): Break apart two printfs.
7652 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7653 * src/reduce.c (reduce_print): Likewise.
7654 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7655 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7656
88c6637f
PE
7657 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7658 Use assignments rather than casts-to-void to suppress
7659 unused-variable warnings. This pacifies 'lint'.
7660 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7661 unused-variable warnings.
7662
fb32e373
JMG
76632005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7664
7665 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7666
edb8f44f
PE
76672005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7668
fb9c0b33
PE
7669 Use unlocked I/O for a minor performance improvement on hosts like
7670 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7671 is to use the gnlib unlocked-io module, and to prefer putc and
7672 puts to printf when either will work (since the latter doesn't
7673 come in an unlocked flavor).
7674 * bootstrap (gnulib_modules): Add unlocked-io.
7675 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7676 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7677 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7678 and similarly for puts and putc and printf.
7679 * data/yacc.c: Likewise.
7680 * lib/bitset.c (bitset_print): Likewise.
7681 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7682 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7683 to printf.
7684 * lib/lbitset.c (debug_lbitset): Likewise.
7685 * src/closure.c (print_firsts, print_fderives): Likewise.
7686 * src/gram.c (grammar_dump): Likewise.
7687 * src/lalr.c (look_ahead_tokens_print): Likewise.
7688 * src/output.c (escaped_output): Likewise.
7689 (user_actions_output): Coalesce two printfs.
2f4f028d 7690 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
7691 * src/reduce.c (reduce_print): Likewise.
7692 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 7693 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 7694
edb8f44f
PE
7695 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7696 this confuses xgettext.
7697
b50d2359
AD
76982005-10-02 Akim Demaille <akim@epita.fr>
7699
7700 * bootstrap (gnulib_modules): Add strverscmp.
7701 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7702 * m4/.cvsignore: Add strverscmp.m4.
7703 * src/parse-gram.y (%require): New token, new rule.
7704 (version_check): New.
7705 * src/scan-gram.l (%require): Adjust.
7706 * tests/input.at (AT_REQUIRE): New.
7707 Use it.
7708 * doc/bison.texinfo (Require Decl): New.
7709 (Calc++ Parser): Use %require.
7710
21667f64
AD
77112005-10-02 Akim Demaille <akim@epita.fr>
7712
7713 * data/location.cc: New.
7714
2b81e969
AD
77152005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7716 Akim Demaille <akim@epita.fr>
7717
7718 Make sure -odir/foo.cc creates dir/location.hh etc.
7719 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7720 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7721 (spec_defines_file): Now const.
7722 (dir_prefix): New.
7723 (short_base_name): Remove.
7724 * src/files.c: Adjust.
7725 (dirname.h): Include.
7726 (base_name): Don't prototype it.
7727 (finput): Remove, duplicates gram_in.
7728 (full_base_name, short_base_name): Replace by...
7729 (all_but_ext, all_but_tab_ext): these.
7730 (compute_base_names): Rename as...
7731 (compute_file_name_parts): this.
7732 Update to compute the new variables, including dir_prefix.
7733 Adjust dependencies.
7734 * src/output.c (prepare): Output them.
7735 * src/reader.c: Adjust to use gram_in, not finput.
7736 * src/scan-skel.l (@dir_prefix@): New.
7737
ad6a9b97
JMG
77382005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7739
7740 * lib/subpipe.c: New function end_of_output_subpipe() added
7741 to allow support for non-posix systems. This is a no-op function
7742 for posix systems.
7743
7744 * lib/subpipe.h: New function end_of_output_subpipe() added
7745 to allow support for non-posix systems. This is a no-op function
7746 for posix systems.
7747
7748 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7749 handle the lack of pipe/fork functionality on non-posix systems.
7750
7751 * djgpp/Makefile.maint: DJGPP specific file.
7752
7753 * djgpp/README.in: DJGPP specific file.
7754
7755 * djgpp/config.bat: DJGPP specific configuration file.
7756
7757 * djgpp/config.sed: DJGPP specific configuration file.
7758
7759 * djgpp/config.site: DJGPP specific configuration file.
7760
7761 * djgpp/config_h.sed: DJGPP specific configuration file.
7762
7763 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7764
7765 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7766
fc695704
AD
77672005-10-02 Akim Demaille <akim@epita.fr>
7768
7769 * data/location.cc: New, extract from...
7770 * data/lalr1.cc: here.
7771 (location.hh): Include it after the user prologue, in case the
7772 filename type is defined by the user.
7773 Forward declation location and position before the pre-prologue.
7774 (yyresult_): Rename as...
7775 (yyresult): this, it's a local variable, not an attribute.
7776 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7777
77782005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
7779
7780 * examples/extexi: Restore the #line generation.
7781
fb9712a9
AD
77822005-09-30 Akim Demaille <akim@epita.fr>,
7783 Alexandre Duret-Lutz <adl@gnu.org>
7784
7785 Move the token type and YYSTYPE in the parser class.
7786 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7787 (parser::token): New, from the moved free definition of tokens.
7788 (parser::semantic_value): Now a full definition instead of an
7789 indirection to YYSTYPE.
7790 (b4_post_prologue): No longer included in the header file, but
7791 in the implementation file.
7792 * doc/bison.texi (C+ Language Interface): Update.
7793 * src/parse-gram.y: Support unary %define.
7794 * tests/actions.at: Define global_tokens_and_yystype for backward
7795 compatibility until we update the tests.
7796 * tests/calc.at: Idem.
7797 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7798 to simplify the code.
7799
55f0c7b1
PE
78002005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7801
7802 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7803 Ah, the good old days! Problem reported by Peter Klein.
7804 * bootstrap (gnulib_modules): Add strerror, strtoul.
7805 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7806 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7807
fb9712a9 78082005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
7809
7810 * data/c.m4 (b4_error_verbose_if): New.
7811 * data/lalr1.cc: Use it.
7812 (YYERROR_VERBOSE_IF): Remove.
7813 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7814 parser members, replaced by...
7815 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7816 local variables.
7817 (yysyntax_error_): Takes the state number as argument.
7818 (yyreduce_print_): Use the argument yyrule, not the former
7819 attribute yyn_.
7820
8a6f72f3
PE
78212005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7822
7823 * bootstrap (gnulib_modules): Add verify.
7824 * lib/.cvsignore: Add verify.h.
7825 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7826 * src/system.h (verify): Remove.
7827 Include verify.h instead.
7828 * src/tables.c (tables_generate): Use new API for 'verify'.
7829
0d50976f
PE
78302005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7831
ebc3737e
PE
7832 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7833 local variables whose names begin with 'yy'.
7834 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7835 Trivial changes from Joel E. Denny.
7836
0d50976f
PE
7837 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7838 it itself.
7839 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7840 don't use alloca any more.
7841
7842 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7843 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 7844 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
7845 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7846 to match yacc.c, to test more hosts.
7847
a05b79df
PE
78482005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7849
55289366
PE
7850 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7851 doesn't affect behavior.
7852 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7853 Solaris, AIX, MSC.
7854 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7855 This works a bit better with glibc, if user code has already included
7856 stdlib.h.
7857 * doc/bison.texinfo (Bison Parser): Document that users can't
7858 arbitrarily use malloc and free for other purposes. Document
7859 that <alloca.h> and <malloc.h> might be included.
7860 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7861 user must declare alloca.
7862
a05b79df
PE
7863 * HACKING (release): Forwarn the Translation Project about
7864 stable releses.
7865
3ab2ca22
AD
78662005-09-20 Akim Demaille <akim@epita.fr>
7867
7868 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7869
a9739e7c
PE
78702005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7871
a702593e
PE
7872 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
7873 (YYSTACK_ALLOC_MAXIMUM): Use it.
7874 (yysyntax_error): New function.
7875 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
7876 multiple syntax errors are reported, and alloca is being used.
7877 Instead, reallocate buffers twice as big each time, so that
7878 we waste at most half the allocated memory. Start with a small
7879 (128-byte) buffer that will suffice in most cases anyway.
7880 Use yysyntax_error to do most of the work.
7881
7882 * doc/bison.texinfo (Error Reporting, Table of Symbols):
7883 yynerrs is the number of errors reported, not the number of
7884 errors encountered.
7885
a9739e7c
PE
7886 * tests/glr-regression.at (Duplicated user destructor for lookahead):
7887 Mark it as expected to fail.
7888 Cast result of malloc; problem reported by twlevo@xs4all.nl.
7889 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
7890 Don't start user-code symbols with "yy", to avoid name space problems.
7891
f479c6c6
AD
78922005-09-19 Akim Demaille <akim@epita.fr>
7893
7894 Remove the traits, failed experiment.
7895 It never proved useful, and anyway because of the current
7896 definition, it was not possible to have several specialization of
7897 this traits, making it useless.
7898 * data/lalr1.cc (yy:traits): Remove.
7899 Inline its definitions in the parser class.
7900
e2586f82
AD
79012005-09-19 Akim Demaille <akim@epita.fr>
7902
7903 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
7904 least Mac OSX with a /usr/local install of gettext.
7905
2e8cf949
AD
79062005-09-19 Akim Demaille <akim@epita.fr>
7907
7908 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
7909 and yytoken for similarity with the other skeletons.
7910
c7fb0b90
AD
79112005-09-19 Akim Demaille <akim@epita.fr>
7912
4e26c69e 7913 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 7914
1bd0deda
PE
79152005-09-16 Paul Eggert <eggert@cs.ucla.edu>
7916
7917 * NEWS: Version 2.1.
7918
7919 * NEWS: Remove notice of yytname change, since it was never in an
7920 official release.
7921 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
7922 diagnostic.
7923 * src/output.c (prepare): Likewise.
7924 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
7925 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
7926 is not defined. This is an awful hack, but it's enough for now.
7927 All callers changed.
7928 * tests/glr-regression-at (make_value): Args are const pointers now,
7929 to avoid GCC warning.
7930 (Duplicated user destructor for lookahead): New test. Currently
7931 skipped. It fails on my host but I'm not sure it'll always fail.
7932
79332005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
7934
7935 * src/symtab.h (struct symbol): Declare the printer and destructor
7936 as const, to avoid accidental calls to free.
7937 (symbol_destructor_set, symbol_printer_set): Adjust.
7938 * src/symtab.c: Adjust.
7939
1bd0deda 79402005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
7941
7942 * data/c.m4 (b4_token_enums): New.
7943 (b4_token_defines): Rename as...
7944 (b4_token_enums_defines): this.
7945 (b4_token_defines): New, output only the #defines.
7946 * data/yacc.c, data/glr.c: Adjust.
7947 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
7948 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
7949 as default values.
7950
dbcdae2d
AD
79512005-09-16 Akim Demaille <akim@epita.fr>
7952
7953 * data/lalr1.cc (yylex_): Remove, inline its code.
7954 (yyreport_syntax_error_): Remove, replaced by...
7955 (yysyntax_error_): this which returns a string and leaves to the
7956 caller the call to the users' error function.
7957 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
7958 Move from members of the parser object...
7959 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
7960 to local variables of the parse function.
7961
70d8f291
AD
79622005-09-16 Akim Demaille <akim@epita.fr>
7963
7964 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
7965 since it's in Bison's name space.
7966
b47dbebe
PE
79672005-09-15 Paul Eggert <eggert@cs.ucla.edu>
7968
ae199bf1
PE
7969 * data/glr.c (yyresolveValue): Add default case to pacify
7970 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
7971
b47dbebe
PE
7972 * NEWS: Document when yyparse started to return 2.
7973 * doc/bison.texinfo (Parser Function): Document when yyparse
7974 returns 2.
7975
7976 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
7977 (b4_filename_type): Renamed back from b4_file_name_type. All uses
7978 changed.
7979 (class position): file_name -> filename (reverting). All uses changed.
7980
79812005-09-14 Paul Eggert <eggert@cs.ucla.edu>
7982
7983 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
7984 do anything if $@ exists. This reverts part of the 2005-07-07
7985 patch.
7986
00292f66
PE
79872005-09-11 Paul Eggert <eggert@cs.ucla.edu>
7988
7989 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
7990 contains obsolete information and isn't worth distributing as a
7991 separate file anyway.
7992 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
7993 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
7994 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
7995 (yyparse): Abort if user code uses longjmp to throw an unexpected
7996 value.
7997
a420f962
PE
79982005-09-09 Paul Eggert <eggert@cs.ucla.edu>
7999
00292f66
PE
8000 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8001 Suggested by twlevo@xs4all.nl.
8002
127287e9
PE
8003 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8004 This avoids a diagnostic from gcc -Wswitch-enum.
8005 Problem reported by twlevo@xs4all.nl.
8006
a420f962
PE
8007 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8008 standards. Use "file name" or "file" or "name", depending on
8009 the context.
8010 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8011 not to hack/foo.tab.c.
8012 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
8013 * data/glr.c: b4_filename -> b4_file_name.
8014 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8015 All uses changed.
8016 (class position): filename -> file_name. All uses changed.
8017 * data/yacc.c: b4_filename -> b4_file_name.
8018 * lib/bitset.h: filename -> file_name in local vars.
8019 * lib/bitset_stats.c: Likewise.
8020 * src/files.c: Likewise.
8021 * src/scan-skel.l ("@output ".*\n): Likewise.
8022 * src/files.c (file_name_split): Renamed from filename_split.
8023 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
8024
80252005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8026
8027 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8028 to accommodate latest gnulib.
8029
8030 * tests/glr-regression.at (Duplicate representation of merged trees):
8031 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8032
8033 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8034 needed.
8035
42a6501d
PE
80362005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8037
8038 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8039 All uses changed. Invoke user destructor after an error during a
8040 split parse (trivial change from Joel E. Denny).
8041
8042 * tests/glr-regression.at
8043 (User destructor after an error during a split parse): New test case.
8044 Problem reported by Joel E. Denny in:
8045 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8046
ef9a1faf
PE
80472005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8048
5b4aaf78
PE
8049 * README-cvs: Give URLs for recommended tools.
8050 Mention Gzip version problem, and bootstrapping issues.
8051 Remove troubleshooting section, as it's somewhat obsolete.
8052
b5240ba5
PE
8053 * bootstrap (no_cache): New var, to accommodate different wget
8054 variants. Use it instead of '-C off'. Problem reported by
8055 twlevo@xs4all.nl.
8056
ef9a1faf
PE
8057 * data/glr.c (yydestroyStackItem): New function.
8058 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8059 debugging information. Problem reported by Joel E. Denny.
8060
e6efa9da
AD
80612005-08-25 Akim Demaille <akim@epita.fr>
8062
8063 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8064
adc90f13
PE
80652005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8066
8067 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8068 Don't invoke destructor on unresolved entries.
8069 * tests/glr-regression.at
8070 (User destructor for unresolved GLR semantic value): New test case.
8071 Problem reported by Joel E. Denny in:
8072 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8073
f9315de5
PE
80742005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8075
15d29c1f
PE
8076 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8077 Add strnlen.c.
8078 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8079 lib-prefix.m4, po.m4.
8080
dd5f2af2
PE
8081 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8082 in yydestruct diagnostic, since it might not be an error.
8083 Problem reported by Joel Denny near end of
8084 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 8085 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
8086 * data/yacc.c (yyreturn): Likewise.
8087 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8088
8089 * src/files.c: Remove obsolete FIXME comment.
8090
8091 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8092 with the other templates, and to fix bogus run-on messages such
8093 as the one reported at the end of
8094 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8095 All callers changed to avoid the newline.
8096 (yyprocessOneStack): Output two lines rather than one, to accommodate
8097 the above change. This changes the debug output format slightly.
8098
f9315de5
PE
8099 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8100 reported by Joel E. Denny in
8101 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8102 (trivial change).
8103 * tests/glr-regression.at (Duplicate representation of merged trees):
8104 New test, from Joel E. Denny in:
8105 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8106 * THANKS: Add Joel E. Denny.
8107
8108 * configure.ac (AC_INIT): Bump to 2.0c.
8109
04098407
PE
81102005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8111
8112 * NEWS: Version 2.0b.
8113
ca5d2013
PE
8114 * Makefile.am (SUBDIRS): Put examples before tests, so that
8115 "make check" doesn't finish with "All 1 tests passed".
8116
3d54b576
PE
8117 * tests/regression.at (Token definitions): Don't rely on
8118 AT_PARSER_CHECK for data that contains backslashes. It currently
8119 uses 'echo', and 'echo' isn't portable if its argument contains
8120 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8121 that the byte '\0xff' is not printable in the C locale; it is,
8122 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8123 not printable, so use '\0x81' to test.
8124
d53ae497
PE
8125 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8126 version of GCC, since the macro is used with non-GCC compilers.
8127
fc01665e
PE
8128 Fix core dump reported by Pablo De Napoli in
8129 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8130 * tests/regression.at (Invalid inputs with {}): New test.
8131 * src/parse-gram.y (token_name): Translate type before using
8132 it as an index.
8133
04098407
PE
8134 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8135 the user's name space. All uses changed to __attribute__
8136 ((__unused__)).
8137 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8138 Add __attribute__ ((__noreturn__)).
8139
8140 * etc/clcommit: Remove. We weren't using it, and it failed
8141 "make maintainer-distcheck".
8142 * Makefile.maint: Merge from coreutils.
8143 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8144 (syntax-check-rules): Change list of rules as described below.
8145 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8146 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8147 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8148 (sc_trailing_space): New rules.
8149 (sc_xalloc_h_in_src): Remove.
8150 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8151 (sc_space_tab, sc_error_exit_success, sc_changelog):
8152 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8153 (makefile-check, po-check, author_mark_check):
8154 (makefile_path_separator_check, copyright-check):
8155 Use grep -n, to make it easier to find violations.
8156 Use CVS_LIST and CVS_LIST_EXCEPT.
8157 (header_regexp, h_re): Remove.
8158 (dd_c): New macro.
8159 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8160 (my-distcheck): Use more-modern GCC flags.
8161 (signatures, %.asc): Remove.
8162 (rel-files, announcement): Remove signatures.
8163 Restore old updating code, even though we don't use it, so
8164 that we're the same as coreutils.
8165 (alpha, beta, major): Depend on news-date-check.
8166 Make the upload commands.
8167
8168 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8169 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8170 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8171 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8172 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8173 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8174 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8175 * tests/sets.at: Likewise.
8176
8177 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8178 we comment out the Autoconf version number.
8179 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8180 it's error-prone and "make maintainer-distcheck" rejects it.
8181
8182 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8183 Indent calls to "error" to pacify "make maintainer-distcheck",
8184 when the calls are not intended to be translated.
8185 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8186
8187 * src/Makefile.am (DEFS): Use +=, to pacify
8188 "make maintainer-distcheck".
8189 (bison_SOURCES): Add scan-skel.h.
8190 (sc_tight_scope): New rule, from coreutils.
8191
8192 * src/files.c (src_extension, header_extension):
8193 Now static, not extern.
8194 * src/getargs.c (short_options): Likewise.
8195 * src/muscle_tab.c (muscle_table): Likewise.
8196 * src/parse-gram.y (current_class, current_type, current_prec):
8197 Likewise.
8198 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8199 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8200 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8201 void, to avoid warning when NLS is disabled.
8202 * src/output.c: Include scan-skel.h.
8203 (scan_skel): Remove decl, since scan-skel.h does this.
8204 (output_skeleton):
8205 Indent calls to "error" to pacify "make maintainer-distcheck".
8206 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8207 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8208 "make maintainer-distcheck".
8209 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8210 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8211 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8212 (skel_lex_destroy, scan_skel): Move these decls to...
8213 * src/scan-skel.h: New file.
8214 * src/uniqstr.c (uniqstr_assert):
8215 Indent calls to "error" to pacify "make maintainer-distcheck".
8216
8217 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8218 not @VAR@.
8219
8220 * tests/torture.at: Revamp to avoid misuse of atoi that
8221 "make maintainer-distcheck" complained about.
8222
8223 * examples/extexi (message): Don't print a message more than once,
8224 and omit line-number decoration that makes Emacs compile think
8225 that informative messages are worth worrying about.
8226
82272005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8228
8229 * configure.ac: Update version number.
8230
8231 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8232 accidentally.
8233 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8234 autogenerated by the maintainer.
8235 * examples/calc++/.cvsignore: Add *.yy.
8236
8237 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8238 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8239 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8240
8241 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8242
8243 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8244 from maintainer-distcheck about casting the argument of 'free'.
8245
8246 * NEWS: Mention recent yytname changes.
8247 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8248
8249 * bootstrap: For translations that have not yet been upgraded to
8250 the new runtime-po domain, prime the pump by extracting the
8251 relevant strings from the obsolete translations. This code can be
8252 removed once the bison-runtime domain has been translated by each
8253 team.
8254
8255 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8256 now that token names are already quoted.
8257
8258 Fix problem reported by Anthony Heading.
8259 * data/glr.c (YYTOKEN_TABLE): New macro.
8260 (yytname): Define if YYTOKEN_TABLE.
8261 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8262 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8263 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8264 * src/output.c (prepare_symbols): Output token_table_flag.
8265
0ffda363
PE
82662005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8267
8268 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8269 again if the first call fails.
8270
8271 * data/glr.c (yytnamerr): New function.
8272 (yyreportSyntaxError): Use it to dequote most string literals.
8273 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8274 with other skeletons. All uses changed.
8275 (yytnameerr_): New function.
8276 (yyreport_syntax_error): Use it to dequote most string literals.
8277 * data/yacc.c (yytnamerr): New function.
8278 (yyerrlab): Use it to decode most string literals.
8279 * doc/bison.texinfo (Decl Summary, Calling Convention):
8280 Clarify quoting convention of yytname.
8281 * src/output.c (prepare_symbols): Quote all names. This undoes
8282 the 2005-04-17 change, which is now accomplished (mostly) via
8283 changes in the parsers as described above.
8284 * tests/regression.at (Token definitions, Web2c Actions):
8285 Undo most 2005-04-17 change here, too.
8286
82872005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8288
8289 Fix more problems reported by twlevo@xs4all.nl.
8290 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8291 remove trailing spaces. This loses the exit status of ./types,
8292 and isn't needed since ./types shouldn't be emitting trailing
8293 spaces.
8294 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8295 as the stack isn't valid in that case.
8296
8297 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8298 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8299 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8300 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8301 is used.
8302 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8303 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8304 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8305 Likewise.
8306
8307 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8308 overly-picky compilers that reject 'char *foo = "bar";'.
8309
8310 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8311 to FILE * parameter, not to stderr. This fixes a typo introduced
8312 in the 2005-07-12 change.
8313
8314 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8315 warnings from GCC 4.
8316
8317 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8318 (yyglrShiftDefer, yysplitStack):
8319 Remove unused parameters b4_pure_formals. All uses changed.
8320 (yyglrShift): Remove unused parameters b4_user_formals.
8321 All uses changed.
8322 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8323
6100a9aa
PE
83242005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8325
258b75ca
PE
8326 Destructor cleanups and regularization among the three skeletons.
8327 * NEWS: Document the behavior changes.
8328 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8329 stack before failing, as the cleanup code will do it for us now.
8330 * data/lalr1.cc (yyerrlab): Likewise.
8331 * data/glr.c (yyparse): Pop everything off the stack before
8332 freeing it, so that destructors get called properly.
8333 * data/lalr1.cc (yyreturn): Likewise.
8334 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8335 This is more consistent.
8336 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8337 why destructors might be called. 1.875 -> 2.1.
8338 (Destructor Decl, Decl Summary, Table of Symbols):
8339 Some English-language cleanups for %destructor.
8340 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8341 Add output line for destructor of start symbol.
8342 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8343 because of that same extra output line.
8344
1a059451
PE
8345 * NEWS: Document minor wording changes in diagnostics of
8346 Bison-generated parsers.
8347 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8348 Remove unused formals. All uses changed.
8349 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8350 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8351 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8352 Rename yyoverflowab to yyexhaustedlab.
8353 When memory exhaustion occurs during syntax-error reporting,
8354 report it separately rather than in a single diagnostic; this
8355 eases translation.
8356 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8357 (Memory Exhausted): Renamed from Parser Stack Overflow.
8358 Revamp wording slightly to prefer "memory exhaustion".
8359 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8360
97460c78
PE
8361 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8362
30757c8c
PE
8363 Add i18n support to the GLR skeleton. Partially fix the C++
8364 skeleton; a C++ expert needs to finish this. Remove debugging
8365 msgids; there's little point to having them translated, since they
8366 can be understood only by someone who can read the
8367 (English-language) source code.
8368
8369 Generate runtime-po/bison-runtime.pot automatically, so that we
8370 don't have to worry about garbage getting in that file. We'll
8371 make sure after the next official release that old msgids don't
8372 get lost. See
8373 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8374
8375 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8376 Now auto-generated.
8377 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8378 Fix typos in explanations of the runtime file.
8379 * bootstrap: Change gettext keyword from YYI18N to YY_.
8380 Use standard Makefile.in.in in runtime-po, since we'll arrange
8381 for backward-compatible bison-runtime.po files in a different way.
8382 * data/glr.c (YY_): New macro, from yacc.c.
8383 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8384 Translate messages intended for users.
8385 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8386 the wording in the other skeletons. We don't know that the memory
8387 is virtual.
8388 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8389 Use same method that yacc.c uses.
8390 Don't translate debugging messages.
8391 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8392 it doesn't work (yet), and requires C++ expertise to fix.
8393 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8394 Move defn to a more logical place, to be consistent with other
8395 skeletons.
8396 Don't translate debugging messages.
8397 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8398 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8399 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8400 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8401
ac8c5689
PE
8402 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8403 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8404 void, not int.
8405 * tests/glr-regression.at (Badly Collapsed GLR States):
8406 Likewise.
8407 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8408 yylex should return 0 at EOF rather than aborting.
8409
6100a9aa
PE
8410 Improve tests for stack overflow in GLR parser.
8411 Problem reported by twlevo@xs4all.nl.
8412 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8413 All uses removed.
8414 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8415 can handle the problem.
8416 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8417 (yyparse): New local variable yyresult to record the result.
8418 Use result of setjmp to set it, rather than storing itinto
8419 struct.
8420 (yyDone): Remove label.
8421 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8422 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8423 if YYABORT is used).
8424 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8425 yyparse status; put status > 1 into diagnostic.
8426 Check that status==2 works.
8427 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8428 Use exit status 3 for failure to open (which shouldn't happen).
8429
15f40952
PE
84302005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8431
67fd79c4
PE
8432 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8433 1 on syntax error; just let yyparse do its thing.
8434 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8435 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8436 (Exploding the Stack Size with Alloca):
8437 (Exploding the Stack Size with Malloc):
8438 Expect exit status 2, not 1, since the parser is supposed to blow
8439 its stack. Problem reported by twlevo@xs4all.nl.
8440
15f40952
PE
8441 * data/glr.c (yyparse): Don't assume that the initial calls
8442 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8443 Print a stack-overflow message and fail instead.
8444 Initialize the line-number information before creating the stack,
8445 so that the stack-overflow message can report line zero safely.
8446
f32c66b5
PE
84472005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8448
a22ff96f 8449 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
8450 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8451 (yyuserMerge): Provide a default case if b4_mergers is empty.
8452 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8453 * tests/glr-regression.at
8454 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 8455 Add casts to pacify C++ compilers.
1beb0b24
PE
8456 * tests/glr-regression.at (Improper merging of GLR delayed action
8457 sets): Declare yylex before using it.
f32c66b5 8458 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
8459 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8460 test for valgrind; valgrind is independent of g++.
8461 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8462 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8463 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8464 Use a destructor, so that we can expand the stack. Change
8465 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 8466
d741bd1b
PE
84672005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8468
8469 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8470 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8471
0410a6e0
PE
84722005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8473
8474 * PACKAGING: New file, suggested by Bruno Haible and taken from
8475 similar wording in gettext's PACKAGING file.
8476 * NEWS: Mention PACKAGING.
8477 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8478
f7ab6a50
PE
84792005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8480
baf785db 8481 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
8482 * bootstrap: Get runtime translations into runtime-po.
8483 Create runtime-po files automatically, if possible.
8484 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8485 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8486 does not infringe on the user's name space.
8487 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8488 * doc/bison.texinfo (Internationalization): Revamp the English
8489 and Texinfo syntax a bit, to try to make it clearer.
8490 (Bison Options, Option Cross Key): Mention --print-localedir.
8491 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8492 YYENABLE_NLS. Quote a bit more.
8493 * runtime-po/.cvsignore: New file.
8494 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8495 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8496 * runtime-po/quot.sed: Likewise.
8497 * runtime-po/boldquot.sed: Likewise.
8498 * runtime-po/en@quot.header: Likewise.
8499 * runtime-po/en@boldquot.header: Likewise.
8500 * runtime-po/insert-header.sin: Likewise.
8501 * runtime-po/remove-potcdate.sin: Likewise.
8502 * runtime-po/Makevars: Likewise.
8503 * runtime-po/LINGUAS: Likewise.
8504 * runtime-po/de.po: Likewise; we will rely on the translation project
8505 to maintain this, so "bootstrap" should get it.
0410a6e0 8506 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
8507 its value.
8508 * src/main.c (main): Bind the bison-runtime domain, too.
8509
85102005-07-12 Bruno Haible <bruno@clisp.org>
8511
8512 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8513 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8514 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8515 * runtime-po: New directory.
8516 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8517 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8518 * runtime-po/Rules-quot: New file, copied from po/.
8519 * runtime-po/quot.sed: Likewise.
8520 * runtime-po/boldquot.sed: Likewise.
8521 * runtime-po/en@quot.header: Likewise.
8522 * runtime-po/en@boldquot.header: Likewise.
8523 * runtime-po/insert-header.sin: Likewise.
8524 * runtime-po/remove-potcdate.sin: Likewise.
8525 * runtime-po/Makevars: New file.
8526 * runtime-po/POTFILES.in: New file.
8527 * runtime-po/LINGUAS: New file.
8528 * runtime-po/bison-runtime.pot: New file.
8529 * runtime-po/de.po: New file.
8530 * m4/bison.m4: New file.
8531 * Makefile.am (SUBDIRS): Add runtime-po.
8532 (aclocaldir, aclocal_DATA): New variables.
8533 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8534 Define aclocaldir.
8535 * src/getargs.c (usage): Document --print-localedir option.
8536 (PRINT_LOCALEDIR_OPTION): New enum item.
8537 (long_options): Add --print-localedir option.
8538 (getargs): Handle --print-localedir option.
8539 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8540 (Internationalization): New section.
8541
22dda0f0
AD
85422005-07-12 Akim Demaille <akim@epita.fr>
8543
8544 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8545 for consistency with the rest of the code.
8546 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8547 Add separators.
8548
82b248ad
AD
85492005-07-12 Akim Demaille <akim@epita.fr>
8550
8551 * src/parse-gram.y: Use %printer instead of YYPRINT.
8552
fa0e9314
AD
85532005-07-12 Akim Demaille <akim@epita.fr>
8554
867a3e00
AD
8555 * src/symtab.h, src/symtab.c (symbol_print): New.
8556 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8557 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8558
85592005-07-12 Akim Demaille <akim@epita.fr>
8560
8561 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
8562 b4_at_dollar and b4_dollar_dollar.
8563
e054b190
PE
85642005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8565
8566 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8567 and Pennello's paper.
8568
34160ec4
PE
85692005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8570
407d4a75
PE
8571 * data/yacc.c (yyparse): Undo previous patch. Instead,
8572 set yylsp[0] and yyvsp[0] only if the initial action
8573 sets yylloc and yylval, respectively.
8574
34160ec4
PE
8575 * data/yacc.c (yyparse): In the initial action, set
8576 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8577 This avoids the use of undefined variables if the initial
8578 action does not set yylloc and/or yylval.
8579
c3d5a4a7
PE
85802005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8581
b34d96c1
PE
8582 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8583 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8584 Remove from CVS. These files are automatically generated.
8585 * examples/extexi: Clarify that this file is now part of Bison,
8586 not GNU M4, and that it works with any POSIX-compatible Awk.
8587 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8588 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8589 so that we also get calc++-parser.yy. Geneate it.
8590 Use $(AWK), not gawk, since any conforming Awk will do.
8591 Put comment before action, since older 'make' can't handle comment
8592 in action.
8593 $(BUILT_SOURCES): List all built sources, not just some of them.
8594 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8595 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8596 $($(calc_sources_generated)): Remove unnecessary test for existence
8597 of target. (This had a shell syntax error anyway; a stray "x".)
8598 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8599 calc++-parser.yy.
8600 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8601
c3d5a4a7
PE
8602 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8603 implied by the other modules.
8604
828c373b
AD
86052005-07-06 Akim Demaille <akim@epita.fr>
8606
8607 Bind examples/calc++ to the package.
8608 * examples/calc++/Makefile: Remove, replaced by...
8609 * examples/calc++/Makefile.am: ... this new file.
8610 * examples/calc++/test: Remove input.
8611 * examples/calc++/compile: Remove.
8612 * examples/Makefile.am: New.
8613 * configure.ac, Makefile.am: Adjust.
8614 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8615
63cb01d6
PE
86162005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8617
fd2df2ed
PE
8618 * data/glr.c (yyFail): Drastically simplify; since the format argument
8619 never had any % directives, we can simply pass it to yyerror.
8620 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8621 be modified later, as that is the usual style in glr.c.
8622 Problems reported by Paul Hilfinger.
8623
63cb01d6
PE
8624 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8625 and size overflow errors.
8626 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8627 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8628 (YYSIZEMAX): New macro.
8629 (yystpcpy): New function, taken from yacc.c.
8630 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8631 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8632 so that we don't have to maintain their signatures.
8633 (yyFail): Check for buffer overflow, by using vsnprintf rather
8634 than vsprintf. Allocate a bigger buffer if possible.
8635 Report an error if buffer allocation fails.
8636 (yyStackOverflow): New function.
8637 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8638 the initialization was successful. It might fail if storage was
8639 exhausted.
8640 (yyexpandGLRStack): Add more checks for storage allocation failure.
8641 Use yyStackOverflow to report failures.
8642 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8643 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8644 Don't assume stack number fits in int.
8645 (yysplitStack): Check for storage allocation failure.
8646 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8647 can print diagnostics on storage allocation failure. All callers
8648 changed.
8649 (yyresolveValue): Use yybool for boolean.
8650 (yyreportSyntaxError): Check for size-calculation overflow.
8651 This code is taken from yacc.c.
8652 (yyparse): Check for storage allocation errors when allocating
8653 the initial stack.
8654
1c59e0a1
AD
86552005-07-05 Akim Demaille <akim@epita.fr>
8656
8657 Extract calc++ from the documentation.
8658 * doc/bison.texinfo (Calc++): Add the extraction marks.
8659 * examples/extexi: New, from the aborted GNU Programming 2E.
8660 Separate the different paragraph of a file with empty lines.
8661 * examples/Makefile: Use it to extract the whole calc++ example.
8662
8a0adb01
AD
86632005-06-24 Akim Demaille <akim@epita.fr>
8664
8665 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8666 class typedefs.
8667
12545799
AD
86682005-06-22 Akim Demaille <akim@epita.fr>
8669
8670 * doc/bison.texinfo (C++ Language Interface): First stab.
8671 (C++ Parsers): Remove.
8672
99be0235
AD
86732005-06-22 Akim Demaille <akim@epita.fr>
8674
8675 * data/lalr1.cc (yylex_): Honor %lex-param.
8676
0ffd4fd1
AD
86772005-06-22 Akim Demaille <akim@epita.fr>
8678
8679 Start a set of simple examples.
8680 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8681 * examples/calc++/calc++-driver.hh,
8682 * examples/calc++/calc++-parser.yy,
8683 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8684 * examples/calc++/compile, examples/calc++/test: New.
8685
0925ebb4
PE
86862005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8687
8688 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8689 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8690 which stems from the 2005-05-27 patch.
8691
43d3b664
PH
86922005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8693
8694 * data/glr.c: Modify treatment of unused parameters to permit use
8695 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8696
3062864d
PE
86972005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8698
8699 Fix infringement on user name space reported by Janos Zoltan Szabo.
8700 * data/yacc.c (yyparse): strlen -> yystrlen.
8701
989b5b8e
AD
87022005-05-30 Akim Demaille <akim@epita.fr>
8703
8704 * data/lalr1.cc (_): New.
8705 Translate the various messages.
8706
bedf57f5
PE
87072005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8708
8709 Fix infringement on user name space reported by Bruno Haible.
8710 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8711 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8712 the user's name space.
8713 (alloca): Include <stdlib.h> to get it, if it's not built in.
8714 (YYMALLOC, YYFREE): Define only if needed.
8715 (malloc, free): Declare, but only if needed, as this infringes on
8716 the user name space.
8717
4d1801f1
PE
87182005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8719
8720 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8721 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8722 with %d format.
8723 * lib/ebitset.c (min, max): Undef before defining.
8724 * lib/vbitset.c (min, max): Likewise.
8725 * lib/subpipe.c (create_subpipe): Save local variables in case
8726 vfork clobbers them.
8727
87282005-05-24 Bruno Haible <bruno@clisp.org>
8729
8730 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8731 error message syntax used by gcc-4.0.
8732
b94a9e1e
PE
87332005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8734
85ac3861
PE
8735 * README: Mention m4 1.4.3. Remove obsolete advice about
8736 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8737
b94a9e1e
PE
8738 * bootstrap: Remove workaround for problem I encountered with
8739 gettext 0.14.1; it seems to be fixed now.
8740
51c30d21
PE
87412005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8742
009ce67d
PE
8743 * NEWS: Version 2.0a.
8744
f2a97c62
PE
8745 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8746 the previous change.
8747
c8775f93
PE
8748 Various maintainer cleanups.
8749 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8750 conftest*, for benefit of CVS commands run at the same time as
8751 "configure". Add build-aux, since "bootstrap" now creates it and
8752 its subfiles.
8753 * Makefile.cfg (move_if_change): Remove.
8754 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8755 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8756 (po_repo, do-po-update, po-update, wget_files, get-targets):
8757 (config.guess-url_prefix, config.sub-url_prefix):
8758 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8759 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8760 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8761 Remove.
8762 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8763 this is now the recommended name.
8764 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8765 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8766 ylwrap. These files now go into build-aux.
8767 * config/move-if-change: Remove.
8768 * config/prev-version.txt: Bump from 1.75 to 2.0.
8769
3ea5f0ec
PE
8770 * bootstrap: Add stdio-safer, unistd-safer modules.
8771 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8772 we don't need it).
8773 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8774 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8775 * lib/subpipe.c: Include "unistd-safer.h".
8776 (create_subpipe): Make sure all the newly-created
8777 file descriptors are > 2, so that diagnostics don't
8778 get sent down them (which might cause Bison to hang, in theory).
8779 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8780 * src/files.c (xfopen): Use fopen_safer, not fopen.
8781
51c30d21
PE
8782 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8783 yesterday's yacc.c fix.
8784
cea1469d
PE
87852005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8786
3ea5f0ec
PE
8787 * data/glr.c, data/lalr1.cc: Update copyright date.
8788
cea1469d
PE
8789 Fix a destructor bug reported by Wolfgang Spraul in
8790 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8791 * data/yacc.c (yyabortlab): Don't call destructor, and
8792 don't set yychar to EMPTY.
8793 (yyoverflowlab): Don't call destructor.
8794 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8795 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8796 since we no longer output the message "discarding lookahead token
8797 end of input ()".
8798
5e6f62f2
PH
87992005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8800
8801 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8802 fix a small glitch in debugging output.
8803 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8804 after YY_SYMBOL_PRINT where needed.
8805
8806 (struct yyGLRState): Add some comments.
8807 (struct yySemanticOption): Add some comments.
8808 (union yyGLRStackItem): Add comment.
8809
8810 (yymergeOptionSets): Correct this to properly perform the union,
8811 avoiding infinite reported by Michael Rosien.
8812 Update comment.
8813
8814 * tests/glr-regression.at: Add test for GLR merging error reported
8815 by M. Rosien.
cea1469d 8816
0fb669f9
PE
88172005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8818
8819 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8820 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8821 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8822 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8823 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8824 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8825 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8826 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8827 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8828 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8829 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8830 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8831 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8832 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8833 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8834 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8835 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8836 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8837 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8838 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8839 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8840 src/output.h, src/parse-gram.c, src/parse-gram.h,
8841 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8842 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8843 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8844 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8845 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8846 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8847 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8848 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8849 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8850 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8851 tests/reduce.at, tests/regression.at, tests/sets.at,
8852 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8853 Update FSF postal mail address.
8854
51f4735e
PE
88552005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8856
8857 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8858 Problem reported by Ralf Menzel.
8859
80ce3401
PE
88602005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8861
8862 * tests/actions.at: Test that stack overflow invokes destructors.
8863 From Marcus Holland-Moritz.
8864 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8865 from here....
8866 (yyreturn): to here. That way, destructors are called properly
8867 even if the stack overflows, or the user calls YYACCEPT or
8868 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8869 (yyoverflowlab): Destroy the lookahead.
8870
88712005-04-24 Paul Eggert <eggert@cs.ucla.edu>
8872
8873 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
8874
72f000b0
PE
88752005-04-17 Paul Eggert <eggert@cs.ucla.edu>
8876
8877 * NEWS: Bison-generated C parsers no longer quote literal strings
8878 associated with tokens.
8879 * src/output.c (prepare_symbols): Don't escape strings,
8880 since users don't want to see C escapes.
8881 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
8882 in diagnostics.
c19683bb 8883 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
8884 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
8885
1094323f
PE
88862005-04-16 Paul Eggert <eggert@cs.ucla.edu>
8887
8888 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
8889 the data size is known to be too small and we can't increase it.
8890 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
8891
ca407bdf
PE
88922005-04-15 Paul Eggert <eggert@cs.ucla.edu>
8893
8894 * src/parse-gram.y: Include quotearg.h.
8895 (string_as_id): Quote $1 before using it as a key, since the
8896 lexer no longer quotes it for us.
8897 (string_content): Don't strip quotes, since lexer no longer
8898 quotes it for us.
8899 * src/scan-gram.l: Include quotearg.h.
8900 ("\""): Omit quote.
8901 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
8902 a key, since the rest of the lexer doesn't quote it.
8903 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
8904 * tests/regression.at (Token definitions): Check for backslashes
8905 in token strings.
8906
8907 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
8908 (YYSIZE_T): Define to unsigned long int when using an older compiler.
8909 (yyparse): Revamp code to generate long syntax error message, to
8910 make it easier to translate, and to avoid problems with arithmetic
8911 overflow. Change "virtual memory" to "memory" in diagnostic, since
8912 we don't know whether the memory is virtual.
8913
1ce59070
PE
89142005-04-13 Paul Eggert <eggert@cs.ucla.edu>
8915
8916 * NEWS: Bison-generated C parsers now use the _ macro to
8917 translate strings.
8918 * data/yacc.c (_) [!defined _]: New macro.
8919 All English strings wrapped inside this macro.
8920 * doc/bison.texinfo (Bison Parser): Document _.
8921 * po/POTFILES.in: Include src/parse-gram.c, since it now
8922 includes translateable strings that parse-gram.y doesn't.
8923
a749a695
PE
89242005-04-12 Paul Eggert <eggert@cs.ucla.edu>
8925
8926 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
8927 reverting the 2004-10-11 change to this function.
8928 (symbol_check_alias_consistency): Don't call symbol_type_set
8929 if the type name is already correct.
8930 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
8931
8fb1053b
PE
89322005-03-25 Paul Eggert <eggert@cs.ucla.edu>
8933
8934 * tests/regression.at (Token definitions): Don't use a token named
8935 c, as that generates a "#define c ..." that runs afoul of buggy
8936 stdlib.h that uses the identifier c as a member of struct
8937 drand48_data. Problem reported by Horst Wente.
8938
ff498c4a
PE
89392005-03-21 Paul Eggert <eggert@cs.ucla.edu>
8940
8941 * bootstrap: Change translation URL from
8942 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
8943 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
8944 redirection glitches. Problem reported by twlevo@xs4all.nl.
8945
65211d70
PE
89462005-03-20 Paul Eggert <eggert@cs.ucla.edu>
8947
8948 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
8949 after operands; POSIX says this isn't portable for the c99 command.
8950
9577fb1f
PE
89512005-03-18 Paul Eggert <eggert@cs.ucla.edu>
8952
8953 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
8954 immediately if a data overrun has occurred; this may help us track
8955 down what may be a spurious failure on MacOS.
8956
78b178f7
PE
89572005-03-17 Paul Eggert <eggert@cs.ucla.edu>
8958
a2599d0f
PE
8959 Respond to problems reported by twlevo@xs4all.nl.
8960
8961 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
8962
78b178f7
PE
8963 * src/vcg.h: Comment fix.
8964 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
8965 (G_CMAX): Change to -1 instead of INT_MAX.
8966
8967 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 8968
7296e729
PE
89692005-03-15 Paul Eggert <eggert@cs.ucla.edu>
8970
8971 * src/tables.c (state_number_to_vector_number): Put it inside an
8972 "#if 0", since it's not currently used. Problem reported by
8973 Roland McGrath.
8974
05ac60f3
PE
89752005-03-06 Paul Eggert <eggert@cs.ucla.edu>
8976
8977 * src/output.c (escaped_output): Renamed from
8978 escaped_file_name_output, since we now use it for symbol tags as
8979 well. All uses changed.
8980 (symbol_destructors_output, symbol_printers_output):
8981 Escape symbol tags too.
8982 Problem reported by Matyas Forstner in
8983 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
8984
8985 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
8986 not needed.
8987 * src/output.c (user_actions_output, token_definitions_output,
8988 symbol_destructors_output, symbol_printers_output): Likewise.
8989 * src/reader.c (prologue_augment): Likewise.
8990 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
8991
8992 * src/vcg.c (output_edge): Don't quote linestyle arg.
8993 Problem reported by twlevo@xs4all.nl.
8994
7eb453ac
PE
89952005-02-28 Paul Eggert <eggert@cs.ucla.edu>
8996
8997 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
8998 example, reported by Derek M Jones. Also, make the example even
8999 more outrageous, to better illustrate how bad the problem is.
9000
4c04c52a
PE
90012005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9002
9003 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9004 putsym. Typo reported by Sebastian Piping.
9005
a61e1620
PE
90062005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9007
9008 * doc/bison.texinfo (Language and Grammar): some -> same
9009 (Epilogue): int he -> in the
9010 Typos reported by Sebastian Piping via Justin Pence.
9011
9ec93868
PE
90122005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9013
9014 * tests/glr-regression.at (Improper handling of embedded actions
9015 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9016 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9017 with dollar signs in test names.
9018 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9019 for a similar reason.
9020
73ce7e7e
PE
90212005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9022
9023 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9024 wants to redefine G_VIEW.
9025
2e72b98e
PE
90262005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9027
9028 * src/vcg.c (get_view_str): Remove case for normal_view.
9029 Problem reported by twlevo@xs4all.nl.
9030
e0d634e5
PE
90312005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9032
ccf830a4
PE
9033 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9034 Problem reported by twlevo@xs4all.nl.
9035
e0d634e5
PE
9036 * doc/bison.texinfo: Change @dircategory from "GNU programming
9037 tools" to "Software development". Requested by Richard Stallman
9038 via Karl Berry.
9039
7bbc8cb0
PE
90402005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9041
9042 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9043 Problem reported by twlevo@xs4all.nl.
9044
08b770bc
PE
90452005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9046
9047 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9048 keyword; it's not needed with modern compilers, and it doesn't
9049 affect correctness with older compilers. Suggested by
9050 twlevo@xs4all.nl.
9051
95f22ad2
PE
90522005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9053
9054 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9055 gcc -Wswitch-default.
9056 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9057 * data/yacc.c (yyparse): Likewise.
9058
d229d15c
PE
90592005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9060
9061 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9062 already. Let config.h define any nonstandard values.
9063
ecadd90f
PE
90642005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9065
9066 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9067 for the benefit of slower hosts. Problem reported by
9068 Nelson H. F. Beebe.
9069
213744b5
PE
90702005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9071
9072 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9073 being defined and not used.
9074 * data/lalr1.cc (yyparse): Likewise.
9075 Use "if (false)" rather than "if (0)".
9076
249d3236
PE
90772005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9078
9079 * TODO: Mention that we should allow NUL bytes in tokens.
9080
987cc1fb
PE
90812005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9082
9083 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9084 Problem reported by Hans Aberg.
9085
08fe02d9
PE
90862005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9087
9088 * src/getargs.c (version): Happy new year; update overall
9089 program copyright date from 2004 to 2005.
9090
9091 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9092 Problem reported by Hans Aberg.
9093 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9094 (Output file names.): Add a test for the case when standard output
9095 is closed.
9096
010c0266
PE
90972004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9098
9099 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9100 to fix an oversight in the Bison 2.0 manual.
9101
da12206a
PE
91022004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9103
9104 * NEWS: Version 2.0. Reformat the existing news items since
9105 1.875, so that related items are grouped together.
3a4734aa 9106 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
9107 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9108
c935d934
PE
9109 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9110 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9111 otherwise, we're not testing alloca. Unfortunately there's no
9112 simple way to consult HAVE_ALLOCA here.
9113
da12206a
PE
9114 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9115 for yymsg, too.
9116
9117 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9118 hand. This avoids a warning about comparing int to size_t when
9119 GCC warnings are enabled.
9120
0a2c5137
PE
91212004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9122
d7e14fc0
PE
9123 * NEWS: Bison-generated parsers no longer default to using the
9124 alloca function (when available) to extend the parser stack, due
9125 to widespread problems in unchecked stack-overflow detection.
9126 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9127 responsibility to set it to a positive value. This lets the user
9128 specify a value that is not a preprocessor constant.
9129 * data/yacc.c (YYMAXDEPTH): Likewise.
9130 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9131 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9132 to be a compile-time constant. However, explain the constraints on it.
9133 Also, explain the constraints on YYINITDEPTH.
9134 (Table of Symbols): Explain that alloca is no longer the default.
9135 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9136 to 1.
9137
0a2c5137
PE
9138 * doc/bison.texinfo (Location Default Action): Mention that n must
9139 be zero when k is zero. Suggested by Frank Heckenbach.
9140
e019c247
AD
91412004-12-22 Akim Demaille <akim@epita.fr>
9142
9143 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9144 (parser::state_type, parser::semantic_type, parser::location_type):
9145 Private, not public.
9146 (parser::parse): Return ints, not bool.
9147 Returning a bool introduces a problem: 0 corresponds to false, and
9148 it seems weird to return false on success. Returning true changes
9149 the conventions for yyparse.
9150 Alternatively we could return void and send an exception.
9151 There is no clear consensus (yet?).
9152 (state_stack, semantic_stack, location_stack): Rename as...
9153 (state_stack_type, semantic_stack_type, location_stack_type): these.
9154 Private, not public.
9155 * tests/c++.at: New.
9156 * tests/testsuite.at, tests/Makefile.am: Adjust.
9157
72731bb7
AD
91582004-12-21 Akim Demaille <akim@epita.fr>
9159
9160 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9161
9a0d8bec
AD
91622004-12-21 Akim Demaille <akim@epita.fr>
9163
9164 Don't impose std::string for filenames.
9165
9166 * data/lalr1.cc (b4_filename_type): New.
9167 (position::filename): Use it.
9168 (parser.hh): Move the inclusion of stack.hh and location.hh below
9169 the user code, so that needed headers for the filename type can be
9170 included first.
72731bb7
AD
9171 Forward declare them before the user code.
9172 * tests/Makefile.am (check-local, installcheck-local): Pass
9173 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 9174
99880de5
AD
91752004-12-20 Akim Demaille <akim@epita.fr>
9176
9177 Use more STL like names: my_class instead of MyClass.
9178
9179 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9180 (SemanticStack, SemanticType, StateStack, StateType)
9181 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9182 (Parser::value): Rename as...
9183 (location_stack, location_type, rhs_number_type, semantic_stack)
9184 (semantic_type, state_stack, state_type, token_number_type, stack)
9185 (slice, traits, parser::yylloc, parser::yylval): these.
9186
9187 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9188
9bec482e
PE
91892004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9190
9191 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9192 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9193
f6fbd3da
PE
91942004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9195
9196 Remove uses of 'short int' and 'unsigned short int'. This raises
9197 some arbitrary limits. It uses more memory but nowadays that's
9198 not much of an issue.
9199
9200 This change does not affect the generated parsers; that's a different
9201 task, as some users will want to conserve memory there.
9202
9203 Ideally we should use size_t to represent all object counts, and
9204 something like ptrdiff_t to represent signed differences of object
9205 counts; but that will require more code-cleanup than I have the
9206 time to do right now.
9207
9208 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9209 Use size_t, not int or short int, to count objects.
9210 * src/closure.c (nritemset, closure): Likewise.
9211 * src/closure.h (nritemset, closure): Likewise.
9212 * src/nullable.c (nullable_compute): Likewise.
9213 * src/print.c (print_core): Likewise.
9214 * src/print_graph.c (print_core): Likewise.
9215 * src/state.c (state_compare, state_hash): Likewise.
9216 * src/state.h (struct state): Likewise.
9217 * src/tables.c (default_goto, goto_actions): Likewise.
9218
9219 * src/gram.h (rule_number, rule): Use int, not short int.
9220 * src/output.c (prepare_rules): Likewise.
9221 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9222 errs, reductions): Likewise.
9223 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9224 Likewise.
9225 * src/tables.c (vector_number, tally, action_number,
9226 ACTION_NUMBER_MINIMUM): Likewise.
9227 * src/output.c (muscle_insert_short_int_table): Remove.
9228
efeed023
AD
92292004-12-17 Akim Demaille <akim@epita.fr>
9230
9231 * data/lalr1.cc: Extensive Doxygenation.
9232 (error_): Rename as...
9233 (error): this, since it is visible to the user.
9234 Adjust callers.
9235 (Parser::message): Now an automatic variable from...
9236 (Parser::yyreport_syntax_error_): here.
9237 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9238 Parser::error.
9239 * tests/input.at: Escape $.
9240
bc82c5a5
PE
92412004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9242
9243 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9244 Parenthesize rhs to avoid obscure problems with mistakes like
9245 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9246 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9247 b4_rhs_location): Likewise.
9248 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9249 b4_rhs_location): Likewise.
9250
fd19f271
AD
92512004-12-16 Akim Demaille <akim@epita.fr>
9252
9253 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9254 yacc.c: be sure to stay within yycheck_.
9255 * tests/actions.at: Re-enable C++ tests.
9256
10454ea4
AD
92572004-12-16 Akim Demaille <akim@epita.fr>
9258
9259 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9260 real.
9261
c5b95ccf
AD
92622004-12-16 Akim Demaille <akim@epita.fr>
9263
9264 Use #define to handle the %name-prefix.
9265
9266 * data/glr.c, data/yacc.c: Comment changes.
9267 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9268 so that one can refer to yylex in the parser file, and have it
9269 renamed, as is the case with other skeletons.
9270
617a8f12
AD
92712004-12-16 Akim Demaille <akim@epita.fr>
9272
9273 Move lalr1.cc internals into yy*.
9274
9275 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9276 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9277 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9278 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9279 (empty_, final_, terror_, errcode_, ntokens_)
9280 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9281 (looka_, ilooka_, error_range_, nerrs_):
9282 Rename as...
9283 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9284 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9285 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9286 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9287 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9288 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9289 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9290 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9291 these.
9292
1e547e6e
PE
92932004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9294
9295 Fix some problems reported by twlevo at xs4all.
9296 * src/symtab.c (symbol_new): Report an error if the input grammar
9297 contains too many symbols. This is better than calling abort() later.
9298 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9299 (struct node, struct graph):
9300 Rename member expand to stretch. All uses changed.
9301 (struct graph): Remove member layoutalgorithm. All uses removed.
9302 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9303 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9304 All uses changed.
9305 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9306
735d6bd4
AD
93072004-12-15 Akim Demaille <akim@epita.fr>
9308
9309 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9310 Add more Doxygen comments.
9311 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9312 (report_syntax_error_, translate_): Rename as...
9313 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9314 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9315
2e1f5829
AD
93162004-12-15 Akim Demaille <akim@epita.fr>
9317
9318 * data/lalr1.cc (lex_): Rename as...
9319 (yylex_): this.
9320 Move the trace here.
9321 Take the %name-prefix into account.
9322 Reported by Alexandre Duret-Lutz.
9323
a3cb6248
AD
93242004-12-15 Akim Demaille <akim@epita.fr>
9325
9326 Simplify the C++ parser constructor.
9327
9328 * data/lalr1.cc (debug_): Rename as...
9329 (yydebug_): so that the parser's internals are always in the yy*
9330 pseudo namespace.
9331 Adjust uses.
9332 (b4_parse_param_decl): Remove the leading comma as it is now only
9333 called as unique argument list.
9334 (Parser::Parser): Remove the constructor accepting a location and
9335 an initial debugging level.
9336 Remove from the other ctor the argument for the debugging level.
9337 (debug_level_type, debug_level, set_debug_level): New.
9338
9339 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9340 constructor calls.
9341
07fed891
AD
93422004-12-15 Akim Demaille <akim@epita.fr>
9343
9344 Remove b4_root related material: failure experiment
a3cb6248 9345 (which goal was to allow to derive from a class).
07fed891
AD
9346
9347 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9348 definitions and uses.
9349
e603eaa5
PE
93502004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9351
9352 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9353 not 2, since it's not portable to subtract 1 from the start of an
9354 array. The new item 0 is never set or used. All uses changed.
9355
9356 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9357 the default definition of YYLLOC_DEFAULT. Problem reported
9358 by Frank Heckenbach.
9359
fafb007d
PE
93602004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9361
9362 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9363 the normal case and one for the error case. Just use the
9364 first one uniformly. Problem reported by Frank Heckenbach.
9365 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9366 use exactly the same macro in both places.
9367 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9368 so that the normal-case YYRHSLOC works for the error case too.
9369 All uses changed.
9370 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9371 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9372 * doc/bison.texinfo (Location Default Action): Don't claim that
9373 we have an array of locations. Use the same macro for both glr
9374 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9375 the index is 0.
9376
48814dcd
PE
93772004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9378
a4e1a53b
PE
9379 * HACKING: Update email addresses to send announcements to.
9380
48814dcd
PE
9381 * configure.ac (AC_INIT): Bump version to 1.875f.
9382
337116ba
PE
93832004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9384
9385 * NEWS: Version 1.875e.
9386 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9387
9388 * src/scan-skel.l: Include "complain.h", for "fatal".
9389
9390 * src/relation.h (relation_print, relation_digraph):
9391 Relation sizes are of type relation_node, not size_t (this is
9392 merely a doc fix, since the two types are equivalent).
9393 (relation_transpose): Relation sizes are of type relation_node,
9394 not int.
9395 * src/relation.c: Likewise.
9396 (top, infinity): Now of type relation_node, not int.
9397 (traverse, relation_transpose): Use relation_node, not int.
9398
9399 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9400 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9401 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9402
9403 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 9404 specifying whether the test should be skipped. Use it tp
337116ba 9405 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 9406 fail on some hosts, and should be skipped.
337116ba 9407
da2a7671
PE
94082004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9409
9410 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9411 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9412 unless otherwise specified below.
9413
9414 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9415 to allocate kernel_base, kernel_items, kernel_size, since
9416 they needn't be initialized to 0.
9417 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9418 * src/closure.c (new_closure): Likewise, for itemset.
9419 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9420 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9421 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9422 (build_relations): Likewise for edge, states1, includes.
9423 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9424 * src/reader.c (packgram): Likewise, for ritem, rules.
9425 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9426 * src/relation.c (relation_digraph): Likewise for VERTICES.
9427 (relation_transpose): Likewise for new_R, end_R.
9428 * src/symtab.c (symbols_token_translations_init): Likewise for
9429 token_translations.
9430 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9431 (token_actions): Likewise for yydefact, actrow, conflrow,
9432 conflict_list.
9433 (save_column): Likewise for froms[symno], tos[symno].
9434 (goto_actions): Likewise for state_count.
9435 (pack_table): Likewise for base, pos, check.
9436 (tables_generate): Likewise for width.
9437
9438 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9439 for initial core. Just have a separate core, so we needn't worry
9440 about whether kernel_size and kernel_base are initialized.
9441
9442 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9443 kernel_size, kernel_items): Remove unnecessary initialization.
9444 * src/conflicts.c (conflicts): Likewise.
9445 * src/derives.c (derives): Likewise.
9446 * src/muscle_tablc (muscle_insert): Likewise.
9447 * src/relation.c (relation_digraph): Likewise.
9448 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9449 conflrow, conflict_table, conflict_list, table, check):
9450 Likewise.
9451
9452 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9453 This is because all callers pass unsigned int.
9454 * src/closure.h (new_closure): Likewise.
9455
9456 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9457 (build_relations): Initialize includes[i] in all cases.
9458 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9459 and rules[ruleno].precsym. Initialize members in order.
9460 * src/relation.c (relation_transpose): Always initialize new_R[i]
9461 and end_R[i].
9462 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9463
9464 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9465 conflict_list[0] was always 0, but now it isn't initialized.
9466
9467 * src/table.c (table_grow): When conflict_table grew, the grown
9468 area wasn't cleared. Fix this.
9469
9470 * lib/.cvsignore: Add strdup.c, strdup.h.
9471 * m4/.cvsignore: Add strdup.m4.
9472
00baeeac
PE
94732004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9474
9475 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9476 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9477 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9478 ngotos + 1 without checking for overflow.
9479 (build_relations): Use END_NODE, not -1, to denote end of edges.
9480 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9481 build_relations): Use goto_number, not int, for goto numbers.
9482 * src/tables.c (save_column, default_goto): Likewise.
9483
be3d9d42
AD
94842004-11-23 Akim Demaille <akim@epita.fr>
9485
9486 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9487 of #defining from yystype.
9488 Don't typedef yystype, C++ does not need it.
9489 This lets it possible to forward declare it as union.
9490
78e526d5
PE
94912004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9492
9493 * bootstrap (gnulib_modules): Add extensions.
9494 Problem reported by Jim Meyering.
9495
afbb696d
PE
94962004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9497
9498 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9499 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9500 src/system.h, src/tables.c: XFREE -> free, to accommodate
9501 recent change to gnulib xalloc.h.
78e526d5 9502 Problem reported by Jim Meyering.
afbb696d 9503
c1f8f16a
AD
95042004-11-17 Akim Demaille <akim@epita.fr>
9505
9506 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9507
db7e5eb5 95082004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
9509 Alexandre Duret-Lutz <adl@gnu.org>
9510
9511 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9512 changes.
9513 (YYCDEBUG): Adjust.
9514 Use it instead of cdebug_.
9515 (Parser::debug_stream, Parser::set_debug_stream): New.
9516 (Parser::symprint_): Define cdebug_ for temporary backward
9517 compatibility.
9518 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9519 debug_stream ().
9520
68e11668
AD
95212004-11-17 Akim Demaille <akim@epita.fr>
9522
9523 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9524 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9525 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9526 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9527
97cbc73e
PE
95282004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9529
9530 * data/glr.c (yyloc_default): Remove; not used.
9531 Problem reported by Frank Heckenbach.
9532
e342c3be
AD
95332004-10-25 Akim Demaille <akim@epita.fr>
9534
9535 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9536 Introduce another definition to address simple location arrays.
9537 (yyGLRStack): New member: yyerror_range.
9538 (yyrecoverSyntaxError, yyparse): Update it.
9539 (yyrecoverSyntaxError): Use it when shifting the error token to
9540 have an accurate range, equivalent to the one computed by both
9541 yacc.c and lalr1.cc.
9542 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9543 that column numbers start at column 0, as per GNU Coding
9544 Standards, the others tests, and the doc.
9545 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9546 Adjust to the above change (first column is 0).
9547 And adjust the location of the "<error>", now covering the whole
9548 line.
9549
93602feb 95502004-10-22 Akim Demaille <akim@epita.fr>
04098407 9551 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
9552
9553 Remove some arbitrary limits on goto numbers and relations.
9554 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9555 initial values, since they're never used.
9556 (set_goto_map): ngotos is now unsigned, so test for overflow
9557 by seeing whether it wraps around to zero.
9558 * src/lalr.h (goto_number): Now size_t, not short int.
9559 (GOTO_NUMBER_MAXIMUM): Remove.
9560 * src/relation.c (relation_print, traverse, relation_transpose):
9561 Check for END_NODE rather than looking at sign.
9562 * src/relation.h (END_NODE): New macro.
9563 (relation_node): Now size_t, not short int.
9564
dba08b04
PE
95652004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9566
9567 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9568 keyword, not an identifier. Problem reported by Baron Schwartz in
9569 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9570
df09ef2e
AD
95712004-10-11 Akim Demaille <akim@epita.fr>
9572
9573 * src/symtab.c (symbol_check_alias_consistency): Also check
9574 type names, destructors, and printers.
9575 Reported by Alexandre Duret-Lutz.
9576 Recode the handling of associativity and precedence in terms
9577 of symbol_precedence_set.
9578 Accept no redeclaration at all, not even equal to the previous
9579 value.
9580 (redeclaration): New.
9581 Use it to factor redeclaration complaints.
9582 (symbol_make_alias): Don't set the type of the alias, let
9583 symbol_check_alias_consistency do it as for other features.
9584 * src/symtab.h (symbol): Add new member prec_location, and
9585 type_location.
9586 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9587 * tests/input.at (Incompatible Aliases): New.
9588
146bc99d
PE
95892004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9590
9591 .cvsignore fixes to accommodate gnulib changes,
9592 and the practice of naming build directories "_build".
9593 * .cvsignore: Add "_*". Sort.
9594 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9595 * m4/.cvsignore: Add "*_gl.m4".
9596
e503aa60
AD
95972004-10-06 Akim Demaille <akim@epita.fr>
9598
9599 * src/parse-gram.y (add_param): Fix the truncation of trailing
9600 spaces.
9601
b4a20338
AD
96022004-10-05 Akim Demaille <akim@epita.fr>
9603
9604 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9605 whether the reducion was empty or not. This leaves room to
9606 improve the use of YYLLOC_DEFAULT in such a case.
9607 lalr1.cc is still experimental, so changing this is acceptable.
9608 And finally, there are probably not many users who changed the
9609 handling of locations in GLR, so changing is admissible too.
9610
9611 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9612 empty reduction, set @$ to an empty location ending the previously
9613 stacked symbol.
9614 Adjust uses to make sure the code is triggered on empty
9615 reductions.
9616 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9617 expected output: empty reductions have empty locations.
9618
f85a5e6f
AD
96192004-09-29 Akim Demaille <akim@epita.fr>
9620
9621 * data/lalr1.cc: Move towards a more standard C++ coding style
9622 for templates: Class < T > -> Class<T>.
9623
b203fc2c
AD
96242004-09-29 Akim Demaille <akim@epita.fr>
9625
9626 * data/lalr1.cc: Reinstall the former ctor, for sake of
9627 compatibility, but warn it will be removed.
9628 Move towards a more standard C++ coding style (i.e., type *var ->
9629 type* var).
9630
5b7e1e73
PE
96312004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9632
3fee967f
PE
9633 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9634 since it's less likely to work if NULs are involved in the future.
5b7e1e73 9635
0dcca5c2
AD
96362004-09-27 Akim Demaille <akim@epita.fr>
9637
9638 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9639
6dde1c82
AD
96402004-09-27 Akim Demaille <akim@epita.fr>
9641
9642 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 9643 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
9644 and argument names.
9645 (b4_cc_constructor_call): Likewise.
9646
b233d555
AD
96472004-09-24 Akim Demaille <akim@epita.fr>
9648
9649 * src/parse-gram.y (add_param): Strip the leading and trailing
9650 blanks from a formal argument declaration.
9651 (YY_LOCATION_PRINT): New.
9652
619404e3
AD
96532004-09-24 Akim Demaille <akim@epita.fr>
9654
9655 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9656 after the location.
9657
dd8d9022
AD
96582004-09-24 Akim Demaille <akim@epita.fr>
9659
9660 * doc/bison.texinfo (Table of Symbols): Sort.
9661
0092f063
AD
96622004-09-21 Akim Demaille <akim@epita.fr>
9663
9664 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9665 the useless parentheses.
9666 Suggested by Paul Eggert.
9667
451364ed
AD
96682004-09-20 Akim Demaille <akim@epita.fr>
9669
9670 Let the initial-action act on the look-ahead, and use it for the
9671 "initial push" (corresponding to an hypothetical beginning-of-file).
9672 And let lalr1.cc honor %initial-action.
9673
9674 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9675 example.
9676 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9677 (Parser::Parser): Remove the ctor that used to initialize it.
9678 (Parser::parse): Like in the other skeletons, issue the "starting
9679 parse" message before any action.
9680 Honor %initial-action.
9681 Initialize the stacks with the lookahead.
9682 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9683 look-ahead.
9684 Push them in the stacks.
9685 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9686
18d192f0
AD
96872004-09-20 Akim Demaille <akim@epita.fr>
9688
9689 * doc/bison.texinfo (Initial Action Decl): New.
9690
b8458aa5
AD
96912004-09-20 Akim Demaille <akim@epita.fr>
9692
9693 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9694 clearer criterion to define it.
9695 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9696 When reducing on an empty RHS, use the latest stacked location as
9697 location.
9698 yylloc is not always available.
9699 * data/glr.c: Likewise.
9700 Also, honor initial-actions.
9701
3fc16193
AD
97022004-09-20 Akim Demaille <akim@epita.fr>
9703
9704 * data/yacc.c (YY_LOCATION_PRINT): New.
9705 Define when we know YYLTYPE's structure, i.e., when the default
9706 YYLLOC_DEFAULT is used.
9707 * data/c.m4 (b4_yysymprint_generate): Use it.
9708 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9709 value of the result.
9710 (error_start_): Replace with...
9711 (error_range_): this location array.
9712 This allows to replace code relying on the implementation of
9713 locations by portable code.
9714 * data/yacc.c (yylerrsp): Replace with...
9715 (yyerror_range): this.
9716 Every time a token is popped, update yyerror_range[0], to have an
9717 accurate location for the error token.
9718 * data/glr.c (YY_LOCATION_PRINT): New.
9719 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9720 deference a pointer.
9721 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9722 report the location in %printers.
9723
9724 * src/scan-skel.l: Instead of abort, report error messages to ease
9725 understanding skeleton scanning failures.
9726
ecfe33e7
AD
97272004-09-16 Akim Demaille <akim@epita.fr>
9728
9729 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9730 (iterator, const_iterator): these, to be more in the C++ spirit.
9731 Also, return reverse iterators so that when displaying the stack
9732 we display its bottom first.
9733 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9734 from yacc.c.
9735 We should probably use vector here though.
9736
1576d44d
AD
97372004-09-16 Akim Demaille <akim@epita.fr>
9738
9739 Have more complete shift traces.
9740
9741 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9742 to report Shifts instead of ad hoc YYDPRINTF invocations,
9743 including for the error token.
9744 * data/lalr1.cc (symprint_): Output the location.
9745 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9746 output the location within the %printer.
9747 Activate GLR tests, at least to make sure they compile properly.
9748 They still don't pass though.
9749 * tests/calc.at: Adjust expect verbose output, since now "Entering
9750 state..." is on a different line than the "Shifting" message.
9751
9c66f418
AD
97522004-09-08 Akim Demaille <akim@epita.fr>
9753
9754 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9755 Bison directive from the Bison file to the invocation of this
9756 macro, so that these directives are passed to
9757 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9758 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9759 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9760 the extra Bison directives instead of the whole series.
9761 Change the grammar so that there are recoverable errors, and
9762 unrecoverable errors. Now we can have the parser give up before
9763 consuming the whole input. As a result we now can observe that
9764 the lookahead is freed when needed.
9765 Change the parser source to parse argv[1] instead of a hard coded
9766 string.
9767 Simplify yylex, and give a value and location to EOF.
9768 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9769 passed directives already coded in the file.
9770 Add some tests to check the location of "error".
9771 For some tests, the C++ parser is correct, and not yacc.c.
9772 For other tests, they provide different, but unsatisfying, values,
9773 so keep the C++ value so that at least one parser is "correct"
9774 according to the test suite.
9775 (Actions after errors): Remove, this is subsumed by the
9776 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9777
52d5733f
AD
97782004-09-06 Akim Demaille <akim@epita.fr>
9779
9780 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 9781 (Parser::pop): New.
52d5733f
AD
9782 Use it.
9783
a0e68930
AD
97842004-09-06 Akim Demaille <akim@epita.fr>
9785
9786 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9787 argument, an informative message.
9788 Call YY_SYMBOL_PRINT.
9789 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9790 * data/lalr1.cc (destruct_): Likewise.
9791 In addition, no longer depend on b4_yysymprint_generate and
9792 b4_yydestruct_generate to generate these functions, do it "by
9793 hand".
9794
e757bb10
AD
97952004-09-03 Akim Demaille <akim@epita.fr>
9796
9797 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9798 invoked, yydestruct the lookahead.
9799 * tests/calc.at (Calculator $1): Update the expected lengths of
9800 traces: there is an added line for the discarded lookahead.
9801 * doc/bison.texinfo (Destructor Decl): Some rewording.
9802 Define "discarded" symbols.
9803
0fe1f06d
AD
98042004-09-02 Akim Demaille <akim@epita.fr>
9805
9806 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9807
284acc8b
AD
98082004-09-02 Akim Demaille <akim@epita.fr>
9809
9810 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9811 (YYDSYMPRINTF): Rename as...
9812 (YY_SYMBOL_PRINT): this.
9813 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9814 two.
9815 Use it instead of direct symprint_ calls.
9816 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9817 one.
9818
a5eb1ed2
AD
98192004-09-02 Akim Demaille <akim@epita.fr>
9820
b7c72fe1
AD
9821 * data/lalr1.cc (b4_yysymprint_generate): New.
9822 (symprint_): New member function, defined when YYDEBUG.
9823 Use it consistently instead of token/nterm debugging output by
9824 hand.
a5eb1ed2
AD
9825 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9826 %printer calls to use cdebug_ when using lalr1.cc.
9827
417141dd
AD
98282004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9829
9830 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9831 with #ifdef YYDEBUG.
9832
2fa09258
AD
98332004-08-26 Akim Demaille <akim@epita.fr>
9834
9835 * doc/bison.texinfo (Implementing Loops): Rename as...
9836 (Implementing Gotos/Loops): this.
9837
9378b508
PE
98382004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9839
9840 Adjust to latest gnulib.
9841 * bootstrap (gnulib_modules): Add xalloc-die.
9842 Set LC_ALL=C so that file names sort consistently.
9843 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9844 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9845 uintmax_t.m4, ulonglong.m4.
9846 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9847 po.m4 since we are now using _gl.m4 instead.
9848
87a8ad5c
PE
98492004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9850
9851 * src/scan-action.l: Remove. Scanning of semantic actions is
9852 handled in scan-gram.l.
9853
dca81a78
PE
98542004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9855
9856 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9857
9858 * src/location.h (struct): The file member is a uniqstr.
9859 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9860
c9cbf7c5
PE
98612004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9862
9863 Fix bug with non-%union parsers that have printers or destructors,
9864 which led to a Bison core dump. Reported by Peter Fales in
9865 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 9866
c9cbf7c5
PE
9867 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9868 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9869 not to our own type.
9870 * src/output.c (symbol_destructors_output, symbol_printers_output):
9871 Don't assume %union.
9872 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
9873 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
9874 UNION-FLAG. All callers changed.
9875 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
9876 Use type char, not unsigned int, when declaring an array of char;
9877 this lets us remove a cast.
9878 (Printers and Destructors): Add non-%union test cases.
9879
fa7e68c3
PE
98802004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9881
9882 * doc/bison.texinfo: Minor editorial changes, mostly to the new
9883 GLR writeups. E.g., avoid frenchspacing and the future tense,
9884 change "lookahead" to "look-ahead", and change "wrt" to "with
9885 respect to".
2fa09258 9886
fa7e68c3
PE
98872004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9888
9889 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
9890 New sections, split off from the GLR Parsers section. Put the new
9891 Simple GLR Parser near the start of the GLR section, for clarity.
9892 Rewrite connective text.
9893
99a9344e
PE
98942004-06-21 Frank Heckenbach <frank@g-n-u.de>
9895
9896 * doc/bison.texinfo (Simple GLR Parsers): New section.
9897
8dd162d3
PE
98982004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9899
9900 * NEWS, TODO, doc/bison.texinfo:
9901 Use "look-ahead" instead of "lookahead", to be consistent.
9902 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
9903 while we're fixing "look-ahead".
9904 * src/conflicts.c (shift_set): Renamed from shiftset.
9905 (look_ahead_set): Renamed from lookaheadset.
9906 * src/print.c: Likewise.
9907 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
9908 name for "lookahead".
9909 (report_types, usage): Likewise.
9910 * src/getargs.h (report_look_ahead_tokens): Renamed from
9911 report_lookaheads.
9912 * src/lalr.c (compute_look_ahead_tokens): Renamed from
9913 compute_lookaheads.
9914 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
9915 (look_ahead_tokens_print): Renamed from lookaheads_print.
9916 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
9917 state_rule_lookaheads_print.
9918 * src/state.h: Likewise.
9919 (reductions.look_ahead_tokens): Renamed from lookaheads.
9920 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
9921 AT_DATA_LOOKAHEADS_GRAMMAR.
9922
57a90331
PE
99232004-06-03 Paul Eggert <eggert@cs.ucla.edu>
9924
9925 * README: Update location of patched M4 distribution.
9926
8ed3234a
PE
99272004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
9928
9929 Don't assume the C++ compiler takes the same arguments as the C compiler
9930 (trivial change).
9931 * configure.ac (O0CXXFLAGS): New var.
9932 * tests/atlocal.in (CXXFLAGS): Use it.
9933
07971983
PE
99342004-05-29 Paul Eggert <eggert@cs.ucla.edu>
9935
9936 Fix some "make check" problems with C++ reported by
9937 Albert Chin-A-Young for Tru64 C++ in this thread:
9938 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
9939
9940 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
9941 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9942 Output to a .cc file for C++, not to a .c file.
9943 * tests/calc.at (AT_CHECK_CALC): Likewise.
9944 * tests/regression.at (AT_CHECK_DANCER): Likewise.
9945 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
9946
29058652
PE
99472004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
9948
9949 * tests/calc.at, tests/actions.at: Workaround for SGI
9950 C++ compiler. (trivial change)
9951
62cb8a99
PE
99522004-05-27 Paul Eggert <eggert@cs.ucla.edu>
9953
fd418816
PE
9954 Spent a few hours checking out which prerequisite versions the
9955 current sources actually require. I went all the way back to
9956 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
9957 a seemingly endless set of combinations of versions more recent
9958 than that. The bottom line is that the current sources require
9959 fairly recent versions of the build tools, and it'll be some work
9960 to change this.
9961 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
9962 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
9963 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
9964 Add comments explaining why those particular versions are
9965 currently needed.
2fa09258 9966
62cb8a99
PE
9967 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
9968 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 9969 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
9970
9971 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
9972 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
9973
caa52c10
PE
99742004-05-26 Paul Eggert <eggert@cs.ucla.edu>
9975
9976 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
9977 0.11.5. Suggested by Bruno Haible.
9978 * bootstrap: Remove gettext version checking.
9979
9980 * doc/bison.texinfo (Decl Summary): Also mention that %union
9981 can depend on prerequisite types. Problem reported by Tim
9982 Van Holder.
9983
4bfd5e4e
PE
99842004-05-25 Paul Eggert <eggert@cs.ucla.edu>
9985
2cef3017
PE
9986 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
9987 * README-alpha: Don't tell people not to package this.
9988
b9c85d5c
PE
9989 * bootstrap: Don't assume $(...) works; use `...` instead.
9990 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
9991 gettext better.
9992
4bfd5e4e
PE
9993 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
9994 put into the -d output file, and mention what to do if YYSTYPE is
9995 defined as a macro.
9996
6a36ff94
PE
99972004-05-24 Paul Eggert <eggert@cs.ucla.edu>
9998
6712933e
PE
9999 Undo change made earlier today: it caused autopoint to not bring
10000 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10001 autopoint's.
10002
10003 * bootstrap: Check that gettext version matches what's in
10004 configure.ac. Warn users to ignore robots.txt ERROR 404.
10005 * bootstrap: Undo today's earlier change (logged below).
10006 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 10007
6a36ff94
PE
10008 The gettext version checking is causing more trouble than it's
10009 curing; remove it. Problem reported by Paul Hilfinger.
10010
10011 * bootstrap: Issue a warning that one can expect a message
10012 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10013 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10014
209ea708
PE
100152004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10016
10017 Ensure that the C++ compiler used for testing actually works on a
10018 simple test program; if not, skip the C++-related tests. Problem
10019 reported by Vin Shelton in:
161a71f3 10020 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
10021
10022 * m4/cxx.m4: New file.
10023 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10024 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10025 * tests/local.at (AT_COMPILE_CXX): Use it.
10026
41ca2549
PE
100272004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10028
383e69dc
PE
10029 * data/glr.c (yylloc): Output this macro even if locations are not
10030 being generated, as the GLR parser needs it even in that case.
10031 Problem reported by Troy A. Johnson
10032 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10033
41ca2549
PE
10034 * configure.ac (AC_INIT): Update to 1.875e.
10035
e476c87d
PE
100362004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10037
10038 * NEWS: Version 1.875d.
10039 * configure.ac (AC_INIT): Likewise.
10040 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10041
10042 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10043 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10044 lalr1.cc runs afoul of the first, and the last two are no longer
10045 supported by GCC 3.4.0.
10046 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10047 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10048
233a88ad
PE
100492004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10050
10051 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10052 unsigned int, for compatibility with latest gnulib hash module.
10053 * src/state.c (state_hash, state_hasher): Likewise.
10054 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10055 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 10056
12ffdd28
PE
100572004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10058
10059 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10060
10061 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10062 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10063 character and string literals.
10064 (unexpected_end): New function.
10065 (unexpected_eof): Use it.
10066 (unexpected_newline): New function.
10067 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10068 actions.
e476c87d 10069
12ffdd28
PE
10070 * NEWS: Document %expect-rr.
10071
10072 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10073 Fix typo by replacing $1 with $option.
10074 Remove more 'intl'-related files.
9668e2be 10075 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
10076
10077 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10078 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10079 strtoul.c.
10080 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10081 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10082 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10083 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10084 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10085 * src/.cvsignore: Add *.output.
10086
10087 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10088 gets copied to the output file.
e476c87d 10089
1f65350a
PE
100902004-04-28 Paul Eggert <eggert@twinsun.com>
10091
10092 Get files from the gnulib and po repositories, instead of relying
10093 on them being in our CVS. Upgrade to latest versions of gnulib
10094 and Automake.
10095
10096 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10097 * bootstrap: Bootstrap from gnulib and po repositories.
10098 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10099 * README-cvs: Document these changes. Remove version numbers from
10100 mentions of build tools, since they change so often. Mention Flex.
10101
10102 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10103 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
10104 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10105 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 10106 does this for us.
12ffdd28
PE
10107 (AC_ISC_POSIX): Remove; we no longer support this
10108 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
10109 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10110 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10111 Do not check for C89 headers, except for locale.h which is used
10112 by the Yacc library and must port to K&R hosts.
10113 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10114 Do not check for C89 functions, except for setlocale which is
10115 used by the Yacc library.
10116 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10117 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10118 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10119 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10120 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10121 AM_GNU_GETTEXT): Remove; now done by:
10122 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10123 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10124 for us.
10125
10126 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10127 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10128 Define to empty, as gnulib.mk will do the rest for us.
10129 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10130 for us.
10131 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10132 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10133
10134 * src/files.c: Include gnulib's xstrndup.h.
10135
10136 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10137 (REALLOC): Use xnrealloc, for likewise.
10138 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10139 (strnlen, memrchr): Remove decls; functions no longer used.
10140 Include <stpcpy.h>.
10141
10142 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10143 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10144 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10145 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10146 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10147 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10148 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10149 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10150 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10151 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10152 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10153 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10154 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10155 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10156 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10157 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10158 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10159 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10160 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10161 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10162 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10163 Remove, as these files are now generated automatically
10164 by bootstrap or automake.
10165
10166 * po/ChangeLog: Remove: all but one entry was a duplicate
10167 of this file, and I moved that 2000-11-02 entry here.
10168
10169 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10170 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10171 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10172 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10173 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10174 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10175 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10176 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10177 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10178 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10179 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10180 xstrndup.h.
10181 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10182 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10183 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10184 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10185 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10186 * src/.cvsignore: Remove *_.c.
10187
10188
10189 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10190 support it. (The latest stable gzip doesn't.)
10191
101922004-04-27 Paul Eggert <eggert@twinsun.com>
10193
10194 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10195 case, as stos_ is now used by destructors due to the 2004-02-09
10196 change.
10197
10198 Remove more K&R C support.
10199 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10200 * lib/subpipe.c (errno): Remove decl.
10201 Include <stdlib.h> unconditionally.
10202 (EXIT_FAILURE): Remove macro.
10203 * src/complain.c (vfprintf, strerror): Remove.
10204 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10205 unconditionally.
10206 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10207 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10208 (strchr, strspn, memchr): Remove decls.
10209 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10210 unconditionally. Do not declare perror.
10211 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10212 unconditionally.
10213
10214 * src/complain.c (_): Remove useless defn, as system.h defines this.
10215
10216 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10217 with latest obstack.h.
10218 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10219 to procedure types, as obstack.h now does that for us.
10220 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10221
10222 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10223 so that this include file can stand alone.
10224 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10225 does this now. Include subpipe.h first after config.h, to
10226 test whether it can stand alone.
10227
10228 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10229 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10230 unused declaration.
10231
10232 * tests/synclines.at (%union synch line): Put a dummy member in
10233 the union, because empty unions aren't allowed in C. Caught
10234 by GCC 3.4.0.
10235
4f16766c
PE
102362004-04-13 Jim Meyering <jim@meyering.net>
10237
10238 * src/conflicts.c (conflicts_print): Correct format string typo:
10239 use `%%' to produce literal `%'. (trivial change)
10240
779e7ceb
PE
102412004-03-30 Paul Eggert <eggert@twinsun.com>
10242
10243 * src/getargs.c (version): Update copyright year to 2004.
10244
10245 * data/c.m4 (b4_int_type): Use 'short int' rather than
10246 'short', and similarly for 'long', 'unsigned', etc.
10247 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10248 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10249 yy_yypstack, yydumpstack): Likewise.
10250 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10251 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10252 Likewise.
10253 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10254 yy_stack_print, yyparse): Likewise.
10255 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10256 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10257 * lib/bitset.c (bitset_print): Likewise.
10258 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10259 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10260 * lib/bitsetv.c (bitsetv_dump): Likewise.
10261 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10262 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10263 Likewise.
10264 * src/LR0.c (allocate_itemsets): Likewise.
10265 * src/gram.h (rule_number, rule): Likewise.
10266 * src/lalr.h (goto_number): Likewise.
10267 * src/nullable.c (nullable_compute): Likewise.
10268 * src/output.c (prepare_rules): Likewise.
10269 * src/relation.c (relation_print, relation_digraph): Likewise.
10270 * src/relation.h (relation_node): Likewise.
10271 * src/state.h (state_number, transitions, errs, reductions,
10272 struct state): Likewise.
10273 * src/symtab.h (symbol_number, struct symbol): Likewise.
10274 * src/tables.c (vector_number, tally, action_number,
10275 default_goto, goto_actions): Likewise.
10276 * tests/existing.at (GNU Cim Grammar): Likewise.
10277 * tests/regression.at (Web2c Actions): Likewise.
10278
10279 * src/output.c (muscle_insert_short_int_table): Renamed from
10280 muscle_insert_short_table. All uses changed.
10281
d6328241
PH
102822004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10283
10284 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10285 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10286 Add %expect-rr rule.
4f16766c 10287
d6328241
PH
10288 * src/scan-gram.l: Recognize %expect-rr.
10289
4f16766c 10290 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 10291 expected_conflicts.
4f16766c 10292 (expected_rr_conflicts): Declare.
d6328241
PH
10293
10294 * src/conflicts.c (expected_sr_conflicts): Rename from
10295 expected_conflicts.
10296 (expected_rr_conflicts): Define.
10297 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10298 for GLR parsers.
10299 Use expected_sr_conflicts in place of expected_conflicts.
10300 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 10301
d6328241 10302 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 10303
1452af69
PE
103042004-03-08 Paul Eggert <eggert@gnu.org>
10305
10306 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 10307 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
10308
10309 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10310 in lalr1.cc.
10311 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10312 * src/scan-gram.l (scan_integer): New function.
10313 ({int}): Use it.
10314 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10315 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10316 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10317 Say "long int", not "long", for uniformity with GNU style.
10318
006d217d
PE
103192004-02-25 Paul Eggert <eggert@twinsun.com>
10320
10321 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10322 compilers. This fixes a problem with Intel's C++ compiler being
10323 chatty, reported by Guido Trentalancia in
161a71f3 10324 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 10325
c2729758
ADL
103262004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10327
10328 Support %destructor and merge error locations in lalr1.cc.
10329
10330 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10331 (Parser::stos_): Define unconditionally.
10332 (Parser::destruct_): New method. Generate its body with
10333 b4_yydestruct_generate.
10334 (Parser::error_start_): New attribute.
10335 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10336 token which are discarded.
10337 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10338 error_start_ when erroneous token are discarded.
10339 (Parser::parse) <yyerrlab1>: Compute the location of the error
10340 token so that it covers all the discarded tokens.
10341 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10342 it can be called with `%skeleton "lalr1.cc"', and do that.
10343
dd0e0635
PE
103442004-02-02 Paul Eggert <eggert@twinsun.com>
10345
10346 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10347 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10348 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10349 There's no need to mention top_builddir since Automake does that
10350 for us.
10351 (INCLUDES): Remove, as Automake says it's obsolescent.
10352 Contents migrated into AM_CPPFLAGS as described above.
10353 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10354
103552004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10356
10357 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10358 (yyreportSyntaxError): Handle case where lookahead token is
10359 YYEMPTY.
10360
be16239b
PH
103612004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10362
10363 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10364 resulting parsers are compilable with C++.
10365
5fa90832
PE
103662003-12-23 Paul Eggert <eggert@twinsun.com>
10367
10368 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10369 * src/output.c (output_skeleton): Rename local var.
10370 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10371 Bison tokens, as this runs afoul of the 2003-10-07 change that
10372 disallowed NUL bytes in character constants or string literals.
10373
10374 * tests/local.at: Require Autoconf 2.59's Autotest.
10375 * tests/testsuite.at: Don't include local.at, since we now assume
10376 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10377 including it.
10378 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10379 multiple inclusion warnings.
dd0e0635 10380
b165c324
AD
103812003-12-02 Akim Demaille <akim@epita.fr>
10382
10383 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10384 conditions.
10385 From Bruno Haible.
10386
26e06a21
ADL
103872003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10388
10389 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10390
92ac3705
PE
103912003-10-07 Paul Eggert <eggert@twinsun.com>
10392
6a5ecb38
PE
10393 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10394 if testsuite doesn't exist.
10395
92ac3705
PE
10396 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10397 literals, unfortunately.
10398 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10399 Complain about NUL bytes in character constants or string literals.
10400
91d2c560
PE
104012003-10-05 Paul Eggert <eggert@twinsun.com>
10402
10403 * NEWS: Don't document %no-default-prec, as it's still
10404 too experimental.
10405 * doc/bison.texinfo: Document %no-default-prec only if
10406 the defaultprec flag is set. Normally it's not.
10407
0cc3da3a
PE
104082003-10-04 Paul Eggert <eggert@twinsun.com>
10409
10410 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10411 non-modifiable lvalue, instead of a modifiable one.
10412 * doc/bison.texinfo (Actions): Document that $$ can
10413 be assigned to. Do not claim that $$ and $N are
10414 array element references: user code should not rely on this.
10415
22fccf95
PE
104162003-10-01 Paul Eggert <eggert@twinsun.com>
10417
10418 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10419 (grammar_declaration): Use it.
10420 * src/scan-gram.l: New token %no-default-prec.
10421 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10422 * NEWS, doc/bison.texinfo: Document the above.
10423
fc8f2965
AD
104242003-10-01 Akim Demaille <akim@epita.fr>
10425
10426 VCG no longer supports long_straight_phase.
10427
10428 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10429 * src/print_graph.c (print_graph): Adjust.
10430
39a06c25
PE
104312003-09-30 Frank Heckenbach <frank@g-n-u.de>
10432 and Paul Eggert <eggert@twinsun.com>
10433
10434 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10435 Table of Symbols): Document %default-prec.
10436 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10437 (grammar_declaration): Set default_prec on %default-prec.
10438 * src/scan-gram.l (%default-prec): New token.
10439 * src/reader.h (default_prec): New flag.
10440 * src/reader.c: Likewise.
10441 (packgram): Handle it.
10442 * tests/conflicts.at (%default-prec without %prec,
10443 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 10444
39a06c25
PE
104452003-09-30 Paul Eggert <eggert@twinsun.com>
10446
10447 * tests/testsuite.at: Include local.at, not input.at, fixing
10448 a typo in the 2003-08-25 patch.
10449
62b6aef9
AD
104502003-08-27 Akim Demaille <akim@epita.fr>
10451
10452 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10453 GCC warnings.
10454
89e1cc61
AD
104552003-08-26 Akim Demaille <akim@epita.fr>
10456
10457 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10458 "<\#" to avoid magic from Gnus when posting parts of this script.
10459
a08460b0
AD
104602003-08-26 Akim Demaille <akim@epita.fr>
10461
10462 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10463 (Parser::parse): here.
10464 Adjust: nerrs and errstatus is now replaced by...
10465 (Parser::nerrs_, Parser::errstatus_): New.
10466
603f1cfd
AD
104672003-08-25 Akim Demaille <akim@epita.fr>
10468
10469 * config/announce-gen, Makefile.cfg: New.
10470 * Makefile.am: Adjust.
10471 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10472 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10473
cd3684cf
AD
104742003-08-25 Akim Demaille <akim@epita.fr>
10475
10476 When reducing initial empty rules, Bison parser read an initial
10477 location that is not defined. This results in garbage, and that
10478 affects Bison's own parser. Therefore we need (i) to extend Bison
10479 to support a means to initialize this location, and (ii) to use
10480 this CVS Bison to fix CVS Bison's parser.
10481
10482 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10483 with...
10484 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10485 * src/parse-gram.y: Adjust.
10486 (%initial-action): New.
10487 (%error-verbose): Since we require CVS Bison, there is no reason
10488 not to use it.
10489 * src/scan-gram.l: Adjust.
10490 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10491 * data/yacc.c (yyparse): Use b4_initial_action.
10492
4e03e201
AD
104932003-08-25 Akim Demaille <akim@epita.fr>
10494
10495 * doc/bison.texinfo: Don't promote stdout for error messages.
10496
8c182d05
AD
104972003-08-25 Akim Demaille <akim@epita.fr>
10498
10499 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10500 From Alexandre Duret-Lutz.
10501
6a60c4cf
PE
105022003-08-25 Akim Demaille <akim@epita.fr>
10503
10504 Version 1.875c.
10505
25f66e1a
AD
105062003-08-25 Akim Demaille <akim@epita.fr>
10507
10508 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10509 Use them.
10510
5348bfbe
AD
105112003-08-25 Akim Demaille <akim@epita.fr>
10512
10513 * data/lalr1.cc (Parser::reduce_print_): New.
10514 Use it.
10515
47301314
AD
105162003-08-25 Akim Demaille <akim@epita.fr>
10517
10518 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10519 error recovery loops. This patch is based on
161a71f3 10520 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
10521 Also, augment the similarity between lalr1.cc and yacc.c.
10522 Note: the locations of error recovery rules are not correct yet.
10523
10524 * data/lalr1.cc: Comment changes to augment the similarity between
10525 lalr1.cc and yacc.c.
10526 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10527 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10528 yyerrlab), when hitting EOF, pop the whole stack here instead of
10529 merely falling thru the default error handling mechanism.
10530 (yyerrorlab): New label, with the old contents of YYERROR,
10531 plus the following change: pop the stack of rhs corresponding
10532 to the production that invoked YYERROR. That is how Yacc
10533 behaves (required by POSIX).
10534 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10535 fail.
10536
1f7a61ff
AD
105372003-08-25 Akim Demaille <akim@epita.fr>
10538
10539 Tune local.at so that people can "autom4te -l autotest calc.at -o
10540 calc" for instance, to extract a sub test suite.
10541
10542 * tests/testsuite.at: Move the initialization, Autotest version
10543 requirement, and AT_TESTED invocation into...
10544 * tests/local.at: here.
10545 * tests/testsuite.at: Include it for compatibility with Autoconf
10546 2.57.
10547 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10548 be ignore.
10549
327b5b56
PE
105502003-08-04 Paul Eggert <eggert@twinsun.com>
10551
10552 Rework code slightly to avoid gcc -Wtraditional warnings.
10553 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10554 The returned value is now stored in *YY0. All callers changed.
10555 * src/output.c (merge_output): Adjust to the above change.
10556
0051e3ed
PE
105572003-07-26 Paul Eggert <eggert@twinsun.com>
10558
10559 * data/glr.c (YYASSERT): New macro.
10560 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10561 yyresolveStates, yyprocessOneStack):
10562 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10563 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 10564
137437c6
PE
105652003-07-25 Paul Eggert <eggert@twinsun.com>
10566
5b620e06
PE
10567 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10568 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 10569 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
10570 by Frank Heckenbach, though I have omitted the structure-initialization
10571 part of his glr-knr.diff patch since I recall that the Portable
10572 C Compiler didn't require that change.
10573
137437c6
PE
10574 Let the user specify how to allocate and free memory.
10575 Derived from a suggestion by Frank Heckenbach in
161a71f3 10576 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
10577 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10578 All uses of free, malloc, realloc changed to use these macros,
10579 and unnecessary casts removed.
10580 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10581
ddb85ca5
PE
105822003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10583
10584 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10585 use s.empty() rather than s == "" to test for empty string; see
161a71f3 10586 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
10587 (trivial change)
10588
39910e09
AD
105892003-06-25 Akim Demaille <akim@epita.fr>
10590
10591 * config/depcomp, config/install-sh: Update from masters.
10592
0ae99356
PE
105932003-06-20 Paul Eggert <eggert@twinsun.com>
10594
10595 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10596 and return properly parenthesized result.
10597 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10598 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10599 Remove unnecessary parentheses from uses.
10600 * doc/bison.texinfo (Location Default Action): Describe the
10601 conventions for parentheses.
10602
cd05d13c
PE
106032003-06-19 Paul Eggert <eggert@twinsun.com>
10604
81fd08ca
PE
10605 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10606 yyreportTree): Do not assume that size_t is the same width as int,
10607 when printing sizes. Print sizes using an unsigned format.
10608 Problem reported by Frank Heckenbach in
161a71f3 10609 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 10610
cd05d13c
PE
10611 Port to Forte Developer 7 C compiler.
10612 * data/glr.c (struct YYLTYPE): If locations are not being used,
10613 declare a single dummy member, as empty structs do not conform
10614 to the C standard.
10615 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10616 the Forte Developer 7 C compiler complains that end-of-loop
10617 code is not reached.
10618
4dcf140b
PE
106192003-06-17 Paul Eggert <eggert@twinsun.com>
10620
10621 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10622 avoid warnings from picky compilers about redefinition of PARAMS.
10623
8dd76bee
PE
106242003-06-17 Paul Eggert <eggert@twinsun.com>
10625
10626 Version 1.875b.
10627
10628 * NEWS: Document 1.875b.
10629
10630 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10631 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10632 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10633 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10634 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10635 per recent gettext manual's suggestion.
10636 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10637 Use prototypes, not old-style definitions.
10638 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10639 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10640 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10641 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10642 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10643 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10644 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10645 vbitset_or_and_cmp, vbitset_copy): Likewise.
10646
10647 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10648 Do not include <stdlib.h>.
10649 (PARAMS): Define unconditionally for C89.
10650 (ATTRIBUTE_NORETURN): Remove.
10651 (ATTRIBUTE_UNUSED): Define unconditionally.
10652
10653 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 10654 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
10655 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10656 * lib/vbitset.c, lib/vbitset.h: New files.
10657 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10658 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10659 from libbitset.
10660
10661 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10662 `How Can I Reset @code{yyparse}', since texinfo does not allow
10663 arbitrary @ in node names.
10664
10665 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10666 shouldn't be needed according to the gettext 0.12.1 documentation
10667 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 10668 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 10669 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 10670 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 10671
8dd76bee
PE
10672 * lib/.cvsignore: Add stdbool.h.
10673 * m4/.cvsignore: Add nls.m4, po.m4.
10674
10675 Upgrade to CVS gnulib.
10676 * stdbool_.h: File renamed from stdbool.h.in.
10677 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10678 AC_HEADER_STDBOOL.
10679 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10680 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10681 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10682 (MOSTLYCLEANFILES): New var.
10683 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10684 (stdbool.h): New rule.
10685 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10686 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10687 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10688 m4/quote.m4: Upgrade to today's gnulib.
10689
10690 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10691 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10692 the tests right now.
10693 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10694 yyerror are declared before use; C99 requires this.
10695
25005f6a
PH
106962003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10697
10698 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10699 first.
10700 (yyrecoverSyntaxError): Correct the logic for setting and testing
10701 yyerrState.
10702 Correct comment on handling EOF.
10703 Allow states with only a default reduction, rather than failing
8dd76bee 10704 (I can't quite reconstruct why these were not allowed before).
25005f6a 10705
137437c6 10706 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 10707 buffer overruns, corrupting state.
8dd76bee
PE
10708
10709 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
10710 definition.
10711 * src/reader.h (max_left_semantic_context): New variable declaration.
10712 * src/scan-gram.l (max_left_semantic_context): Define.
10713 (handle_action_dollar): Update max_left_semantic_context.
10714 * data/glr.c (YYMAXLEFT): New definition.
10715 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10716 (yyresolveAction): Ditto.
10717
10718 Fixes to problems with location handling in GLR parsers reported by
10719 Frank Heckenbach (2003/06/05).
10720
10721 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10722 (YYRHSLOC): Add parentheses, and define only if locations used.
10723 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10724 locations not used.
10725 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10726 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 10727
25005f6a
PH
10728 * tests/cxx-type.at: Exercise location information; update tests
10729 to differentiate output with and without locations.
8dd76bee 10730 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
10731 because default YYLTYPE not yet defined.
10732 Change semantic actions to compute strings, rather than printing
10733 them directly (to test proper passing of semantics values). Change
10734 output to prefix notation and update test data and expected results.
10735 (yylex): Track locations.
10736 (stmtMerge): Return value rather than printing, and include arguments
10737 in value.
8dd76bee 10738
711f40b7
PE
107392003-06-03 Paul Eggert <eggert@twinsun.com>
10740
10741 Avoid warnings generated by GCC 2.95.4 when Bison is
10742 configured with --enable-gcc-warnings.
10743 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10744 yy::]b4_parser_class_name[::translate_,
10745 yy::Stack::operator[] (unsigned),
10746 yy::Stack::operator[] (unsigned) const,
10747 yy::Slice::operator[] (unsigned),
10748 yy::Slice::operator[] (unsigned) const):
10749 Rename local vars to avoid warnings.
10750 * tests/glr-regression.at (Improper handling of embedded actions
10751 and $-N in GLR parsers): Remove unused local variable from yylex.
10752 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10753 (void) as arg when not pure, since we now assume C89 when building
10754 Bison. Pacify GCC by using parameter.
10755
ac695f7d
PE
107562003-06-02 Paul Eggert <eggert@twinsun.com>
10757
10758 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10759 yy::Location::lines, yy::Location::columns): Rename arguments
10760 to avoid shadowing; this removes a warning generated by GCC 3.3.
10761
26ec81e0
PE
107622003-06-01 Paul Eggert <eggert@twinsun.com>
10763
10764 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10765 to g++, as GCC 3.3 complains if you do it.
10766 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10767 everything that WARNING_CFLAGS has, except omit warnings
10768 not suitable for C++.
10769 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10770 * tests/atlocal.in (CXXFLAGS): New var.
10771 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10772
10773 Fix a GLR parser bug I reported in February; see
161a71f3 10774 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
10775 The problem was that GLR parsers did not conform to the C standard,
10776 because actions like { $1 = $2 + $3; } expanded to expressions
10777 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10778 to a local variable. The C standard says that expressions
10779 like (var = f ()) + (var = f ()) have undefined behavior.
10780 Another problem was that GCC sometimes issues warnings that
10781 yyfill and its parameters are unused.
10782
10783 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10784 as possibly unused.
10785 (yyfill): New function.
10786 (YYFILL): Use it.
10787 (yyuserAction): Change type of yynormal to bool, so that it matches
10788 the new yyfill signature. Mark it as possibly unused.
10789
10790
10791 Follow up on a bug I reported in February, where a Bison-generated
10792 parser can loop. Provide a test case and a fix for yacc.c. I
10793 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10794 The original bug report is in:
161a71f3 10795 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
10796
10797 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10798 macro's size was becoming unwieldy.
10799 (yyerrlab): Do not discard an empty lookahead symbol, as this
10800 might destroy garbage.
10801 (yyerrorlab): New label, with the old contents of YYERROR,
10802 plus the following change: pop the stack of rhs corresponding
10803 to the production that invoked YYERROR. That is how Yacc
10804 behaves, and POSIX requires this behavior.
10805 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10806 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10807 Define 'alarm' to do nothing if unistd.h is not available.
10808 Add a new rule "exp: '-' error;" to test the above change to
10809 data/yacc.c. Use 'alarm' to abort any test taking longer than
10810 10 seconds, as it's probably looping.
10811 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10812 Also, the new yacc.c generates two fewer diagnostics for an
10813 existing test.
10814
d0829076
PE
108152003-05-24 Paul Eggert <eggert@twinsun.com>
10816
c6ae27df
PE
10817 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10818 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10819 This fixes a problem reported by John Bowman when the Compaq/HP
10820 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10821 -ansi -Wall -gall).
10822 * data/yacc.c (union yyalloc): Likewise.
10823 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 10824
d0829076
PE
10825 Switch from 'int' to 'bool' where that makes sense.
10826
10827 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10828 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10829 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10830 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10831 Return or accept bool, not int. All callers changed.
10832 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10833 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10834 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10835 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10836 bitset_or_and_cmp_): Likewise.
10837 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10838 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10839 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10840 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10841 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10842 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10843 bitset_stats_or_and_cmp): Likewise.
10844 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10845 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10846 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10847 ebitset_xor_cmp): Likewise.
10848 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10849 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10850 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10851 lbitset_xor_cmp): Likewise.
10852 * lib/bbitset.h: Include <stdbool.h>.
10853 (struct bitset_vtable): The following members now return bool, not
10854 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10855 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10856 or_and_cmp).
10857 * src/conflicts.c (count_rr_conflicts): Likewise.
10858 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10859 All uses changed.
10860 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10861 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10862 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10863 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10864 graph_flag): Likewise.
10865 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10866 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10867 graph_flag): Likewise.
10868 * src/output.c (error_verbose): Likewise.
10869 * src/output.h (error_verbose): Likewise.
10870 * src/reader.c (start_flag, typed): Likewise.
10871 * src/reader.h (typed): Likewise.
10872 * src/getargs.c (LOCATIONS_OPTION): New constant.
10873 (long_options, getargs): Use it.
10874 * src/lalr.c (build_relations): Use bool, not int.
10875 * src/nullable.c (nullable_compute): Likewise.
10876 * src/print.c (print_reductions): Likewise.
10877 * src/tables.c (action_row, pack_vector): Likewise.
10878 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
10879 * src/output.c (prepare): Use it.
10880 * src/output.c (token_definitions_output,
10881 symbol_destructors_output, symbol_destructors_output): Use string,
10882 not boolean integer, to keep track of whether to output separator.
10883 * src/print_graph.c (print_core): Likewise.
10884 * src/state.c (state_rule_lookaheads_print): Likewise.
10885
10886 * config/install-sh: Sync from automake 1.7.5.
10887
6b2584b7
PE
108882003-05-14 Paul Eggert <eggert@twinsun.com>
10889
10890 * src/parse-gram.y (rules_or_grammar_declaration): Require a
10891 semicolon after a grammar declaration, in the interest of possible
10892 future changes to the Bison input language.
10893 Do not allow a stray semicolon at the start of the grammar.
10894 (rhses.1): Allow one or more semicolons after any rule, including
10895 just before "|" as required by POSIX.
10896 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
10897 grammar.
10898
caf37a36
ADL
108992003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
10900
10901 %parse-param support for lalr1.cc.
10902
10903 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
10904 b4_cc_constructor_calls, b4_cc_constructor_call,
10905 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
10906 definitions.
10907 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
10908 parse-param arguments.
10909 (yy::b4_parser_class_name): Declare instance variables to
10910 hold parse-param arguments.
10911 * tests/calc.at: s/value/semantic_value/ because value clashes
10912 with a member of yy::b4_parser_class_name. Adjust C++ code
10913 to handle %parse-param. Enable %parse-param test in C++.
10914
3ab37077
PE
109152003-05-12 Paul Eggert <eggert@twinsun.com>
10916
10917 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
10918 English a bit. Fix fclose typo. Change "const char" to "char
10919 const", and use ANSI C rather than K&R for "main". Suggest
10920 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
10921 and suggest yy_switch_to_buffer.
10922
109232003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
10924
10925 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
10926 C89. This avoids a diagnostic on compilers that define __STDC__
10927 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 10928 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 10929
e743727f
PE
109302003-05-03 Paul Eggert <eggert@twinsun.com>
10931
10932 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
10933 Do not overrun array bounds.
10934 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 10935 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 10936
916708d5
AD
109372003-04-29 Akim Demaille <akim@epita.fr>
10938
10939 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
10940 * src/getargs.c, src/getargs.h: here, as bool, not int.
10941 (nondeterministic_parser): New.
10942 * src/parse-gram.y, src/scan-gram.l: Support
10943 %nondeterministic-parser.
10944 * src/output.c (prepare): Use nondeterministic_parser instead
10945 of glr_parser where appropriate.
10946 * src/tables.c (conflict_row, action_row, save_row)
10947 (token_actions, token_actions, pack_vector): Ditto.
10948
a06ea4aa
AD
109492003-04-29 Akim Demaille <akim@epita.fr>
10950
10951 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
10952
211074ca
AD
109532003-04-29 Akim Demaille <akim@epita.fr>
10954
10955 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
10956 with %pure-parser and %locations to exercise the patch from Yakov
10957 Markovitch below.
10958
6175ffe3
PE
109592003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
10960
10961 * data/yacc.c: (b4_lex_param): Corrected for the case where
10962 %lex-param is provided and %pure-parser isn't.
10963
b1e95857
PE
109642003-04-27 Paul Eggert <eggert@twinsun.com>
10965
10966 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 10967 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
10968 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
10969 if it is not defined.
10970 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
10971
acda9df6
PE
109722003-04-26 Paul Eggert <eggert@twinsun.com>
10973
3470c57b
PE
10974 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
10975 Declare to be of type suitable for the ninf value itself, not of
10976 type suitable for the corresponding table, since the latter might
10977 be unsigned but the ninf value might be negative. This fixes a
10978 bug reported by Alexandre Duret-Lutz in
161a71f3 10979 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 10980
acda9df6
PE
10981 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
10982 invokes it. We shouldn't invoke it twice because it will attempt
10983 to put error.o in the archive twice. This fixes a glitch reported
10984 by Martin Mokrejs in
161a71f3 10985 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 10986
b5250f26
PE
109872003-04-21 Paul Eggert <eggert@twinsun.com>
10988
10989 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
10990 to gnulib.
10991
089ac0f1
PE
109922003-04-21 Yakov Markovitch <Markovitch@iso.ru>
10993
10994 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
10995 Fix obvious typo that results in uncompilable GLR parsers
10996 when both %pure-parser and %locations are used. (trivial change)
10997
5ededac6
PE
109982003-04-17 Paul Eggert <eggert@twinsun.com>
10999
1b8f2fff
PE
11000 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11001 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11002 Do not insert the expected token via unput, as this runs afoul
11003 of a POSIX-compatibility bug in flex 2.5.31.
11004 All uses changed to BEGIN the parent state,
11005 since we no longer insert the expected token via unput.
11006 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11007 that is no longer emitted after the above change.
11008
5ededac6
PE
11009 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11010 the first one. This change is from Paul Hilfinger, and it fixes
11011 regression reported by Werner Lemberg in
161a71f3 11012 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
11013
11014 (resolve_sr_conflict): Don't invoke state_errs_set
11015 unless one or more tokens have been explicitly made errors.
11016 Otherwise, the above change causes Bison to abort.
11017
11018 * tests/existing.at (GNU pic Grammar): New test case, taken from
11019 Lemberg's email.
11020
b8be9132
AD
110212003-03-31 Akim Demaille <akim@epita.fr>
11022
11023 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11024
d423d460
AD
110252003-03-31 Akim Demaille <akim@epita.fr>
11026
11027 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11028 output.
11029
c7e441b4
AD
110302003-03-31 Akim Demaille <akim@epita.fr>
11031
11032 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11033 From Paul Hilfinger.
11034
231897ad
AD
110352003-03-29 Akim Demaille <akim@epita.fr>
11036
11037 * m4/error.m4: Do not put under dynamic conditions some code which
11038 expansion is under static control.
11039
5b066063
AD
110402003-03-29 Akim Demaille <akim@epita.fr>
11041
11042 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11043
22a74fec
AD
110442003-03-29 Akim Demaille <akim@epita.fr>
11045
11046 * doc/bison.texinfo (Strings are Destroyed): New.
11047
0eee27e7
PE
110482003-03-13 Paul Eggert <eggert@twinsun.com>
11049
11050 * .cvsignore: Add configure.lineno.
11051 * src/.cvsignore: Add yacc.
11052 * tests/.cvsignore: Add testsuite.log.
11053 * doc/fdl.texi: Sync with latest FSF version.
11054
f61aad93
PE
110552003-03-12 Paul Eggert <eggert@twinsun.com>
11056
537636c7
PE
11057 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11058 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11059 cursor, instead of leaving it undefined. This fixes a bug
11060 reported by Tim Van Holder in
161a71f3 11061 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
11062 * tests/input.at (Torturing the Scanner): Test the scanner on
11063 an empty input file, which was Tim Van Holder's test case.
11064
11065 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11066 <sys/resource.h> can be included, include sys/time.h and
11067 sys/times.h first, if available. This works around the SunOS
11068 4.1.4 porting bug reported by Bruce Becker in
161a71f3 11069 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
11070
11071 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11072 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11073 AC_HEADER_SYS_WAIT.
11074
f61aad93
PE
11075 Merge changes from gnulib. This was prompted because the CVS
11076 snapshot didn't build on Solaris 7 due to strnlen problems.
11077
11078 These changes need to be merged back into gnulib:
11079 * lib/hash.c: Include <stdbool.h> unconditionally.
11080 * m4/onceonly.m4 (m4_quote): New macro.
11081 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11082 Quote AC_FOREACH variable-expansions properly.
11083 The 2003-01-03 obstack.h change also needs merging.
11084 {end of changes requiring merging}
5b066063 11085
f61aad93
PE
11086 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11087 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11088 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11089 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11090 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11091 New files, imported from gnulib.
11092 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11093 above.
11094
11095 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11096 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11097 gnulib sources.
11098
11099 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11100 Add.
11101 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11102 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11103 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11104 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11105 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11106 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11107 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11108 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11109 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11110 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11111 (jm_PREREQ_ARGMATCH): Remove.
11112 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11113 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11114
11115 * src/system.h: Include <stdbool.h> unconditionally.
11116
11117 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11118 assuming at least C89 in the bitset code for some time now.
11119
d2ffe116
AD
111202003-03-03 Akim Demaille <akim@epita.fr>
11121
11122 * ro.po: New.
11123
052826fd
AD
111242003-03-02 Akim Demaille <akim@epita.fr>
11125
11126 * doc/bison.texinfo (Table of Symbols): Reactivate the
11127 documentation for %lex-param, and %parse-param.
11128
c4749565
AD
111292003-03-02 Akim Demaille <akim@epita.fr>
11130
11131 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11132 generate verbose error messages.
11133 Use the number of tokens as an upper bound in yytname, as it
11134 cannot be a non terminal.
11135
d5286af1
AD
111362003-03-02 Akim Demaille <akim@epita.fr>
11137
11138 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11139 message.
11140
22e304a6
AD
111412003-03-02 Akim Demaille <akim@epita.fr>
11142
22e304a6
AD
11143 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11144 Use them to exercise yycheck overrun.
11145 Based on Andrew Suffield's grammar.
11146
67a25fed
AD
111472003-03-02 Akim Demaille <akim@epita.fr>
11148
11149 Create tests/local.at for Bison generic testing macros.
11150
11151 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11152 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11153 This new file.
11154 * tests/calc.at (AT_CHECK_CALC): Adjust.
11155 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11156 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11157 * tests/local.at: here.
11158 (AT_COMPILE_CXX): Tags the tests using it as c++.
11159 Ignore the test if CXX is not functional.
11160
9c2b381f
PE
111612003-03-01 Paul Eggert <eggert@twinsun.com>
11162
11163 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11164 not loc->end, since loc->end might contain garbage and this leads
11165 to undefined behavior on some platforms.
11166 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11167 depend on *loc, so that the reader doesn't give the the false
11168 impression that *loc is initialized.
11169 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11170 does not survive the return.
11171
0433ba88
AD
111722003-03-01 Akim Demaille <akim@epita.fr>
11173
11174 * src/scan-gram.l (code_start): Always initialize it when entering
11175 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11176 yylex invocation. An alternative would be making it static, but
11177 then it starts with the second %%'s beginning, instead of its end.
11178
b305ea69
PE
111792003-02-28 Paul Eggert <eggert@twinsun.com>
11180
11181 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11182 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 11183 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 11184
c3d25e01
PE
111852003-02-26 Paul Eggert <eggert@twinsun.com>
11186
11187 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11188 Remove Sequent/Pyramid discussion (nobody uses them any more).
11189 Merge VMS and MS-DOS discussion; these ports may well be dead
11190 but let's keep mentioning them for now. Put <> around email
11191 addresses. Add copyright notice.
11192
c267ffbc
PE
111932003-02-24 Paul Eggert <eggert@twinsun.com>
11194
11195 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11196 to avoid collision with flex use of yylineno.
11197 Problem reported by Bruce Lilly in
161a71f3 11198 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
11199 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11200 * data/yacc.c (yy_reduce_print): Likewise.
11201
11202 * config/depcomp: Sync with Automake 1.7.3.
11203
f939fc12
AD
112042003-02-21 Akim Demaille <akim@epita.fr>
11205
11206 * data/lalr1.cc: Use temporary variables instead of casts to
11207 change integer types.
11208 Suggested by Paul Eggert.
11209
95923bd6
AD
112102003-02-21 Akim Demaille <akim@epita.fr>
11211
11212 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11213 to avoid confusions with lalr1.cc's notion of Position.
11214 Suggested by Paul Eggert.
11215
2cdc240e
AD
112162003-02-20 Akim Demaille <akim@epita.fr>
11217
11218 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11219 before initial_columns.
11220 (location.hh): Use consistent variable names when defining the
11221 operator<<.
11222 Use "last" so that we subtract from Positions, not from unsigned.
11223
5d003116
AD
112242003-02-20 Akim Demaille <akim@epita.fr>
11225
11226 * data/lalr1.cc (position.hh): New subfile, including the extended
11227 and Doxygen'ed documentation of class Position.
11228 (location.hh): Use it.
11229 Document a` la Doxygen.
ba1ecc07 11230 With the help of Benoit Perrot.
5d003116 11231
d02b25f9
AD
112322003-02-20 Akim Demaille <akim@epita.fr>
11233
11234 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11235 AT_YACC_IF.
11236 Redefine AT_YYERROR_SEES_LOC_IF using it.
11237 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11238 not defined.
11239 Don't use the location in yy::Parser::error_ and
11240 yy::Parser::print_ when not %locations.
11241 Activate more lalr1.cc tests.
11242
0d1c3a04
AD
112432003-02-19 Akim Demaille <akim@epita.fr>
11244
11245 * data/lalr1.cc: When displaying a line number, be sure to make it
11246 an int.
11247
60a777aa
AD
112482003-02-19 Akim Demaille <akim@epita.fr>
11249
11250 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11251 Remove, useless.
11252 (YYABORT, YYACCEPT, YYERROR): New.
11253 * tests/calc.at: Renable the lalr1.cc test.
11254
0b86fc41
AD
112552003-02-19 Akim Demaille <akim@epita.fr>
11256
11257 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11258 error recovery, mixing with/without pops and discarding of the
11259 lookahead.
11260 Exercise YYERROR.
11261 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11262
da99a5dc
PE
112632003-02-17 Paul Eggert <eggert@twinsun.com>
11264
11265 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11266 * tests/testsuite.at (AT_COMPILE): Use them.
11267 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 11268 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 11269
93b8c255
PE
112702003-02-12 Paul Eggert <eggert@twinsun.com>
11271
11272 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11273 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 11274 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
11275 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11276 Check for malloc failure, for consistency with yacc.c.
11277 (yytname_size): Remove, for consistency with yacc.c.
11278
11279 The bug still remains in data/lalr1.cc, as I didn't have time
11280 to fix it there.
11281
7548fed2
AD
112822003-02-06 Akim Demaille <akim@epita.fr>
11283
11284 * configure.ac (GXX): Rename as...
11285 (CXX): this, to keep the original Autoconf semantics.
11286 Require 2.57.
11287 * data/lalr1.cc: Fix b4_copyright invocations.
11288 If YYDEBUG is not defined, don't depend upon name_ being defined.
11289 (location.hh): Include string and iostream.
11290 (Position::filename): New member.
11291 (Position::Position ()): New.
11292 (operator<< (Position)): New.
11293 (operator- (Position, int)): New.
11294 (Location::first, Location::last): Rename as...
11295 (Location::begin, Location::end): these, to mock the conventional
11296 iterator names.
11297 (operator<< (Location)): New.
11298 * tests/atlocal.in (CXX): New.
11299 * tests/testsuite.at (AT_COMPILE_CXX): New.
11300 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11301 locations in a more synthetic way.
11302 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11303 lalr1.cc is used.
11304 Adjust the C locations to match those from Emacs: first column is
11305 column 0.
11306 Change all the expected results.
11307 Conform to the GCS: simplify the locations when applicable.
11308 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11309 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11310 these CPP macros with the m4 macros new defined by...
11311 (AT_CHECK_PUSHDEFS): this, i.e.:
11312 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 11313 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
11314 New macros.
11315 (AT_CHECK_POPDEFS): Undefine them.
11316 (AT_CHECK_CALC_LALR1_CC): New.
11317 Use it for the first lalr1.cc test.
11318
43a176ef
AD
113192003-02-04 Akim Demaille <akim@epita.fr>
11320
11321 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11322 Location as is defined.
11323
fc049e9c
AD
113242003-02-04 Akim Demaille <akim@epita.fr>
11325
11326 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11327 name_ being defined.
11328
a737b216
PE
113292003-02-03 Paul Eggert <eggert@twinsun.com>
11330
11331 * src/gram.h (start_symbol): Remove unused decl.
11332
11333 Use more-consistent naming conventions for local vars.
11334
11335 * src/derives.c (derives_compute): Change type of local var from
11336 int to rule_number.
11337 * src/gram.c (grammar_rules_partial_print): Likewise.
11338 * src/print.c (print_core): Likewise.
11339 * src/reduce.c (reduce_grammar_tables): Likewise.
11340
11341 * src/gram.c (grammar_dump): Change name of item_number *
11342 local var from r to rp.
11343 * src/nullable.c (nullable_compute): Likewise.
11344
11345 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11346
11347 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11348 for symbol or symbol_number var.
11349 * src/reader.c (grammar_start_symbol_set): Likewise.
11350 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11351 Likewise.
11352 * src/state.c (transitions_to): Likewise.
11353 * src/state.h: Likewise.
11354 * src/tables.c (symbol_number_to_vector_number): Likewise.
11355
11356 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11357 char * var.
11358
11359 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11360 var.
11361
11362 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11363 var.
11364
11365 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11366 Use str, not s, for char * var. Use ch, not c, for character var.
11367 Use size for size var.
11368
11369 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11370 char * var.
11371 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11372 uniqstr var.
11373 * src/uniqstr.h: Likewise.
11374
11375 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11376 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11377 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11378 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11379 param to have same name as that of enum, so that we don't use
11380 "s" to stand for a non-state.
11381
68e93ad5
AD
113822003-02-02 Akim Demaille <akim@epita.fr>
11383
11384 * src/scan-skel.l: Scan more than one inert character per yylex
11385 invocation.
11386
92898986
PE
113872003-02-01 Paul Eggert <eggert@twinsun.com>
11388
11389 Version 1.875a.
11390
1d9d5d71
PE
11391 * po/LINGUAS: Add ms.
11392
0435d061
AD
113932003-01-30 Akim Demaille <akim@epita.fr>
11394
11395 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11396
6029a57f
PH
113972003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11398
11399 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11400 of $1.
0435d061
AD
11401
11402 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 11403 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 11404 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 11405
6029a57f
PH
11406 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11407 (b4_rhs_location): Ditto.
0435d061 11408 (yyfill): New function to copy from stack tree into array
6029a57f 11409 incrementally.
0435d061
AD
11410 (yyuserAction): Modify to allow incremental move of semantic values
11411 to rhs array when in GLR mode.
11412 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
11413 as needed.
11414 Remove dummy use of yystack, as there is now a guaranteed use.
11415 (yydoAction): Modify to allow incremental move of semantic values
11416 to rhs array when in GLR mode.
11417 (yyresolveAction): Ditto.
11418 (yyglrShiftDefer): Update comment.
0435d061 11419 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
11420 (yyglrReduce): Ditto.
11421 (yydoAction): Ditto
0435d061 11422
6029a57f
PH
11423 * tests/glr-regr1.at: Rename to ...
11424 * tests/glr-regression.at: Add new regression test for the problems
11425 described above (adapted from S. Eken).
11426 Update copyright notice.
11427 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11428 * tests/Makefile.am: Ditto.
11429
6cee6297
PE
114302003-01-28 Paul Eggert <eggert@twinsun.com>
11431
11432 * data/lalr1.cc: Do not use @output_header_name@ unless
11433 b4_defines_flag is set. This fixes two bugs reported by
11434 Tim Van Holder in
161a71f3
PE
11435 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11436 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 11437
b2a836b5
PE
114382003-01-21 Paul Eggert <eggert@twinsun.com>
11439
11440 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11441 we don't need to worry about yyerrlab1 being reported as an
11442 "unused label" by non-GCC C compilers. The downside is that if
11443 locations are used then a couple of statements are duplicated each
11444 time YYERROR is invoked, but the upside is that the warnings
11445 should vanish.
11446 (yyerrlab1): Move code to YERROR.
11447 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11448 This reverts some of the 2002-12-27 change.
11449
4196b931
PE
114502003-01-17 Paul Eggert <eggert@twinsun.com>
11451
11452 * src/output.c (symbol_printers_output): Fix typo that led
11453 to core dump. Problem reported by Antonio Rus in
161a71f3 11454 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 11455
3ae831b4
AD
114562003-01-13 Akim Demaille <akim@epita.fr>,
11457 Quoc Peyrot <chojin@lrde.epita.fr>,
11458 Robert Anisko <anisko_r@lrde.epita.fr>
11459
11460 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11461 when the stacks contain one element, as the loop would otherwise
11462 free the last state, and then use the top state (the one we just
11463 popped). This means that the initial elements will not be freed
11464 explicitly, as is the case in yacc.c; it is not a problem, as
11465 these elements have fake values.
11466
e3aa65c5
PE
114672003-01-11 Paul Eggert <eggert@twinsun.com>
11468
11469 * NEWS: %expect-violations are now just warnings, reverting
11470 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11471 bootstrapping problem reported by Matthias Klose; see
161a71f3 11472 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
11473 * src/conflicts.c (conflicts_print): Likewise.
11474 * tests/conflicts.at (%expect not enough, %expect too much,
11475 %expect with reduce conflicts): Likewise.
11476 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11477 that the warning is enabled if the number of conflicts changes
11478 (not necessarily increases).
11479
11480 * src/getargs.c (version): Update copyright year.
11481
f0057011
AD
114822003-01-09 Akim Demaille <akim@epita.fr>
11483
11484 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11485
1ee6d2a0
PE
114862003-01-08 Paul Eggert <eggert@twinsun.com>
11487
11488 * Makefile.maint (WGETFLAGS):
11489 New macro, containing "-C off" to disable proxy caches.
11490 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11491 (rel-check): Use $(WGET) instead of wget.
11492
d4fd77c4
PE
114932003-01-06 Paul Eggert <eggert@twinsun.com>
11494
11495 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11496 the GLR paper of Scott, Johnstone and Hussain.
11497
464c6927
PE
114982003-01-04 Paul Eggert <eggert@twinsun.com>
11499
d600ee67
PE
11500 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11501 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11502 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11503 (EXTRA_LIBRARIES): New var, for liby.a.
11504 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11505 (EXTRA_SCRIPTS): New var, for yacc.
11506
464c6927
PE
11507 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11508 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11509 Problem reported by Nelson H. F. Beebe.
11510
115112003-01-03 Paul Eggert <eggert@twinsun.com>
11512
11513 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11514 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11515 when compiling Bison 1.875's `bitset bset = obstack_alloc
11516 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11517
11518 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11519 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11520 grow to a huge size with typical invocation.
d600ee67 11521
464c6927
PE
11522 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11523 Use the pattern recommended by Autoconf 2.57, except also protect
11524 against double-definition.
11525 * src/system.h: Likewise.
11526 Portability issues reported by Nelson H. F. Beebe.
d600ee67 11527
464c6927
PE
11528 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11529 All uses changed. Provide a definition in both C and C++.
11530 (yytrue, yyfalse): Define even if defined (__cplusplus).
11531
11532 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11533 Reported by Nelson H. F. Beebe.
d600ee67 11534
464c6927
PE
11535 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11536
0f42c7d5
PE
115372003-01-02 Paul Eggert <eggert@twinsun.com>
11538
11539 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11540 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11541 Bug reported by Nelson H. F. Beebe.
11542
dc546b0f
PE
115432003-01-01 Paul Eggert <eggert@twinsun.com>
11544
11545 * Version 1.875.
11546
2c09b6a7
PE
115472002-12-30 Paul Eggert <eggert@twinsun.com>
11548
11549 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11550 Moved here from...
11551 (<INITIAL>","): Here. This causes stray "," to be treated
11552 more uniformly.
11553
dc546b0f 11554 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
11555 last brace in braced code when not in Yacc mode, for compatibility
11556 with Bison 1.35. This resurrects the 2001-12-15 patch to
11557 src/reader.c.
11558
11559 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11560 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11561
535c0f63
PE
115622002-12-28 Paul Eggert <eggert@twinsun.com>
11563
11564 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11565 that of SYM's type. This fixes Debian bug 168069, reported by
11566 Thomas Olsson.
d600ee67 11567
963fcc17
PE
115682002-12-28 Paul Eggert <eggert@twinsun.com>
11569
11570 Version 1.75f.
11571
11572 Switch back to the Yacc style of conflict reports, undoing some
11573 of the 2002-07-30 change.
11574 * doc/bison.texinfo (Understanding): Use Yacc style for
11575 conflict reports. Also, use new way of locating rules.
11576 * src/conflicts.c (conflict_report):
11577 Renamed from conflict_report_yacc, removing the old
11578 'conflict_report'. Translate the entire conflict report at once,
11579 so that we don't assume that "," has the same interpretation in
11580 all languages.
11581 (conflicts_output): Use Yacc-style conflict report for each state,
11582 instead of our more-complicated style.
11583 (conflicts_print): Use Yacc-style conflict report, except print
11584 the input file name when not emulating Yacc.
11585 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11586 Conflicted Reduction, %expect not enough, %expect too much,
11587 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11588 * tests/existing.at (GNU Cim Grammar): Likewise.
11589 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11590
11591 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11592 fatal): Don't invoke fflush; it's not needed and it might even be
11593 harmful for stdout, as stdout might not be open.
11594 * src/reduce.c (reduce_print): Likewise.
11595
b1efe548
PE
115962002-12-27 Paul Eggert <eggert@twinsun.com>
11597
11598 Fix a bug where error locations were not being recorded correctly.
11599 This problem was originally reported by Paul Hilfinger in
161a71f3 11600 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
11601
11602 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11603 top of the location stack's error locations.
11604 (yyerrlab): Set it. When discarding a token, push its location
11605 onto yylerrsp so that we don't lose track of the error's end.
11606 (yyerrlab1): Now is only the target of YYERROR, so that we can
11607 properly record the location of the action that failed. For GCC
11608 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11609 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11610 (yyerrlab2): New label, which yyerrlab now falls through to.
11611 Compute the error's location by applying YYLLOC_DEFAULT to
11612 the locations of all the symbols that went into the error.
11613 * doc/bison.texinfo (Location Default Action): Mention that
11614 YYLLOC_DEFAULT is also invoked for syntax errors.
11615 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11616 Error locations include the locations of all the tokens that were
11617 discarded, not just the last token.
d600ee67 11618
983c5c2c
PE
116192002-12-26 Paul Eggert <eggert@twinsun.com>
11620
b1efe548
PE
11621 * src/files.c: Include quote.h.
11622 (compute_output_file_names): Warn if we detect conflicting
11623 outputs to the same file. This should catch the misunderstanding
11624 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11625
11626 * src/conflicts.c (conflicts_print): If the user specifies
11627 "%expect N", report an error if there are any reduce/reduce
11628 conflicts. This is what the manual says should happen.
11629 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11630 * tests/conflicts.at (%expect with reduce conflicts): New test.
11631
983c5c2c
PE
11632 Don't use m4_include on relative file names, as it doesn't work as
11633 desired if there happens to be a file with that name under ".".
d600ee67 11634
983c5c2c
PE
11635 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11636 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11637 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11638 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11639 * src/output.c (output_skeleton): Use full path names when
11640 specifying a file to include; don't rely on include path, as
11641 it's unreliable when the working file contains a file with
11642 that name.
d600ee67 11643
983c5c2c
PE
116442002-12-25 Paul Eggert <eggert@twinsun.com>
11645
11646 Remove obsolete references to bison.simple and bison.hairy.
11647 Problem mentioned by Aubin Mahe in
161a71f3 11648 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
11649 * data/glr.c: Comment fix.
11650 * doc/bison.1: Remove references. Also, mention "yacc".
11651
11652 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11653 with -g option.
11654
11655 * src/parse-gram.y (declaration): Use enum "report_states" rather
11656 than its numeric value 1.
11657
11658 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11659 opening a new one. This fixes Debian bug 165349, reported by
11660 Bruce Stephens.
11661
23f2d9dc
PE
116622002-12-24 Paul Eggert <eggert@twinsun.com>
11663
11664 Version 1.75e.
11665
11666 * Makefile.maint (cvs-update): Don't assume that the shell
11667 supports $(...), as Solaris sh doesn't.
11668
11669 * src/parse-gram.y (lloc_default): Remove test for empty
11670 nonterminals at the end, since it didn't change the result.
11671
116722002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
11673
11674 If the user does not define YYSTYPE as a macro, Bison now declares it
11675 using typedef instead of defining it as a macro. POSIX requires this.
11676 For consistency, YYLTYPE is also declared instead of defined.
11677
11678 %union directives can now have a tag before the `{', e.g., the
11679 directive `%union foo {...}' now generates the C code
11680 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11681 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11682 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11683 instead of `yyltype'.
11684
11685 `yystype' and `yyltype' are now obsolescent macros instead of being
11686 typedefs or tags; they are no longer documented and will be
11687 withdrawn in a future release.
11688
11689 * data/glr.c (b4_location_type): Remove.
11690 (YYSTYPE): Renamed from yystype.
11691 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11692 (struct YYLTYPE): Renamed from struct yyltype.
11693 (YYLTYPE): Renamed from yyltype.
11694 (yyltype, yystype): New (and obsolescent) macros,
11695 for backward compatibility.
11696 * data/yacc.c: Likewise.
11697
11698 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11699 does not specify a union tag. This is for compatibility with
11700 Solaris 9 yacc.
11701
11702 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11703 const *, since it is now modified by stripping surrounding { }.
11704 (current_braced_code): Remove.
11705 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11706 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11707 trailing " {...}". Now of type <chars>.
11708 (grammar_declaration): Adjust to bundled tokens.
11709 (code_content): Remove; stripping is now done by add_param.
11710 (print_token_value): Print contents of bundled tokens.
11711 (token_name): New function.
11712
11713 * src/reader.h (braced_code, current_braced_code): Remove.
11714 (token_name): New decl.
11715
11716 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11717 token_type, not braced_code code_kind. All uses changed.
11718 (SC_PRE_CODE): New state, for scanning after a keyword that
11719 has (or usually has) an immediately-following braced code.
11720 (token_type): New local var, to keep track of which token type
11721 to return when scanning braced code.
11722 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 11723 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
11724 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11725 instead of returning a token type immediately.
11726 (<INITIAL>"{"): Set token type.
11727 (<SC_BRACED_CODE>"}"): Use it.
11728 (handle_action_dollar, handle_action_at): Now returns bool
11729 indicating success. Fail if ! current_rule; this prevents a core dump.
11730 (handle_symbol_code_dollar, handle_symbol_code_at):
11731 Remove; merge body into caller.
11732 (handle_dollar, handle_at): Complain in invalid contexts.
11733
11734 * NEWS, doc/bison.texinfo: Document the above.
11735 * NEWS: Fix years and program names in copyright notice.
11736
879ca4f8
PE
117372002-12-17 Paul Eggert <eggert@twinsun.com>
11738
11739 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11740 Reporting, Table of Symbols): Omit mentions of %lex-param and
11741 %parse-param from the documentation for now.
11742
1c5fe69d
PE
117432002-12-15 Paul Eggert <eggert@twinsun.com>
11744
11745 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11746 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11747 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
11748 disagreed with the Bison documentation. Bug
11749 reported by Andrew Walrond.
d600ee67 11750
1c5fe69d
PE
11751 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11752 as the caller now does that.
11753 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11754 (YYEMPTY): Parenthesize right hand side, since others use it.
11755 (yyparse): Don't assume that our generated code is the only code
11756 that sets yychar.
11757
d1de5372
PE
117582002-12-13 Paul Eggert <eggert@twinsun.com>
11759
11760 Version 1.75d.
11761
11762 POSIX requires a "yacc" command.
11763 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11764 (MOSTLYCLEANFILES): Add yacc.
11765 (yacc): New rule.
1c5fe69d 11766 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
11767 as an alias for bison y.
11768
11769 * po/LINGUAS: Add da.
d600ee67 11770
d1de5372
PE
11771 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11772 problem with latest <getopt.h>.
11773 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11774
11775 * doc/fdl.texi: Upgrade to 1.2.
11776 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11777 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11778 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11779 gnulib.
11780 * config/install-sh: Sync with autotools.
11781
11782 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 11783 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
11784 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11785 locations are requested.
11786 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11787 locations are requested.
11788
d0f3fe23
PE
117892002-12-12 Paul Eggert <eggert@twinsun.com>
11790
11791 Remove unportable casts and storage allocation tricks.
11792 While we're at it, remove almost all casts, since they
11793 usually aren't needed and are a sign of trouble.
11794
11795 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11796
11797 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11798 the pointer DSET returned by malloc; this isn't portable.
11799 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11800 Similarly for DERIVES.
11801 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11802 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11803 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11804
11805 * src/derives.c (derives_compute): Do not bother invoking
11806 int_of_rule_number, since rule numbers are integers.
11807
11808 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11809 rather than XMALLOC (char, N).
11810
11811 * src/files.c (filename_split): Rewrite to avoid cast.
11812
11813 * src/gram.h (symbol_number_as_item_number,
11814 item_number_as_symbol_number, rule_number_as_item_number,
11815 item_number_as_rule_number):
11816 Now inline functions rather than macros, to avoid casts.
11817 * src/state.h (state_number_as_int): Likewise.
11818 * src/tables.c (state_number_to_vector_number,
11819 symbol_number_to_vector_number): Likewise.
11820
11821 * src/gram.h (int_of_rule_number): Remove; no longer used.
11822
11823 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11824 since the resulting storage is always stored into.
11825
11826 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11827 where it's needed.
11828
11829 * src/muscle_tab.c (muscle_m4_output):
11830 Now inline. Return bool, not int.
11831 * src/state.c (state_compare): Likewise.
11832 * src/symtab.c (symbol_check_defined,
11833 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11834 hash_compare_symbol, hash_symbol):
11835 Likewise.
11836 * src/uniqstr.c (uniqstr_print): Likewise.
11837 * src/muscle_tab.c (muscle_m4_output_processor):
11838 New function, to avoid casts.
11839 * src/state.c (state_comparator, stage_hasher): Likewise.
11840 * src/symtab.c (symbol_check_defined_processor,
11841 symbol_check_alias_consistency_processor, symbol_pack_processor,
11842 symbol_translation_processor, hash_symbol_comparator,
11843 hash_symbol_hasher): Likewise.
11844 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11845 * src/muscle_tab.c (muscles_m4_output):
11846 Use new functions instead of casting old functions unportably.
11847 * src/state.c (state_hash_new): Likewise.
11848 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11849 symbols_token_translations_init):
11850 Likewise.
11851 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11852
11853 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11854 var instead of casting to long, to avoid casts.
11855 (prepare_states): Use MALLOC rather than alloca, so that we don't
11856 have to worry about alloca.
11857 * src/state.c (state_hash_lookup): Likewise.
11858
11859 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11860 local var instead of casting to unsigned char, to avoid casts.
11861
11862 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11863 STATE_ALLOC): Remove.
11864 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11865 rather than calloc, and use offsetof to avoid allocating slightly
11866 too much storage.
11867 (state_new): Initialize all members.
11868
11869 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11870
11871 * src/symtab.c (symbol_free): Remove; unused.
11872 (symbol_get): Remove cast in lhs of assignment.
11873 (symbols_do): Now static. Accept generic arguments, not
11874 hashing-related ones.
11875
11876 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
11877 (symbol_processor): Remove.
11878 (symbols_do): Remove decl; now static.
11879
11880 * src/system.h (alloca): Remove; decl no longer needed.
11881 (<stddef.h>): Include, for offsetof.
11882 (<inttypes.>, <stdint.h>): Include if available.
11883 (uintptr_t): New type, if system lacks it.
11884 (CALLOC, MALLOC, REALLOC): New macros.
11885 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
11886 new macros.
11887
11888 * src/tables.c (table_size): Now int, to pacify GCC.
11889 (table_grow, table_ninf_remap): Use signed table size.
11890 (save_row): Don't bother initializing locals when not needed.
11891 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
11892 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
11893
11894 * src/vcg.h: Correct misspellings.
11895
11896 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
11897
11898
11899 * src/getargs.c (getargs): Don't assume EOF == -1.
11900
26b4a969
PE
119012002-12-09 Paul Eggert <eggert@twinsun.com>
11902
11903 Change identifier spellings to avoid collisions with names
11904 that are reserved by POSIX.
11905
11906 Don't use names ending in _t, since POSIX reserves them.
11907 For consistency, remove _e and _s endings -- they're weren't
11908 needed to remove ambiguity. All uses changed.
11909 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
11910 turn was just renamed from struniq_t.
11911 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
11912 which in turn was just renamed from struniq_processor_t.
11913 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
11914 in turn was renamed from hash_compare_struniq_t.
11915 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
11916 (state_list): Renamed from state_list_t.
11917 * src/assoc.h (assoc): Renamed from assoc_t.
11918 * src/conflicts.c (enum conflict_resolution): Renamed from
11919 enum conflict_resolution_e.
11920 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
11921 (rule_list): Renamed from rule_list_t.
11922 * src/getargs.h (enum trace): Renamed from enum trace_e.
11923 (enum report): Renamed from enum report_e.
11924 * src/gram.h (item_number): Renamed from item_number_t.
11925 (rule_number): Renamed from rule_number_t.
11926 (struct rule_s): Remove the "rule_s" part; not used.
11927 (rule): Renamed from rule_t.
11928 (rule_filter): Renamed from rule_filter_t.
11929 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
11930 (goto_list): Renamed from goto_list_t.
11931 * src/lalr.h (goto_number): Renamed from goto_number_t.
11932 * src/location.h (location): Renamed from location_t.
11933 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
11934 and moved here from:
11935 * src/muscle_tab.h (muscle_entry_t): here.
11936 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
11937 (rule_list): Renamed from rule_list_t.
11938 * src/print_graph.c (static_graph): Renamed from graph.
11939 * src/reader.h (braced_code): Renamed from braced_code_t.
11940 Remove brace_code_e tag.
11941 * src/relation.h (relation_node): Renamed from relation_node_t.
11942 (relation_nodes): Renamed from relation_nodes_t.
11943 (relation): Renamed from relation_t.
11944 * src/state.h (state_number): Renamed from state_number_t.
11945 (struct state): Renamed from struct state_s.
11946 (state): Renamed from state_t.
11947 (transitions): Renamed from transitions_t. Unused (and
11948 misspelled) transtion_s tag removed.
11949 (errs): Renamed from errs_t. Unused errs_s tag removed.
11950 (reductions): Renamed from reductions_t. Unused tag
11951 reductions_s removed.
11952 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
11953 (struct symbol_list): Renamed from struct symbol_list_s.
11954 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
11955 (struct symbol): Renamed from struct symbol_s.
11956 (symbol): Renamed from symbol_t.
11957 * src/tables.c (vector_number): Renamed from vector_number_t.
11958 (action_number): Renamed from action_t.
11959 * src/tables.h (base_number): Renamed from base_t.
11960 * src/vcg.h (enum color): Renamed from enum color_e.
11961 (enum textmode): Renamed from enum textmode_e.
11962 (enum shape): Renamed from enum shape_e.
11963 (struct colorentry): Renamed from struct colorentry_s.
11964 (struct classname): Renamed from struct classname_s.
11965 (struct infoname): Renamed from struct infoname_s.
11966 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
11967 (enum decision): Renamed from enum decision_e.
11968 (enum orientation): Renamed from enum orientation_e.
11969 (enum alignment): Renamed from enum alignment_e.
11970 (enum arrow_mode): Renamed from enum arrow_mode_e.
11971 (enum crossing_type): Renamed from enum crossing_type_e.
11972 (enum view): Renamed from enum view_e.
11973 (struct node): Renamed from struct node_s.
11974 (node): Renamed from node_t.
11975 (enum linestyle): Renamed from enum linestyle_e.
11976 (enum arrowstyle): Renamed from enum arrowstyle_e.
11977 (struct edge): Renamed from struct edge.
11978 (edge): Renamed from edge_t.
11979 (struct graph): Renamed from struct graph_s.
11980 (graph): Renamed from graph_t.
11981 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
11982 Rename value_t -> value.
11983 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
11984 value_t_as_yystype -> value_as_yystype.
11985
11986 Don't include <errno.h> in the mainstream code, since it
11987 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
11988 * lib/get-errno.c, lib/get-errno.h: New files.
11989 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
11990 get-errno.c.
11991 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
11992 * src/output.c (output_skeleton): Likewise.
11993 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
11994 instead of errno.
11995 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
11996 Likewise.
11997 (handle_action_dollar, handle_action_at): Likewise.
11998 * src/system.h: Do not include <errno.h>.
11999 (TAB_EXT): Renamed from EXT_TAB.
12000 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12001
12002 Avoid str[a-z]*, since <string.h> reserves that name space.
12003 Change all instances of "struniq" in names to "uniqstr", and
12004 likewise for "STRUNIQ" and "UNIQSTR".
12005 * src/uniqstr.c: Renamed from src/struniq.c.
12006 * src/uniqstr.h: Renamed from src/struniq.h.
12007 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12008 * src/files.c (strsuffix): Remove; unused.
12009 (concat2): Renamed from stringappend. Now static.
12010 * src/files.h (strsuffix, stringappend): Remove; unused.
12011 * src/parse-gram.y (<chars>): Renamed from <string>.
12012 (<uniqstr>): Renamed from <struniq>.
12013 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12014 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12015 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12016 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12017 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12018 (N_EXPAND): Renamed from N_STRETCH.
12019
12020 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12021 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12022 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12023 Remove; unused.
12024 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12025 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12026 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12027 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12028 (BASE_MAXIMUM): Renamed from BASE_MAX.
12029 (BASE_MINIMUM): Renamed from BASE_MIN.
12030 (ACTION_MAX): Remove; unused.
12031 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12032 Unnecessary casts removed from above defines.
12033
12034
12035 Fix misspelling in names.
12036 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12037 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12038 G_NODE_ALIGNEMENT.
12039
12040
12041 * lib/timevar.c (timevar_report): Renamed from time_report,
12042 for consistency with other names.
12043 * lib/timevar.h (timevar_report): New decl.
12044 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12045
12046
12047 Sort include-file uses.
12048
12049 Reorder all include files under src to be in the order "system.h".
12050 then the ../lib include files in angle brackets (alphabetized),
12051 then the . include files in double-quotes (alphabetized). Fix
12052 dependency breakages encountered in this process, as follows:
12053 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12054 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12055 * src/state.h: Include "symtab.h".
12056
996b1c7e
PE
120572002-12-08 Paul Eggert <eggert@twinsun.com>
12058
12059 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12060 since this causes problems when __file__ contains character
12061 sequences like "@" that are treated specially by src/scan-skel.l.
12062 Instead, just use the file's basename. This fixes the bug
12063 reported by Martin Mokrejs in
161a71f3 12064 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 12065
e19c4e5d
PE
120662002-12-06 Paul Eggert <eggert@twinsun.com>
12067
12068 Add support for rules that do not have trailing semicolons, as
12069 POSIX requires. Improve the quality of locations in Bison
12070 diagnostics.
26b4a969 12071
e19c4e5d
PE
12072 * src/location.c: Include <quotearg.h>.
12073 (empty_location): Now const.
12074 (location_print): New function. Follow the recommendation of the
12075 GNU Coding Standards for locations that span file boundaries.
12076 * src/location.h: Do not include <quotearg.h>; no longer needed.
12077 (boundary): New type.
12078 (location_t): Use it. This allows locations to span file boundaries.
12079 All member uses changed: file -> start.file or end.file (as needed),
12080 first_line -> start.line, first_column -> start.column,
12081 last_line -> end.line, last_column -> end.column.
12082 (equal_boundaries): New function.
12083 (LOCATION_RESET, LOCATION_STEP): Remove.
12084 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12085 (empty_location): Now const.
12086 (location_print): New decl.
12087 * src/parse-gram.y (lloc_default): New function, which handles
12088 empty locations more accurately.
12089 (YYLLOC_DEFAULT): Use it.
12090 (%token COLON): Remove.
12091 (%token ID_COLON): New token.
26b4a969 12092 (rules): Use it.
e19c4e5d
PE
12093 (declarations, rules): Remove trailing semicolon.
12094 (declaration, rules_or_grammar_declaration):
12095 Allow empty (";") declaration.
12096 (symbol_def): Remove empty actions; no longer needed.
12097 (rules_or_grammar_declaration): Remove trailing semicolon.
12098 (semi_colon.opt): Remove.
12099 * src/reader.h: Include location.h.
12100 (scanner_cursor): New decl.
12101 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12102 rolling our own.
12103 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12104 of *loc.
12105 (STEP): Remove. No longer needed, now that adjust_location does
12106 the work. All uses removed.
12107 (scanner_cursor): New var.
12108 (adjust_location): Renamed from extend_location. It now sets
12109 *loc and adjusts the scanner cursor. All uses changed.
12110 Don't bother testing for CR.
12111 (handle_syncline): Remove location arg; now updates scanner cursor.
12112 All callers changed.
12113 (unexpected_end_of_file): Now accepts start boundary of token or
12114 comment, not location. All callers changed. Update scanner cursor,
12115 not the location.
12116 (SC_AFTER_IDENTIFIER): New state.
12117 (context_state): Renamed from c_context. All uses changed.
12118 (id_loc, code_start, token_start): New local vars.
12119 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12120 processing of Yacc white space and equivalents here.
12121 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12122 instead of returning ID immediately, since we need to search for
12123 a subsequent colon.
12124 (<INITIAL>"'", "\""): Save token_start.
12125 (<INITIAL>"%{", "{", "%%"): Save code_start.
12126 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12127 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12128 BEGIN context_state at end, not INITIAL.
12129 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12130 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12131 Return correct token start.
12132 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12133 the start of a character, string or multiline comment is found.
12134 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12135 Reduction): Adjust reported locations to match the more-precise
12136 results now expected.
12137 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12138 * tests/reduce.at (Useless Rules, Reduced Automaton,
12139 Underivable Rules): Likewise.
12140 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12141 or "|"' now that so many other tokens are allowed by the new grammar.
12142
12143 * src/complain.h (current_file): Remove duplicate decl;
12144 current_file is now owned by files.h.
12145 * src/complain.c, src/scan-gram.l: Include files.h.
12146
121472002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 12148
e19c4e5d
PE
12149 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12150 promotes to int; it might be unsigned int.
12151 * data/yacc.c (yy_reduce_print): Likewise.
12152
12153 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12154 be #defined in the prologue, not in the Bison declarations.
12155 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 12156
b64755e3
PE
121572002-12-02 Paul Eggert <eggert@twinsun.com>
12158
12159 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12160 * lib/strtoul.c: New file, from gnulib.
12161 This fixes a porting bug reported by Peter Klein in
161a71f3 12162 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 12163
6e746484
PE
121642002-11-30 Paul Eggert <eggert@twinsun.com>
12165
b64755e3
PE
12166 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12167 and put only a forward declaration in the prologue. This is for
12168 consistency with the other scanner helper functions.
12169
6ba55592
PE
12170 Type clashes now generate warnings, not errors, since it
12171 appears that POSIX may allow some grammars with type clashes.
12172 * src/reader.c (grammar_current_rule_check): Warn about
12173 type clashes instead of complaining.
12174 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12175
6e746484
PE
12176 Add Yacc library, since POSIX requires it.
12177 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12178 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12179 * lib/main.c, lib/yyerror.c: New files.
12180
12181 gram_error can be static; it need not be extern.
12182 * src/reader.h (gram_error): Remove decl.
12183 * src/parse-gram.y (gram_error): Now static. Add static decl.
12184 (print_token_value): Omit parameter names from forward decl,
12185 for consistency.
12186
88510f9c
PE
121872002-11-29 Paul Eggert <eggert@twinsun.com>
12188
6e746484
PE
12189 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12190 be declared before being used. E.g., one should typically
12191 declare them in the prologue. Use GNU coding style in examples.
12192 Put "const" consistently after the type it modifies. Mention
12193 that C99 supports "inline". Mention that yyerror traditionally
12194 returns "int".
12195
88510f9c
PE
12196 %parse-param and %lex-param now take just one argument, the
12197 declaration; the argument name is deduced from the declaration.
12198
12199 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12200 Reporting, Table of Symbols): Document this.
12201 * src/parse-gram.y (add_param): New function.
12202 (COMMA): Remove.
12203 (declaration): Implement new rule for %parse-param and %lex-param.
12204 * src/scan-gram.l: "," now elicits a warning, rather than being
12205 a token; this is more compatible with byacc.
12206 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12207
bb92250c
PE
122082002-11-27 Paul Eggert <eggert@twinsun.com>
12209
12210 Rename identifiers to avoid real and potential collisions.
12211
12212 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12213 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 12214 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
12215 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12216 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12217 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12218 All uses changed.
12219 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12220 The name "yycontrol" violates the name space rules, and this stuff
12221 wasn't being used anyway.
12222 (input): Remove action; this stuff wasn't being used.
12223 (gram_error): Rename local variable yylloc -> loc.
12224 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12225 (YY_DECL): Don't use "yy" at start of local variables.
12226 All uses changed, e.g., yylloc -> loc.
12227 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12228 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12229 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12230 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12231
12232 * src/parse-gram.y (gram_error): loc is now const *.
12233 * src/reader.h (gram_error): Likewise.
12234
3af4feb2
PE
122352002-11-24 Paul Eggert <eggert@twinsun.com>
12236
12237 Version 1.75c.
12238
12239 * tests/actions.at (Actions after errors): Use an output format
12240 more similar to that of the Printers and Destructors test.
12241 Test the position of the ';' token too.
12242 (Printers and Destructors): Likewise.
12243 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12244 unnecessarily alarming people when the test fails.
12245
12246 * data/yacc.c (yyerrlab1): Move this label down, so that the
12247 parser does not discard the lookahead token if the user code
12248 invokes YYERROR. This change is required for POSIX conformance.
12249
12250 * lib/error.c: Sync with gnulib.
12251
122522002-11-22 Paul Eggert <eggert@twinsun.com>
12253
12254 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12255 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12256 * lib/xmalloc.c: Likewise.
26b4a969 12257
58004308
PE
122582002-11-20 Paul Eggert <eggert@twinsun.com>
12259
12260 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12261
122622002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 12263
58004308
PE
12264 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12265 should use `if (! x) abort ();' rather than `assert (x);', and
12266 anyway it's one less thing to worry about configuring.
12267
12268 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12269 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12270 and replace all instances of assert with abort.
12271 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12272 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12273
12274 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12275 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12276 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12277 hash_find_entry, hash_rehash, hash_insert): Likewise.
12278 * src/conflicts.c (resolve_sr_conflict): Likewise.
12279 * src/lalr.c (set_goto_map, map_goto): Likewise.
12280 * src/nullable.c (nullable_compute): Likewise.
12281 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12282 * src/reader.c (packgram, reader): Likewise.
12283 * src/state.c (state_new, state_free, state_transitions_set,
12284 state_reduction_find): Likewise.
12285 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12286 symbol_pack): Likewise.
12287 * src/tables.c (conflict_row, pack_vector): Likewise.
12288 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12289 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12290 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12291 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12292
12293 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12294 (ARGMATCH_CONSTRAINT): New macro.
12295 (ARGMATCH_ASSERT): Use it.
12296
12297 * src/system.h (verify): New macro.
12298 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12299 rather than assert.
12300 * src/tables.c (tables_generate): Likewise.
12301
12302 * src/struniq.c (struniq_assert): Now returns void, and aborts
12303 if the assertion is false.
12304 (struniq_assert_p): Remove.
12305 * src/struniq.h: Likewise.
12306
76ae8198
PE
123072002-11-18 Paul Eggert <eggert@twinsun.com>
12308
12309 * data/glr.c (yygetLRActions): Replace `yyindex' with
12310 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12311 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 12312 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 12313
d3c4e709
AD
123142002-11-18 Akim Demaille <akim@epita.fr>
12315
12316 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12317 space.
12318 From Tim Van Holder.
12319
8d8a7238
PE
123202002-11-17 Paul Eggert <eggert@twinsun.com>
12321
12322 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12323 to "SyntaxError" for consistency with my 2002-11-15 change.
12324
12325 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12326 not define to {}, since this breaks the common use of `YYDPRINTF
12327 ((...));' if a single statement is desired (e.g. before `else').
12328 Work around GCC warnings by surrounding corresponding calls with
12329 {} if needed.
12330 (yyhasResolvedValue): Remove unused function.
12331 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12332 loop body.
12333 (yyreportSyntaxError): Renamed from yyreportParseError.
12334 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12335 All uses changed.
12336 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12337 extern when possible. Remove unused initializations.
12338
b0937b22
AD
123392002-11-16 Akim Demaille <akim@epita.fr>
12340
12341 Augment the similarity between GLR and LALR traces.
12342
12343 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12344 (YY_REDUCE_PRINT): New.
12345 (yyparse): Use them.
12346 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12347 YYDPRINT here.
12348 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12349 state reached after the reduction/recovery, since...
12350 (yyparse, yyprocessOneStack): Report the state we are entering in.
12351
c5e3e510
AD
123522002-11-16 Akim Demaille <akim@epita.fr>
12353
12354 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12355 Add support for --trace=skeleton.
12356 * src/scan-skel.l: %option debug.
12357 Scan strings of non-@ or \n instead of character by character.
12358 (scan_skel): Handle trace_skeleton.
12359 (QPUTS): New.
12360 (@output_parser_name@, @output_header_name@): ``Restore'' their
12361 support (used to be M4 macros).
12362 * data/yacc.c: Quote larger chunks, a la glr.c.
12363 * data/lalr1.cc: Likewise.
12364 The header guards are no longer available, so use some other
12365 string than `YYLSP_NEEDED'.
12366
4c6cc1db
AD
123672002-11-16 Akim Demaille <akim@epita.fr>
12368
12369 Make the ``Printers and Destructors'' test more verbose, taking
12370 `yacc.c''s behavior as (possibly wrong) reference.
12371
12372 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12373 instead of fprint on stdout.
12374 Set and report the last_line of the symbols.
12375 Consistently display values and locations.
12376
6d9e8019
PE
123772002-11-16 Paul Eggert <eggert@twinsun.com>
12378
12379 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12380
6e649e65
PE
123812002-11-15 Paul Eggert <eggert@twinsun.com>
12382
b25d88f6
PE
12383 * tests/actions.at (Actions after errors): New test case.
12384
6e649e65
PE
12385 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12386 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12387 tests/action.at, tests/calc.at, tests/conflicts.at,
12388 tests/cxx-type.at, tests/regression.at:
12389 "parse error" -> "syntax error" for POSIX compatibility.
12390 "parsing stack overflow..." -> "parser stack overflow" so
12391 that code matches Bison documentation.
12392
0f39aab9
AD
123932002-11-15 Akim Demaille <akim@epita.fr>
12394
12395 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12396 take two BRACED_CODE, not two string_content.
12397 Free the scanner's obstack when we are done.
12398 (code_content): New.
12399 * tests/calc.at: Adjust.
12400 * doc/bison.texinfo: Adjust.
12401 Also, make sure to include the `,' for these declarations.
12402
761c1926
AD
124032002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12404
12405 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12406 definition; avoids potential autoreconf problems.
12407
b0f98b10
AD
124082002-11-15 Akim Demaille <akim@epita.fr>
12409
12410 Always check the value returned by yyparse.
12411
12412 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12413 returned by yyparse.
12414 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12415 Adjust calls.
12416 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12417 returned by yyparse.
12418
970785f1
PH
124192002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12420
12421 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12422 on input.at test.
12423
8fcc7db1
PE
124242002-11-14 Paul Eggert <eggert@twinsun.com>
12425
7ec1b48e
PE
12426 * src/output.c (output_skeleton): Call xfopen instead of
12427 duplicating xfopen's body.
12428
cfff7583 12429 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 12430 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 12431
8fcc7db1
PE
12432 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12433 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12434 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12435 file twice in the grammar, as an extra check.
12436
12437 * tests/input.at (Torturing the Scanner): Surround the
12438 backslash-newline tests with "#if 0", to make it less likely that
12439 we'll run into compiler bugs. Bring back solitary \ inside
12440 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 12441 test backslash-newline in C character constant.
8fcc7db1 12442
4e8d992c
AD
124432002-11-14 Akim Demaille <akim@epita.fr>
12444
12445 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12446 status of the compiler.
f32b346d 12447 Calling `exit 1' is no longer needed.
4e8d992c
AD
12448 Reported by Nelson H. F. Beebe.
12449
9501dc6e
AD
124502002-11-14 Akim Demaille <akim@epita.fr>
12451
12452 * tests/atlocal.in (CPPFLAGS): We have config.h.
12453 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12454 New.
12455 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12456 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12457 * tests/regression.at, tests/torture.at: Use them for all the
12458 grammars that are to be compiled.
12459 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12460 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12461 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12462
18b519c0
AD
124632002-11-14 Akim Demaille <akim@epita.fr>
12464
12465 * doc/bison.texinfo: Various formatting changes (alignments in
12466 samples, additional @group/@end group, GCS in samples.
12467 Use @deffn instead of simple @table to define the directives,
12468 macros, variables etc.
12469
9a86cdb9
PE
124702002-11-13 Paul Eggert <eggert@twinsun.com>
12471
daa33def 12472 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 12473 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 12474
daa33def 12475 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 12476 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
12477 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12478 * tests/headers.at (export YYLTYPE): Likewise.
12479
12480 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 12481 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 12482
9a86cdb9
PE
12483 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12484 comments, since they're not portable. Use GNU coding style.
12485
9c1e26bd
AD
124862002-11-13 Akim Demaille <akim@epita.fr>
12487
12488 * data/yacc.c: Leave bigger chunks of quoted text.
12489 (YYDSYMPRINTF): New.
12490 Use it to report symbol activities.
12491 * data/glr.c (YYDSYMPRINTF): New.
12492 Use it.
12493
87f721cc
PE
124942002-11-12 Paul Eggert <eggert@twinsun.com>
12495
12496 Version 1.75b.
12497
12498 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12499 (yyglrReduce): Return yyok, not 0.
12500 This should avoid the enumerated-type warnings reported
464c6927 12501 by Nelson H. F. Beebe in
161a71f3 12502 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
12503
12504 * lib/bbitset.h (BITSET_INLINE): Remove.
12505 * lib/bitset.h [! BITSET_INLINE]: Remove.
12506 (bitset_set, bitset_reset, bitset_test): Rename local vars
12507 to avoid shadowing warnings by GCC.
12508
12509 * data/glr.c (inline): Remove #define. It's the user's
12510 responsibility to #define it away, just like 'const'.
464c6927 12511 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 12512 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 12513
87f721cc
PE
12514 * Makefile.maint (po-check): Scan .l and .y files instead of the
12515 .c and the .h files that they generate. This fixes the bug
12516 reported by Tim Van Holder in:
161a71f3 12517 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
12518 Look for N_ as well as for _. Try to avoid matching #define for
12519 N_ and _.
12520 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12521 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12522 * src/scan-gram.l: Revamp regular expressions so that " and '
12523 do not confuse xgettext.
12524
12525 * src/struniq.h (struniq_new): Do not declare the return type
12526 to be 'const'; this violates the C standard.
12527 * src/struniq.c (struniq_new): Likewise.
12528
be14ade5
AD
125292002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12530
12531 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12532 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12533 linker.
12534
05291fbc
AD
125352002-11-12 Akim Demaille <akim@epita.fr>
12536
12537 * Makefile.maint: Sync with Autoconf:
12538 (local_updates): New.
12539
1f5fd52e
AD
125402002-11-12 Akim Demaille <akim@epita.fr>
12541
12542 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12543
283f1e64
AD
125442002-11-12 Akim Demaille <akim@epita.fr>
12545
12546 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12547 locations.
12548
886b69d1
AD
125492002-11-12 Akim Demaille <akim@epita.fr>
12550
12551 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12552 not yyvalue.
12553
3df37415
AD
125542002-11-12 Akim Demaille <akim@epita.fr>
12555
12556 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12557 Use it to test the GLR parser.
12558
7bd6c77e
AD
125592002-11-12 Akim Demaille <akim@epita.fr>
12560
12561 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12562 defines it.
12563 * data/glr.c (yystos): New.
12564 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12565 (YYDSYMPRINT): New.
12566 (yyval): Don't define it, it is handled via M4.
12567 (yyrecoverParseError): Free verbosely the discarded symbols.
12568 * data/yacc.c (yysymprint): Remove, rather...
12569 (b4_yysymprint_generate): invoke.
12570 * data/c.m4 (b4_yysymprint_generate): New.
12571 Accept pointers as arguments, as opposed to the version from
12572 yacc.c.
12573 (b4_yydestruct_generate): Likewise.
12574 * tests/cations.at (Printers and Destructors): Use Bison directives
12575 instead of CPP macros.
12576 Don't rely on internal details.
12577
b0400cc6
AD
125782002-11-12 Akim Demaille <akim@epita.fr>
12579
12580 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12581 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12582 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12583 it against YYEMPTY and so forth), work on yytoken (i.e., set
12584 it to YYEMPTY etc.).
12585 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12586 (b4_symbol_actions): Remove.
12587 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12588 for 0, end-of-input.
12589
72f889cc
AD
125902002-11-12 Akim Demaille <akim@epita.fr>
12591
12592 * doc/bison.texinfo (Destructor Decl): New.
12593
b1ae9233
AD
125942002-11-12 Akim Demaille <akim@epita.fr>
12595
12596 * src/tables.c (tables_generate): Use free for pointers that
12597 cannot be NULL, not XFREE.
12598 (pack_vector): Use assert, not fatal, for bound violations.
12599 * src/state.c (state_new): Likewise.
12600 * src/reader.c (reader): Likewise.
12601 * src/lalr.c (set_goto_map): Likewise.
72f889cc 12602 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
12603 the file name.
12604
7ec2d4cd
AD
126052002-11-12 Akim Demaille <akim@epita.fr>
12606
12607 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12608 Restore.
12609 * src/scan-gram.l (last_string): Is global to the file, not to
12610 yylex.
12611 * src/parse-gram.y (input): Don't append the epilogue here,
12612 (epilogue.opt): do it here, and free the scanner's obstack.
12613 * src/reader.c (epilogue_set): Rename as...
12614 (epilogue_augment): this.
12615 * data/c.m4 (b4_epilogue): Defaults to empty.
12616
573a6cd3
AD
126172002-11-12 Akim Demaille <akim@epita.fr>
12618
12619 * src/getargs.c (long_options): Remove duplicates.
12620 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12621 Remove.
12622 * doc/bison.rnh: Remove.
12623 * doc/bison.texinfo (VMS Invocation): Remove.
12624
95612cfa
AD
126252002-11-12 Akim Demaille <akim@epita.fr>
12626
12627 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12628 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12629
12630 Use struniq for symbols.
12631
12632 * src/symtab.h (symbol_t): The tag member is a struniq.
12633 (symbol_type_set): Adjust.
12634 * src/symtab.c (symbol_new): Takes a struniq.
12635 (symbol_free): Don't free the tag member.
12636 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12637 (hash_compare_symbol, hash_symbol): these.
12638 Use the fact that tags as struniqs.
12639 (symbol_get): Use struniq_new.
12640 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12641 Returns a strniq.
12642 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12643 and type members are struniqs.
12644 * src/reader.c (get_merge_function)
12645 (grammar_current_rule_merge_set): Adjust.
12646 (TYPE, current_type): Are struniq.
12647
12648 Use struniq for file names.
12649
12650 * src/files.h, src/files.c (infile): Split into...
12651 (grammar_file, current_file): these.
12652 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12653 * src/reduce.c (reduce_print): Likewise.
12654 * src/getargs.c (getargs): Likewise.
12655 * src/complain.h, src/complain.c: Likewise.
12656 * src/main.c (main): Call struniqs_new early enough to use it for
12657 file names.
12658 Don't free the input file name.
12659
3e6656f9
AD
126602002-11-12 Akim Demaille <akim@epita.fr>
12661
12662 * src/symtab.c (symbol_free): Remove dead deactivated code:
12663 type_name are properly removed.
12664 Don't use XFREE to free items that cannot be NULL.
12665 * src/struniq.h, src/struniq.c: New.
12666 * src/main.c (main): Initialize/free struniqs.
12667 * src/parse-gram.y (%union): Add astruniq member.
12668 (yyprint): Adjust.
12669 * src/scan-gram.l (<{tag}>): Return a struniq.
12670 Free the obstack bit that used to store it.
12671 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12672
7672019c
PE
126732002-11-11 Paul Eggert <eggert@twinsun.com>
12674
12675 Revamp to fix many (but not all) of the C- and M4-related quoting
12676 problems. Among other things, this fixes the Bison bug reported
12677 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 12678 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
12679
12680 Use new @ escapes consistently. Represent brackets with @{ and @}
12681 rather than @<:@ and @:>@, since this works a bit better with dumb
12682 editors like vi. Represent @ with @@, since @ is now consistently
12683 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12684 __ofile__, to avoid unexpected expansions. Similarly, use @output
12685 rather than #output.
12686
12687 * data/c.m4 (b4_copyright): Omit file name from comment, since
12688 the file name could contain "*/".
12689 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12690 be quoted. All uses changed.
12691
12692 * data/glr.c: Use new @ escapes consistently.
12693 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12694 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12695 Remove, since they couldn't handle arbitrary characters in file
12696 names.
12697 * data/lalr1.cc: Likewise.
12698 * data/yacc.c: Likewise.
12699
12700 * src/files.c (output_infix): Remove; all uses removed.
12701 * src/files.h: Likewise.
12702
12703 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12704 mishandled funny characters in file names, and anyway it isn't
12705 needed any more.
12706 * data/yacc.c: Likewise.
12707 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12708
12709 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12710 * data/yacc.c: Likewise.
12711
12712 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12713 strings now.
12714 (muscle_init): Quote filename as a C string.
12715 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12716 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12717 * src/output.c (escaped_file_name_output): New function.
12718 (prepare_symbols): Quote tokens for M4.
12719 (prepare): Don't insert output_infix, output_prefix,
12720 output_parser_name, output_header_name; this is now down by scan-skel.
12721 Insert skeleton as a C string.
12722
12723 * src/output.c (user_actions_output, symbol_destructors_output,
12724 symbol_printers_output): Quote filenames for C and M4.
12725 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12726
12727 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12728 escapes other than \\ and \'; this simplifies the code.
12729 (<SC_STRING>): Likewise, for \\ and \".
12730 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12731 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12732 Use new escapes @{ and @} for [ and ].
12733
12734 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12735 them with auto vars.
12736 Switch to new escape scheme, where @ is the escape character uniformly.
12737 Abort if a stray escape character is found. Avoid unbounded input
12738 buffer when parsing non-escaped text.
12739
12740 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12741 __oline__, #output, $@, and @{ do not have unintended meanings.
12742
acea4f3b
PE
127432002-11-09 Paul Eggert <eggert@twinsun.com>
12744
12745 Fix the test failure due to GCC warnings described in
161a71f3 12746 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
12747 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12748 evaluate to 0 if it's impossible for NINF to be in the respective
12749 table.
12750 (yygetLRActions, yyrecoverParseError): Use them.
12751
12752 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12753 counted in the token inserted at end of file. Now takes
12754 location_t *, not location_t, so that the location can be
12755 adjusted. All uses changed.
12756
12757 * tests/regression.at (Invalid inputs): Adjust wording in
12758 diagnostic to match the new behavior.
12759
12760 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12761 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12762 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12763 abort ();'. This reduces the runtime of the "Many lookaheads"
12764 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12765 GCC 3.2.
12766
20ef1ad5
PE
127672002-11-07 Paul Eggert <eggert@twinsun.com>
12768
12769 * src/parse-gram.y (CHARACTER): Remove unused token.
12770 All uses removed.
12771
12772 * src/scan-gram.l: Remove stack option. We no longer use the
12773 stack, since the stack was never deeper than 1; instead, use the
12774 new auto var c_context to record the stacked value.
12775
12776 Remove nounput option. At an unexpected end of file, we now unput
12777 the minimal input necessary to end cleanly; this simplifies the
12778 code.
12779
12780 Avoid unbounded token sizes where this is easy.
12781
12782 (unexpected_end_of_file): New function.
12783 Use it to systematize the error message on unexpected EOF.
12784 (last-string): Now auto, not static.
12785 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12786 (scanner_last_string_free): Remove; not used.
12787 (percent_percent_count): Move decl to just before use.
12788 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12789 not the (never otherwised-used) CHARACTER.
12790
93724f13
AD
127912002-11-07 Akim Demaille <akim@epita.fr>
12792
12793 Let yyerror always receive the msg as last argument, so that
12794 yyerror can be variadic.
12795
12796 * data/yacc.c (b4_yyerror_args): New.
12797 Use it when calling yyerror.
12798 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12799 Use it when calling yyerror.
12800 * doc/bison.texinfo (Error Reporting): Adjust.
12801 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12802 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12803
6e40b4eb
AD
128042002-11-06 Akim Demaille <akim@epita.fr>
12805
12806 #line should have quoted strings.
12807 Ideally, this should be done by m4_quotearg.
12808
12809 * src/scan-skel.l: Include quotearg.h.
12810 Quote __ofile__.
12811 * src/output.c (symbol_printers_output)
12812 (symbol_destructors_output): Quote the file name.
12813
2dfbfc12
AD
128142002-11-06 Akim Demaille <akim@epita.fr>
12815
12816 * tests/regression.at (Invalid inputs): Adjust to the recent
12817 messages.
12818
437c2d80
AD
128192002-11-06 Akim Demaille <akim@epita.fr>
12820
12821 Restore --no-lines.
12822 Reported by Jim Kent.
12823
12824 * data/c.m4 (b4_syncline): New.
12825 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12826 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12827 * src/output.c (user_actions_output): Likewise.
12828 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 12829 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 12830
900c5db5
AD
128312002-11-06 Akim Demaille <akim@epita.fr>
12832
12833 * src/main.c (main): Free `infile'.
12834 * src/scan-gram.l (handle_syncline): New.
12835 Recognize `#line'.
12836 * src/output.c (user_actions_output, symbol_destructors_output)
12837 (symbol_printers_output): Use the location's file name, not
12838 infile.
12839 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12840
e183b123 128412002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 12842
e183b123 12843 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 12844 either has GLR conflict entries.
e183b123 12845
193eb6b7
PE
128462002-11-05 Paul Eggert <eggert@twinsun.com>
12847
e183b123
PE
12848 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12849 "integer out of range" rather than "invalid value".
12850 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12851 accordingly.
12852
193eb6b7
PE
12853 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12854 Also, remove one static variable in the scanner.
12855
12856 * src/scan-gram.l (braces_level): Now auto, not static.
12857 Initialize to zero if the compiler is being picky.
12858 (INITIAL): Clear braces_level instead of incrementing it.
12859 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12860 as POSIX 1003.1-2001 requires.
12861 * src/system.h (IF_LINT): New macro, taken from coreutils.
12862 * configure.ac: Define "lint" if --enable-gcc-warnings.
12863
29c01725
AD
128642002-11-05 Akim Demaille <akim@epita.fr>
12865
12866 * src/scan-gram.l: When it starts with `%', complain about the
12867 whole directive, not just that `invalid character: %'.
12868
8aeac3ca
AD
128692002-11-04 Akim Demaille <akim@epita.fr>
12870
12871 * Makefile.maint: Update from Autoconf.
12872 (update, cvs-update, po-update, do-po-update): New.
12873
793a58bb
AD
128742002-11-04 Akim Demaille <akim@epita.fr>
12875
12876 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
12877 and yyerror.
12878 Have yyerror `use' its arguments.
12879 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
12880 returns true when location & yacc & pure & parse-param.
12881 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
12882
c4d720cd
AD
128832002-11-04 Akim Demaille <akim@epita.fr>
12884
12885 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
12886 clashes.
12887 * src/scan-gram.l: Use [\'] instead of ['] to pacify
12888 font-lock-mode.
12889 Use complain_at.
12890 Use quote, not quote_n since LOCATION_PRINT no longer uses the
12891 slot 0.
12892
613a0dc5
PE
128932002-11-03 Paul Eggert <eggert@twinsun.com>
12894
12895 * src/reader.c (get_merge_function, grammar_current_rule_check):
12896 Use consistent diagnostics for reporting type name clashes.
12897 Quote the types with <>, for consistency with Yacc.
12898 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
12899
2a8d363a
AD
129002002-11-03 Akim Demaille <akim@epita.fr>
12901
12902 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
12903 New.
12904 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
12905 (b4_parse_param): Remove.
12906 Use b4_identification.
12907 Propagate b4_pure_args where needed to pass them to yyerror.
12908 * data/glr.m4 (b4_parse_param): Remove.
12909 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
12910 (b4_lpure_formals): New.
12911 Use b4_identification.
12912 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
12913 b4_user_formals and b4_user_args.
12914 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
12915 (yyreportAmbiguity): When using a pure parser, also need
12916 the location, and the parse-params.
12917 Adjust callers.
12918 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
12919 When using a pure parser, also need the parse-params.
12920 Adjust callers.
12921 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
12922 (%pure-parser + %parse-param) LALR and GLR parsers.
12923 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
12924 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
12925 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
12926 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
12927 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
12928 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
12929 * doc/bison.texinfo: Untabify the whole file.
12930 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
12931 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
12932 (Error Reporting): Adjust to these new directives.
12933 Document %error-verbose, deprecate YYERROR_VERBOSE.
12934
9e32add8
AD
129352002-11-03 Akim Demaille <akim@epita.fr>
12936
12937 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
12938 AT_CHECK_CALC_GLR invocations to use % directives, instead of
12939 command line options.
12940 * tests/cxx-type.at: Formatting changes.
12941
b02d90a5
PE
129422002-11-03 Paul Eggert <eggert@twinsun.com>
12943
12944 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
12945 to count columns correctly, and to check for invalid inputs.
9e32add8 12946
b02d90a5
PE
12947 Use mbsnwidth to count columns correctly. Account for tabs, too.
12948 Include mbswidth.h.
12949 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
12950 (extend_location): New function.
12951 (YY_LINES): Remove.
12952
12953 Handle CRLF in C code rather than in Lex code.
12954 (YY_INPUT): New macro.
12955 (no_cr_read): New function.
12956
12957 Scan UCNs, even though we don't fully handle them yet.
12958 (convert_ucn_to_byte): New function.
12959
12960 Handle backslash-newline correctly in C code.
12961 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
12962 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
12963 all uses changed.
12964 (tag, splice): New EREs. Do not allow NUL or newline in tags.
12965 Use {splice} wherever C allows backslash-newline.
12966 YY_STEP after space, newline, vertical-tab.
12967 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 12968
b02d90a5
PE
12969 (letter, id): Don't assume ASCII; e.g., spell out a-z.
12970
12971 ({int}, handle_action_dollar, handle_action_at): Check for integer
12972 overflow.
9e32add8 12973
b02d90a5
PE
12974 (YY_STEP): Omit trailing semicolon, so that it's more like C.
12975
12976 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
12977 as well as \000. Check for UCHAR_MAX, not 255.
12978 Allow \x with an arbitrary positive number of digits, as in C.
12979 Check for overflow here.
12980 Allow \? and UCNs, for compatibility with C.
12981
12982 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
12983 with quote slot used by complain_at.
12984
12985 * tests/input.at: Add tests for backslash-newline, m4 quotes
12986 in symbols, long literals, and funny escapes in strings.
12987
12988 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
12989 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
12990 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
12991 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
12992 * m4/mbswidth.m4: New file, from GNU coreutils.
12993
12994 * doc/bison.texinfo (Grammar Outline): Document // comments.
12995 (Symbols): Document that trigraphs have no special meaning in Bison,
12996 nor is backslash-newline allowed.
12997 (Actions): Document that trigraphs have no special meaning.
12998
12999 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13000 no longer used.
13001
130022002-11-02 Paul Eggert <eggert@twinsun.com>
13003
13004 * src/reader.c: Don't include quote.h; not needed.
13005 (get_merge_function): Reword warning to be consistent with
13006 type clash diagnostic in grammar_current_rule_check.
13007
13008 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13009 bug in trigraph handling.
13010
13011 * src/output.c (prepare_symbols): When printing token names,
13012 escape "[" as "@<:@" and likewise for "]".
13013
13014 * src/system.h (errno): Remove declaration, as we are now
13015 assuming C89 or better, and C89 guarantees errno.
13016
762b212b
PE
130172002-10-30 Paul Eggert <eggert@twinsun.com>
13018
13019 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13020 Check for close failures.
13021 * src/files.h (xfclose): Return void, not int, since it always
13022 returned zero.
13023 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13024 indicates one.
13025 * src/output.c (output_skeleton): Use xfclose rather than fclose
13026 and ferror. xfclose now checks ferror.
13027
13028 * data/glr.c (YYLEFTMOST_STATE): Remove.
13029 (yyreportTree): Use a stack-based leftmost state. This avoids
13030 our continuing battles with bogus warnings about initializers.
13031
56100c60
AD
130322002-10-30 Akim Demaille <akim@epita.fr>
13033
13034 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13035 #if.
13036
51b4a04c
PH
130372002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13038
13039 * tests/glr-regr1.at: New test for reported regressions.
13040 * tests/testsuite.at: Add glr-regr1.at test.
13041 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 13042
bf1ebda2
PE
130432002-10-24 Paul Eggert <eggert@twinsun.com>
13044
5c16c6b1
PE
13045 Version 1.75a.
13046
bf1ebda2
PE
13047 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13048 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13049 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13050 Don't assume strdup exists; POSIX says its an XSI extension.
13051 Check for buffer overflow on input.
13052
b526ee61
AD
130532002-10-24 Akim Demaille <akim@epita.fr>
13054
13055 * src/output.c (output_skeleton): Don't disable M4sugar comments
13056 too soon: it results in comments being expanded.
13057 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13058 first output.
13059
f1886bb2
AD
130602002-10-24 Akim Demaille <akim@epita.fr>
13061
13062 * data/yacc.c (m4_int_type): New.
13063 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13064 char' as only yacc.c wants K&R portability.
13065 * data/glr.c (yysigned_char): Remove.
13066 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13067 Reported by Quoc Peyrot.
13068
c5576256
PE
130692002-10-23 Paul Eggert <eggert@twinsun.com>
13070
13071 * src/main.c (main): With --trace=time, report times even if a
13072 non-fatal error occurs. Formerly, the times were reported in some
13073 such cases but not in others.
13074 * src/reader.c (reader): Just return if a complaint has been issued,
13075 instead of exiting, so that 'main' can report times.
13076
27b0ffea
AD
130772002-10-22 Akim Demaille <akim@epita.fr>
13078
13079 * src/system.h: Include sys/types.
13080 Reported by Bert Deknuydt.
13081
223a7883
PE
130822002-10-23 Paul Eggert <eggert@twinsun.com>
13083
13084 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13085 Suggested by Art Haas.
13086
130872002-10-22 Paul Eggert <eggert@twinsun.com>
13088
13089 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13090 decl; not needed any more.
13091 * src/main.c (main): Use return to exit, undoing yesterday's change.
13092 The last OS that we could find where this wouldn't work is
13093 SunOS 3.5, and that's too old to worry about now.
13094
13095 * data/glr.c (struct yyltype): Define members even when not
13096 doing locations. This is more consistent with yacc.c, and it
13097 works around the following bug reports:
161a71f3
PE
13098 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13099 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 13100
223a7883
PE
13101 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13102 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13103 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13104
8b76775a
AD
131052002-10-22 Akim Demaille <akim@epita.fr>
13106
13107 * data/README: New.
13108
6db10d14
PE
131092002-10-21 Paul Eggert <eggert@twinsun.com>
13110
13111 Be consistent about 'bool'; the old code used an enum in one
13112 module and an int in another, and this violates the C standard.
13113 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13114 * configure.ac (AC_HEADER_STDBOOL): Add.
13115 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13116 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13117 * src/symtab.c (hash_compare_symbol_t): Likewise.
13118 * src/system.h (bool, false, true): Use a definition consistent
13119 with ../lib/hash.c. All uses changed.
13120
13121 * src/complain.c (warning_issued): Renamed from warn_message_count,
13122 so that we needn't worry about integer overflow (!).
13123 Now of type bool. All uses changed.
13124 (complaint_issued): Renamed from complain_message_count; likewise.
13125
13126 * src/main.c (main): Use exit to exit with failure.
27b0ffea 13127
6db10d14
PE
13128 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13129 rather than 1 and 0.
13130 * src/main.c (main): Likewise.
13131 * src/getargs.c (getargs): Likewise.
13132 * src/reader.c (reader): Likewise.
13133
13134 * src/getarg.c (getargs): Remove duplicate code for
13135 "Try `bison --help'".
13136
13137 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13138 What was that "2" for?
13139
13140 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13141 * src/getargs.c (usage): Likewise.
13142
13143 * src/getargs.c (getargs): When there are too few operands, report
13144 the last one. When there are too many, report the first extra
13145 one. This is how diffutils does it.
13146
92a060fd
PE
131472002-10-20 Paul Eggert <eggert@twinsun.com>
13148
13149 Remove K&R vestiges.
13150 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13151 * src/complain.c (VA_START): Remove. Assume prototypes.
13152 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13153 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13154 fatal): Assume prototypes.
13155 * src/complain.h: Assume prototypes.
13156 * src/system.h (PARAMS): Remove.
13157 Include <limits.h> unconditionally, since it's guaranteeed even
13158 for a freestanding C89 compiler.
13159 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13160 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 13161
e7cb57c0
AD
131622002-10-20 Akim Demaille <akim@epita.fr>
13163
13164 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13165 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13166 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13167 (yyresolveStates, yyresolveAction, yyresolveStack)
13168 (yyprocessOneStack): Use them.
13169 (yy_reduce_print): New.
13170 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13171
0245f82d
AD
131722002-10-20 Akim Demaille <akim@epita.fr>
13173
13174 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13175 arguments and output `void'.
13176 (b4_c_function): Rename as...
13177 (b4_c_function_def): this.
13178 (b4_c_function_decl, b4_c_ansi_function_def)
13179 (b4_c_ansi_function_decl): New.
13180 Change the interpretation of the arguments: before `int, foo', now
13181 `int foo, foo'.
13182 * data/yacc.c (yyparse): Prototype and define thanks to these.
13183 Adjust b4_c_function_def uses.
13184 * data/glr.c (yyparse): Likewise, but ANSI only.
13185
39912f52
AD
131862002-10-20 Akim Demaille <akim@epita.fr>
13187
13188 * src/output.c (prepare): Move the definition of `tokens_number',
13189 `nterms_number', `undef_token_number', `user_token_number_max'
13190 to...
13191 (prepare_tokens): Here.
13192 (prepare_tokens): Rename as...
13193 (prepare_symbols): this.
13194 (prepare): Move the definition of `rules_number' to...
13195 (prepare_rules): here.
13196 (prepare): Move the definition of `last', `final_state_number',
13197 `states_number' to...
13198 (prepare_states): here.
13199 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13200
20c1e2ad
AD
132012002-10-20 Akim Demaille <akim@epita.fr>
13202
13203 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13204
21964f43
AD
132052002-10-20 Akim Demaille <akim@epita.fr>
13206
13207 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13208 * data/c.m4: here.
13209
66d30cd4
AD
132102002-10-20 Akim Demaille <akim@epita.fr>
13211
13212 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13213 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13214 `pair'.
13215 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13216 `name' to...
13217 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13218 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13219 These.
13220
95f2c9fe
PE
132212002-10-19 Paul Eggert <eggert@twinsun.com>
13222
13223 Do not create a temporary file, as that involves security and
13224 cleanup headaches. Instead, use a pair of pipes.
13225 Derived from a suggestion by Florian Krohm.
13226 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13227 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13228 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13229 (BISON_PREREQ_SUBPIPE): Add.
13230 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13231 Add subpipe.h, subpipe.c.
13232 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13233 * po/POTFILES.in: Add lib/subpipe.c.
13234 * src/output.c: Include "subpipe.h".
13235 (m4_invoke): Remove decl.
13236 (scan_skel): New decl.
13237 (output_skeleton): Use pipe rather than temporary file for m4 input.
13238 Check that m4sugar.m4 is readable, to avoid deadlock.
13239 Check for pipe I/O error.
13240 * src/scan-skel.l (readpipe): Remove decl.
13241 (scan_skel): New function, to be used in place of m4_invoke.
13242 Read from stream rather than file.
66d30cd4 13243
95f2c9fe
PE
13244 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13245 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13246 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13247 this generates a more-accurate value anyway.
13248
13249 * lib/timevar.c (timervar_accumulate): Rename locals to
13250 avoid confusion with similarly-named more-global.
13251 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13252
13253 * src/output.c (prepare): Use xstrdup to convert char const *
13254 to char *, to avoid GCC warning.
13255
c19988b7
AD
132562002-10-19 Akim Demaille <akim@epita.fr>
13257
13258 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13259 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13260 Use them to have `calc.y' ready for %pure-parser.
13261 * data/yacc.c (YYLEX): Pass a yylex return type to
13262 b4_c_function_call.
13263
ae7453f2
AD
132642002-10-19 Akim Demaille <akim@epita.fr>
13265
13266 Prototype support of %lex-param and %parse-param.
13267
13268 * src/parse-gram.y: Add the definition of the %lex-param and
13269 %parse-param tokens, plus their rules.
13270 Drop the `_' version of %glr-parser.
13271 Add the "," token.
13272 * src/scan-gram.l (INITIAL): Scan them.
13273 * src/muscle_tab.c: Comment changes.
13274 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13275 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13276 (muscle_entry_s): The `value' member is no longer const.
13277 Adjust all dependencies.
13278 * src/muscle_tab.c (muscle_init): Adjust: use
13279 MUSCLE_INSERT_STRING.
13280 Initialize the obstack earlier.
13281 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13282 (muscle_pair_list_grow): New.
13283 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13284 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13285 * tests/calc.at: Use %locations, not --locations.
13286 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13287
0e575721
AD
132882002-10-19 Akim Demaille <akim@epita.fr>
13289
13290 * src/getargs.c (usage): Take status as argument and exit
13291 accordingly.
13292 Report the traditional `Try ... --help' message when status != 0.
13293 (usage, version): Don't take a FILE * as arg, it is pointless.
13294 (getargs): When there is an incorrect number of arguments, make it
13295 an error, and report it GNUlically thanks to `usage ()'.
13296
724ce7f5
PE
132972002-10-18 Paul Eggert <eggert@twinsun.com>
13298
3a781eb2
PE
13299 * data/glr.c (yyreportParseError): Don't assume that sprintf
13300 yields the length of the printed string, as this is not true
13301 on SunOS 4.1.4. Reported by Peter Klein.
13302
724ce7f5
PE
13303 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13304 * tests/conflicts.at (%nonassoc and eof): Likewise.
13305 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13306
473d0a75
AD
133072002-10-17 Akim Demaille <akim@epita.fr>
13308
13309 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13310 * src/getargs.c (trace_types, trace_args): Adjust.
13311 * src/reader.c (grammar_current_rule_prec_set)
13312 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13313 Standardize error messages.
13314 And s/@prec/%prec/!
13315 (reader): Use trace_flag to enable scanner/parser debugging,
13316 instead of an adhoc scheme.
13317 * src/scan-gram.l: Remove trailing debugging code.
13318
e76d2469
PE
133192002-10-16 Paul Eggert <eggert@twinsun.com>
13320
93e2236a
PE
13321 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13322 MUSCLE_TAB_H.
13323
e76d2469
PE
13324 * NEWS: Officially drop support for building Bison with K&R C,
13325 since it didn't work anyway and it's not worth worrying about.
13326 * Makefile.maint (wget_files): Remove ansi2knr.c.
13327 (ansi2knr.c-url_prefix): Remove.
13328 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13329 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13330 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13331
5bd1c419
PE
133322002-10-15 Paul Eggert <eggert@twinsun.com>
13333
13334 Stop using the "enum_" trick for K&R-style function definitions;
13335 it confused me, and I was the author! Instead, assume that people
13336 who want to use K&R C compilers (when using these modules in GCC,
13337 perhaps?) will run ansi2knr.
13338
13339 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13340 All uses of "enum_" changed to "enum ".
13341 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13342 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 13343
5bd1c419
PE
13344 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13345 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13346 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13347 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13348 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13349 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13350 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13351 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13352 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13353 Use function prototypes; this removes the need for declaring
13354 static functions simply to provide their prototypes.
13355 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13356 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13357 bitset_count_, bitset_create, bitset_dump, bitset_first,
13358 bitset_free, bitset_init, bitset_last, bitset_next,
13359 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13360 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13361 bitset_print, bitset_release_memory, bitset_toggle_,
13362 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13363 debug_bitset): Likewise.
13364 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13365 * lib/bitset_stats.c (bitset_log_histogram_print,
13366 bitset_percent_histogram_print, bitset_stats_and,
13367 bitset_stats_and_cmp, bitset_stats_and_or,
13368 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13369 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13370 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13371 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13372 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13373 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13374 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13375 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13376 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13377 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13378 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13379 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13380 bitset_stats_zero): Likewise.
13381 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13382 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13383 bitsetv_dump, debug_bitsetv): Likewise.
13384 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13385 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13386 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13387 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13388 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13389 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13390 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13391 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13392 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13393 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13394 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13395 Likewise.
13396 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13397 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13398 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13399 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13400 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13401 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13402 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13403 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13404 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13405 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13406 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 13407
ae26e1f0
AD
134082002-10-14 Akim Demaille <akim@epita.fr>
13409
13410 Version 1.75.
13411
d43baf71
AD
134122002-10-14 Akim Demaille <akim@epita.fr>
13413
13414 * tests/Makefile.am (maintainer-check-posix): New.
13415
7ebc83e3
AD
134162002-10-14 Akim Demaille <akim@epita.fr>
13417
13418 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13419 member.
13420
05846dae
AD
134212002-10-14 Akim Demaille <akim@epita.fr>
13422
13423 * src/tables.c (table_ninf_remap): base -> tab.
13424 Reported by Matt Rosing.
13425
1318e37d
PE
134262002-10-14 Paul Eggert <eggert@twinsun.com>
13427
447fbb17
PE
13428 * tests/action.at, tests/calc.at, tests/conflicts.at,
13429 tests/cxx-type.at, tests/headers.at, tests/input.at,
13430 tests/regression.at, tests/synclines.at, tests/torture.at:
13431 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13432 so that the tests still work even if POSIXLY_CORRECT is set.
13433 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 13434
1318e37d
PE
13435 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13436 for portability to K&R hosts. Fix typo: signed char is guaranteed
13437 only to 127, not to 128.
13438 * data/glr.c (yysigned_char): New type.
13439 * data/yacc.c (yysigned_char): Likewise.
13440 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13441
cc0f0794
PE
134422002-10-13 Paul Eggert <eggert@twinsun.com>
13443
5038f418
PE
13444 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13445 true due to limited range of data type" warning from GCC.
13446
cc0f0794
PE
13447 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13448 by wrapping enum yytokentype's definition inside #ifndef
13449 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13450
6fed0802
AD
134512002-10-13 Akim Demaille <akim@epita.fr>
13452
13453 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13454 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13455
32f0598d
AD
134562002-10-13 Akim Demaille <akim@epita.fr>
13457
13458 * Makefile.maint: Update from Autoconf 2.54.
13459 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13460
7ea9a33f
AD
134612002-10-13 Akim Demaille <akim@epita.fr>
13462
13463 * src/print.c (print_state): Separate the list of solved conflicts
13464 from the other items.
13465 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13466
ea99527d
AD
134672002-10-13 Akim Demaille <akim@epita.fr>
13468
13469 Let nondeterministic skeletons be usable with deterministic
13470 tables.
13471
13472 With the patch, GAWK compiled by GCC without -O2 passes its test
13473 suite using a GLR parser driven by LALR tables. It fails with -O2
13474 because `struct stat' gives two different answers on my machine:
13475 88 (definition of an auto var) and later 96 (memset on this var).
13476 Hence the stack is badly corrumpted. The headers inclusion is to
13477 blame: if I move the awk.h inclusion before GLR's system header
13478 inclusion, the two struct stat have the same size.
13479
13480 * src/tables.c (pack_table): Always create conflict_table.
13481 (token_actions): Always create conflict_list.
13482 * data/glr.c (YYFLAG): Remove, unused.
13483
f377f69f
AD
134842002-10-13 Akim Demaille <akim@epita.fr>
13485
13486 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13487 (O0FLAGS): New.
13488 (VALGRIND, GXX): New.
13489 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13490 * tests/bison.in: Run $PREBISON a pre-command.
13491 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13492 (maintainer-check-g++): New.
13493 * Makefile.am (maintainer-check): New.
13494
2a1fe6ed
AD
134952002-10-13 Akim Demaille <akim@epita.fr>
13496
13497 * data/glr.c: Formatting changes.
13498 Tweak some trace messages to match yacc.c's.
13499
f50adbbd
AD
135002002-10-13 Akim Demaille <akim@epita.fr>
13501
13502 GLR parsers sometimes raise parse errors instead of performing the
13503 default reduction.
13504 Reported by Charles-Henry de Boysson.
13505
13506 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 13507 check the length of the traces when %glr.
f50adbbd
AD
13508 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13509 GLR's traces.
13510 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13511 Test GLR parsers.
13512 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13513 (yyltype): Remove the yy prefix from the member names.
13514 (yytable): Complete its comment.
13515 (yygetLRActions): Map error action number from YYTABLE from
13516 YYTABLE_NINF to 0.
13517 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13518 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13519 not satisfying as we could compare an YYACTION computed from
13520 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13521 only value for error actions.
13522 (yyreportParseError): In verbose parse error messages, don't issue
13523 `error' in the list of expected tokens.
13524 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13525 next action to perform to match glr.c's decoding.
13526 (yytable): Complete its comment.
13527
bcbad5b9
PE
135282002-10-13 Paul Eggert <eggert@twinsun.com>
13529
13530 Fix problem reported by Henrik Grubbstroem in
161a71f3 13531 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
13532 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13533 because the Bison parser reads the second action before reducing
13534 the first one.
13535 * src/scan-gram.l (rule_length): New static var.
13536 Use it to keep track of the rule length in the scanner, since
13537 we can't expect the parser to be in lock-step sync with the scanner.
13538 (handle_action_dollar, handle_action_at): Use this var.
13539 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 13540
14904b89
PE
135412002-10-12 Paul Eggert <eggert@twinsun.com>
13542
1fe611e5
PE
13543 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13544 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13545 Include <sys/time.h> when checking for clock_t and struct tms.
13546 Use same include order as source.
13547 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 13548 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 13549
1fe611e5
PE
13550 * lib/timevar.c: Update copyright date and clarify comments.
13551 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 13552
1fe611e5
PE
13553 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13554 GCC version as of today, then merge Bison's changes.
13555 Change "GCC" to "Bison" in copyright notice. timevar.def's
13556 author is Akim, so change that too.
13557
98194095
PE
13558 * src/reader.c (grammar_current_rule_check):
13559 Don't worry about the default action if $$ is untyped.
13560 Prevents bogus warnings reported by Jim Gifford in
161a71f3 13561 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 13562
14904b89
PE
13563 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13564 * data/glr.c, data/lalr1.cc, data/yacc.c:
13565 Output token definitions before the first part of user declarations.
13566 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 13567 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 13568
ff6dca18
PE
135692002-10-11 Paul Eggert <eggert@twinsun.com>
13570
13571 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13572 (yyparse): here. This undoes some of the 2002-07-25 change.
13573 Compatibility problem reported by Ralf S. Engelschall with
13574 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13575
eb714592
AD
135762002-10-11 Akim Demaille <akim@epita.fr>
13577
13578 * tests/regression.at Characters Escapes): New.
13579 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13580 characters.
13581 Reported by Jan Nieuwenhuizen.
13582
b7195100
AD
135832002-10-11 Akim Demaille <akim@epita.fr>
13584
13585 * po/id.po: New.
13586
f28a0f2d
PE
135872002-10-10 Paul Eggert <eggert@twinsun.com>
13588
13589 Portability fixes for bitsets; this also avoids several GCC
13590 warnings.
13591
13592 * lib/abitset.c: Include <stddef.h>, for offsetof.
13593 * lib/lbitset.c: Likewise.
13594
13595 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13596 properly for vectors of objects. Do not assume that adding a
13597 header size to a multiple of a word size yields a value that is
13598 properly aligned for the whole union.
13599 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13600
13601 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13602 unique names for structures.
13603 * lib/ebitset.c (ebitset_bytes): Likewise.
13604 * lib/lbitset.c (lbitset_bytes): Likewise.
13605
13606 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13607 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13608 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13609 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13610 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13611 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13612 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13613 to improve the type-checking that GCC can do.
13614 * lib/bitset.c (bitset_op4_cmp): Likewise.
13615 * lib/bitset_stats.c (bitset_stats_count,
13616 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13617 bitset_stats_copy, bitset_stats_disjoint_p,
13618 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13619 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13620 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13621 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13622 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13623 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13624 bitset_stats_or_and_cmp): Likewise.
13625 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13626 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13627 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13628 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13629
13630 * lib/abitset.h: Include bitset.h, not bbitset.h.
13631 * lib/ebitset.h: Likewise.
13632 * lib/lbitset.h: Likewise.
13633
13634 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13635 All instances of parameters of type enum bitset_opts are now of
13636 type enum_bitset_opts, to conform to the C Standard, and similarly
13637 for enum_bitset_type.
13638 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13639 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13640
13641 Do not use "struct bitset_struct" to mean different things in
13642 different modules. Not only is this confusing, it violates
13643 the C Standard, which requires that structure types in different
13644 modules must be compatible if one is to be passed to the other.
13645 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13646 All instances of "struct bitset_struct *" replaced with "bitset".
13647 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13648 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13649 struct lbitset_struct, struct bitset_stats_struct): New types.
13650 All uses of struct bitset_struct changed to union bitset_union,
13651 etc.
ba0fe3c7 13652 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
13653 struct bitset_struct): Remove.
13654 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13655 struct bitset_struct): Remove.
13656 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13657 bitset_struct): Remove.
13658 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13659 Likewise.
13660
13661 Do not call a function of type T using a call that assumes the
13662 function is of a different type U. Standard C requires that a
13663 function must be called with a type that is compatible with its
13664 definition.
13665 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13666 New decls.
13667 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13668 New functions.
13669 * lib/ebitset.c (PFV): Remove.
13670 * lib/lbitset.c (PFV): Likewise.
13671 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13672 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13673 decls.
13674 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13675 (ebitset_vtable): Use them.
13676 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13677 lbitset_xor): New functions.
13678 (lbitset_vtable): Use them.
13679
13680 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13681 Declare.
13682
13683 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13684 GCC warning.
13685 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13686 Use offsetof, for simplicity.
13687
6fbe4984
PE
136882002-10-06 Paul Eggert <eggert@twinsun.com>
13689
13690 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13691 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 13692 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
13693 which was inadvertently undone by the 2002-09-30 patch.
13694 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13695 the same width as int.
13696
420f93c8
PE
136972002-10-04 Paul Eggert <eggert@twinsun.com>
13698
13699 Version 1.50.
13700
13701 * configure.ac (AC_INIT), NEWS: Increment version number.
13702
13703 * doc/bison.texinfo: Minor spelling, grammar, and white space
13704 fixes.
13705 (Symbols): Mention that any negative value returned from yylex
13706 signifies end-of-input. Warn about negative chars. Mention
13707 the portable Standard C character set.
13708
13709 The GNU coding standard says CFLAGS and YFLAGS are reserved
13710 for the installer to set.
13711 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13712 * src/Makefile.am (AM_CFLAGS): Likewise.
13713 (AM_YFLAGS): Renamed from YFLAGS.
13714
13715 Fix some MAX and MIN problems.
13716 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13717 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13718 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13719 * src/reader.c (reader): Use it.
13720
13721 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13722 POSIX 1003.1-2001 has removed fgrep.
13723
137242002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13725
13726 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13727 interpreted as signed.
13728 * lib/ebitset.c (ebitset_list): Fix bug.
13729
ff68026d
PE
137302002-10-01 Paul Eggert <eggert@twinsun.com>
13731
13732 More fixes for 64-bit hosts and large bitsets.
13733
13734 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13735 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13736 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13737 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13738 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13739 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13740 bitset_count_): Likewise.
13741 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13742 bitset_first, bitset_last): Likewise.
13743 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13744 bitset_stats_list_reverse, bitset_stats_size,
13745 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13746 Likewise.
13747 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13748 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13749 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13750 bitsetv_reflexive_transitive_closure): Likewise.
13751 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13752 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13753 Likewise.
13754 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13755 Likewise.
420f93c8 13756
ff68026d
PE
13757 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13758 Use size_t, not unsigned int, to count bytes.
13759 * lib/abitset.h (abitset_bytes): Likewise.
13760 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13761 Likewise.
13762 * lib/bitset.h (bitset_bytes): Likewise.
13763 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13764 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13765 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13766 * lib/ebitset.c (ebitset_bytes): Likewise.
13767 * lib/ebitset.h (ebitset_bytes): Likewise.
13768 * lib/lbitset.c (lbitset_bytes): Likewise.
13769 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 13770
ff68026d
PE
13771 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13772 abitset_subset_p, abitset_disjoint_p, abitset_and,
13773 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13774 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13775 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13776 abitset_or_and, abitset_or_and_cmp):
13777 Use bitset_windex instead of unsigned int.
13778 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13779 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13780 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13781 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13782 Likewise.
13783 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 13784
ff68026d
PE
13785 * lib/bitset.c (bitset_print):
13786 Use proper printf formats for widths of integer types.
13787 * lib/bitset_stats.c (bitset_percent_histogram_print,
13788 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13789 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13790 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13791 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 13792
ff68026d
PE
13793 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13794 BITSET_SIZE_MAX): New macros.
13795 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13796 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13797 to BITSET_WINDEX_MAX.
13798
13799 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13800 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13801 since we now return the bitset_bindex type (not int).
13802
13803 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13804 when computing sizes.
13805 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13806
13807 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13808 and avoid cast to unsigned.
13809
6aa452a6
AD
138102002-09-30 Akim Demaille <akim@epita.fr>
13811
13812 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13813 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13814 Updates from Michael Hayes.
13815
927f7817
AD
138162002-09-30 Art Haas <ahaas@neosoft.com>
13817
13818 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13819 invocations.
13820 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13821 defined.
13822
9738f41e
AD
138232002-09-27 Akim Demaille <akim@epita.fr>
13824
13825 Version 1.49c.
13826
a5c75d7f
AD
138272002-09-27 Akim Demaille <akim@epita.fr>
13828
13829 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13830 (Because of AC_LIBSOURCE).
13831
8280e179
AD
138322002-09-27 Akim Demaille <akim@epita.fr>
13833
13834 Playing with Autoscan.
13835
13836 * configure.ac: Remove the old LIBOBJ tweaks.
13837 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13838 * lib/strrchr.c: New.
13839 * lib/strtol.c: New, from the Coreutils 4.5.1.
13840
ae64af35
AD
138412002-09-27 Akim Demaille <akim@epita.fr>
13842
13843 Playing with Autoscan.
13844
13845 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13846 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13847 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13848 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13849 Coreutils 4.5.1.
13850
d1a1114f
AD
138512002-09-24 Akim Demaille <akim@epita.fr>
13852
13853 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13854 (Frequently Asked Questions, Parser Stack Overflow): New.
13855
b906441c
AD
138562002-09-13 Akim Demaille <akim@epita.fr>
13857
13858 Playing with autoscan.
13859
13860 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13861 * src/files.c (skeleton_find): Remove, unused.
13862 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13863 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13864
bd701811
AD
138652002-09-13 Akim Demaille <akim@epita.fr>
13866
13867 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13868 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13869
e0a13e7b
AD
138702002-09-13 Akim Demaille <akim@epita.fr>
13871
13872 * configure.ac: Require 2.54.
13873 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
13874 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
13875 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
13876 Remove, provided by Autoconf macros.
13877
c97011bf
AD
138782002-09-12 Akim Demaille <akim@epita.fr>
13879
13880 * m4/prereq.m4: Update, from Coreutils 4.5.1.
13881
d862b1be
AD
138822002-09-12 Akim Demaille <akim@epita.fr>
13883
13884 * m4/prereq.m4: Update, from Fileutils 4.1.5.
13885 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
13886 Reported by Martin Mokrejs.
13887
3d38c03a
AD
138882002-09-10 Akim Demaille <akim@epita.fr>
13889
13890 * src/parse-gram.y: Associate a human readable string to each
13891 token type.
13892 * tests/regression.at (Invalid inputs): Adjust.
13893
b6347355
AD
138942002-09-10 Gary V. Vaughan <gary@gnu.org>
13895
13896 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
13897 with an Autoconf-2.5x style configure.ac.
13898
09ba4ab2
PE
138992002-09-06 Paul Eggert <eggert@twinsun.com>
13900
13901 * doc/bison.texinfo (Conditions): Make explicit that the GPL
13902 exception applies only to yacc.c. This is a modification of a
13903 patch originally suggested by Akim Demaille.
13904
21846f69
AD
139052002-09-06 Akim Demaille <akim@epita.fr>
13906
09ba4ab2
PE
13907 * data/c.m4 (b4_copyright): Move the GPL exception comment from
13908 here to...
13909 * data/yacc.c: here.
13910
21846f69
AD
13911 * data/lalr1.cc (struct yyltype): Don't define it, since we use
13912 LocationType.
13913 (b4_ltype): Default to yy::Location from location.hh.
13914
c0ad8bf3
AD
139152002-09-04 Jim Meyering <jim@meyering.net>
13916
13917 * data/yacc.c: Guard the declaration of yytoknum also with
13918 `#ifdef YYPRINT', so it is declared only when used.
13919
3a93251e
AD
139202002-09-04 Akim Demaille <akim@epita.fr>
13921
13922 * configure.in: Rename as...
13923 * configure.ac: this.
13924 Bump to 1.49c.
13925
427c0dda
AD
139262002-09-04 Akim Demaille <akim@epita.fr>
13927
13928 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
13929 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
13930 translate maintainer only messages.
13931
6a254321
PE
139322002-08-12 Paul Eggert <eggert@twinsun.com>
13933
645e30d1
PE
13934 Version 1.49b.
13935
6a254321
PE
13936 * Makefile.am (SUBDIRS): Remove intl.
13937 (DISTCLEANFILES): Remove.
13938 * NEWS: Mention that GNU M4 is now required. Clarify what is
13939 meant by "larger grammars". Mention the pt_BR translation.
13940 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
13941 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
13942 Bump version from 0.11.2 to 0.11.5.
13943 (BISON_PREREQ_STAGE): Remove.
13944 (AM_GNU_GETTEXT): Use external gettext.
13945 (AC_OUTPUT): Remove intl/Makefile.
13946
13947 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
13948
13949 * data/glr.c: Include string.h, for strlen.
13950 (yyreportParseError): Use size_t for yysize.
13951 (yy_yypstack): No longer nested inside yypstates, as nested
13952 functions are not portable. Do not assume size_t is the
13953 same width as int.
13954 (yypstates): Do not assume that ptrdiff_t is the same width
13955 as int, and similarly for yyposn and YYINDEX.
13956
13957 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
13958
13959 * lib/Makefile.am (INCLUDES): Do not include from the intl
13960 directory, which has been removed.
13961 * src/Makefile.am (INCLUDES): Likewise.
13962
13963 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
13964 (bitsets_sources, additional_bitsets_sources, timevars_sources):
13965 New vars.
13966
13967 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
13968 * tests/Makefile.am (EXTRA_DIST): Likewise.
13969
13970 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
13971 Do not assume that bitset_windex is the same width as unsigned.
13972
13973 * lib/abitset.c (abitset_unused_clear): Do not assume that
13974 bitset_word is the same width as int.
13975 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
13976 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
13977 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
13978 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
13979 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
13980
13981 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
13982 portability to one's complement hosts!).
13983 * lib/ebitset.c (ebitset_op1): Likewise.
13984 * lib/lbitset.c (lbitset_op1): Likewise.
13985
13986 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
13987 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13988 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
13989 Sync with fileutils.
13990 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
13991 lib/gettext.h: Sync with diffutils.
13992
13993 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
13994 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
13995
13996 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
13997 PROTOTYPES to check for prototypes, and "defined __STDC__" to
13998 check for void *.
13999
14000 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14001 size_t; the old version tried to do this but casted improperly.
14002 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14003 (bitset_test): Now returns int, not unsigned long.
14004
14005 * lib/bitset_stats.c: Include "gettext.h".
14006 (_): New macro.
14007 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14008 name locals "index", as it generates unnecessary warnings on some
14009 hosts that have an "index" function.
14010
14011 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14012 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14013 they need translation.
14014 * src/LR0.c (state_list_append, new_itemsets, get_state,
14015 append_states, generate_states): Likewise.
14016 * src/assoc.c (assoc_to_string): Likewise.
14017 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14018 * src/gram.c (grammar_dump): Likewise.
14019 * src/injections.c (injections_compute): Likewise.
14020 * src/lalr.c (lookaheads_print): Likewise.
14021 * src/relation.c (relation_transpose): Likewise.
14022 * src/scan-gram.l: Likewise.
14023 * src/tables.c (table_grow, pack_vector): Likewise.
14024
14025 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14026 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14027 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14028 * m4/mbstate_t.m4: Sync with fileutils.
14029 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14030
14031 * po/LINGUAS: Add pt_BR.
14032 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14033 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14034 lib/timevar.c.
14035 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14036 manual recommends.
14037 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14038
14039 * src/complain.c (strerror_r): Remove decl; not needed.
14040 (strerror): Use same pattern as ../lib/error.c.
14041
14042 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14043
14044 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14045
14046 * src/main.c (main): Cast result of bindtextdomain and textdomain
14047 to void, to avoid a GCC warning when --disable-nls is in effect.
14048
14049 * src/scan-gram.l: Use strings rather than escapes when possible,
14050 to minimize the number of warnings from xgettext.
14051 (handle_action_dollar, handle_action_at): Don't use isdigit,
14052 as it mishandles negative chars and it may not work as expected
14053 outside the C locale.
14054
14055 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14056 this is a GCC extension and is not portable to other compilers.
14057
14058 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14059 Do not include <ctype.h>; no longer needed.
14060 Do not include <malloc.h>; no longer needed (and generates
14061 warnings on OpenBSD 3.0).
14062
14063 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14064 it's not portable.
14065
14066 * tests/regression.at: Do not use 'cc -c input.c -o input';
14067 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14068
14069 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14070 exit status as failure, not just exit status 1. Sun C exits
14071 with status 2 sometimes.
14072
14073 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14074 Use it for the two large tests.
14075
c8f002c7
AD
140762002-08-02 Akim Demaille <akim@epita.fr>
14077
14078 * src/conflicts.c (conflicts_output): Don't output rules never
14079 reduced here, since anyway that computation doesn't work.
14080 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14081 (rule_useless_p, rule_never_reduced_p): New.
14082 (grammar_rules_partial_print): Use a filter instead of a range.
14083 Display the title only if needed.
14084 (grammar_rules_print): Adjust.
14085 (grammar_rules_never_reduced_report): New.
14086 * src/tables.c (action_row): Move the computation of rules never
14087 reduced to...
14088 (token_actions): here.
14089 * src/main.c (main): Make the parser before making the report, so
14090 that rules never reduced are computed.
14091 Call grammar_rules_never_reduced_report.
14092 * src/print.c (print_results): Report rules never reduced.
14093 * tests/conflicts.at, tests/reduce.at: Adjust.
14094
cd08e51e
AD
140952002-08-01 Akim Demaille <akim@epita.fr>
14096
14097 Instead of attaching lookaheads and duplicating the rules being
14098 reduced by a state, attach the lookaheads to the reductions.
14099
14100 * src/state.h (state_t): Remove the `lookaheads',
14101 `lookaheads_rule' member.
14102 (reductions_t): Add a `lookaheads' member.
14103 Use a regular array for the `rules'.
14104 * src/state.c (reductions_new): Initialize the lookaheads member
14105 to 0.
14106 (state_rule_lookaheads_print): Adjust.
14107 * src/state.h, src/state.c (state_reductions_find): New.
14108 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14109 (count_rr_conflicts): Adjust.
14110 * src/lalr.c (LArule): Remove.
14111 (add_lookback_edge): Adjust.
14112 (state_lookaheads_count): New.
14113 (states_lookaheads_initialize): Merge into...
14114 (initialize_LA): this.
14115 (lalr_free): Adjust.
14116 * src/main.c (main): Don't free nullable and derives too early: it
14117 is used by --verbose.
14118 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14119
bb0027a9
AD
141202002-08-01 Akim Demaille <akim@epita.fr>
14121
14122 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14123 `rule_number_t**'.
14124 (set_derives, free_derives): Rename as...
14125 (derives_compute, derives_free): this.
14126 Adjust all dependencies.
14127 * src/nullable.c (set_nullable, free_nullable): Rename as...
14128 (nullable_compute, nullable_free): these.
14129 (rule_list_t): Store rule_t *, not rule_number_t.
14130 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14131 pointers, instead of their numbers.
14132 * src/main.c (main): Call nullable_free, and derives_free earlier,
14133 as they were lo longer used.
14134
3325ddc4
AD
141352002-08-01 Akim Demaille <akim@epita.fr>
14136
14137 * lib/timevar.c (get_time): Include children time.
14138 * src/lalr.h (LA, LArule): Don't export them: used with the
14139 state_t.
14140 * src/lalr.c (LA, LArule): Static.
14141 * src/lalr.h, src/lalr.c (lalr_free): New.
14142 * src/main.c (main): Call it.
14143 * src/tables.c (pack_vector): Check whether loc is >= to the
14144 table_size, not >.
14145 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14146 (tables_generate): do it, since that's also it which allocates
14147 them.
14148 Don't free LA and LArule, main does.
14149
c6f1a33c
AD
141502002-07-31 Akim Demaille <akim@epita.fr>
14151
14152 Separate parser tables computation and output.
14153
14154 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14155 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14156 (yydefgoto, yydefact, high): Move to...
14157 * src/tables.h, src/tables.c: here.
14158 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14159 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14160 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14161 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14162 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14163 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14164 (action_row, save_row, token_actions, save_column, default_goto)
14165 (goto_actions, sort_actions, matching_state, pack_vector)
14166 (table_ninf_remap, pack_table, prepare_actions): Move to...
14167 * src/tables.c: here.
14168 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14169 * src/output.c (token_actions, output_base, output_conflicts)
14170 (output_check): Merge into...
14171 (prepare_actions): this.
14172 (actions_output): Rename as...
14173 (user_actions_output): this.
14174 * src/main.c (main): Call tables_generate and tables_free.
14175
1509d42f
AD
141762002-07-31 Akim Demaille <akim@epita.fr>
14177
14178 Steal GCC's --time-report support.
14179
14180 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14181 stolen/adjusted from GCC.
14182 * m4/stage.m4: Remove time related checks.
14183 * m4/timevar.m4: New.
14184 * configure.in: Adjust.
14185 * src/system.h: Adjust to using timevar.h.
14186 * src/getargs.h, src/getargs.c: Support trace_time for
14187 --trace=time.
14188 * src/main.c (stage): Remove.
14189 (main): Replace `stage' invocations with timevar calls.
14190 * src/output.c: Insert pertinent timevar calls.
14191
273a74fa
AD
141922002-07-31 Akim Demaille <akim@epita.fr>
14193
14194 Let --trace have arguments.
14195
14196 * src/getargs.h (enum trace_e): New.
14197 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14198 (long_options, short_options): --trace/-T takes an optional
14199 argument.
14200 Change all the uses of trace_flag to reflect the new flags.
14201 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14202
14203 Strengthen `stage' portability.
14204
14205 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14206 * configure.in: Use it.
14207 Don't check for malloc.h and sys/times.h.
14208 * src/system.h: Include them when appropriate.
14209 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14210 times and struct tms are available.
14211
217598da
AD
142122002-07-30 Akim Demaille <akim@epita.fr>
14213
14214 In verbose parse error message, don't report `error' as an
14215 expected token.
14216 * tests/actions.at (Printers and Destructors): Adjust.
14217 * tests/calc.at (Calculator $1): Adjust.
14218 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14219 error message, do not report the parser accepts the error token in
14220 that state.
14221
52489d44
AD
142222002-07-30 Akim Demaille <akim@epita.fr>
14223
14224 Normalize conflict related messages.
14225
14226 * src/complain.h, src/complain.c (warn, complain): New.
14227 * src/conflicts.c (conflicts_print): Use them.
14228 (conflict_report_yacc): New, extracted from...
14229 (conflicts_print): here.
14230 * tests/conflicts.at, tests/existing.at: Adjust.
14231
e8832397
AD
142322002-07-30 Akim Demaille <akim@epita.fr>
14233
14234 Report rules which are never reduced by the parser: those hidden
14235 by conflicts.
14236
14237 * src/LR0.c (save_reductions): Don't make the final state too
14238 different: save its reduction (accept) instead of having a state
14239 without any action (no shift or goto, no reduce).
14240 Note: the final state is now a ``regular'' state, i.e., the
14241 parsers now contain `reduce 0' as default reduction.
14242 Nevertheless, since they decide to `accept' when yystate =
14243 final_state, they still will not reduce rule 0.
14244 * src/print.c (print_actions, print_reduction): Adjust.
14245 * src/output.c (action_row): Track reduced rules.
14246 (token_actions): Report rules never reduced.
14247 * tests/conflicts.at, tests/regression.at: Adjust.
14248
caf23d24
AD
142492002-07-30 Akim Demaille <akim@epita.fr>
14250
14251 `stage' was accidently included in a previous patch.
14252 Initiate its autoconfiscation.
14253
14254 * configure.in: Look for malloc.h and sys/times.h.
14255 * src/main.c (stage): Adjust.
14256 Report only when trace_flag.
14257
640748ee
AD
142582002-07-29 Akim Demaille <akim@epita.fr>
14259
14260 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14261 state_number_t.
14262 (errs_t): symbol_t*, not symbol_number_t.
14263 (reductions_t): rule_t*, not rule_number_t.
14264 (FOR_EACH_SHIFT): New.
14265 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14266 * src/print.c, src/print_graph.c: Adjust.
14267
88bce5a2
AD
142682002-07-29 Akim Demaille <akim@epita.fr>
14269
14270 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14271
14272 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14273 (endtoken, accept): these.
14274 * src/reader.c (reader): Set endtoken's default tag to "$end".
14275 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14276 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14277 Adjust.
14278
1bfb97db
AD
142792002-07-29 Akim Demaille <akim@epita.fr>
14280
14281 * src/reduce.c (reduce_grammar): When the language is empty,
14282 complain about the start symbol, not the axiom.
14283 Use its location.
14284 * tests/reduce.at (Empty Language): New.
14285
fc5734fe
AD
142862002-07-26 Akim Demaille <akim@epita.fr>
14287
14288 * src/reader.h, src/reader.c (gram_error): ... can't get
14289 yycontrol without making too strong assumptions on the parser
14290 itself.
14291 * src/output.c (prepare_tokens): Use the real 0th value of
14292 token_translations instead of `0'.
14293 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14294 visible here.
14295 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14296 for the time being: %locations ought to provide it to yyerror.
14297
3650b4b8
AD
142982002-07-25 Akim Demaille <akim@epita.fr>
14299
14300 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14301 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14302 * tests/regression.at (Web2c Actions): Adjust.
14303
4b3d3a8e
AD
143042002-07-25 Akim Demaille <akim@epita.fr>
14305
14306 Stop storing rules from 1 to nrules + 1.
14307
14308 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14309 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14310 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14311 Iterate from 0 to nrules.
14312 Use rule_number_as_item_number and item_number_as_rule_number.
14313 Adjust to `derive' now containing possibly 0.
14314 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14315 Handle the `- 1' part in rule numbers from/to item numbers.
14316 * src/conflicts.c (log_resolution): Fix the message which reversed
14317 shift and reduce.
14318 * src/output.c (action_row): Initialize default_rule to -1.
14319 (token_actions): Adjust.
14320 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14321 expected output.
14322 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14323
4a2a22f4
AD
143242002-07-25 Akim Demaille <akim@epita.fr>
14325
14326 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14327 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14328 (b4_c_knr_arg_decl): New.
14329 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14330 yyreport_parse_error.
14331
b8df3223
AD
143322002-07-25 Akim Demaille <akim@epita.fr>
14333
14334 * data/yacc.c (yyreport_parse_error): New, extracted from...
14335 (yyparse): here.
14336 (yydestruct, yysymprint): Move above yyparse.
14337 Be K&R compliant.
14338
a762e609
AD
143392002-07-25 Akim Demaille <akim@epita.fr>
14340
14341 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14342 replace...
14343 (b4_sint_type, b4_uint_type): these.
14344 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14345 * tests/regression.at (Web2c Actions): Adjust.
14346
12b0043a
AD
143472002-07-25 Akim Demaille <akim@epita.fr>
14348
14349 * src/gram.h (TIEM_NUMBER_MAX): New.
14350 (item_number_of_rule_number, rule_number_of_item_number): Rename
14351 as...
14352 (rule_number_as_item_number, item_number_as_rule_number): these.
14353 Adjust dependencies.
14354 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14355 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14356 (symbol_number_to_vector_number): New.
14357 (order): Of vector_number_t* type.
14358 (base_t, BASE_MAX, BASE_MIN): New.
14359 (froms, tos, width, pos, check): Of base_t type.
14360 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14361 (actrow): Of action_number_t type.
14362 (conflrow): Of unsigned int type.
14363 (table_ninf, base_ninf): New.
14364 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14365 (muscle_insert_int_table, muscle_insert_base_table)
14366 (muscle_insert_rule_number_table): New.
14367 (prepare_tokens): Output `toknum' as int_table.
14368 (action_row): Returns a rule_number_t.
14369 Use ACTION_MIN, not SHRT_MIN.
14370 (token_actions): yydefact is rule_number_t*.
14371 (table_ninf_remap): New.
14372 (pack_table): Use it for `base' and `table'.
14373 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14374 replaced with...
14375 (YYPACT_NINF, YYTABLE_NINF): these.
14376 (yypact, yytable): Compute their types instead of hard-coded
14377 `short'.
14378 * tests/regression.at (Web2c Actions): Adjust.
14379
5dde258a
AD
143802002-07-19 Akim Demaille <akim@epita.fr>
14381
14382 * src/scan-gram.l (id): Can start with an underscore.
14383
a945ec39
AD
143842002-07-16 Akim Demaille <akim@epita.fr>
14385
14386 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14387 Adjust all former `associativity' dependencies.
14388 * src/symtab.c (symbol_new): Default associativity is `undef', not
14389 `right'.
14390 (symbol_check_alias_consistence): Adjust.
14391
fae437e8
AD
143922002-07-09 Akim Demaille <akim@epita.fr>
14393
14394 * doc/bison.texinfo: Properly set the ``header'' part.
14395 Use @dircategory ``GNU programming tools'' as per Texinfo's
14396 documentation.
14397 Use @copying.
14398
1a715ef2
AD
143992002-07-09 Akim Demaille <akim@epita.fr>
14400
14401 * lib/quotearg.h: Protect against multiple inclusions.
14402 * src/location.h (location_t): Add a `file' member.
14403 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14404 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14405 `error_one_per_line' support.
14406
a5d50994
AD
144072002-07-09 Akim Demaille <akim@epita.fr>
14408
14409 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14410 * src/reader.c (lineno): Remove.
14411 Adjust all dependencies.
14412 (get_merge_function): Take a location and use complain_at.
14413 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14414 * tests/regression.at (Invalid inputs, Mixing %token styles):
14415 Adjust.
14416
b275314e
AD
144172002-07-09 Akim Demaille <akim@epita.fr>
14418
14419 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14420 recovery rule, and forbid extensions when --yacc.
14421 (gram_error): Use complain_at.
14422 * src/reader.c (reader): Exit if there were parse errors.
14423
865b9df1
AD
144242002-07-09 Akim Demaille <akim@epita.fr>
14425
14426 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14427 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14428 Reported by R Blake <blakers@mac.com>.
14429
c76e14da
AD
144302002-07-09 Akim Demaille <akim@epita.fr>
14431
14432 * data/yacc.c: Output the copyright notive in the header.
14433
7db2ed2d
AD
144342002-07-03 Akim Demaille <akim@epita.fr>
14435
14436 * src/output.c (froms, tos): Are state_number_t.
14437 (save_column): sp, sp1, and sp2 are state_number_t.
14438 (prepare): Rename `final' as `final_state_number', `nnts' as
14439 `nterms_number', `nrules' as `rules_number', `nstates' as
14440 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14441 unused.
14442 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14443 * data/lalr1.cc (nsym_): Remove, unused.
14444
e68e0410
AD
144452002-07-03 Akim Demaille <akim@epita.fr>
14446
14447 * src/lalr.h, src/lalr.c (goto_number_t): New.
14448 * src/lalr.c (goto_list_t): New.
14449 Propagate them.
14450 * src/nullable.c (rule_list_t): New.
14451 Propagate.
14452 * src/types.h: Remove.
14453
e1a4f3a4
AD
144542002-07-03 Akim Demaille <akim@epita.fr>
14455
14456 * src/closure.c (print_fderives): Use rule_rhs_print.
14457 * src/derives.c (print_derives): Use rule_rhs_print.
14458 (rule_list_t): New, replaces `shorts'.
14459 (set_derives): Add comments.
14460 * tests/sets.at (Nullable, Firsts): Adjust.
14461
536545f3
AD
144622002-07-03 Akim Demaille <akim@epita.fr>
14463
14464 * src/output.c (prepare_actions): Free `tally' and `width'.
14465 (prepare_actions): Allocate and free `order'.
14466 * src/symtab.c (symbols_free): Free `symbols'.
14467 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14468 * src/output.c (m4_invoke): Move to...
14469 * src/scan-skel.l: here.
14470 (<<EOF>>): Close yyout, and free its name.
14471
8b752b00
AD
144722002-07-03 Akim Demaille <akim@epita.fr>
14473
14474 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14475
14476 * src/LR0.c (new_state): Merge into...
14477 (state_list_append): this.
14478 (new_states): Merge into...
14479 (generate_states): here.
14480 (set_states): Don't ensure a proper `errs' state member here, do it...
14481 * src/conflicts.c (conflicts_solve): here.
14482 * src/state.h, src/state.c: Comment changes.
14483 (state_t): Rename member `shifts' as `transitions'.
14484 Adjust all dependencies.
14485 (errs_new): For consistency, also take the values as argument.
14486 (errs_dup): Remove.
14487 (state_errs_set): New.
14488 (state_reductions_set, state_transitions_set): Assert that no
14489 previous value was assigned.
14490 (state_free): New.
14491 (states_free): Use it.
14492 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14493 temporary storage: use `errs' and `nerrs' as elsewhere.
14494 (set_conflicts): Allocate and free this `errs'.
14495
613f5e1a
AD
144962002-07-02 Akim Demaille <akim@epita.fr>
14497
14498 * lib/libiberty.h: New.
14499 * lib: Update the bitset implementation from upstream.
14500 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14501 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14502 * src/main.c: Adjust bitset stats calls.
14503
26e0cadc
PE
145042002-07-01 Paul Eggert <eggert@twinsun.com>
14505
14506 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14507 char, so that negative chars don't collide with $.
14508
1154cced
AD
145092002-06-30 Akim Demaille <akim@epita.fr>
14510
14511 Have the GLR tests be `warning' checked, and fix the warnings.
14512
14513 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14514 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14515 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14516 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14517 (yyaddDeferredAction): static.
14518 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14519 (yyreportParseError): yyprefix is const.
14520 yytokenp is used only when verbose.
14521 (yy__GNUC__): Replace with __GNUC__.
14522 (yypdumpstack): yyi is size_t.
14523 (yypreference): Un-yy local variables and arguments, to avoid
14524 clashes with `yyr1'. Anyway, we are not in the user name space.
14525 (yytname_size): be an int, as is compared with ints.
14526 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14527 Use them.
14528 * tests/cxx-gram.at: Use quotation to protect $1.
14529 Use AT_COMPILE to enable warnings hunts.
14530 Prototype yylex and yyerror.
14531 `Use' argc.
14532 Include `string.h', not `strings.h'.
14533 Produce and prototype stmtMerge only when used.
14534 yylex takes a location.
14535
97650f4e
AD
145362002-06-30 Akim Demaille <akim@epita.fr>
14537
14538 We spend a lot of time in quotearg, in particular when --verbose.
14539
14540 * src/symtab.c (symbol_get): Store a quoted version of the key.
14541 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14542 Adjust all callers.
14543
d2576365
AD
145442002-06-30 Akim Demaille <akim@epita.fr>
14545
14546 * src/state.h (reductions_t): Rename member `nreds' as num.
14547 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14548 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14549
ccaf65bc
AD
145502002-06-30 Akim Demaille <akim@epita.fr>
14551
14552 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14553 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14554 (shifts_to): Rename as...
14555 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14556 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14557 (TRANSITION_IS_DISABLED, transitions_to): these.
14558
87675353
AD
145592002-06-30 Akim Demaille <akim@epita.fr>
14560
14561 * src/print.c (print_shifts, print_gotos): Merge into...
14562 (print_transitions): this.
14563 (print_transitions, print_errs, print_reductions): Align the
14564 lookaheads columns.
14565 (print_core, print_transitions, print_errs, print_state,
14566 print_grammar): Output empty lines separator before, not after.
14567 (state_default_rule_compute): Rename as...
14568 (state_default_rule): this.
14569 * tests/conflicts.at (Defaulted Conflicted Reduction),
14570 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14571 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14572
ce4ccb4b
AD
145732002-06-30 Akim Demaille <akim@epita.fr>
14574
14575 Display items as we display rules.
14576
14577 * src/gram.h, src/gram.c (rule_lhs_print): New.
14578 * src/gram.c (grammar_rules_partial_print): Use it.
14579 * src/print.c (print_core): Likewise.
14580 * tests/conflicts.at (Defaulted Conflicted Reduction),
14581 (Unresolved SR Conflicts): Adjust.
14582 (Unresolved SR Conflicts): Adjust and rename as...
14583 (Resolved SR Conflicts): this, as was meant.
14584 * tests/regression.at (Web2c Report): Adjust.
14585
bc933ef1
AD
145862002-06-30 Akim Demaille <akim@epita.fr>
14587
14588 * src/print.c (state_default_rule_compute): New, extracted from...
14589 (print_reductions): here.
14590 Pessimize, but clarify the code.
14591 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14592
53d4308d
AD
145932002-06-30 Akim Demaille <akim@epita.fr>
14594
14595 * src/output.c (action_row): Let default_rule be always a rule
14596 number.
14597
574fb2d5
AD
145982002-06-30 Akim Demaille <akim@epita.fr>
14599
14600 * src/closure.c (print_firsts, print_fderives, closure):
14601 Use BITSET_EXECUTE.
14602 * src/lalr.c (lookaheads_print): Likewise.
14603 * src/state.c (state_rule_lookaheads_print): Likewise.
14604 * src/print_graph.c (print_core): Likewise.
14605 * src/print.c (print_reductions): Likewise.
14606 * src/output.c (action_row): Likewise.
14607 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14608
05811fd7
AD
146092002-06-30 Akim Demaille <akim@epita.fr>
14610
14611 * src/print_graph.c: Use report_flag.
14612
0e4d5753
AD
146132002-06-30 Akim Demaille <akim@epita.fr>
14614
14615 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14616 to...
14617 * src/relation.h, src/relation.c (traverse, relation_digraph)
14618 (relation_print, relation_transpose): New.
14619
24c7d800
AD
146202002-06-30 Akim Demaille <akim@epita.fr>
14621
14622 * src/state.h, src/state.c (shifts_to): New.
14623 * src/lalr.c (build_relations): Use it.
14624
9222837b
AD
146252002-06-30 Akim Demaille <akim@epita.fr>
14626
14627 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14628 (item_number_of_rule_number, rule_number_of_item_number): New.
14629 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14630 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14631 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14632 Propagate their use.
14633 Much remains to be done, in particular wrt `shorts' from types.h.
14634
260008e5
AD
146352002-06-30 Akim Demaille <akim@epita.fr>
14636
14637 * src/symtab.c (symbol_new): Initialize the `printer' member.
14638
8a731ca8
AD
146392002-06-30 Akim Demaille <akim@epita.fr>
14640
14641 * src/LR0.c (save_reductions): Remove, replaced by...
14642 * src/state.h, src/state.c (state_reductions_set): New.
14643 (reductions, errs): Rename as...
14644 (reductions_t, errs_t): these.
14645 Adjust all dependencies.
14646
32e1e0a4
AD
146472002-06-30 Akim Demaille <akim@epita.fr>
14648
14649 * src/LR0.c (state_list_t, state_list_append): New.
14650 (first_state, last_state): Now symbol_list_t.
14651 (this_state): Remove.
14652 (new_itemsets, append_states, save_reductions): Take a state_t as
14653 argument.
14654 (set_states, generate_states): Adjust.
14655 (save_shifts): Remove, replaced by...
14656 * src/state.h, src/state.c (state_shifts_set): New.
14657 (shifts): Rename as...
14658 (shifts_t): this.
14659 Adjust all dependencies.
14660 * src/state.h (state_t): Remove the `next' member.
14661
e5fb6710
AD
146622002-06-30 Akim Demaille <akim@epita.fr>
14663
14664 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14665 escaped in slot 0.
14666
c7ca99d4
AD
146672002-06-30 Akim Demaille <akim@epita.fr>
14668
14669 Use hash.h for the state hash table.
14670
14671 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14672 (allocate_storage): Use state_hash_new.
14673 (free_storage): Use state_hash_free.
14674 (new_state, get_state): Adjust.
14675 * src/lalr.h, src/lalr.c (states): Move to...
14676 * src/states.h (state_t): Remove the `link' member, no longer
14677 used.
14678 * src/states.h, src/states.c: here.
14679 (state_hash_new, state_hash_free, state_hash_lookup)
14680 (state_hash_insert, states_free): New.
14681 * src/states.c (state_table, state_compare, state_hash): New.
14682 * src/output.c (output_actions): Do not free states now, since we
14683 still need to know the final_state number in `prepare', called
14684 afterwards. Do it...
14685 * src/main.c (main): here: call states_free after `output'.
14686
df0e7316
AD
146872002-06-30 Akim Demaille <akim@epita.fr>
14688
14689 * src/state.h, src/state.c (state_new): New, extracted from...
14690 * src/LR0.c (new_state): here.
14691 * src/state.h (STATE_ALLOC): Move to...
14692 * src/state.c: here.
14693 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14694 * src/state.h, src/state.c: here.
14695
39f41916
AD
146962002-06-30 Akim Demaille <akim@epita.fr>
14697
14698 * src/reader.c (gensym): Rename as...
14699 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14700 (getsym): Rename as...
14701 (symbol_get): this.
14702
d57650a5
AD
147032002-06-30 Akim Demaille <akim@epita.fr>
14704
14705 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14706 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14707 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14708 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14709
5a08f1ce
AD
147102002-06-30 Akim Demaille <akim@epita.fr>
14711
14712 Make the test suite pass with warnings checked.
14713
14714 * tests/actions.at (Printers and Destructors): Improve.
14715 Avoid unsigned vs. signed issues.
14716 * tests/calc.at: Don't exercise the scanner here, do it...
14717 * tests/input.at (Torturing the Scanner): here.
14718
720623af
PH
147192002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14720
88e7e941 14721 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
14722 reorganize first lines parallel to yacc.c.
14723
fb8135fa
AD
147242002-06-28 Akim Demaille <akim@epita.fr>
14725
14726 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14727 (b4_token_enum, b4_token_defines): New, factored from...
14728 * data/lalr1.cc, data/yacc.c, glr.c: here.
14729
41442480
AD
147302002-06-28 Akim Demaille <akim@epita.fr>
14731
14732 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14733 unused variables.
14734 * src/output.c (merger_output): static.
14735
e0e5bf84
AD
147362002-06-28 Akim Demaille <akim@epita.fr>
14737
ba0fe3c7 14738 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
14739 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14740 pacify GCC.
14741 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 14742
676385e2
PH
147432002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14744
14745 Accumulated changelog for new GLR parsing features.
14746
6a254321 14747 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
14748 conflicts_total_count.
14749 * src/conflicts.h: Ditto.
14750 * src/output.c (token_actions): Use the new name.
14751 (output_conflicts): Change conflp => conflict_list_heads, and
14752 confl => conflict_list for better readability.
14753 * data/glr.c: Use the new names.
14754 * NEWS: Add self to GLR announcement.
e0e5bf84 14755
676385e2
PH
14756 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14757
14758 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14759 Akim Demaille.
14760
14761 * data/bison.glr: Change name to glr.c
14762 * data/glr.c: Renamed from bison.glr.
14763 * data/Makefile.am: Add glr.c
e0e5bf84
AD
14764
14765 * src/getargs.c:
14766
676385e2 14767 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 14768 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 14769
676385e2
PH
14770 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14771
14772 * data/bison.glr: Be sure to restore the
14773 current #line when returning to the skeleton contents after having
14774 exposed the input file's #line.
14775
14776 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14777
14778 * data/bison.glr: Bring up to date with changes to bison.simple.
14779
14780 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14781
14782 * data/bison.glr: Correct definitions that use b4_prefix.
14783 Various reformatting.
14784 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14785 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14786 yytokenp argument; now part of stack.
14787 (yychar): Define to behave as documented.
14788 (yyclearin): Ditto.
e0e5bf84 14789
676385e2
PH
14790 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14791
14792 * src/reader.h: Add declaration for free_merger_functions.
14793
14794 * src/reader.c (merge_functions): New variable.
14795 (get_merge_function): New function.
14796 (free_merger_functions): New function.
14797 (readgram): Check for %prec that is not followed by a symbol.
14798 Handle %dprec and %merge declarations.
14799 (packgram): Initialize dprec and merger fields in rules array.
14800
14801 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14802 conflict_list_cnt, conflict_list_free): New variables.
14803 (table_grow): Also grow conflict_table.
e0e5bf84 14804 (prepare_rules): Output dprec and merger tables.
676385e2 14805 (conflict_row): New function.
e0e5bf84 14806 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
14807 default reduction in conflicted states for GLR parser so that there
14808 are spaces for the conflict lists.
14809 (save_row): Also save conflict information.
14810 (token_actions): Allocate conflict list.
14811 (merger_output): New function.
14812 (pack_vector): Pack conflict table, too.
14813 (output_conflicts): New function to output yyconflp and yyconfl.
14814 (output_check): Allocate conflict_tos.
14815 (output_actions): Output conflict tables, also.
14816 (output_skeleton): Output b4_mergers definition.
14817 (prepare): Output b4_max_rhs_length definition.
14818 Use 'bison.glr' as default skeleton for GLR parsers.
14819
14820 * src/gram.c (glr_parser): New flag.
14821 (grammar_free): Call free_merger_functions.
14822
14823 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14824 all pairs of conflicting reductions, rather than just all tokens
14825 causing conflicts. Needed to size conflict tables.
e0e5bf84 14826 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
14827 interface.
14828 (conflicts_print): Ditto.
14829 (count_total_conflicts): New function.
14830
14831 * src/reader.h (merger_list): New type.
14832 (merge_functions): New variable.
14833
14834 * src/lex.h (tok_dprec, tok_merge): New token types.
14835
14836 * src/gram.h (rule_s): Add dprec and merger fields.
14837 (glr_parser): New flag.
14838
14839 * src/conflicts.h (count_total_conflicts): New function.
14840
14841 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14842
14843 * doc/bison.texinfo (Generalized LR Parsing): New section.
14844 (GLR Parsers): New section.
14845 (Language and Grammar): Mention GLR parsing.
14846 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14847 Correct typo ("tge" -> "the").
14848
14849 * data/bison.glr: New skeleton for GLR parsing.
14850
14851 * tests/cxx-gram.at: New tests for GLR parsing.
14852
14853 * tests/testsuite.at: Include cxx-gram.at.
14854
14855 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 14856
676385e2
PH
14857 * src/parse-gram.y:
14858
14859 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14860
14861 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 14862
b5480d74 148632002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
14864
14865 * src/options.h, src/options.c: Remove.
14866 * src/getargs.c (short_options, long_options): New.
14867
60491a94
AD
148682002-06-27 Akim Demaille <akim@epita.fr>
14869
14870 * data/bison.simple, data/bison.c++: Rename as...
14871 * data/yacc.c, data/lalr1.cc: these.
14872 * doc/bison.texinfo (Environment Variables): Remove.
14873
9be0c25b
AD
148742002-06-25 Raja R Harinath <harinath@cs.umn.edu>
14875
14876 * src/getargs.c (report_argmatch): Initialize strtok().
14877
1ae72863
AD
148782002-06-20 Akim Demaille <akim@epita.fr>
14879
14880 * data/bison.simple (b4_symbol_actions): New, replaces...
14881 (b4_symbol_destructor, b4_symbol_printer): these.
14882 (yysymprint): Be sure to call YYPRINT only for tokens, and using
14883 user token numbers.
14884
87542d29
AD
148852002-06-20 Akim Demaille <akim@epita.fr>
14886
14887 * data/bison.simple (yydestructor): Rename as...
14888 (yydestruct): this.
14889
1a31ed21
AD
148902002-06-20 Akim Demaille <akim@epita.fr>
14891
14892 * src/symtab.h, src/symtab.c (symbol_type_set)
14893 (symbol_destructor_set, symbol_precedence_set): The location is
14894 the last argument.
14895 Adjust all callers.
14896
e776192e
AD
148972002-06-20 Akim Demaille <akim@epita.fr>
14898
14899 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
14900 internals.
14901 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
14902 Takes a location.
14903 * src/symtab.h, src/symtab.c (symbol_class_set)
14904 (symbol_user_token_number_set): Likewise.
14905 Adjust all callers.
14906 Promote complain_at.
14907 * tests/input.at (Type Clashes): Adjust.
14908
5c1180b3
AD
149092002-06-20 Akim Demaille <akim@epita.fr>
14910
14911 * data/bison.simple (YYLEX): Fix the declaration when
14912 %pure-parser.
14913
e3170060
AD
149142002-06-20 Akim Demaille <akim@epita.fr>
14915
14916 * data/bison.simple (yysymprint): Don't print the token number,
14917 just its name.
14918 * tests/actions.at (Destructors): Rename as...
14919 (Printers and Destructors): this.
14920 Also exercise %printer.
14921
253862fd
AD
149222002-06-20 Akim Demaille <akim@epita.fr>
14923
14924 * data/bison.simple (YYDSYMPRINT): New.
14925 Use it to remove many of the #if YYDEBUG/if (yydebug).
14926
366eea36
AD
149272002-06-20 Akim Demaille <akim@epita.fr>
14928
14929 * src/symtab.h, src/symtab.c (symbol_t): printer and
14930 printer_location are new members.
14931 (symbol_printer_set): New.
14932 * src/parse-gram.y (PERCENT_PRINTER): New token.
14933 Handle its associated rule.
14934 * src/scan-gram.l: Adjust.
14935 (handle_destructor_at, handle_destructor_dollar): Rename as...
14936 (handle_symbol_code_at, handle_symbol_code_dollar): these.
14937 * src/output.c (symbol_printers_output): New.
14938 (output_skeleton): Call it.
14939 * data/bison.simple (yysymprint): New. Cannot be named yyprint
14940 since there are already many grammar files with a user `yyprint'.
14941 Replace the calls to YYPRINT to calls to yysymprint.
14942 * tests/calc.at: Adjust.
14943 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
14944 taking advantage of parser very internal details (stack size!).
14945
4f25ebb0
AD
149462002-06-20 Akim Demaille <akim@epita.fr>
14947
14948 * src/scan-gram.l: Complete the scanner with the missing patterns
14949 to pacify Flex.
14950 Use `quote' and `symbol_tag_get' where appropriate.
14951
93b68a0e
AD
149522002-06-19 Akim Demaille <akim@epita.fr>
14953
14954 * tests/actions.at (Destructors): Augment to test locations.
14955 * data/bison.simple (yydestructor): Pass it the current location
14956 if locations are enabled.
14957 Prototype only when __STDC__ or C++.
14958 Change the argument names to move into the yy name space: there is
14959 user code here.
14960
58612f1d
AD
149612002-06-19 Akim Demaille <akim@epita.fr>
14962
74310291
AD
14963 * data/bison.simple (b4_pure_if): New.
14964 Use it instead of #ifdef YYPURE.
14965
149662002-06-19 Akim Demaille <akim@epita.fr>
14967
14968 * data/bison.simple (b4_location_if): New.
58612f1d
AD
14969 Use it instead of #ifdef YYLSP_NEEDED.
14970
f25bfb75
AD
149712002-06-19 Akim Demaille <akim@epita.fr>
14972
14973 Prepare @$ in %destructor, but currently don't bind it in the
14974 skeleton, as %location use is not cleaned up yet.
14975
14976 * src/scan-gram.l (handle_dollar, handle_destructor_at)
14977 (handle_action_at): New.
14978 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
14979 a braced_code_t and a location as additional arguments.
14980 (handle_destructor_dollar): Instead of requiring `b4_eval', just
14981 unquote one when outputting `b4_dollar_dollar'.
14982 Adjust callers.
14983 * data/bison.simple (b4_eval): Remove.
14984 (b4_symbol_destructor): Adjust.
14985 * tests/input.at (Invalid @n): Adjust.
14986
c732d2c6
AD
149872002-06-19 Zack Weinberg <zack@codesourcery.com>
14988
14989 * doc/bison.texinfo: Document ability to have multiple
14990 prologue sections.
14991
8c165d89
AD
149922002-06-18 Akim Demaille <akim@epita.fr>
14993
14994 * src/files.c (compute_base_names): When computing the output file
14995 names from the input file name, strip the directory part.
14996
ca98bf57
AD
149972002-06-18 Akim Demaille <akim@epita.fr>
14998
14999 * data/bison.simple.new: Comment changes.
15000 Reported by Andreas Schwab.
15001
0bfb02ff
AD
150022002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15003
15004 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15005 there are no `label `yyoverflowlab' defined but not used' warnings
15006 when yyoverflow is defined.
15007
24c0aad7
AD
150082002-06-18 Akim Demaille <akim@epita.fr>
15009
15010 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15011 new member.
15012 (symbol_destructor_set): Adjust.
15013 * src/output.c (symbol_destructors_output): Output the destructor
15014 locations.
15015 Output the symbol name.
15016 * data/bison.simple (b4_symbol_destructor): Adjust.
15017
5719c109
AD
150182002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15019 and Akim Demaille <akim@epita.fr>
15020
15021 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15022 what's left on the stack when the error recovery hits EOF.
15023 * tests/actions.at (Destructors): Complete to exercise this case.
15024
9280d3ef
AD
150252002-06-17 Akim Demaille <akim@epita.fr>
15026
15027 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15028 arguments is really empty, not only equal to `[]'.
15029 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15030 member.
15031 (symbol_destructor_set): New.
15032 * src/output.c (symbol_destructors_output): New.
15033 * src/reader.h (brace_code_t, current_braced_code): New.
15034 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15035 (handle_dollar): Rename as...
15036 (handle_action_dollar): this.
15037 (handle_destructor_dollar): New.
15038 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15039 (grammar_declaration): Use it.
15040 * data/bison.simple (yystos): Is always defined.
15041 (yydestructor): New.
15042 * tests/actions.at (Destructors): New.
15043 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15044
dafdc66f
AD
150452002-06-17 Akim Demaille <akim@epita.fr>
15046
15047 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15048 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15049 rule_length only when needed.
15050 * src/output.c (actions_output, token_definitions_output): Output
15051 the full M4 block.
15052 * src/symtab.c: Don't access directly to the symbol tag, use
15053 symbol_tag_get.
15054 * src/parse-gram.y: Use symbol_list_free.
15055
56c47203
AD
150562002-06-17 Akim Demaille <akim@epita.fr>
15057
15058 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15059 (symbol_list_prepend, get_type_name): Move to...
15060 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15061 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15062 Adjust all callers.
15063 (symbol_list_free): New.
15064 * src/scan-gram.l (handle_dollar): Takes a location.
15065 * tests/input.at (Invalid $n): Adjust.
15066
1e0bab92
AD
150672002-06-17 Akim Demaille <akim@epita.fr>
15068
15069 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15070 (symbol_list_prepend): New.
15071 * src/parse-gram.y (%union): `list' is a new member.
15072 (symbols.1): New, replaces...
15073 (terms_to_prec.1, nterms_to_type.1): these.
15074 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15075 Take a location as additional argument.
15076 Adjust all callers.
15077
04e60654
AD
150782002-06-15 Akim Demaille <akim@epita.fr>
15079
15080 * src/parse-gram.y: Move %token in the declaration section so that
15081 we don't depend upon CVS Bison.
15082
10e5b8bd
AD
150832002-06-15 Akim Demaille <akim@epita.fr>
15084
15085 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15086 * src/print.c (print_core): Use it.
15087
9801d40c
AD
150882002-06-15 Akim Demaille <akim@epita.fr>
15089
15090 * src/conflicts.c (log_resolution): Accept the rule involved in
15091 the sr conflicts instead of the lookahead number that points to
15092 that rule.
15093 (flush_reduce): Accept the current lookahead vector as argument,
15094 instead of the index in LA.
15095 (resolve_sr_conflict): Accept the current number of lookahead
15096 bitset to consider for the STATE, instead of the index in LA.
15097 (set_conflicts): Adjust.
15098 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15099
c0263492
AD
151002002-06-15 Akim Demaille <akim@epita.fr>
15101
15102 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15103 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15104 Adjust all dependencies.
15105 * src/lalr.c (initialize_lookaheads): Split into...
15106 (states_lookaheads_count, states_lookaheads_initialize): these.
15107 (lalr): Adjust.
15108
9757c359
AD
151092002-06-15 Akim Demaille <akim@epita.fr>
15110
15111 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15112 out of...
15113 (grammar_rules_print): here.
15114 * src/reduce.c (reduce_output): Use it.
15115 * tests/reduce.at (Useless Rules, Reduced Automaton)
15116 (Underivable Rules): Adjust.
15117
6b98e4b5
AD
151182002-06-15 Akim Demaille <akim@epita.fr>
15119
15120 Copy BYacc's nice way to report the grammar.
15121
15122 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15123 New.
15124 Don't print the rules' location, it is confusing and useless.
15125 (rule_print): Use grammar_rhs_print.
15126 * src/print.c (print_grammar): Use grammar_rules_print.
15127
6b98e4b5
AD
151282002-06-15 Akim Demaille <akim@epita.fr>
15129
15130 Complete and rationalize `useless thing' warnings.
15131
15132 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15133 (symbol_tag_print): New.
15134 Use them everywhere in place of accessing directly the tag member.
15135 * src/gram.h, src/gram.c (rule_print): New.
15136 Use it where a rule used to be printed `by hand'.
15137 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15138 (reduce_grammar_tables): Report the useless rules.
15139 (reduce_print): Useless things are a warning, not an error.
15140 Report it as such.
15141 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15142 (Reduced Automaton, Underivable Rules): Adjust.
15143 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15144 * tests/conflicts.at (Unresolved SR Conflicts)
15145 (Solved SR Conflicts): Adjust.
15146
ee000ba4
AD
151472002-06-15 Akim Demaille <akim@epita.fr>
15148
15149 Let symbols have a location.
15150
15151 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15152 (getsym): Adjust.
15153 Adjust all callers.
15154 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15155 Use location_t, not int.
15156 * src/symtab.c (symbol_check_defined): Take advantage of the
15157 location.
15158 * tests/regression.at (Invalid inputs): Adjust.
15159
8efe435c
AD
151602002-06-15 Akim Demaille <akim@epita.fr>
15161
15162 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15163 (input): Don't try to initialize yylloc here, do it in the
15164 scanner.
15165 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15166 * src/gram.h (rule_t): Change line and action_line into location
15167 and action_location, of location_t type.
15168 Adjust all dependencies.
15169 * src/location.h, src/location.c (empty_location): New.
15170 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15171 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15172 (grammar_current_rule_symbol_append)
15173 (grammar_current_rule_action_append): Expect a location as argument.
15174 * src/reader.c (grammar_midrule_action): Adjust to attach an
15175 action's location as dummy symbol location.
15176 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15177 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15178 the line numbers.
15179
1921f1d7
AD
151802002-06-14 Akim Demaille <akim@epita.fr>
15181
15182 Grammar declarations may be found in the grammar section.
15183
15184 * src/parse-gram.y (rules_or_grammar_declaration): New.
15185 (declarations): Each declaration may end with a semicolon, not
15186 just...
15187 (grammar_declaration): `"%union"'.
15188 (grammar): Branch to rules_or_grammar_declaration.
15189
4515534c
AD
151902002-06-14 Akim Demaille <akim@epita.fr>
15191
15192 * src/main.c (main): Invoke scanner_free.
15193
f958596b
AD
151942002-06-14 Akim Demaille <akim@epita.fr>
15195
15196 * src/output.c (m4_invoke): Extracted from...
15197 (output_skeleton): here.
15198 Free tempfile.
15199
2c569025
AD
152002002-06-14 Akim Demaille <akim@epita.fr>
15201
15202 * src/parse-gram.y (directives, directive, gram)
15203 (grammar_directives, precedence_directives, precedence_directive):
15204 Rename as...
15205 (declarations, declaration, grammar, grammar_declaration)
15206 (precedence_declaration, precedence_declarator): these.
15207 (symbol_declaration): New.
15208
592e8d4d
AD
152092002-06-14 Akim Demaille <akim@epita.fr>
15210
15211 * src/files.c (action_obstack): Remove, unused.
15212 (output_obstack): Remove it, and all its dependencies, as it is no
15213 longer needed.
15214 * src/reader.c (epilogue_set): Build the epilogue in the
15215 muscle_obstack.
15216 * src/output.h, src/output.c (muscle_obstack): Move to...
15217 * src/muscle_tab.h, src/muscle_tab.h: here.
15218 (muscle_init): Initialize muscle_obstack.
15219 (muscle_free): New.
15220 * src/main.c (main): Call it.
15221
0c15323d
AD
152222002-06-14 Akim Demaille <akim@epita.fr>
15223
15224 * src/location.h: New, extracted from...
15225 * src/reader.h: here.
15226 * src/Makefile.am (noinst_HEADERS): Merge into
15227 (bison_SOURCES): this.
15228 Add location.h.
15229 * src/parse-gram.y: Use location_t instead of Bison's.
15230 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15231 Use location_t instead of ints.
15232
e96c9728
AD
152332002-06-14 Akim Demaille <akim@epita.fr>
15234
15235 * data/bison.simple, data/bison.c++: Be sure to restore the
15236 current #line when returning to the skeleton contents after having
15237 exposed the input file's #line.
15238
75d1fe16
AD
152392002-06-12 Akim Demaille <akim@epita.fr>
15240
15241 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15242 eager.
15243 * tests/actions.at (Exotic Dollars): New.
15244
6c35d22c
AD
152452002-06-12 Akim Demaille <akim@epita.fr>
15246
15247 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15248 ['"/] too eagerly.
15249 * tests/input.at (Torturing the Scanner): New.
15250
1d6412ad
AD
152512002-06-11 Akim Demaille <akim@epita.fr>
15252
15253 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15254 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15255 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15256 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15257 * src/reader.c (reader): Use it.
15258
4cdb01db
AD
152592002-06-11 Akim Demaille <akim@epita.fr>
15260
15261 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15262 Adjust all callers.
15263 (scanner_last_string_free): New.
15264
44995b2e
AD
152652002-06-11 Akim Demaille <akim@epita.fr>
15266
15267 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15268 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15269 (last_string, YY_OBS_FREE): New.
15270 Use them when returning an ID.
15271
e9955c83
AD
152722002-06-11 Akim Demaille <akim@epita.fr>
15273
15274 Have Bison grammars parsed by a Bison grammar.
15275
15276 * src/reader.c, src/reader.h (prologue_augment): New.
15277 * src/reader.c (copy_definition): Remove.
15278
15279 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15280 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15281 (grammar_current_rule_prec_set, grammar_current_rule_check)
15282 (grammar_current_rule_symbol_append)
15283 (grammar_current_rule_action_append): Export.
15284 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15285 (symbol_list_action_append): Remove.
15286 Hook the routines from reader.
15287 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15288 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15289
15290 * src/reader.c (read_declarations): Remove, unused.
15291
15292 * src/parse-gram.y: Handle the epilogue.
15293 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15294 (grammar_start_symbol_set): this.
15295 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15296 * src/reader.c (readgram): Remove, unused.
15297 (reader): Adjust to insert eoftoken and axiom where appropriate.
15298
15299 * src/reader.c (copy_dollar): Replace with...
15300 * src/scan-gram.h (handle_dollar): this.
15301 * src/parse-gram.y: Remove `%thong'.
15302
15303 * src/reader.c (copy_at): Replace with...
15304 * src/scan-gram.h (handle_at): this.
15305
15306 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15307 New.
15308
15309 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15310 time being.
15311
15312 * src/reader.h, src/reader.c (grammar_rule_end): New.
15313
15314 * src/parse.y (current_type, current_class): New.
15315 Implement `%nterm', `%token' support.
15316 Merge `%term' into `%token'.
15317 (string_as_id): New.
15318 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15319 type name.
15320
15321 * src/parse-gram.y: Be sure to handle properly the beginning of
15322 rules.
15323
15324 * src/parse-gram.y: Handle %type.
15325 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15326
15327 * src/parse-gram.y: More directives support.
15328 * src/options.c: No longer handle source directives.
15329
15330 * src/parse-gram.y: Fix %output.
15331
15332 * src/parse-gram.y: Handle %union.
15333 Use the prologue locations.
15334 * src/reader.c (parse_union_decl): Remove.
15335
15336 * src/reader.h, src/reader.c (epilogue_set): New.
15337 * src/parse-gram.y: Use it.
15338
15339 * data/bison.simple, data/bison.c++: b4_stype is now either not
15340 defined, then default to int, or to the contents of %union,
15341 without `union' itself.
15342 Adjust.
15343 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15344
15345 * src/output.c (actions_output): Don't output braces, as they are
15346 already handled by the scanner.
15347
15348 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15349 characters to themselves.
15350
15351 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15352 that the epilogue has a proper #line.
15353
15354 * src/parse-gram.y: Handle precedence/associativity.
15355
15356 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15357 a terminal.
15358 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15359 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15360 at all to define terminals that cannot be emitted.
15361
15362 * src/scan-gram.l: Escape M4 characters.
15363
15364 * src/scan-gram.l: Working properly with escapes in user
15365 strings/characters.
15366
15367 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15368 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15369 grammar.
15370 Use more modest sizes, as for the time being the parser does not
15371 release memory, and therefore the process swallows a huge amount
15372 of memory.
15373
15374 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15375 stricter %token grammar.
15376
15377 * src/symtab.h (associativity): Add `undef_assoc'.
15378 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15379 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15380
15381 * tests/regression.at (Invalid %directive): Remove, as it is now
15382 meaningless.
15383 (Invalid inputs): Adjust to the new error messages.
15384 (Token definitions): The new grammar doesn't allow too many
15385 eccentricities.
15386
15387 * src/lex.h, src/lex.c: Remove.
15388 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15389 (copy_character, copy_string2, copy_string, copy_identifier)
15390 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15391 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15392 (parse_action): Remove.
15393 * po/POTFILES.in: Adjust.
15394
2e047461
AD
153952002-06-11 Akim Demaille <akim@epita.fr>
15396
cd05d13c 15397 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
15398 rule's action member: return the action as a string.
15399 Don't require `rule_length' as an argument: compute it.
15400 (grammar_current_rule_symbol_append)
15401 (grammar_current_rule_action_append): New, eved out from
15402 (readgram): here.
15403 Remove `action_flag', `rulelength', unused now.
15404
9af3fbce
AD
154052002-06-11 Akim Demaille <akim@epita.fr>
15406
15407 * src/reader.c (grammar_current_rule_prec_set).
15408 (grammar_current_rule_check): New, eved out from...
15409 (readgram): here.
15410 Remove `xaction', `first_rhs': useless.
15411 * tests/input.at (Type clashes): New.
15412 * tests/existing.at (GNU Cim Grammar): Adjust.
15413
1485e106
AD
154142002-06-11 Akim Demaille <akim@epita.fr>
15415
15416 * src/reader.c (grammar_midrule_action): New, Eved out from
15417 (readgram): here.
15418
da4160c3
AD
154192002-06-11 Akim Demaille <akim@epita.fr>
15420
15421 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15422 New.
15423 (readgram): Use them as replacement of inlined code, crule and
15424 crule1.
15425
f6d0f937
AD
154262002-06-11 Akim Demaille <akim@epita.fr>
15427
15428 * src/reader.c (grammar_end, grammar_symbol_append): New.
15429 (readgram): Use them.
15430 Make the use of `p' as local as possible.
15431
69078d4b
AD
154322002-06-10 Akim Demaille <akim@epita.fr>
15433
15434 GCJ's parser requires the tokens to be defined before the prologue.
15435
15436 * data/bison.simple: Output the token definition before the user's
15437 prologue.
15438 * tests/regression.at (Braces parsing, Duplicate string)
15439 (Mixing %token styles): Check the output from bison.
15440 (Early token definitions): New.
15441
5e424082
AD
154422002-06-10 Akim Demaille <akim@epita.fr>
15443
15444 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15445 assigning twice the same user number to a token, so that we can
15446 use it in...
15447 * src/lex.c (lex): here.
15448 Also use `symbol_class_set' instead of hand written code.
15449 * src/reader.c (parse_assoc_decl): Likewise.
15450
44536b35
AD
154512002-06-10 Akim Demaille <akim@epita.fr>
15452
15453 * src/symtab.c, src/symtab.c (symbol_class_set)
15454 (symbol_user_token_number_set): New.
15455 * src/reader.c (parse_token_decl): Use them.
15456 Use a switch instead of ifs.
15457 Use a single argument.
15458
8b9f2372
AD
154592002-06-10 Akim Demaille <akim@epita.fr>
15460
15461 Remove `%thong' support as it is undocumented, unused, duplicates
15462 `%token's job, and creates useless e-mail traffic with people who
15463 want to know what it is, why it is undocumented, unused, and
15464 duplicates `%token's job.
15465
15466 * src/reader.c (parse_thong_decl): Remove.
15467 * src/options.c (option_table): Remove "thong".
15468 * src/lex.h (tok_thong): Remove.
15469
3ae2b51f
AD
154702002-06-10 Akim Demaille <akim@epita.fr>
15471
15472 * src/symtab.c, src/symtab.c (symbol_type_set)
15473 (symbol_precedence_set): New.
15474 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15475 (value_components_used): Remove, unused.
15476
2f1afb73
AD
154772002-06-09 Akim Demaille <akim@epita.fr>
15478
15479 Move symbols handling code out of the reader.
15480
15481 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15482 (axiom): Move to...
15483 * src/symtab.h, src/symtab.c: here.
15484
15485 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15486 * src/reader.c (startval): Rename as...
15487 * src/symtab.h, src/symtab.c (startsymbol): this.
15488 * src/reader.c: Adjust.
15489
15490 * src/reader.c (symbol_check_defined, symbol_make_alias)
15491 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15492 (token_translations_init)
15493 Move to...
15494 * src/symtab.c: here.
15495 * src/reader.c (packsymbols): Move to...
15496 * src/symtab.h, src/symtab.c (symbols_pack): here.
15497 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15498 argument.
15499
e9bca3ad
AD
155002002-06-03 Akim Demaille <akim@epita.fr>
15501
15502 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15503 then statements.
15504
86eff183
AD
155052002-06-03 Akim Demaille <akim@epita.fr>
15506
15507 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15508 structs with non literals.
15509 * src/scan-skel.l: never-interactive.
15510 * src/conflicts.c (enum conflict_resolution_e): No trailing
15511 comma.
15512 * src/getargs.c (usage): Split long literal strings.
15513 Reported by Hans Aberg.
15514
717be197
AD
155152002-05-28 Akim Demaille <akim@epita.fr>
15516
15517 * data/bison.c++: Use C++ ostreams.
15518 (cdebug_): New member.
15519
670ddffd
AD
155202002-05-28 Akim Demaille <akim@epita.fr>
15521
15522 * src/output.c (output_skeleton): Be sure to allocate enough room
15523 for `/' _and_ for `\0' in full_skeleton.
15524
769b430f
AD
155252002-05-28 Akim Demaille <akim@epita.fr>
15526
15527 * data/bison.c++: Catch up with bison.simple:
15528 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15529 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15530 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15531 and popping traces.
15532
7067cb36
PH
155332002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15534
15535 * src/output.c (output_skeleton): Put an explicit path in front of
15536 the skeleton file name, rather than relying on the -I directory,
15537 to partially alleviate effects of having a skeleton file lying around
15538 in the current directory.
769b430f 15539
4a713ec2
PH
155402002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15541
769b430f 15542 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
15543 obstack_printf should be obstack_fgrow1.
15544
b408954b
AD
155452002-05-26 Akim Demaille <akim@epita.fr>
15546
15547 * src/state.h (state_t): `solved_conflicts' is a new member.
15548 * src/LR0.c (new_state): Set it to 0.
15549 * src/conflicts.h, src/conflicts.c (print_conflicts)
15550 (free_conflicts, solve_conflicts): Rename as...
15551 (conflicts_print, conflicts_free, conflicts_solve): these.
15552 Adjust callers.
15553 * src/conflicts.c (enum conflict_resolution_e)
15554 (solved_conflicts_obstack): New, used by...
15555 (log_resolution): this.
15556 Adjust to attach the conflict resolution to each state.
15557 Complete the description with the precedence/associativity
15558 information.
15559 (resolve_sr_conflict): Adjust.
15560 * src/print.c (print_state): Output its solved_conflicts.
15561 * tests/conflicts.at (Unresolved SR Conflicts)
15562 (Solved SR Conflicts): Exercise --report=all.
15563
a49aecd5
AD
155642002-05-26 Akim Demaille <akim@epita.fr>
15565
15566 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15567 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15568 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15569 (token_number_t, item_number_as_token_number)
15570 (token_number_as_item_number, muscle_insert_token_number_table):
15571 Rename as...
15572 (symbol_number_t, item_number_as_symbol_number)
15573 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15574 these, since it is more appropriate.
15575
5504898e
AD
155762002-05-26 Akim Demaille <akim@epita.fr>
15577
15578 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15579 `Error:' lines.
15580 * data/bison.simple (yystos) [YYDEBUG]: New.
15581 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15582 error recovery.
15583 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15584
ec3bc396
AD
155852002-05-25 Akim Demaille <akim@epita.fr>
15586
15587 * doc/bison.texinfo (Debugging): Split into...
15588 (Tracing): this new section, its former contents, and...
15589 (Understanding): this new section.
15590 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15591 by...
15592 (report_flag): this.
15593 Adjust all dependencies.
15594 (report_args, report_types, report_argmatch): New.
15595 (usage, getargs): Report/support -r, --report.
15596 * src/options.h
15597 (struct option_table_struct): Rename as..,
15598 (struct option_table_s): this.
15599 Rename the `set_flag' member to `flag' to match with getopt_long's
15600 struct.
15601 * src/options.c (option_table): Split verbose into an entry for
15602 %verbose, and another for --verbose.
15603 Support --report/-r, so remove -r from the obsolete --raw.
15604 * src/print.c: Attach full item sets and lookaheads reports to
15605 report_flag instead of trace_flag.
15606 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15607
78df8250
PE
156082002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15609 and Paul Eggert <eggert@twinsun.com>
769b430f 15610
78df8250
PE
15611 * data/bison.simple (yyparse): Correct error handling to conform to
15612 POSIX and yacc. Specifically, after syntax error is discovered,
15613 do not reduce further before shifting the error token.
15614 Clean up the code a bit by removing the labels yyerrdefault,
15615 yyerrhandle, yyerrpop.
15616 * NEWS: Document the above.
15617
c0c9ea05
PH
156182002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15619
15620 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15621 type; it isn't always big enough, since it doesn't necessarily
15622 include non-terminals.
769b430f 15623 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
15624 the latter can be removed.
15625 (yy_token_number_type): Remove, only one use.
15626 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15627 don't use TokenNumberType as element type.
769b430f 15628
c0c9ea05
PH
15629 * tests/regression.at: Modify expected output to agree with change
15630 to yyr1 and yytranslate.
769b430f 15631
6390a83f
FK
156322002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15633
15634 * src/reader.c (parse_action): Use copy_character instead of
15635 obstack_1grow.
15636
db7c8e9a
AD
156372002-05-13 Akim Demaille <akim@epita.fr>
15638
15639 * tests/regression.at (Token definitions): Prototype yylex and
15640 yyerror.
15641
fcc61800
PH
156422002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15643
158c687b 15644 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
15645 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15646 32-bit arithmetic.
15647 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15648
5683e9b2
AD
156492002-05-07 Akim Demaille <akim@epita.fr>
15650
15651 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15652 avoid GCC warnings.
15653
0c2d3f4c
AD
156542002-05-07 Akim Demaille <akim@epita.fr>
15655
15656 Kill GCC warnings.
15657
15658 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15659 over the RHS of each rule.
15660 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15661 * src/state.h (state_t): Member `nitems' is unsigned short.
15662 * src/LR0.c (get_state): Adjust.
15663 * src/reader.c (packgram): Likewise.
15664 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15665 `Type'.
15666 (muscle_insert_int_table): Remove, unused.
15667 (prepare_rules): Remove `max'.
15668
1565b720
AD
156692002-05-06 Akim Demaille <akim@epita.fr>
15670
15671 * src/closure.c (print_firsts): Display of the symbol tags.
15672 (bitmatrix_print): Move to...
15673 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15674 here.
15675 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15676
cfaee611
AD
156772002-05-06 Akim Demaille <akim@epita.fr>
15678
15679 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15680 hash_do_for_each.
15681
458be8e0
AD
156822002-05-06 Akim Demaille <akim@epita.fr>
15683
15684 * src/LR0.c (new_state, get_state): Instead of using the global
15685 `kernel_size' and `kernel_base', have two new arguments:
15686 `core_size' and `core'.
15687 Adjust callers.
15688
a900a624
AD
156892002-05-06 Akim Demaille <akim@epita.fr>
15690
15691 * src/reader.c (packgram): No longer end `ritem' with a 0
15692 sentinel: it is not used.
15693
d4e7d3a1
AD
156942002-05-05 Akim Demaille <akim@epita.fr>
15695
15696 New experimental feature: display the lookaheads in the report and
15697 graph.
15698
15699 * src/print (print_core): When --trace-flag, display the rules
15700 lookaheads.
15701 * src/print_graph.c (print_core): Likewise.
15702 Swap the arguments.
15703 Adjust caller.
15704
39ceb25b
AD
157052002-05-05 Akim Demaille <akim@epita.fr>
15706
15707 * tests/torture.at (Many lookaheads): New test.
15708
5372019f
AD
157092002-05-05 Akim Demaille <akim@epita.fr>
15710
15711 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15712 (GENERATE_MUSCLE_INSERT_TABLE): this.
15713 (output_int_table, output_unsigned_int_table, output_short_table)
15714 (output_token_number_table, output_item_number_table): Replace with...
15715 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15716 (muscle_insert_short_table, muscle_insert_token_number_table)
15717 (muscle_insert_item_number_table): these.
15718 Adjust all callers.
15719 (prepare_tokens): Don't free `translations', since...
15720 * src/reader.h, src/reader.c (grammar_free): do it.
15721 Move to...
15722 * src/gram.h, src/gram.c (grammar_free): here.
15723 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15724 b4_translate_max.
15725
5df5f6d5
AD
157262002-05-05 Akim Demaille <akim@epita.fr>
15727
15728 * src/output.c (output_unsigned_int_table): New.
15729 (prepare_rules): `i' is unsigned.
15730 `prhs', `rline', `r2' are unsigned int.
15731 Rename muscle `rhs_number_max' as `rhs_max'.
15732 Output muscles `prhs_max', `rline_max', and `r2_max'.
15733 Free rline and r1.
15734 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15735 to compute types instead of constant types.
15736 * tests/regression.at (Web2c Actions): Adjust.
15737
b87f8b21
AD
157382002-05-04 Akim Demaille <akim@epita.fr>
15739
15740 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15741 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15742 Adjust dependencies.
15743 * src/output.c (token_definitions_output): Be sure not to output a
15744 `#define 'a'' when fed with `%token 'a' "a"'.
15745 * tests/regression.at (Token definitions): New.
15746
8bb936e4
PE
157472002-05-03 Paul Eggert <eggert@twinsun.com>
15748
15749 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15750 for K&R C.
15751
157522002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15753
15754 * Makefile.am (SUBDIRS): Remove intl.
15755 (EXTRA_DIST): Add config/config.rpath.
15756
53c71a12
AD
157572002-05-03 Akim Demaille <akim@epita.fr>
15758
15759 * data/bison.simple (m4_if): Don't output empty enums.
15760 And actually, output valid enum definitions :(.
15761
289dd0cf
AD
157622002-05-03 Akim Demaille <akim@epita.fr>
15763
15764 * configure.bat: Remove, completely obsolete.
15765 * Makefile.am (EXTRA_DIST): Adjust.
15766 Don't distribute config.rpath...
15767 * config/Makefile.am (EXTRA_DIST): Do it.
15768
db85e524
AD
157692002-05-03 Akim Demaille <akim@epita.fr>
15770
15771 * configure.in (GETTEXT_VERSION): New.
15772 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15773
83ccf991
AD
157742002-05-03 Akim Demaille <akim@epita.fr>
15775
15776 * data/bison.simple (b4_token_enum): New.
15777 (b4_token_defines): Use it to output tokens both as #define and
15778 enums.
15779 Suggested by Paul Eggert.
15780 * src/output.c (token_definitions_output): Don't output spurious
15781 white spaces.
15782
1f418995
AD
157832002-05-03 Akim Demaille <akim@epita.fr>
15784
15785 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15786
45119f04
RA
157872002-05-02 Robert Anisko <robert@lrde.epita.fr>
15788
15789 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15790 Update the stack class, give a try to deque as the default container.
15791
b2d52318
AD
157922002-05-02 Akim Demaille <akim@epita.fr>
15793
15794 * data/bison.simple (yyparse): Do not implement @$ = @1.
15795 (YYLLOC_DEFAULT): Adjust to do it.
15796 * doc/bison.texinfo (Location Default Action): Fix.
15797
3a8b4109
AD
157982002-05-02 Akim Demaille <akim@epita.fr>
15799
15800 * src/reader.c (parse_braces): Merge into...
15801 (parse_action): this.
15802
84614e13
AD
158032002-05-02 Akim Demaille <akim@epita.fr>
15804
15805 * configure.in (ALL_LINGUAS): Remove.
15806 * po/LINGUAS, hr.po: New.
15807
fdbcd8e2
AD
158082002-05-02 Akim Demaille <akim@epita.fr>
15809
15810 Remove the so called hairy (semantic) parsers.
15811
15812 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15813 * src/gram.h, src/gram.c (semantic_parser): Remove.
15814 (rule_t): Remove the guard and guard_line members.
15815 * src/lex.h (token_t): remove tok_guard.
15816 * src/options.c (option_table): Remove %guard and %semantic_parser
15817 support.
15818 * src/output.c, src/output.h (guards_output): Remove.
15819 (prepare): Adjust.
15820 (token_definitions_output): Don't output the `T'
15821 tokens (???).
15822 (output_skeleton): Don't output the guards.
15823 * src/files.c, src/files.c (attrsfile): Remove.
15824 * src/reader.c (symbol_list): Remove the guard and guard_line
15825 members.
15826 Adjust dependencies.
15827 (parse_guard): Remove.
15828 * data/bison.hairy: Remove.
15829 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15830 BISON_HAIRY.
15831
82b6cb3f
AD
158322002-05-02 Akim Demaille <akim@epita.fr>
15833
15834 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15835 (parse_guard): Rename the formal argument `stack_offset' as
15836 `rule_length', which is more readable.
15837 Adjust callers.
15838 (copy_at, copy_dollar): Instead of outputting the hard coded
15839 values of $$, $n and so forth, output invocation to b4_lhs_value,
15840 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
15841 Note: this patch partially drops `semantic-parser' support: it
15842 always does `rule_length - n', where semantic parsers ought to
15843 always use `-n'.
82b6cb3f
AD
15844 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15845 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15846
6cbfbcc5
AD
158472002-05-02 Akim Demaille <akim@epita.fr>
15848
15849 * configure.in (AC_INIT): Bump to 1.49b.
15850 (AM_INIT_AUTOMAKE): Short invocation.
15851
b8548114
AD
158522002-05-02 Akim Demaille <akim@epita.fr>
15853
15854 Version 1.49a.
15855
c20cd1fa
AD
158562002-05-01 Akim Demaille <akim@epita.fr>
15857
15858 * src/skeleton.h: Remove.
15859
8a9566d4
AD
158602002-05-01 Akim Demaille <akim@epita.fr>
15861
15862 * src/skeleton.h: Fix the #endif.
15863 Reported by Magnus Fromreide.
15864
8c6d399a
PE
158652002-04-26 Paul Eggert <eggert@twinsun.com>
15866
15867 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15868 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 15869 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 15870
2b7ed18a
RA
158712002-04-25 Robert Anisko <robert@lrde.epita.fr>
15872
15873 * src/scan-skel.l: Postprocess quadrigraphs.
15874
15875 * src/reader.c (copy_character): New function, used to output
15876 single characters while replacing `[' and `]' with quadrigraphs, to
15877 avoid troubles with M4 quotes.
15878 (copy_comment): Output characters with copy_character.
15879 (read_additionnal_code): Likewise.
15880 (copy_string2): Likewise.
15881 (copy_definition): Likewise.
15882
15883 * tests/calc.at: Exercise M4 quoting.
15884
34a89c50
AD
158852002-04-25 Akim Demaille <akim@epita.fr>
15886
15887 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
15888 between `!' and the command.
15889 Reported by Paul Eggert.
15890
0dd1580a
RA
158912002-04-24 Robert Anisko <robert@lrde.epita.fr>
15892
15893 * tests/calc.at: Exercise prologue splitting.
15894
15895 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
15896 `b4_post_prologue' instead of `b4_prologue'.
15897
15898 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
15899 muscles.
15900 (output): Free pre_prologue_obstack and post_prologue_obstack.
15901 * src/files.h, src/files.c (attrs_obstack): Remove.
15902 (pre_prologue_obstack, post_prologue_obstack): New.
15903 * src/reader.c (copy_definition): Add a parameter to specify the
15904 obstack to fill, instead of using attrs_obstack unconditionally.
15905 (read_declarations): Pass pre_prologue_obstack to copy_definition if
15906 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
15907
83c1796f
PE
159082002-04-23 Paul Eggert <eggert@twinsun.com>
15909
15910 * data/bison.simple: Remove unnecessary commentary and white
15911 space differences from 1_29-branch.
15912 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
15913
15914 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
15915 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
15916 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
15917 constructors or destructors.
15918
15919 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
15920
1207eeac
AD
159212002-04-23 Akim Demaille <akim@epita.fr>
15922
15923 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
15924 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
15925 location with columns.
15926 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
15927 All reported by Paul Eggert.
15928
78ab8f67
AD
159292002-04-22 Akim Demaille <akim@epita.fr>
15930
15931 * src/reduce.c (dump_grammar): Move to...
15932 * src/gram.h, src/gram.c (grammar_dump): here.
15933 Be sure to separate long item numbers.
15934 Don't read the members of a rule's prec if its nil.
15935
133c20e2
AD
159362002-04-22 Akim Demaille <akim@epita.fr>
15937
15938 * src/output.c (table_size, table_grow): New.
15939 (MAXTABLE): Remove, replace uses with table_size.
15940 (pack_vector): Instead of dying when the table is too big, grow it.
15941
9515e8a7
AD
159422002-04-22 Akim Demaille <akim@epita.fr>
15943
15944 * data/bison.simple (yyr1): Its type is that of a token number.
15945 * data/bison.c++ (r1_): Likewise.
15946 * tests/regression.at (Web2c Actions): Adjust.
15947
23c5a174
AD
159482002-04-22 Akim Demaille <akim@epita.fr>
15949
15950 * src/reader.c (token_translations_init): 256 is now the default
15951 value for the error token, i.e., it will be assigned another
15952 number if the user assigned 256 to one of her tokens.
15953 (reader): Don't force 256 to error.
15954 * doc/bison.texinfo (Symbols): Adjust.
15955 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
15956 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
15957 etc. instead of 10, 20, 30 (which was used to `jump' over error
15958 (256) and undefined (2)).
15959
5fbb0954
AD
159602002-04-22 Akim Demaille <akim@epita.fr>
15961
15962 Propagate more token_number_t.
15963
15964 * src/gram.h (token_number_as_item_number)
15965 (item_number_as_token_number): New.
15966 * src/output.c (GENERATE_OUTPUT_TABLE): New.
15967 Use it to create output_item_number_table and
15968 output_token_number_table.
15969 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15970 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
15971 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
15972 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
15973
4f940944
AD
159742002-04-22 Akim Demaille <akim@epita.fr>
15975
15976 * src/output.h, src/output.c (get_lines_number): Remove.
15977
3ded9a63
AD
159782002-04-19 Akim Demaille <akim@epita.fr>
15979
15980 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
15981 as Lex/Flex'.
15982 (Debugging): More details about enabling the debugging features.
15983 (Table of Symbols): Describe $$, $n, @$, and @n.
15984 Suggested by Tim Josling.
15985
e0c471a9
AD
159862002-04-19 Akim Demaille <akim@epita.fr>
15987
15988 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
15989
fecc10cd
AD
159902002-04-10 Akim Demaille <akim@epita.fr>
15991
15992 * src/system.h: Rely on HAVE_LIMITS_H.
15993 Suggested by Paul Eggert.
15994
51dec47b
AD
159952002-04-09 Akim Demaille <akim@epita.fr>
15996
15997 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
15998 full stderr, and strip it according to the bison options, instead
15999 of composing the error message from different bits.
16000 This makes it easier to check for several error messages.
16001 Adjust all the invocations.
16002 Add an invocation exercising the error token.
16003 Add an invocation demonstrating a stupid error message.
16004 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16005 Adjust the tests.
16006 Error message are for stderr, not stdout.
16007
007a50a4
AD
160082002-04-09 Akim Demaille <akim@epita.fr>
16009
16010 * src/gram.h, src/gram.c (error_token_number): Remove, use
16011 errtoken->number.
16012 * src/reader.c (reader): Don't specify the user token number (2)
16013 for $undefined, as it uselessly prevents using it.
16014 * src/gram.h (token_number_t): Move to...
16015 * src/symtab.h: here.
16016 (state_t.number): Is a token_number_t.
16017 * src/print.c, src/reader.c: Use undeftoken->number instead of
16018 hard coded 2.
16019 (Even though this 2 is not the same as above: the number of the
16020 undeftoken remains being 2, it is its user token number which
16021 might not be 2).
16022 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16023 `user_token_number_max'.
16024 Output `undef_token_number'.
16025 * data/bison.simple, data/bison.c++: Use them.
16026 Be sure to map invalid yylex return values to
16027 `undef_token_number'. This saves us from gratuitous SEGV.
16028
16029 * tests/conflicts.at (Solved SR Conflicts)
16030 (Unresolved SR Conflicts): Adjust.
16031 * tests/regression.at (Web2c Actions): Adjust.
16032
06446ccf
AD
160332002-04-08 Akim Demaille <akim@epita.fr>
16034
16035 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16036 Adding #line.
16037 Remove the duplicate `typedefs'.
16038 (RhsNumberType): Fix the declaration and various other typos.
16039 Use __ofile__.
16040 * data/bison.simple: Use __ofile__.
16041 * src/scan-skel.l: Handle __ofile__.
16042
62a3e4f0
AD
160432002-04-08 Akim Demaille <akim@epita.fr>
16044
16045 * src/gram.h (item_number_t): New, the type of item numbers in
16046 RITEM. Note that it must be able to code symbol numbers as
16047 positive number, and the negation of rule numbers as negative
16048 numbers.
16049 Adjust all dependencies (pretty many).
16050 * src/reduce.c (rule): Remove this `short *' pointer: use
16051 item_number_t.
16052 * src/system.h (MINSHORT, MAXSHORT): Remove.
16053 Include `limits.h'.
16054 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16055 (shortcpy): Remove.
16056 (MAXTABLE): Move to...
16057 * src/output.c (MAXTABLE): here.
16058 (prepare_rules): Use output_int_table to output rhs.
16059 * data/bison.simple, data/bison.c++: Adjust.
16060 * tests/torture.at (Big triangle): Move the limit from 254 to
16061 500.
16062 * tests/regression.at (Web2c Actions): Ajust.
16063
16064 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16065 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16066 passes, but produces negative #line number, once fixed, GCC is
16067 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16068 C), it passes.
16069 * src/state.h (state_h): Code input lines on ints, not shorts.
16070
bb88b0fc
AD
160712002-04-08 Akim Demaille <akim@epita.fr>
16072
16073 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16074 and then the grammar.
16075
9a636f47
AD
160762002-04-08 Akim Demaille <akim@epita.fr>
16077
16078 * src/system.h: No longer using strndup.
16079
680e8701
AD
160802002-04-07 Akim Demaille <akim@epita.fr>
16081
16082 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16083 * src/output.c (output_table_data): Return the longest number.
16084 (prepare_tokens): Output `token_number_max').
16085 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16086 New.
16087 Use them to define yy_token_number_type/TokenNumberType.
16088 Use this type for yytranslate.
16089 * tests/torture.at (Big triangle): Push the limit from 124 to
16090 253.
16091 * tests/regression.at (Web2c Actions): Adjust.
16092
817e9f41
AD
160932002-04-07 Akim Demaille <akim@epita.fr>
16094
16095 * tests/torture.at (Big triangle): New.
16096 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16097 * tests/existing.at: here.
16098
5123689b
AD
160992002-04-07 Akim Demaille <akim@epita.fr>
16100
16101 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16102 nritems.
16103 Adjust dependencies.
16104
f3849179
AD
161052002-04-07 Akim Demaille <akim@epita.fr>
16106
16107 * src/reader.c: Normalize increments to prefix form.
16108
bd02036a
AD
161092002-04-07 Akim Demaille <akim@epita.fr>
16110
16111 * src/reader.c, symtab.c: Remove debugging code.
16112
db8837cb
AD
161132002-04-07 Akim Demaille <akim@epita.fr>
16114
16115 Rename all the `bucket's as `symbol_t'.
16116
16117 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16118 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16119 * src/symtab.c, src/symtab.h (bucket): Rename as...
16120 (symbol_t): this.
16121 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16122 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16123 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16124 (buckets_new, buckets_free, buckets_do): Rename as...
16125 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16126 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16127 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16128 (symbols_new, symbols_free, symbols_do): these.
16129
72a23c97
AD
161302002-04-07 Akim Demaille <akim@epita.fr>
16131
16132 Use lib/hash for the symbol table.
16133
16134 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16135 EOF.
16136 * src/lex.c (lex): Set the `number' member of new terminals.
16137 * src/reader.c (bucket_check_defined, bucket_make_alias)
16138 (bucket_check_alias_consistence, bucket_translation): New.
16139 (reader, grammar_free, readgram, token_translations_init)
16140 (packsymbols): Adjust.
16141 (reader): Number the predefined tokens.
16142 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16143 for predefined tokens.
16144 * src/symtab.h (bucket): Remove all the hash table related
16145 members.
16146 * src/symtab.c (symtab): Replace by...
16147 (bucket_table): this.
16148 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16149 (buckets_new, buckets_do): New.
16150
280a38c3
AD
161512002-04-07 Akim Demaille <akim@epita.fr>
16152
16153 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16154 (start_symbol, max_user_token_number, semantic_parser)
16155 (error_token_number): Initialize.
16156 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16157 Initialize.
16158 (reader): Don't.
16159 (errtoken, eoftoken, undeftoken, axiom): Extern.
16160
03b31c0c
AD
161612002-04-07 Akim Demaille <akim@epita.fr>
16162
16163 * src/gram.h (rule_s): prec and precsym are now pointers
16164 to the bucket giving the priority/associativity.
16165 Member `associativity' removed: useless.
16166 * src/reduce.c, src/conflicts.c: Adjust.
16167
8b3df748
AD
161682002-04-07 Akim Demaille <akim@epita.fr>
16169
16170 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16171 Properly escape the symbols' TAG when outputting them.
16172
e601aa1d
AD
161732002-04-07 Akim Demaille <akim@epita.fr>
16174
16175 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16176
b0299a2e
AD
161772002-04-07 Akim Demaille <akim@epita.fr>
16178
16179 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16180 (LArule): this, which is an array to rule_t*.
16181 * src/print.c, src/conflicts.c: Adjust.
16182
d7e1f00c
AD
161832002-04-07 Akim Demaille <akim@epita.fr>
16184
16185 * src/gram.h (rule_t): Rename `number' as `user_number'.
16186 `number' is a new member.
16187 Adjust dependencies.
16188 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16189
cc9305dd
AD
161902002-04-07 Akim Demaille <akim@epita.fr>
16191
16192 As a result of the previous patch, it is no longer needed
16193 to reorder ritem itself.
16194
16195 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16196
b0940840
AD
161972002-04-07 Akim Demaille <akim@epita.fr>
16198
16199 Be sure never to walk through RITEMS, but use only data related to
16200 the rules themselves. RITEMS should be banished.
16201
16202 * src/output.c (output_token_translations): Rename as...
16203 (prepare_tokens): this.
16204 In addition to `translate', prepare the muscles `tname' and
16205 `toknum', which were handled by...
16206 (output_rule_data): this.
16207 Remove, and move the remainder of its outputs into...
16208 (prepare_rules): this new routines, which also merges content from
16209 (output_gram): this.
16210 (prepare_rules): Be sure never to walk through RITEMS.
16211 (output_stos): Rename as...
16212 (prepare_stos): this.
16213 (output): Always invoke prepare_states, after all, just don't use it
16214 in the output if you don't need it.
16215
643a5994
AD
162162002-04-07 Akim Demaille <akim@epita.fr>
16217
16218 * src/LR0.c (new_state): Display `nstates' as the name of the
16219 newly created state.
16220 Adjust to initialize first_state and last_state if needed.
16221 Be sure to distinguish the initial from the final state.
16222 (new_states): Create the itemset of the initial state, and use
16223 new_state.
16224 * src/closure.c (closure): Now that the initial state has its
16225 items properly set, there is no need for a special case when
16226 creating `ruleset'.
16227
16228 As a result, now the rule 0, reducing to $axiom, is visible in the
16229 outputs. Adjust the test suite.
16230
16231 * tests/conflicts.at (Solved SR Conflicts)
16232 (Unresolved SR Conflicts): Adjust.
16233 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16234 * tests/conflicts.at (S/R in initial): New.
16235
b4c4ccc2
AD
162362002-04-07 Akim Demaille <akim@epita.fr>
16237
16238 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16239 the RHS of the rules.
16240 * src/output.c (output_gram): Likewise.
16241
bba97eb2
AD
162422002-04-07 Akim Demaille <akim@epita.fr>
16243
16244 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16245 bucket.
16246 Adjust all dependencies.
16247 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16248 `number' of the buckets too.
16249 * src/gram.h: Include `symtab.h'.
16250 (associativity): Move to...
16251 * src/symtab.h: here.
16252 No longer include `gram.h'.
16253
c3b407f4
AD
162542002-04-07 Akim Demaille <akim@epita.fr>
16255
16256 * src/gram.h, src/gram.c (rules_rhs_length): New.
16257 (ritem_longest_rhs): Use it.
16258 * src/gram.h (rule_t): `number' is a new member.
16259 * src/reader.c (packgram): Set it.
16260 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16261 the end of `rules', and count them out of `nrules'.
16262 (reduce_output, dump_grammar): Adjust.
16263 * src/print.c (print_grammar): It is no longer needed to check for
16264 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16265 * tests/reduce.at (Reduced Automaton): New test.
16266
11652ab3
AD
162672002-04-07 Akim Demaille <akim@epita.fr>
16268
16269 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16270 lacking `+ 1' to nrules, Bison reported as useless a token if it
16271 was used solely to set the precedence of the last rule...
16272
26b23c1a
AD
162732002-04-07 Akim Demaille <akim@epita.fr>
16274
16275 * data/bison.c++, data/bison.simple: Don't output the current file
16276 name in #line, to avoid useless diffs between two identical
16277 outputs under different names.
16278
18bcecb0
AD
162792002-04-07 Akim Demaille <akim@epita.fr>
16280
16281 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16282 Normalize loops to using `< nrules + 1', not `<= nrules'.
16283
fa770c86
AD
162842002-04-07 Akim Demaille <akim@epita.fr>
16285
16286 * TODO: Update.
16287
d9b739c3
AD
162882002-04-07 Akim Demaille <akim@epita.fr>
16289
16290 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16291 bucket.value as bucket.number.
16292
99013900
AD
162932002-04-07 Akim Demaille <akim@epita.fr>
16294
16295 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16296 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16297 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16298 RHS, instead of being an index in RITEMS.
16299
e966383b
PE
163002002-04-04 Paul Eggert <eggert@twinsun.com>
16301
16302 * doc/bison.texinfo: Update copyright date.
16303 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16304 (Symbols): Warn about running Bison in one character set,
16305 but compiling and/or running in an incompatible one.
16306 Warn about character code 256, too.
16307
163082002-04-03 Paul Eggert <eggert@twinsun.com>
16309
16310 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16311 YYERROR_VERBOSE is nonzero, not whether it is defined.
16312
16313 Merge changes from bison-1_29-branch.
c307773e 16314
8d6c48b9
PE
163152002-03-20 Paul Eggert <eggert@twinsun.com>
16316
16317 Merge fixes from Debian bison_1.34-1.diff.
16318
16319 * configure.in (AC_PREREQ): 2.53.
16320
e53c6322
AD
163212002-03-20 Akim Demaille <akim@epita.fr>
16322
16323 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16324
9ffbeca7
PE
163252002-03-19 Paul Eggert <eggert@twinsun.com>
16326
21db0b2a
PE
16327 * src/bison.simple (YYCOPY): New macro.
16328 (YYSTACK_RELOCATE): Use it.
16329 Remove Type arg; no longer needed. All callers changed.
16330 (yymemcpy): Remove; no longer needed.
16331
9ffbeca7
PE
16332 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16333 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16334
642cb8f8
AD
163352002-03-19 Akim Demaille <akim@epita.fr>
16336
16337 Test and fix the #line outputs.
16338
16339 * tests/atlocal.at (GCC): New.
16340 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 16341 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
16342 (Action synch line, Epilogue synch line): New tests.
16343 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16344 * data/bison.simple, data/bison.c++: Use it.
16345
3c31a486
AD
163462002-03-19 Akim Demaille <akim@epita.fr>
16347
16348 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16349 (Solved SR Conflicts, %expect not enough, %expect right)
16350 (%expect too much): Move to...
16351 * tests/conflicts.at: this new file.
16352
0d8bed56
AD
163532002-03-19 Akim Demaille <akim@epita.fr>
16354
16355 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16356 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16357 that we can move to enums for instance.
16358 * src/output.c (token_definitions_output): Output a list of
16359 `token-name, token-number' instead of the #define.
16360 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16361
9208d17f
AD
163622002-03-14 Akim Demaille <akim@epita.fr>
16363
16364 Use Gettext 0.11.1.
16365
af27eacb
RA
163662002-03-09 Robert Anisko <robert@lrde.epita.fr>
16367
16368 * data/bison.c++: Make the user able to add members to the generated
16369 parser by subclassing.
16370
9101a310
RA
163712002-03-05 Robert Anisko <robert@lrde.epita.fr>
16372
16373 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16374 a character.
16375 Reported by Nicolas Tisserand and Nicolas Burrus.
16376
fff9bf0b
RA
163772002-03-04 Robert Anisko <robert@lrde.epita.fr>
16378
16379 * src/reader.c: Warn about lacking semi-colons, do not complain.
16380
64dba31e
RA
163812002-03-04 Robert Anisko <robert@lrde.epita.fr>
16382
16383 * data/bison.c++: Remove a debug line.
16384
374f5a14
RA
163852002-03-04 Robert Anisko <robert@lrde.epita.fr>
16386
16387 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16388 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16389 provide a default implementation.
16390
bfcf1f3a
AD
163912002-03-04 Akim Demaille <akim@epita.fr>
16392
16393 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16394 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16395 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16396 * tests/semantic.at (Parsing Guards): Similarly.
16397 * src/reader.at (readgram): Complain if the last rule is not ended
16398 with a semi-colon.
16399
65ccf9fc
AD
164002002-03-04 Akim Demaille <akim@epita.fr>
16401
16402 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16403 * src/closure.c: here.
16404 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16405 RTC.
16406 * src/warshall.h, src/warshall.c: Remove.
16407 * tests/sets.at (Broken Closure): Adjust.
16408
d0039cbc
AD
164092002-03-04 Akim Demaille <akim@epita.fr>
16410
16411 * src/output.c (output_skeleton): tempdir is const.
16412 bytes_read is unused.
16413
345cea78
AD
164142002-03-04 Akim Demaille <akim@epita.fr>
16415
16416 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16417 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16418 Update.
16419 From Michael Hayes.
16420
564801f7
AD
164212002-03-04 Akim Demaille <akim@epita.fr>
16422
16423 * src/closure.c (closure): `r' is unused.
16424
e5352bc7
AD
164252002-03-04 Akim Demaille <akim@epita.fr>
16426
16427 * tests/sets.at (Broken Closure): Add the ending `;'.
16428 * src/reader.at (readgram): Complain if a rule is not ended with a
16429 semi-colon.
16430
914feea9
AD
164312002-03-04 Akim Demaille <akim@epita.fr>
16432
16433 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16434 (count_sr_conflicts): Use bitset_count.
16435 * src/reduce.c (inaccessable_symbols): Ditto.
16436 (bits_size): Remove.
16437 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16438
f0250de6
AD
164392002-03-04 Akim Demaille <akim@epita.fr>
16440
16441 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16442 * src/reduce.c: Remove the `bitset_zero's following the
16443 `bitset_create's, as now it is performed by the latter.
16444
ef017502
AD
164452002-03-04 Akim Demaille <akim@epita.fr>
16446
16447 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16448 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16449 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16450 latest sources from Michael.
16451
76514394
AD
164522002-03-04 Akim Demaille <akim@epita.fr>
16453
16454 * src/output.c (output): Don't free the grammar.
16455 * src/reader.c (grammar_free): New.
16456 * src/main.c (main): Call it and don't free symtab here.
16457
55024580
AD
164582002-03-04 Akim Demaille <akim@epita.fr>
16459
16460 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16461 before returning.
16462 Reported by Benoit Perrot.
16463
f9abaa2c
AD
164642002-03-04 Akim Demaille <akim@epita.fr>
16465
16466 Use bitset operations when possible, not loops over bits.
16467
16468 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16469 bitset_or.
16470 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16471 * src/reduce.c (useless_nonterminals): Formatting changes.
16472 * src/warshall.c (TC): Use bitset_or.
16473
0e721e75
AD
164742002-03-04 Akim Demaille <akim@epita.fr>
16475
16476 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16477 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16478 Ditto.
16479
0fb1ffb1
AD
164802002-03-04 Akim Demaille <akim@epita.fr>
16481
16482 * src/lalr.c (F): Now a bitset*.
16483 Adjust all dependencies.
16484
b86796bf
AD
164852002-03-04 Akim Demaille <akim@epita.fr>
16486
16487 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16488 Adjust all dependencies.
16489
602bbf31
AD
164902002-03-04 Akim Demaille <akim@epita.fr>
16491
16492 * src/L0.c, src/LR0.h (nstates): Be size_t.
16493 Adjust comparisons (signed vs unsigned).
16494 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16495 bitset*.
16496 Adjust all dependencies.
16497
d8a0245c
AD
164982002-03-04 Akim Demaille <akim@epita.fr>
16499
16500 * src/closure.c (firsts): Now, also a bitset.
16501 Adjust all dependencies.
16502 (varsetsize): Remove, now unused.
16503 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16504
34ba9743
AD
165052002-03-04 Akim Demaille <akim@epita.fr>
16506
16507 * src/print.c: Convert to use bitset.h, not hand coded iterations
16508 over ints.
16509
ed86e78c
AD
165102002-03-04 Akim Demaille <akim@epita.fr>
16511
16512 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16513
dfdb1797
AD
165142002-03-04 Akim Demaille <akim@epita.fr>
16515
16516 * src/closure.c (ruleset): Be a bitset.
16517 (rulesetsize): Remove.
16518
7086e707
AD
165192002-03-04 Akim Demaille <akim@epita.fr>
16520
16521 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16522 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16523 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16524 * src/closure.c (fderives): Be an array of bitsets.
16525
98254360
RA
165262002-02-28 Robert Anisko <robert@lrde.epita.fr>
16527
16528 * data/bison.c++: Merge the two generated headers. Insert a copyright
16529 notice in each output file.
16530
a75c057f
AD
165312002-02-28 Akim Demaille <akim@epita.fr>
16532
16533 * data/bison.c++: Copy the prologue of bison.simple to fetch
16534 useful M4 definitions, such as b4_header_guard.
16535
06b00abc
AD
165362002-02-25 Akim Demaille <akim@epita.fr>
16537
16538 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
16539 translator friendly scheme for the bgr
16540 copyright notice.
06b00abc 16541
70e7d534
AD
165422002-02-25 Akim Demaille <akim@epita.fr>
16543
16544 * src/output.c (header_output): Remove, now handled completely via
16545 M4.
16546
abe017f6
AD
165472002-02-25 Akim Demaille <akim@epita.fr>
16548
16549 * m4/m4.m4: New, from CVS Autoconf.
16550 * configure.in: Invoke it.
16551 * src/output.c (output_skeleton): Use its result instead of the
16552 hard coded name.
16553
381fb12e
AD
165542002-02-25 Akim Demaille <akim@epita.fr>
16555
16556 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16557 Fileutils 4.1.5.
16558 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16559 * src/output.c (output_skeleton): Use mkstemp to create a real
16560 temporary file.
16561 Move the filling of `skeleton' and its muscle to...
16562 (prepare): here.
16563 (output): Move the definition of the prologue muscle to...
16564 (prepare): here.
16565 * src/system.h (DEFAULT_TMPDIR): New.
16566
6f38107f
PE
165672002-02-14 Paul Eggert <eggert@twinsun.com>
16568
16569 Remove the support for C++ namespace cleanliness; it was
16570 causing more problems than it was curing, since it didn't work
16571 properly on some nonstandard C++ compilers. This can wait
16572 for a proper C++ parser.
16573
16574 * NEWS: Document this.
16575 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16576 of C++, as it's treated like C now.
16577 * src/bison.simple (YYSTD): Remove.
16578 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16579 Treat C++ just like Standard C instead of trying to support
16580 namespace cleanliness.
16581
80cce3da
AD
165822002-02-14 Akim Demaille <akim@epita.fr>
16583
16584 * tests/regression.at (else): Adjust to Andreas' change.
16585
842e8679
AD
165862002-02-14 Akim Demaille <akim@epita.fr>
16587
16588 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16589
4bda3f10
AD
165902002-02-13 Andreas Schwab <schwab@suse.de>
16591
16592 * src/output.c (output_rule_data): Don't output NULL, it might
16593 not be defined yet.
16594
4162fa07 165952002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 16596
4162fa07
RA
16597 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16598 (Copyright notice): Update.
b418ecd8 16599
bd16a5dc
AD
166002002-02-11 Akim Demaille <akim@epita.fr>
16601
16602 * tests/regression.at (%nonassoc and eof): Don't include
16603 nonportable headers.
16604
8d69a1a3
RA
166052002-02-08 Robert Anisko <robert@lrde.epita.fr>
16606
16607 * data/bison.c++: Correct error recovery. Make the user able to
16608 initialize the starting location.
16609
9b2d0677
AD
166102002-02-07 Akim Demaille <akim@epita.fr>
16611
16612 * tests/input.at: New.
16613
69e2658b
RA
166142002-02-07 Robert Anisko <robert@lrde.epita.fr>
16615
16616 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 16617 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
16618 directives around tables only needed for debugging.
16619
4aacc3a7
RA
166202002-02-07 Robert Anisko <robert@lrde.epita.fr>
16621
16622 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16623 C++ parsers.
16624 (yy::b4_name::parse): Use print_.
16625
762a801e
RA
166262002-02-07 Robert Anisko <robert@lrde.epita.fr>
16627
16628 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16629
4bb2bc3f
RA
166302002-02-07 Robert Anisko <robert@lrde.epita.fr>
16631
16632 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16633 C++ parsers.
16634 (yy::b4_name::parse): Build verbose error messages, and use error_.
16635
6b45a3ca
RA
166362002-02-06 Robert Anisko <robert@lrde.epita.fr>
16637
16638 * data/bison.c++: Fix m4 quoting in comments.
16639
50997c6e
RA
166402002-02-06 Robert Anisko <robert@lrde.epita.fr>
16641
16642 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16643 not expanded by m4.
16644
3f3eed27
AD
166452002-02-05 Akim Demaille <akim@epita.fr>
16646
16647 * data/bison.c++: Adjust to the M4 back end.
16648 More is certainly needed.
16649
be2a1a68
AD
166502002-02-05 Akim Demaille <akim@epita.fr>
16651
16652 Give a try to M4 as a back end.
16653
16654 * lib/readpipe.c: New, from wdiff.
16655 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16656 BISON_HAIRY.
16657 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16658 specific values. Now it is m4 that performs the lookup.
16659 * src/parse-skel.y: Remove.
16660 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16661 * src/output.c (actions_output, guards_output)
16662 (token_definitions_output): No longer keeps track of the output
16663 line number, hence remove the second argument.
16664 (guards_output): Check against the guard member of a rule, not the
16665 action member.
16666 Adjust callers.
16667 (output_skeleton): Don't look for the skeleton location, let m4 do
16668 that.
16669 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16670 file will be used.
16671 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16672 (prepare): Given that for the time being changesyntax is not
16673 usable in M4, rename the muscles using `-' to `_'.
16674 Define `defines_flag', `output_parser_name' and `output_header_name'.
16675 * src/output.h (actions_output, guards_output)
16676 (token_definitions_output): Adjust prototypes.
16677 * src/scan-skel.l: Instead of scanning the skeletons, it now
16678 processes the output of m4: `__oline__' and `#output'.
16679 * data/bison.simple: Adjust to be used by M4(sugar).
16680 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16681 to date.
16682 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16683 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16684 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16685 shamelessly stolen from CVS Autoconf.
16686
beda758b
AD
166872002-02-05 Akim Demaille <akim@epita.fr>
16688
16689 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16690 * configure.in: Check for the declarations of free and malloc.
16691 * src/muscle_tab.c: Adjust.
16692
5ece6d43
AD
166932002-02-05 Akim Demaille <akim@epita.fr>
16694
16695 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16696 which have no values.
16697
5bb18f9a
AD
166982002-02-05 Akim Demaille <akim@epita.fr>
16699
16700 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16701 * data/: here.
16702
894dd62e
PE
167032002-01-29 Paul Eggert <eggert@twinsun.com>
16704
16705 * src/bison.simple (YYSIZE_T): Do not define merely because
16706 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16707 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16708
82841af7
AD
167092002-01-27 Akim Demaille <akim@epita.fr>
16710
16711 Fix `%nonassoc and eof'.
16712
16713 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16714 which were not properly copied! Replace
16715 memcpy (res->errs, src->errs, src->nerrs);
16716 with
16717 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16718 !!!
16719 * tests/regression.at (%nonassoc and eof): Adjust to newest
16720 Autotest: `.' is not in the PATH.
16721
318b76e9
AD
167222002-01-27 Akim Demaille <akim@epita.fr>
16723
16724 * tests/sets.at (AT_EXTRACT_SETS): New.
16725 (Nullable): Use it.
16726 (Firsts): New.
16727
30d2f3d5
AD
167282002-01-26 Akim Demaille <akim@epita.fr>
16729
16730 * tests/actions.at, tests/calc.at, tests/headers.at,
16731 * tests/torture.at: Adjust to the newest Autotest which no longer
16732 forces `.' in the PATH.
16733
30f8c395
AD
167342002-01-25 Akim Demaille <akim@epita.fr>
16735
16736 * tests/regression.at (%nonassoc and eof): New.
16737 Suggested by Robert Anisko.
16738
29ae55f1
AD
167392002-01-24 Akim Demaille <akim@epita.fr>
16740
16741 Bison dumps core when trying to complain about broken input files.
16742 Reported by Cris van Pelt.
16743
16744 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16745 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16746 into...
16747 (Invalid inputs): Strengthen: exercise parse_percent_token.
16748
2b548aa6
RA
167492002-01-24 Robert Anisko <robert.anisko@epita.fr>
16750
16751 * src/Makefile.am: Add bison.c++.
16752 * src/bison.c++: New skeleton.
16753
bb0146c2
AD
167542002-01-21 Paolo Bonzini <bonzini@gnu.org>
16755
16756 * po/it.po: New.
16757
bec30531
AD
167582002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16759
16760 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16761
fc6edc45
MA
167622002-01-20 Marc Autret <marc@gnu.org>
16763
16764 * src/files.c (compute_output_file_names): Fix
16765
5e5d5415
MA
167662002-01-20 Marc Autret <marc@gnu.org>
16767
16768 * tests/output.at: New test.
16769 * src/files.c (compute_base_names): Don't map extensions when
16770 the YACC flag is set, use defaults.
16771 Reported by Evgeny Stambulchik.
16772
44ea3fbd
MA
167732002-01-20 Marc Autret <marc@gnu.org>
16774
ba0fe3c7
PE
16775 * src/system.h: Need to define __attribute__ away for non-GCC
16776 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
16777 Suggested by Albert Chin-A-Young.
16778
338963d1
TVH
167792002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16780
16781 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16782 canonical definition.
16783 * src/system.h: Use the canonical definition for PARAMS (avoids
16784 a conflict with the macro from lib/hash.h).
16785
c57b2479
AD
167862002-01-11 Akim Demaille <akim@epita.fr>
16787
16788 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 16789 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 16790
b85810ae
AD
167912002-01-09 Akim Demaille <akim@epita.fr>
16792
16793 * src/files.c, src/files.h (output_infix): New.
16794 (tab_extension): Remove.
16795 (compute_base_names): Compute the former, drop the latter.
16796 * src/output.c (prepare): Insert the muscles `output-infix', and
16797 `output-suffix'.
16798 * src/parse-skel.y (string, string.1): New.
16799 (section.header): Use it.
16800 (section.yacc): Remove.
16801 (prefix): Remove too.
16802 * src/scan-skel.l: Adjust.
16803 * src/bison.simple, src/bison.hairy: Adjust.
16804
cae60122
AD
168052002-01-09 Akim Demaille <akim@epita.fr>
16806
16807 * configure.in (WERROR_CFLAGS): Compute it.
16808 * src/Makefile.am (CFLAGS): Pass it.
16809 * tests/atlocal.in (CFLAGS): Idem.
16810 * src/files.c: Fix a few warnings.
16811 (get_extension_index): Remove, unused.
16812
ae404801
AD
168132002-01-08 Akim Demaille <akim@epita.fr>
16814
16815 * src/getargs.c (AS_FILE_NAME): New.
16816 (getargs): Use it to convert DOSish file names.
16817 * src/files.c (base_name): Rename as full_base_name to avoid
16818 clashes with `base_name ()'.
16819 (filename_split): New.
16820 (compute_base_names): N-th rewrite, using filename_split.
16821
22312b71
AD
168222002-01-08 Akim Demaille <akim@epita.fr>
16823
16824 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16825 New, stolen from the Fileutils 4.1.
16826 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16827 * configure.in: Check for the presence of memrchr, and of its
16828 prototype.
16829
a67cef01
TVH
168302002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16831
16832 * lib/hash.h (__P): Added definition for this macro.
16833 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16834 BUILT_SOURCES, to ensure they are generated first.
16835 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16836 %error-verbose to allow bootstrapping with bison 1.30x.
16837
2b25d624
AD
168382002-01-06 Akim Demaille <akim@epita.fr>
16839
16840 * src/reader.c (parse_braces): Don't fetch the next char, the
16841 convention is to fetch on entry.
16842 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16843 'switch' without a following semicolon.
16844 * tests/regression.at (braces parsing): New.
16845
3460813b
AD
168462002-01-06 Akim Demaille <akim@epita.fr>
16847
16848 Bison is dead wrong in its RR conflict reports.
16849
16850 * tests/torture.at (GNU Cim Grammar): New.
16851 * src/conflicts.c (count_rr_conflicts): Fix.
16852
73784c64
AD
168532002-01-06 Akim Demaille <akim@epita.fr>
16854
16855 Creating package.m4 from configure.ac causes too many problems.
16856
16857 * tests/Makefile.am (package.m4): Create it by hand,
16858 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16859
25d81090
AD
168602002-01-06 Akim Demaille <akim@epita.fr>
16861
16862 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16863 skeleton.h.
16864
a9b8959e
PE
168652002-01-04 Paul Eggert <eggert@twinsun.com>
16866
16867 * doc/bison.texinfo (Debugging):
16868 Remove YYSTDERR; it's no longer defined or used.
16869 Also, s/cstdio.h/cstdio/.
16870
25d81090
AD
168712002-01-03 Akim Demaille <akim@epita.fr>
16872
16873 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
16874
1109455c
AD
168752002-01-03 Akim Demaille <akim@epita.fr>
16876
16877 * src/parse-skel.y (process_skeleton): Don't bind the parser's
16878 tracing code to --trace, wait for a better --trace option, with
16879 args.
16880
7ea5e977
AD
168812002-01-03 Akim Demaille <akim@epita.fr>
16882
16883 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
16884 The ISO C++ standard is extremely clear about it: stderr is
16885 considered a macro, not a regular symbol (see table 94 `Header
16886 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
16887 Therefore std:: does not apply to it. It still does with fprintf.
16888 Also, s/cstdio.h/cstdio/.
16889
fab5b110
AD
168902002-01-03 Akim Demaille <akim@epita.fr>
16891
16892 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
16893 for non system headers.
16894
aed7fd9b
AD
168952002-01-02 Akim Demaille <akim@epita.fr>
16896
16897 Equip the skeleton chain with location tracking, runtime trace,
16898 pure parser and scanner.
16899
16900 * src/parse-skel.y: Request a pure parser, locations, and prefix
16901 renaming.
16902 (%union): Having several members with the same type does not help
16903 type mismatches, simplify.
16904 (YYPRINT, yyprint): New.
16905 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
16906 (skel_error): this.
16907 Handle locations.
16908 * src/scan-skel.l: Adjust to these changes.
16909 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
16910 (LOCATION_PRINT, skel_control_t): New.
16911
24fad99e
AD
169122001-12-30 Akim Demaille <akim@epita.fr>
16913
16914 * src/parse-skel.y: Get rid of the shift/reduce conflict:
16915 replace `gb' with BLANKS.
16916 * src/scan-skel.l: Adjust.
16917
a4b36db4
AD
169182001-12-30 Akim Demaille <akim@epita.fr>
16919
16920 * src/system.h: We don't need nor want bcopy.
16921 Throw away MS-DOS crap: we don't need getpid.
16922 * configure.in: We don't need strndup. It was even causing
16923 problems: because Flex includes the headers *before* us,
16924 _GNU_SOURCE is not defined by config.h, and therefore strndup was
16925 not visible.
16926 * lib/xstrndup.c: New.
16927 * src/scan-skel.l: Use it.
16928 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
16929 * src/parse-skel.y: Use %directives instead of #defines.
16930
1239777d
AD
169312001-12-30 Akim Demaille <akim@epita.fr>
16932
16933 * src/skeleton.h: New.
16934 * src/output.c (output_parser, output_master_parser): Remove, dead
16935 code.
16936 * src/output.h (get_lines_number, actions_output, guards_output)
16937 (token_definitions_output): Prototype them.
16938 * src/parse-skel.y: Add the license notice.
16939 Include output.h and skeleton.h.
16940 (process_skeleton): Returns void, and takes a single parameter.
16941 * src/scan-skel.l: Add the license notice.
16942 Include skeleton.h.
16943 Don't use %option yylineno: it seems that then Flex imagines
16944 REJECT has been used, and therefore it won't reallocate its
16945 buffers (which makes no other sense to me than a bug). It results
16946 in warnings for `unused: yy_flex_realloc'.
16947
9b3add5b
RA
169482001-12-30 Robert Anisko <robert.anisko@epita.fr>
16949
16950 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16951 (MUSCLE_INSERT_PREFIX): ...to there.
16952 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16953 (MUSCLE_INSERT_PREFIX): Move from here...
16954
16955 * src/bison.hairy: Add a section directive. Put braces around muscle
16956 names. This parser skeleton is still broken, but Bison should not
16957 choke on a bad muscle 'syntax'.
16958 * src/bison.simple: Add a section directive. Put braces around muscle
16959 names.
16960
16961 * src/files.h (strsuffix, stringappend): Add declarations.
16962 (tab_extension): Add declaration.
16963 (short_base_name): Add declaration.
16964
16965 * src/files.c (strsuffix, stringappend): No longer static. These
16966 functions are used in the skeleton parser.
16967 (tab_extension): New.
16968 (compute_base_names): Use the computations done in this function
fab5b110 16969 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
16970 names.
16971 (short_base_name): No longer static.
16972
16973 * src/output.c (output_skeleton): New.
16974 (output): Disable call to output_master_parser, and give a try to
16975 a new skeleton handling system.
16976 (guards_output, actions_output): No longer static.
16977 (token_definitions_output, get_lines_number): No longer static.
16978
16979 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
16980
fab5b110 16981 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
16982 parse-skel.y.
16983
16984 * src/parse-skel.y: New file.
16985 * src/scan-skel.l: New file.
16986
b5b61c61
AD
169872001-12-29 Akim Demaille <akim@epita.fr>
16988
16989 %name-prefix is broken.
16990
16991 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
16992 Adjust all dependencies.
16993 * tests/headers.at (export YYLTYPE): Strengthen this test: use
16994 %name-prefix.
16995
16996 Renaming yylval but not yylloc is not consistent. Now we do.
16997
16998 * src/bison.simple: Prefix yylloc if used.
16999 * doc/bison.texinfo (Decl Summary): Document that.
17000
8c9a50be
AD
170012001-12-29 Akim Demaille <akim@epita.fr>
17002
17003 * doc/bison.texinfo: Promote `%long-directive' over
17004 `%long_directive'.
17005 Remove all references to fixed-output-files, yacc is enough.
17006
d99361e6
AD
170072001-12-29 Akim Demaille <akim@epita.fr>
17008
17009 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17010 user prologue. These are defaults.
17011 * tests/actions.at (Mid-rule actions): Make sure the user can
17012 define YYDEBUG and YYERROR_VERBOSE.
17013
b9cecb91
AD
170142001-12-29 Akim Demaille <akim@epita.fr>
17015
17016 * src/output.c (header_output): Don't forget to export YYLTYPE and
17017 yylloc.
17018 * tests/headers.at (export YYLTYPE): New, make sure it does.
17019 * tests/regression.at (%union and --defines, Invalid CPP headers):
17020 Move to...
17021 * tests/headers.at: here.
17022
aea13e97
AD
170232001-12-29 Akim Demaille <akim@epita.fr>
17024
17025 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17026
931394cb
AD
170272001-12-29 Akim Demaille <akim@epita.fr>
17028
17029 * tests/actions.at (Mid-rule actions): Output on a single line
17030 instead of several.
17031
704a47c4
AD
170322001-12-29 Akim Demaille <akim@epita.fr>
17033
17034 * doc/bison.texinfo: Formatting changes.
17035
091e20bb
AD
170362001-12-29 Akim Demaille <akim@epita.fr>
17037
17038 Don't store the token defs in a muscle, just be ready to output it
17039 on command. Now possible via `symbols'. Fixes a memory leak.
17040
17041 * src/output.c (token_definitions_output): New.
17042 (output_parser, header_output): Use it.
17043 * src/reader.c (symbols_save): Remove.
17044
cce71710
AD
170452001-12-29 Akim Demaille <akim@epita.fr>
17046
17047 * src/bison.simple: Do not provide a default for YYSTYPE and
17048 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17049 default.
17050
82c035a8
AD
170512001-12-29 Akim Demaille <akim@epita.fr>
17052
17053 Mid-rule actions are simply... ignored!
17054
17055 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17056 the empty-rule associated to the dummy symbol, not to the host
17057 rule.
17058 * tests/actions.at (Mid-rule actions): New.
17059
8419d367
AD
170602001-12-29 Akim Demaille <akim@epita.fr>
17061
17062 Memory leak.
17063
17064 * src/reader.c (reader): Free grammar.
17065
375d5806
AD
170662001-12-29 Akim Demaille <akim@epita.fr>
17067
17068 Memory leak.
17069
17070 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17071 since it allocates it for each state, although only one is needed.
17072 (allocate_storage): Do it here.
17073
f51cb8ff
AD
170742001-12-29 Akim Demaille <akim@epita.fr>
17075
17076 * src/options.h, src/options.c (create_long_option_table): Rename
17077 as...
17078 (long_option_table_new): this, with a clearer prototype.
17079 (percent_table): Remove, unused,
17080 * src/getargs.c (getargs): Adjust.
17081
29e88316
AD
170822001-12-29 Akim Demaille <akim@epita.fr>
17083
17084 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17085 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17086 as states.
17087
b9f71f19
AD
170882001-12-29 Akim Demaille <akim@epita.fr>
17089
17090 * src/lalr.c (build_relations): Rename `states' as `states1'.
17091 Sorry, I don't understand exactly what it is, no better name...
17092
1a2b5d37
AD
170932001-12-29 Akim Demaille <akim@epita.fr>
17094
17095 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17096 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17097 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17098 as rules.
17099
1cca533e
AD
171002001-12-29 Akim Demaille <akim@epita.fr>
17101
17102 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17103 ago.
17104
c03ae966
AD
171052001-12-29 Akim Demaille <akim@epita.fr>
17106
17107 * src/reader.c, src/reader.h (user_toknums): Remove.
17108 Adjust all users to use symbols[i]->user_token_number.
17109
5a670b1e
AD
171102001-12-29 Akim Demaille <akim@epita.fr>
17111
17112 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17113 Adjust all users to use symbols[i]->prec or ->assoc.
17114
ad949da9
AD
171152001-12-29 Akim Demaille <akim@epita.fr>
17116
17117 * src/reader.c, src/reader.h (tags): Remove.
17118 Adjust all users to use symbols[i]->tag.
17119
0e78e603
AD
171202001-12-29 Akim Demaille <akim@epita.fr>
17121
17122 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17123 and rule_table.
17124 * src/reader.c (packsymbols): Fill this table.
17125 Drop sprec.
17126 * src/conflicts.c (resolve_sr_conflict): Adjust.
17127 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17128 single table.
17129 Use symbols[i]->tag instead of tags[i].
17130
213e640e
AD
171312001-12-29 Akim Demaille <akim@epita.fr>
17132
17133 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17134 In addition, put a comment in there, to replace...
17135 * tests/regression.at (%union and C comments): Remove.
17136
e7b8bef1
AD
171372001-12-29 Akim Demaille <akim@epita.fr>
17138
17139 * tests/regression.at (Web2c Actions): Blindly move the actual
17140 output as expected output. The contents *seem* right to me, but I
17141 can't pretend reading perfectly parser tables... Nonetheless, all
17142 the other tests pass correctly, the table look OK, even though the
17143 presence of `$axiom' is to be noted: AFAICS it is useless (but
17144 harmless).
17145
b68e7744
AD
171462001-12-29 Akim Demaille <akim@epita.fr>
17147
17148 * src/reader.c (readgram): Don't add the rule 0 if there were no
17149 rules read. In other words, add it _after_ having performed
17150 grammar sanity checks.
17151 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17152
78d5bae9
AD
171532001-12-29 Akim Demaille <akim@epita.fr>
17154
17155 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17156 visible, and some states have now a different number.
17157
ff442794
AD
171582001-12-29 Akim Demaille <akim@epita.fr>
17159
17160 * src/reader.c (readgram): Bind the initial rule's lineno to that
17161 of the first rule.
17162 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17163 (Solved SR Conflicts): Adjust rule 0's line number.
17164
610ab194
AD
171652001-12-29 Akim Demaille <akim@epita.fr>
17166
17167 Fix the `GAWK Grammar' failure.
17168
17169 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17170 the reductions of the first state which was mistakenly confused
17171 with the final state because precisely final_state was initialized
17172 to 0.
17173 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17174 now noticed by Bison.
17175 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17176 have a reduction on $default.
17177
29d29c8f
AD
171782001-12-29 Akim Demaille <akim@epita.fr>
17179
17180 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17181 rule line numbers.
17182 * src/closure.c (print_closure): Likewise.
17183 * src/derives.c (print_derives): Likewise.
17184 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17185 now.
17186
7c6b64d0
AD
171872001-12-29 Akim Demaille <akim@epita.fr>
17188
17189 * src/lalr.c (lookaheads_print): New.
17190 (lalr): Call it when --trace-flag.
17191 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17192 are dumped.
17193
3d4daee3
AD
171942001-12-29 Akim Demaille <akim@epita.fr>
17195
17196 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17197 when walking through ritem, even via rule->rhs.
17198 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17199 (useful_production, useless_nonterminals): Likewise.
17200 (reduce_grammar_tables): Likewise, plus update nritems.
17201 * src/nullable.c (set_nullable): Likewise.
17202 * src/lalr.c (build_relations): Likewise.
17203 * tests/sets.at (Nullable): Adjust.
17204 Fortunately, now, the $axiom is no longer nullable.
17205
9e7f6bbd
AD
172062001-12-29 Akim Demaille <akim@epita.fr>
17207
17208 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17209 the 0-sentinel.
17210 * src/gram.c (ritem_longest_rhs): Likewise.
17211 * src/reduce.c (nonterminals_reduce): Likewise.
17212 * src/print_graph.c (print_graph): Likewise.
17213 * src/output.c (output_rule_data): Likewise.
17214 * src/nullable.c (set_nullable): Likewise.
17215
255ef638
AD
172162001-12-29 Akim Demaille <akim@epita.fr>
17217
17218 * src/output.c: Comment changes.
17219
0d8a7363
AD
172202001-12-27 Paul Eggert <eggert@twinsun.com>
17221
17222 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17223 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17224 Sparc, as they were causing more porting problems than the
17225 (minor) performance improvement was worth.
17226
17227 Also, catch up with 1.31's YYSTD.
17228
3db472b9
AD
172292001-12-27 Akim Demaille <akim@epita.fr>
17230
17231 * src/output.c (output_gram): Rely on nritems, not the
17232 0-sentinel. See below.
17233 Use -1 as separator, not 0.
17234 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17235 Rely on -1 as separator in yyrhs, instead of 0.
17236 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17237 twice `Now at end of input', therefore there are two lines less to
17238 expect.
17239
b365aa05
AD
172402001-12-27 Akim Demaille <akim@epita.fr>
17241
17242 * tests/regression.at (Unresolved SR Conflicts):
17243 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17244 below.
17245
30171f79
AD
172462001-12-27 Akim Demaille <akim@epita.fr>
17247
17248 * src/LR0.c (new_state): Recognize the final state by the fact it
17249 is reached by eoftoken.
17250 (insert_start_shifting_state, insert_eof_shifting_state)
17251 (insert_accepting_state, augment_automaton): Remove, since now
17252 these states are automatically computed from the initial state.
17253 (generate_states): Adjust.
17254 * src/print.c: When reporting a rule number to the user, substract
17255 1, so that the axiom rule is rule 0, and the first user rule is 1.
17256 * src/reduce.c: Likewise.
17257 * src/print_graph.c (print_core): For the time being, just as for
17258 the report, depend upon --trace-flags to dump the full set of
17259 items.
17260 * src/reader.c (readgram): Once the grammar read, insert the rule
17261 0: `$axiom: START-SYMBOL $'.
17262 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17263 number of the states has changed (the final state is no longer
17264 necessarily the last), catch up.
17265
75142d45
AD
172662001-12-27 Akim Demaille <akim@epita.fr>
17267
17268 Try to make the use of the eoftoken valid. Given that its value
17269 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17270 is used instead of > 0 where appropriate, (ii), depend upon nritems
17271 instead of the 0-sentinel.
17272
17273 * src/gram.h, src/gram.c (nritems): New.
17274 Expected to be duplication of nitems, but for the time being...
17275 * src/reader.c (packgram): Assert nritems and nitems are equal.
17276 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17277 * src/closure.c (print_closure, print_fderives): Likewise.
17278 * src/gram.c (ritem_print): Likewise.
17279 * src/print.c (print_core, print_grammar): Likewise.
17280 * src/print_graph.c: Likewise.
17281
b7c49edf
AD
172822001-12-27 Akim Demaille <akim@epita.fr>
17283
17284 * src/main.c (main): If there are complains after grammar
17285 reductions, then output the report anyway if requested, then die.
17286 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17287 * src/reader.c (eoftoken): New.
17288 (parse_token_decl): If the token being defined has value `0', it
17289 is the eoftoken.
17290 (packsymbols): No longer hack `tags' to insert `$' by hand.
17291 Be sure to preserve the value of the eoftoken.
17292 (reader): Make sure eoftoken is defined.
17293 Initialize nsyms to 0: now eoftoken is created just like the others.
17294 * src/print.c (print_grammar): Don't special case the eof token.
17295 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17296 lie anyway, albeit pleasant.
17297 * tests/calc.at: Exercise error messages with eoftoken.
17298 Change the grammar so that empty input is invalid.
17299 Adjust expectations.
17300 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17301
ec2da99f
AD
173022001-12-27 Akim Demaille <akim@epita.fr>
17303
17304 * configure.in: Check the protos of strchr ans strspn.
17305 Replace strchr if needed.
17306 * src/system.h: Provide the protos of strchr, strspn and memchr if
17307 missing.
17308 * lib/strchr.c: New.
17309 * src/reader.c (symbols_save): Use strchr.
17310
8adfa272
AD
173112001-12-27 Akim Demaille <akim@epita.fr>
17312
17313 * src/print.c, src/print_graph.c (escape): New.
17314 Use it to quote the TAGS outputs.
17315 * src/print_graph.c (print_state): Now errors are in red, and
17316 reductions in green.
17317 Prefer high to wide: output the state number on a line of its own.
17318
80dac38c
AD
173192001-12-27 Akim Demaille <akim@epita.fr>
17320
17321 * src/state.h, src/state.c (reductions_new): New.
17322 * src/LR0.c (set_state_table): Let all the states have a
17323 `reductions', even if reduced to 0.
17324 (save_reductions): Adjust.
17325 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17326 * src/print.c (print_reductions, print_actions): Adjust.
17327 * src/output.c (action_row): Adjust.
17328
2cec70b9
AD
173292001-12-27 Akim Demaille <akim@epita.fr>
17330
17331 * src/state.h, src/state.c (errs_new, errs_dup): New.
17332 * src/LR0.c (set_state_table): Let all the states have an errs,
17333 even if reduced to 0.
17334 * src/print.c (print_errs, print_reductions): Adjust.
17335 * src/output.c (output_actions, action_row): Adjust.
17336 * src/conflicts.c (resolve_sr_conflict): Adjust.
17337
13ca549a
AD
173382001-12-27 Akim Demaille <akim@epita.fr>
17339
17340 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17341
5092aba5
AD
173422001-12-27 Akim Demaille <akim@epita.fr>
17343
17344 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17345 * src/print.c: here.
17346 (lookaheadset, shiftset): New, used as additional storage by
17347 print_reductions.
17348 (print_results): Adjust.
17349 (print_shifts, print_gotos, print_errs): New, extracted from...
17350 (print_actions): here.
17351 * src/print_graph.c (print_actions): Remove dead code.
17352
11e2beca
AD
173532001-12-27 Akim Demaille <akim@epita.fr>
17354
17355 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17356 `$n' and `@n'.
17357
dac3c910
AD
173582001-12-27 Akim Demaille <akim@epita.fr>
17359
17360 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17361 (build_relations): Adjust.
17362
d0b0fefa
AD
173632001-12-27 Akim Demaille <akim@epita.fr>
17364
17365 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17366 duplication.
17367
adc8c848
AD
173682001-12-27 Akim Demaille <akim@epita.fr>
17369
17370 * src/reader.c (packgram): Catch nitems overflows.
17371
14d293ac
AD
173722001-12-27 Akim Demaille <akim@epita.fr>
17373
17374 * src/files.c, src/files.h (guard_obstack): Remove.
17375 * src/output.c (output): Adjust.
17376 * src/reader.c (parse_braces): New, factoring...
17377 (copy_action, copy_guard): these two which are renamed as...
17378 (parse_action, parse_guard): these.
17379 As a voluntary consequence, using braces around guards is now
17380 mandatory.
17381
f499b062
AD
173822001-12-27 Akim Demaille <akim@epita.fr>
17383
17384 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17385 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17386 members.
17387 (symbol_list_new): Adjust.
17388 (copy_action): action_line is the first line, not the last.
17389 (copy_guard): Just as for actions, store the `action' only, not
17390 the switch/case/break flesh.
17391 Don't parse the user action that might follow the guard, let...
17392 (readgram): do it, i.e., now, there can be an action after a
17393 guard.
17394 In other words the guard is just explicitly optional.
17395 (packgram): Adjust.
17396 * src/output.c (guards_output): New.
17397 (output_parser): Call it when needed.
17398 (output): Also free the guard and attrs obstacks.
17399 * src/files.c, src/files.h (obstack_save): Remove.
17400 (output_files): Remove.
17401 As a result, if one needs the former `.act' file, using an
17402 appropriate skeleton which requires actions and guards is now
17403 required.
17404 * src/main.c (main): Adjust.
17405 * tests/semantic.at: New.
17406 * tests/regression.at: Use `input.y' as input file name.
17407 Avoid 8+3 problems by requiring input.c when the test needs the
17408 parser.
17409
d945f5cd
AD
174102001-12-27 Akim Demaille <akim@epita.fr>
17411
17412 * src/reader.c (symbol_list_new): Be sure to initialize all the
17413 fields.
17414
d200e455
AD
174152001-12-27 Akim Demaille <akim@epita.fr>
17416
17417 All the hacks using a final pseudo state are now useless.
17418
17419 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17420 * src/lalr.c (nLA): New.
17421 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17422 instead of lookaheadsp from the pseudo state (nstate + 1).
17423
f9507c28
AD
174242001-12-27 Akim Demaille <akim@epita.fr>
17425
17426 * src/output.c (action_row, token_actions): Use a state_t instead
17427 of a integer, and nlookaheads instead of the following state's
17428 lookaheadsp.
17429
065fbd27
AD
174302001-12-27 Akim Demaille <akim@epita.fr>
17431
17432 * src/conflicts.c (log_resolution, flush_shift)
17433 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17434 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17435 (conflicts_print, print_reductions): Use a state_t instead of an
17436 integer when referring to a state.
17437 As much as possible, depend upon nlookaheads, instead of the
17438 `lookaheadsp' member of the following state (since lookaheads of
17439 successive states are successive, the difference between state n + 1
17440 and n served as the number of lookaheads for state n).
17441 * src/lalr.c (add_lookback_edge): Likewise.
17442 * src/print.c (print_core, print_actions, print_state)
17443 (print_results): Likewise.
17444 * src/print_graph.c (print_core, print_actions, print_state)
17445 (print_graph): Likewise.
17446 * src/conflicts.h: Adjust.
17447
1b177bd7
AD
174482001-12-27 Akim Demaille <akim@epita.fr>
17449
17450 * src/bison.hairy: Formatting/comment changes.
17451 ANSIfy.
17452 Remove `register' indications.
17453 Add plenty of `static'.
17454
7742ddeb
AD
174552001-12-27 Akim Demaille <akim@epita.fr>
17456
17457 * src/output.c (prepare): Drop the muscle `ntbase' which
17458 duplicates ntokens.
17459 * src/bison.simple: Formatting/comment changes.
17460 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17461 is an undocumented synonym.
17462
1fa14068
AD
174632001-12-22 Akim Demaille <akim@epita.fr>
17464
17465 * src/output.c (output_table_data): Change the prototype to use
17466 `int' for array ranges: some invocations do pass an int, not a
17467 short.
17468 Reported by Wayne Green.
17469
b9752825
AD
174702001-12-22 Akim Demaille <akim@epita.fr>
17471
17472 Some actions of web2c.y are improperly triggered.
17473 Reported by Mike Castle.
17474
17475 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17476 * tests/regression.at (Web2c): Rename as...
17477 (Web2c Report): this.
17478 (Web2c Actions): New.
17479
776209d6
AD
174802001-12-22 Akim Demaille <akim@epita.fr>
17481
17482 Reductions in web2c.y are improperly reported.
17483 Reported by Mike Castle.
17484
17485 * src/conflicts.c (print_reductions): Fix.
17486 * tests/regression.at (Web2c): New.
17487
275fc3ad
AD
174882001-12-18 Akim Demaille <akim@epita.fr>
17489
17490 Some host fail on `assert (!"foo")', which expands to
17491 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17492 Reported by Nelson Beebee.
17493
17494 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17495 `#define it_succeeded 0' and `assert (it_succeeded)'.
17496
897668ee
MA
174972001-12-17 Marc Autret <autret_m@epita.fr>
17498
17499 * src/bison.simple: Don't hard code the skeleton line and filename.
17500 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17501 New line counter 'skeleton_line' (skeleton-line muscle).
17502
ab3399e0
PE
175032001-12-17 Paul Eggert <eggert@twinsun.com>
17504
17505 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17506 YYDEBUG must be defined to a nonzero value.
17507
17508 * src/bison.simple (yytname): Do not assume that the user defines
17509 YYDEBUG to a properly parenthesized expression.
17510
3877f72b
AD
175112001-12-17 Akim Demaille <akim@epita.fr>
17512
17513 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17514 nlookaheads is a new member.
17515 Adjust all users.
17516 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17517 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17518 state.
776209d6 17519
331dbc1b
AD
175202001-12-17 Akim Demaille <akim@epita.fr>
17521
17522 * src/files.h, src/files.c (open_files, close_files): Remove.
17523 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17524 let...
17525 * src/reader.c (reader): Do it.
776209d6 17526
be750e4c
AD
175272001-12-17 Akim Demaille <akim@epita.fr>
17528
17529 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 17530
709ae8c6
AD
175312001-12-17 Akim Demaille <akim@epita.fr>
17532
17533 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17534 (flush_reduce): New.
17535 (resolve_sr_conflict): Adjust.
776209d6 17536
f87685c3
AD
175372001-12-17 Akim Demaille <akim@epita.fr>
17538
17539 * src/output.c (output_obstack): Be static and rename as...
17540 (format_obstack): this, to avoid any confusion with files.c's
17541 output_obstack.
17542 * src/reader.h (muscle_obstack): Move to...
17543 * src/output.h: here, since it's defined in output.c.
17544
837491d8
AD
175452001-12-17 Akim Demaille <akim@epita.fr>
17546
17547 * src/output.c (action_row, save_column, default_goto)
17548 (sort_actions, matching_state, pack_vector): Better variable
17549 locality.
17550
796d61fb
AD
175512001-12-17 Akim Demaille <akim@epita.fr>
17552
17553 * src/output.c: Various formatting changes.
776209d6 17554
64d15509
AD
175552001-12-17 Akim Demaille <akim@epita.fr>
17556
17557 * src/files.c (output_files): Free the output_obstack.
17558 * src/main.c (main): Call print and print_graph conditionally.
17559 * src/print.c (print): Work unconditionally.
17560 * src/print_graph.c (print_graph): Work unconditionally.
17561 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17562
fbc8ecb7
MA
175632001-12-16 Marc Autret <autret_m@epita.fr>
17564
17565 * src/output.c (actions_output): Fix. When we use %no-lines,
17566 there is one less line per action.
17567
f0440388
MA
175682001-12-16 Marc Autret <autret_m@epita.fr>
17569
17570 * src/bison.simple: Remove a useless #line directive.
17571 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17572 * src/output.c (get_lines_number): New.
776209d6 17573 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
17574 output muscles.
17575 Fix line numbering.
17576 (actions_output): Computes the number of lines taken by actions.
17577 (output_master_parser): Insert new skeleton which is the name of
17578 the output parser file name.
17579
a79986b8
MA
175802001-12-15 Marc Autret <autret_m@epita.fr>
17581
17582 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17583
4ec8e00f
MA
175842001-12-15 Marc Autret <autret_m@epita.fr>
17585
17586 * src/output.c (output_gram): Keep track of the hairy one.
17587
1a4648ff
AD
175882001-12-15 Akim Demaille <akim@epita.fr>
17589
17590 Make `make distcheck' work.
17591
17592 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17593 system.h which uses libgettext.h.
17594
9c2c67e6
AD
175952001-12-15 Akim Demaille <akim@epita.fr>
17596
17597 * src/nullable.c (set_nullable): Useless rules must be skipped,
17598 otherwise, since we range over their symbols, we might look at a
17599 nonterminal which no longer ``exists'', i.e., it is not counted in
17600 `nvars', hence we overflow our arrays.
17601
93ede233
AD
176022001-12-15 Akim Demaille <akim@epita.fr>
17603
17604 The header can also be produced directly, without any obstack!
17605 Yahoo!
17606
17607 * src/files.c, src/files.h (defines_obstack): Remove.
17608 (compute_header_macro): Global.
17609 (defines_obstack_save): Remove.
17610 * src/reader.c (parse_union_decl): No longer output to
17611 defines_obstack: its content can be found in the `stype' muscle
17612 anyway.
17613 (output_token_translations): Merge into...
17614 (symbols_output): this.
17615 Rename as...
17616 (symbols_save): this.
17617 (reader): Adjust.
17618 * src/output.c (header_output): New.
17619 (output): Call it.
17620
2666f928
AD
176212001-12-15 Akim Demaille <akim@epita.fr>
17622
17623 * src/reader.c (parse_union_decl): Instead of handling two obstack
17624 simultaneously, use one to define the `stype' muscle, and use the
17625 value of the latter to fill defines_obstack.
17626 (copy_comment): Remove.
17627 (copy_comment2): Work for a single obstack.
17628 Rename as...
17629 (copy_comment): this.
17630
428046f8
AD
176312001-12-15 Akim Demaille <akim@epita.fr>
17632
17633 * src/lex.c, src/lex.h (xgetc): No longer static.
17634 * src/reader.c (parse_union_decl): Revamp.
17635
ea52d706
AD
176362001-12-15 Akim Demaille <akim@epita.fr>
17637
17638 Still making progress in separating Bison into (i) input, (ii)
17639 process, (iii) output: now we can directly output the parser file
17640 without using table_obstack at all.
17641
17642 * src/files.c, src/files.h (table_obstack): Bye bye.
17643 (parser_file_name): New.
17644 * src/files.c (compute_output_file_names): Compute it.
17645 * src/output.c (actions_output, output_parser)
17646 (output_master_parser): To a file instead of an obstack.
17647
3f96f4dc
AD
176482001-12-15 Akim Demaille <akim@epita.fr>
17649
17650 Attach actions to rules, instead of pre-outputting them to
17651 actions_obstack.
17652
17653 * src/gram.h (rule_t): action and action_line are new members.
17654 * src/reader.c (symbol_list): Likewise.
17655 (copy_action): Save the actions within the rule.
17656 (packgram): Save them in rule_table.
17657 * src/output.c (actions_output): New.
17658 (output_parser): Use it on `%%actions'.
17659 (output_rule_data): Don't free rule_table.
17660 (output): Do it.
17661 (prepare): Don't save the `action' muscle.
17662 * src/bison.simple: s/%%action/%%actions/.
17663
51576fb3
AD
176642001-12-15 Akim Demaille <akim@epita.fr>
17665
17666 * src/reader.c (copy_action): When --yacc, don't append a `;'
17667 to the user action: let it fail if lacking.
dee049eb 17668 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 17669
2648a72d
AD
176702001-12-14 Akim Demaille <akim@epita.fr>
17671
17672 * src/lex.c (literalchar): Simply return the char you decoded, non
17673 longer mess around with obstacks and int pointers.
17674 Adjust all callers.
17675
92790e5b
AD
176762001-12-14 Akim Demaille <akim@epita.fr>
17677
17678 * src/lex.c (literalchar): Don't escape the special characters,
17679 just decode them, and keep them as char (before, eol was output as
17680 the 2 char string `\n' etc.).
17681 * src/output.c (output_rule_data): Use quotearg to output the
17682 token strings.
17683
927c1557
PE
176842001-12-13 Paul Eggert <eggert@twinsun.com>
17685
17686 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17687 Do not infringe on the global user namespace when using C++.
17688 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17689 All uses of `fprintf' and `stderr' changed.
17690
17691 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17692
ed8e1f68
AD
176932001-12-13 Akim Demaille <akim@epita.fr>
17694
17695 The computation of nullable is broken: it doesn't handle empty
17696 RHS's properly.
17697
17698 * tests/torture.at (GNU AWK Grammar): New.
17699 * tests/sets.at (Nullable): New.
17700 * src/nullable.c (set_nullable): Instead of blindly looping over
17701 `ritems', loop over the rules, and then over their rhs's.
17702
17703 Work around Autotest bugs.
17704
17705 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17706 frame, because Autotest understand lines starting with a `+' as
17707 traces from the shell. Then, they are not processed properly.
17708 Admittedly an Autotest bug, but we don't have time to wait for
17709 Autotest to catch up.
17710 * tests/regression.at (Broken Closure): Adjust to the new table
17711 frames.
17712 Move to...
17713 * tests/sets.at: here.
17714
cb581495
AD
177152001-12-13 Akim Demaille <akim@epita.fr>
17716
17717 * src/closure.c (closure): Use nrules instead of playing tricks
17718 with BITS_PER_WORD.
17719
2e729273
AD
177202001-12-13 Akim Demaille <akim@epita.fr>
17721
17722 * src/print.c (print_actions): Output the handling of `$' as the
17723 traces do: shifting the token EOF. Before EOF was treated as a
17724 nonterminal.
17725 * tests/regression.at: Adjust some tests.
17726 * src/print_graph.c (print_core): Complete the set of items via
17727 closure. The next-to-final and final states are still unsatisfying,
17728 but that's to be addressed elsewhere.
17729 No longer output the rule numbers, but do output the state number.
17730 A single loop for the shifts + gotos is enough, but picked a
17731 distinct color for each.
17732 (print_graph): Initialize and finalize closure.
17733
107f7dfb
AD
177342001-12-13 Akim Demaille <akim@epita.fr>
17735
17736 * src/reader.c (readgram): Remove dead code, an strip useless
17737 braces.
17738 (get_type): Remove, unused.
17739
9b53a24f
AD
177402001-12-12 Akim Demaille <akim@epita.fr>
17741
17742 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17743 on that of lib/error.c.
17744
dbfb6dcd
AD
177452001-12-12 Akim Demaille <akim@epita.fr>
17746
17747 Some hosts don't like `/' in includes.
17748
17749 * src/system.h: Include libgettext.h without qualifying the path.
17750 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17751 $(top_srcdir).
17752
c25fb648
MA
177532001-12-11 Marc Autret <autret_m@epita.fr>
17754
17755 * src/output.c (output_parser): Remove useless muscle.
17756
710ddc4f
MA
177572001-12-11 Marc Autret <autret_m@epita.fr>
17758
17759 * src/bison.simple: Remove #line just before %%epilogue. It
17760 is now handled in ...
17761 * src/reader.c (read_additionnal_code): Add the output of a
17762 #line for the epilogue.
17763
e83d80b8
MA
177642001-12-10 Marc Autret <autret_m@epita.fr>
17765
927c1557 17766 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
17767 replace precedent remove.
17768 * src/bison.simple: Remove #line before %%prologue because
17769 %%input-line is wrong at this time.
17770
971d5158
MA
177712001-12-10 Marc Autret <autret_m@epita.fr>
17772
17773 * src/reader.c (symbols_output): Clean up.
927c1557 17774 * src/output.c (output_gram, output): Clean up.
971d5158 17775
5edafffd
AD
177762001-12-10 Akim Demaille <akim@epita.fr>
17777
17778 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17779 * src/LR0.c (set_state_table): here.
17780 * src/lalr.c (lalr): Call it.
17781
0279f8e9
AD
177822001-12-10 Akim Demaille <akim@epita.fr>
17783
17784 * src/state.h (shifts): Remove the `number' member: shifts are
17785 attached to state, hence no longer need to be labelled with a
17786 state number.
17787
190c4f5f
AD
177882001-12-10 Akim Demaille <akim@epita.fr>
17789
17790 Now that states have a complete set of members, the linked list of
17791 shifts is useless: just fill directly the state's shifts member.
17792
17793 * src/state.h (shifts): Remove the `next' member.
17794 * src/LR0.c (first_state, last_state): Remove.
17795 Adjust the callers.
17796 (augment_automaton): Don't look for the shifts that must be added
17797 a shift on EOF: it is those of the state we looked for! But now,
17798 since shifts are attached, it is no longer needed to looking
17799 merely by its id: its number.
17800
2a73b93d
AD
178012001-12-10 Akim Demaille <akim@epita.fr>
17802
17803 * src/LR0.c (augment_automaton): Better variable locality.
17804 Remove an impossible branch: if there is a state corresponding to
17805 the start symbol being shifted, then there is shift for the start
17806 symbol from the initial state.
17807
74392f6a
AD
178082001-12-10 Akim Demaille <akim@epita.fr>
17809
17810 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17811 only when appropriate: when insert_start_shifting_state' is not
17812 invoked.
17813 * tests/regression.at (Rule Line Numbers): Adjust.
17814
37c82725
AD
178152001-12-10 Akim Demaille <akim@epita.fr>
17816
17817 * src/LR0.c (augment_automaton): Now that all states have shifts,
17818 merge the two cases addition shifts to the initial state.
17819
6a164e0c
AD
178202001-12-10 Akim Demaille <akim@epita.fr>
17821
17822 * src/lalr.c (set_state_table): Move to...
17823 * src/LR0.c: here.
17824 * src/lalr.c (lalr): Don't call it...
17825 * src/LR0.c (generate_states): do it.
17826 * src/LR0.h (first_state): Remove, only the table is used.
17827
7215de24
AD
178282001-12-10 Akim Demaille <akim@epita.fr>
17829
17830 * src/LR0.h (first_shift, first_reduction): Remove.
17831 * src/lalr.c: Don't use first_shift: find shifts through the
17832 states.
17833
80e25d4d
AD
178342001-12-10 Akim Demaille <akim@epita.fr>
17835
17836 * src/LR0.c: Attach shifts to states as soon as they are
17837 computed.
17838 * src/lalr.c (set_state_table): Instead of assigning shifts to
17839 state, just assert that the mapping was properly done.
17840
0ab3728b
AD
178412001-12-10 Akim Demaille <akim@epita.fr>
17842
17843 * src/LR0.c (insert_start_shift): Rename as...
17844 (insert_start_shifting_state): this.
17845 (insert_eof_shifting_state, insert_accepting_state): New.
17846 (augment_automaton): Adjust.
17847 Better locality of the variables.
17848 When looking if the start_symbol is shifted from the initial
17849 state, using `while (... symbol != start_symbol ...)' sounds
17850 better than `while (... symbol < start_symbol ...)': If fail
17851 to see how the order between symbols could be relevant!
17852
78af9bbc
AD
178532001-12-10 Akim Demaille <akim@epita.fr>
17854
17855 * src/getargs.h: Don't declare `spec_name_prefix' and
17856 `spec_file_prefix', declared by src/files.h.
17857 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17858 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17859 * src/output.c (prepare): Adjust.
17860 * src/reader.c (symbols_output): Likewise.
17861 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17862
bdef2a41
AD
178632001-12-10 Akim Demaille <akim@epita.fr>
17864
17865 * src/muscle_tab.c (muscle_init): NULL is a better default than
17866 `"0"'.
17867
3735969c
AD
178682001-12-10 Akim Demaille <akim@epita.fr>
17869
17870 * src/reader.c (reader): Calling symbols_output once is enough.
17871
49701457
AD
178722001-12-10 Akim Demaille <akim@epita.fr>
17873
17874 Now that states have a complete set of members, the linked list of
17875 reductions is useless: just fill directly the state's reductions
17876 member.
17877
17878 * src/state.h (struct reductions): Remove member `number' and
17879 `next'.
17880 * src/LR0.c (first_reduction, last_reduction): Remove.
17881 (save_reductions): Don't link the new reductions, store them in
17882 this_state.
17883 * src/lalr.c (set_state_table): No need to attach reductions to
17884 states, it's already done.
17885 * src/output.c (output_actions): No longer free the shifts, then
17886 the reductions, then the states: free all the states and their
17887 members.
17888
0edad749
AD
178892001-12-10 Akim Demaille <akim@epita.fr>
17890
17891 * src/options.c (OPTN, DRTV, BOTH): New.
17892 (option_table): Use them.
17893
0edad749
AD
17894 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
17895 the job of system.h.
17896 * src/options.c: Don't include stdio.h and xalloc.h for the same
17897 reasons.
17898
5449dd0f
AD
178992001-12-10 Akim Demaille <akim@epita.fr>
17900
17901 * src/output.c (output, prepare): Make sure the values of the
17902 muscles `action' and `prologue' are 0-terminated.
17903
a870c567
AD
179042001-12-10 Akim Demaille <akim@epita.fr>
17905
17906 Clean up GCC warnings.
17907
17908 * src/reader.c (copy_action): `buf' is not used.
17909 (parse_skel_decl): Be static.
17910 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
17911 * src/options.h (create_long_option_table): Have a real prototype.
17912 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
17913 (hash_delete_at): Return const void *.
17914 Adjust casts to preserve the const.
17915
80df8768
AD
179162001-12-10 Akim Demaille <akim@epita.fr>
17917
17918 * configure.in: Require 2.52g.
17919 M4 is not needed, but AUTOM4TE is.
17920 * m4/m4.m4: Remove.
17921 * tests/Makefile.am: Adjust.
17922
f693ad14
AD
179232001-12-10 Akim Demaille <akim@epita.fr>
17924
17925 One structure for states is enough, even though theoretically
17926 there are LR(0) states and LALR(1) states.
17927
17928 * src/lalr.h (state_t): Remove.
17929 (state_table): Be state_t **, not state_t *.
17930 * src/state.h (core, CORE_ALLOC): Rename as...
17931 (state_t, STATE_ALLOC): this.
17932 Add the LALR(1) members: shifts, reductions, errs.
17933 * src/LR0.c (state_table): Rename as...
17934 (state_hash): this, to avoid name clashes with the global
17935 `state_table'.
17936 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
17937 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
17938
74ffbcb6
AD
179392001-12-10 Akim Demaille <akim@epita.fr>
17940
17941 Bison dumps core on bash.y.
17942 Reported by Pascal Bart.
17943
17944 * src/warshall.c (bitmatrix_print): New.
17945 (TC): Use it.
ba0fe3c7 17946 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
17947 j must be the outer loop.
17948 * tests/regression.at (Broken Closure): New.
17949
07708e19
AD
179502001-12-05 Akim Demaille <akim@epita.fr>
17951
17952 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
17953 its argument.
ba1ecc07 17954 Reported by Peter Hamorsky.
07708e19 17955
92b16366
AD
179562001-12-05 Akim Demaille <akim@epita.fr>
17957
17958 * src/conflicts.c (err_table): Remove.
17959 (resolve_sr_conflict): Adjust.
17960 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
17961 Rename as...
17962 (state_t.reductions, state_t.shifts): this.
17963
076ab033
AD
179642001-12-05 Akim Demaille <akim@epita.fr>
17965
17966 * src/reduce.c (reduce_grammar_tables): No longer disable the
17967 removal of useless rules via CPP but via `if (0)', so that the
17968 compiler still check the code is valid.
17969 For instance, it should have noticed `rline' no longer exists: use
17970 the `line' member of rule_t.
17971 * src/gram.c (dummy, rline): Remove, unused.
17972
3843c413
AD
179732001-12-05 Akim Demaille <akim@epita.fr>
17974
17975 * src/output.c (pack_vector): Use assert, not berror.
17976 * src/main.c (berror): Remove, unused.
17977
43168960
AD
179782001-12-05 Akim Demaille <akim@epita.fr>
17979
17980 New experimental feature: if --verbose --trace output all the
17981 items of a state, not only its kernel.
17982
17983 * src/print.c (print_core): If `trace_flag', then invoke closure
17984 before outputting the items of the state (print_core is no longer
17985 a correct name them).
17986 (print_results): Invoke new_closure/free_closure if needed.
17987
b2872512
AD
179882001-12-05 Akim Demaille <akim@epita.fr>
17989
17990 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
17991 * src/closure.c, src/closure.h (itemsetsize): Rename as...
17992 (nitemset): for consistency with the rest of the project.
17993
23cbcc6c
AD
179942001-12-05 Akim Demaille <akim@epita.fr>
17995
17996 * src/closure.c (print_closure): Improve.
17997 (closure): Use it for printing input and output.
17998
03ec521c
AD
179992001-12-05 Akim Demaille <akim@epita.fr>
18000
18001 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18002 indexed by nonterminals.
18003
3a7456dd
AD
180042001-12-05 Akim Demaille <akim@epita.fr>
18005
18006 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18007 what it was!).
18008 * src/warshall.h: Remove accidental duplication of the content.
18009
1cbcf2e7
AD
180102001-12-05 Akim Demaille <akim@epita.fr>
18011
18012 * src/closure.c (set_fderives): De-obfuscate.
18013
84182270
AD
180142001-12-05 Akim Demaille <akim@epita.fr>
18015
18016 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18017
3f6f053c
AD
180182001-12-05 Akim Demaille <akim@epita.fr>
18019
18020 * src/closure.c (set_firsts): De-obfuscate.
18021
7a5350ba
AD
180222001-12-05 Akim Demaille <akim@epita.fr>
18023
18024 * src/output.c (action_row): De-obfuscate
18025 using the good o' techniques: arrays not pointers, variable
18026 locality, BITISSET, RESETBIT etc.
18027
d954473d
AD
180282001-12-05 Akim Demaille <akim@epita.fr>
18029
18030 Pessimize the code to simplify it: from now on, all the states
18031 have a valid SHIFTS, which NSHIFTS is possibly 0.
18032
18033 * src/LR0.c (shifts_new): Be global and move to..
18034 * src/state.c, src/state.h: here.
18035 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18036 * src/print_graph: Adjust.
18037
9839bbe5
AD
180382001-12-05 Akim Demaille <akim@epita.fr>
18039
18040 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18041 * src/conflicts.c: Use it.
18042 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18043 incorrectly ``simplified''.
18044
9f136c07
AD
180452001-12-05 Akim Demaille <akim@epita.fr>
18046
18047 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18048 using the good o' techniques: arrays not pointers, variable
18049 locality, BITISSET, RESETBIT etc.
18050
b608206e
AD
180512001-12-05 Akim Demaille <akim@epita.fr>
18052
18053 * src/state.h (SHIFT_SYMBOL): New.
18054 * src/conflicts.c: Use it to deobfuscate.
18055
52afa962
AD
180562001-12-05 Akim Demaille <akim@epita.fr>
18057
18058 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18059 (print_reductions): De-obfuscate using the good o' techniques:
18060 arrays not pointers, variable locality, BITISSET.
18061
e74dc321
AD
180622001-12-05 Akim Demaille <akim@epita.fr>
18063
18064 * src/conflicts.c (print_reductions): Arrays, not pointers.
18065 Use BITISSET.
18066
768fca83
AD
180672001-12-05 Akim Demaille <akim@epita.fr>
18068
18069 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18070
a17e599f
AD
180712001-12-05 Akim Demaille <akim@epita.fr>
18072
18073 * src/conflicts.c (print_reductions): Improve variable locality.
18074
a04bc341
AD
180752001-12-05 Akim Demaille <akim@epita.fr>
18076
18077 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18078
c8ea038e
AD
180792001-12-05 Akim Demaille <akim@epita.fr>
18080
18081 * src/conflicts.c (print_reductions): Improve variable locality.
18082
aa2aab3c
AD
180832001-12-05 Akim Demaille <akim@epita.fr>
18084
18085 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18086 * src/lalr.c: Use them.
18087
b178c8cc
AD
180882001-12-05 Akim Demaille <akim@epita.fr>
18089
18090 * src/LR0.c (augment_automaton): Formatting changes.
18091 Better variable locality.
18092
f67d13aa
AD
180932001-12-05 Akim Demaille <akim@epita.fr>
18094
18095 * src/lalr.c (matrix_print): New.
18096 (transpose): Use it.
18097 Use arrays instead of pointers.
18098
c2713865
AD
180992001-12-05 Akim Demaille <akim@epita.fr>
18100
18101 * src/lalr.c (maxrhs): Move to...
18102 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18103 * src/lalr.c (build_relations): Adjust.
18104
9887c18a
AD
181052001-12-05 Akim Demaille <akim@epita.fr>
18106
18107 * src/lalr.c (transpose): Free the memory allocated to the
18108 argument, as it is replaced by the results by the unique caller.
18109 (build_relations): Merely invoke transpose: it handles the memory
18110 deallocation.
18111 Improve variable locality.
18112 Avoid variables used as mere abbreviations.
18113 (compute_lookaheads): Use arrays instead of pointers.
18114
4d4f699c
AD
181152001-12-05 Akim Demaille <akim@epita.fr>
18116
18117 * src/lalr.c (initialize_F): Improve variable locality.
18118 Avoid variables used as mere abbreviations.
18119
80a69750
AD
181202001-12-05 Akim Demaille <akim@epita.fr>
18121
18122 * src/derives.c (print_derives): Display the ruleno.
18123 * src/lalr.c (initialize_F, transpose): Better variable locality
18124 to improve readability.
18125 Avoid variables used as mere abbreviations.
18126
fe961097
AD
181272001-12-05 Akim Demaille <akim@epita.fr>
18128
18129 * src/lalr.c (traverse): Use arrays instead of pointers.
18130
e3e4e814
AD
181312001-12-05 Akim Demaille <akim@epita.fr>
18132
18133 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18134 the handling of squeue.
18135 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18136
630e182b
AD
181372001-12-05 Akim Demaille <akim@epita.fr>
18138
18139 Because useless nonterminals are now kept alive (instead of being
18140 `destroyed'), we now sometimes examine them, and store information
18141 related to them. Hence we need to know their number, and adjust
18142 memory allocations.
18143
18144 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18145 static.
18146 * src/LR0.c (allocate_itemsets): The memory allocated to
18147 `symbol_count' was used for two different purpose: once to count
18148 the number of occurrences of each symbol, and later reassigned to
18149 `shift_symbol', containing the symbol that can be shifted from a
18150 given state.
18151 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18152 only, and...
18153 (new_itemsets): Allocate `shift_symbol' here.
18154 (allocate_itemsets): symbol_count includes useless nonterminals.
18155 Make room for them.
18156 (free_storage): Use `free', not `XFREE', for pointers that cannot
18157 be null.
18158
81b51460
AD
181592001-12-05 Akim Demaille <akim@epita.fr>
18160
18161 * src/nullable.c (set_nullable): Deobfuscate the handling of
18162 ritem.
18163 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18164
3067fbef
AD
181652001-12-05 Akim Demaille <akim@epita.fr>
18166
18167 * src/gram.c, src/gram.h (ritem_print): New.
18168 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18169 (This useless function was defined only to work around VMS linkers
18170 that can't handle compilation units with variables only).
18171 * src/reduce.c (dump_grammar): Use it to trace the construction of
18172 ritem.
18173
c2bea5f9
PE
181742001-12-04 Paul Eggert <eggert@twinsun.com>
18175
7d27c823
PE
18176 * src/bison.simple (union yyalloc): Change member names
18177 to be the same as the stack names.
18178 (yyparse): yyptr is now union yyalloc *, not char *.
18179 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18180 and may generate better code on some machines.
c2bea5f9
PE
18181 (yystpcpy): Use prototype if __STDC__ is defined, not just
18182 if __cplusplus is defined.
35687a9d 18183
2c8a9dfa
AD
181842001-11-30 Akim Demaille <akim@epita.fr>
18185
18186 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18187 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18188 Gettext doesn't compile cleanly, and dies with -Werror.
18189 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18190 Include WARNING_CFLAGS here.
18191 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18192 before being defined.
18193
f4e421e6
AD
181942001-11-27 Paul Eggert <eggert@twinsun.com>
18195
18196 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18197 First arg is int, not unsigned.
18198 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18199 (SIZE_MAX, UINT_MAX): New macros.
18200 (quotearg_n_options): Abort if N is negative.
18201 Avoid overflow check on hosts where size_t is 64 bits and int
18202 is 32 bits, as overflow is impossible there.
18203 Fix off-by-one typo that caused unnecessary reallocation.
18204
7093d0f5
AD
182052001-11-29 Paul Eggert <eggert@twinsun.com>
18206
18207 Name space cleanup in generated parser.
18208
18209 * doc/bison.texinfo (Bison Parser): Discuss system headers
18210 and their effect on the user name space.
18211
18212 * src/bison.simple:
18213 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18214 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18215 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18216
18217 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18218 on user names when possible.
18219
18220 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18221 Simplify test for whather <alloca.h> exists.
18222
18223 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18224
18225 (<stdio.h>): Include if YYDEBUG.
18226
18227 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18228 ! defined (yyoverflow) && ! defined (yymemcpy).
18229
18230 (yymemcpy, yyparse): Rename local variables as needed so that
18231 they all begin with 'yy'.
18232
18233 (yystrlen, yystpcpy): New functions.
18234
18235 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18236 All uses changed.
18237
18238 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18239 instead of relying on string.h functions. Use YYSTACK_ALLOC
18240 and YYSTACK_FREE instead of malloc and free.
18241
fd51e5ff
AD
182422001-11-30 Akim Demaille <akim@epita.fr>
18243
18244 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18245 before their first uses.
18246 (YYBISON, YYPURE): Move to the top of the output.
18247
7d13ff5f
AD
182482001-11-30 Akim Demaille <akim@epita.fr>
18249
18250 * tests/reduce.at (Useless Nonterminals): Fix.
18251
892a3995
AD
182522001-11-30 Akim Demaille <akim@epita.fr>
18253
18254 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18255 if body instead of `;' to pacify GCC's warnings.
18256
68f1e3ed
AD
182572001-11-30 Akim Demaille <akim@epita.fr>
18258
18259 Instead of mapping the LHS of unused rules to -1, keep the LHS
18260 valid, but flag the rules as invalid.
18261
18262 * src/gram.h (rule_t): `useful' is a new member.
18263 * src/print.c (print_grammar): Adjust.
18264 * src/derives.c (set_derives): Likewise.
18265 * src/reader.c (packgram, reduce_output): Likewise.
18266 * src/reduce.c (reduce_grammar_tables): Likewise.
18267 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18268
d2d1b42b
AD
182692001-11-30 Akim Demaille <akim@epita.fr>
18270
18271 * src/reduce.c (reduce_output): Formatting changes.
18272 * src/print.c (print_results, print_grammar): Likewise.
18273 * tests/regression.at (Rule Line Numbers)
18274 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18275
760b53a8
AD
182762001-11-30 Akim Demaille <akim@epita.fr>
18277
18278 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18279 useless nonterminals, move them at the end of the symbol arrays.
18280 (reduce_output): Adjust.
18281 * tests/reduce.at (Useless Nonterminals): Adjust.
18282
00238958
AD
182832001-11-30 Akim Demaille <akim@epita.fr>
18284
18285 * src/reduce.c: Various comment/formatting changes.
18286 (nonterminals_reduce): New, extracted from...
18287 (reduce_grammar_tables): here.
18288 (reduce_grammar): Call nonterminals_reduce.
18289
396452de
PE
182902001-11-29 Paul Eggert <eggert@twinsun.com>
18291
18292 * src/bison.simple (YYSTACK_REALLOC): Remove.
18293 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18294 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18295 New macros.
18296 (union yyalloc): New type.
18297 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18298 an arbitrary restriction on hosts where size_t is wider than int.
18299
18300 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18301 a parser stack overflow. Allocate just one block of memory for all
18302 three stacks, instead of allocating three blocks; this typically is
18303 faster and reduces fragmentation.
18304
18305 Do not limit the number of items in the stack to a value that fits
18306 in 'int', as this is an arbitrary limit on hosts with 64-bit
18307 size_t and 32-bit int.
18308
147e184c
MA
183092001-11-29 Marc Autret <autret_m@epita.fr>
18310
18311 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18312 of defining YYERROR_VERBOSE.
18313 [AT_DATA]: $4 is now out of C declarations in the prologue.
18314
426cf563
MA
183152001-11-28 Marc Autret <autret_m@epita.fr>
18316
18317 * src/reader.c (parse_dquoted_param): New.
18318 (parse_skel_decl): Use it.
18319 * src/lex.h: Add its prototype.
18320 * src/lex.c (literalchar): Become not static.
18321
c7925b99
MA
183222001-11-28 Marc Autret <autret_m@epita.fr>
18323
18324 * src/output.h: And put its extern declaration here.
18325 * src/output.c (error_verbose): Define here.
18326 (prepare): Echo name modification.
18327 * src/getargs.h: Clean its extern declaration.
18328 * src/getargs.c (error_verbose_flag): Remove.
18329 (getargs): Remove case 'e'.
18330 * src/options.c (option_table): 'error-verbose' is now seen as simple
18331 percent option.
18332 Include output.h.
18333
18334 * src/reader.c (read_declarations): Remove case tok_include.
18335 (parse_include_decl): Remove.
18336 * src/lex.h (token_t): Remove tok_include.
18337 * src/options.c (option_table): 'include' is now a simple command line
18338 option.
18339
5b5d1929
MA
183402001-11-28 Marc Autret <autret_m@epita.fr>
18341
18342 * src/bison.simple: Adjust muscle names.
18343 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18344 * src/output.c (prepare): s/_/-/ for the muscles names.
18345 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18346
8850be4b
MA
183472001-11-28 Marc Autret <autret_m@epita.fr>
18348
18349 * src/bison.simple: Fix debug.
18350 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18351
4a38e613
AD
183522001-11-28 Akim Demaille <akim@epita.fr>
18353
18354 * src/LR0.c (shifts_new): New.
18355 (save_shifts, insert_start_shift, augment_automaton): Use it.
18356
4b35e1c1
AD
183572001-11-28 Akim Demaille <akim@epita.fr>
18358
18359 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18360 keep ruleno only.
18361
d2b04478
AD
183622001-11-28 Akim Demaille <akim@epita.fr>
18363
18364 * src/closure.c (closure): Instead of looping over word in array
18365 then bits in words, loop over bits in array.
18366
2c4c30aa
AD
183672001-11-28 Akim Demaille <akim@epita.fr>
18368
18369 * src/closure.c (closure): No longer optimize the special case
18370 where all the bits of `ruleset[r]' are set to 0, to make the code
18371 clearer.
18372
576890b7
AD
183732001-11-28 Akim Demaille <akim@epita.fr>
18374
18375 * src/closure.c (closure): `r' and `c' are new variables, used to
18376 de-obfuscate accesses to RULESET and CORE.
18377
cb487d7d
AD
183782001-11-28 Akim Demaille <akim@epita.fr>
18379
18380 * src/reduce.c (reduce_print): Use ngettext.
18381 (dump_grammar): Improve the trace accuracy.
18382
6013d43f
AD
183832001-11-28 Akim Demaille <akim@epita.fr>
18384
18385 * src/reduce.c (dump_grammar): Don't translate trace messages.
18386
cb4956ee
AD
183872001-11-28 Akim Demaille <akim@epita.fr>
18388
18389 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18390 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18391 as all tags are free'ed afterwards.
18392 From Enrico Scholz.
18393
648185ab
PE
183942001-11-27 Paul Eggert <eggert@twinsun.com>
18395
18396 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18397 use alloca when we didn't want to, and vice versa.
18398
68254a03
MA
183992001-11-27 Marc Autret <autret_m@epita.fr>
18400
9113b58f
AD
18401 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18402 initialization.
68254a03
MA
18403 * src/output.c (prepare): Remove its update.
18404
04d843a2
MA
184052001-11-27 Marc Autret <autret_m@epita.fr>
18406
18407 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18408 Use %error-verbose.
18409
d2079671 184102001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
18411
18412 * src/bison.simple: Remove YYERROR_VERBOSE using.
18413 Use %%error_verbose.
18414 (yyparse): Likewise.
18415 * src/output.c (prepare): Give its final value.
18416 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18417 * src/getargs.h: Add its extern declaration.
18418 * src/getargs.c (error_verbose_flag): New int.
18419 (getargs): Update to catch new case.
18420 * src/options.c (option_table): 'error-verbose' is a new option.
18421 (shortopts): Update.
18422
e0327bc8
AD
184232001-11-27 Akim Demaille <akim@epita.fr>
18424
18425 * src/system.h: Use intl/libgettext.h.
18426 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18427
000f1a3c
AD
184282001-11-27 Akim Demaille <akim@epita.fr>
18429
18430 * tests/torture.at (Exploding the Stack Size with Malloc):
18431 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18432
26cfe0be
AD
184332001-11-27 Akim Demaille <akim@epita.fr>
18434
18435 * src/files.c: Include error.h.
18436 Reported by Hans Aberg.
18437
f6bd5427
MA
184382001-11-26 Marc Autret <autret_m@epita.fr>
18439
d2079671 18440 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
18441 (read_declarations): Add case tok_include.
18442 * src/getargs.h (include): Add its extern definition.
18443 * src/getargs.c (include): New const char *.
18444 (getargs): Add case '-I'.
18445 * src/options.c (option_table): Add include as command line and
18446 percent option.
18447 * src/lex.h (token_t): Add tok_include.
18448
2ca209c1
AD
184492001-11-26 Akim Demaille <akim@epita.fr>
18450
18451 * src/reader.c (readgram): Make sure rules for mid-rule actions
18452 have a lineno equal to that of their host rule.
18453 Reported by Hans Aberg.
18454 * tests/regression.at (Rule Line Numbers): New.
18455
0e41b407
AD
184562001-11-26 Akim Demaille <akim@epita.fr>
18457
18458 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18459 size_ts.
18460
184612001-11-26 Akim Demaille <akim@epita.fr>
18462
18463 * src/complain.c, src/complain.h (error): Remove, provided by
18464 lib/error.[ch].
18465
e0c40012
AD
184662001-11-26 Akim Demaille <akim@epita.fr>
18467
18468 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18469 issue an error message.
18470 * tests/regression.at (Invalid %directive): New.
18471 Reported by Hans Aberg.
18472
5e147124
AD
184732001-11-26 Akim Demaille <akim@epita.fr>
18474
18475 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18476 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18477
a034c8b8
AD
184782001-11-26 Akim Demaille <akim@epita.fr>
18479
18480 * src/conflicts.c (conflicts_print): Don't complain at all when
18481 there are no reduce/reduce conflicts, and as many shift/reduce
18482 conflicts as expected.
18483 * tests/regression.at (%expect right): Adjust.
18484
c64a20f3
AD
184852001-11-23 Akim Demaille <akim@epita.fr>
18486
18487 * lib/alloca.c: Update, from fileutils.
18488
5b0d29bb
AD
184892001-11-23 Akim Demaille <akim@epita.fr>
18490
18491 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18492
722c4bfe
AD
184932001-11-23 Akim Demaille <akim@epita.fr>
18494
18495 * src/system.h: Include alloca.h.
18496 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18497
6255b435
AD
184982001-11-23 Akim Demaille <akim@epita.fr>
18499
18500 * src/print_graph.c (print_actions): Remove `rule', unused.
18501 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18502 pacify GCC's signed < unsigned warnings.
18503 * src/closure.c (itemsetsize): Likewise.
18504 * src/reader.c (symbol_list_new): Static.
18505
b29b2ed5
AD
185062001-11-23 Akim Demaille <akim@epita.fr>
18507
18508 Attaching lineno to buckets is stupid, since only one copy of each
18509 symbol is kept, only the line of the first occurrence is kept too.
18510
18511 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18512 * src/reader.c (rline_allocated): Remove, unused.
18513 (symbol_list): Have a `line' member.
18514 (symbol_list_new): New.
18515 (readgram): Use it.
18516 * src/print.c (print_grammar): Output the rule line numbers.
18517 * tests/regression.at (Solved SR Conflicts)
18518 (Unresolved SR Conflicts): Adjust.
18519 Reported by Hans Aberg.
18520
a81b1d4a
MA
185212001-11-22 Marc Autret <autret_m@epita.fr>
18522
18523 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18524
c1ecb3c1
MA
185252001-11-22 Marc Autret <autret_m@epita.fr>
18526
18527 * src/muscle_tab.c (muscle_init): Remove initialization of
18528 skeleton muscle.
18529 * src/output.c (output_master_parser): Do it here.
18530
fbe01355
AD
185312001-11-20 Akim Demaille <akim@epita.fr>
18532
18533 * po/sv.po: New.
18534 * configure.in (ALL_LINGUAS): Adjust.
18535 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18536 longer contains strings to translate.
18537
81e895c0
AD
185382001-11-19 Akim Demaille <akim@epita.fr>
18539
18540 * src/conflicts.c (conflicts_print): Add a missing \n.
18541
6bb1878b
AD
185422001-11-19 Akim Demaille <akim@epita.fr>
18543
18544 * src/nullable.c (nullable_print): New.
18545 (set_nullable): Call it when tracing.
18546 Better locality of variables.
18547
d9ec2d07
AD
185482001-11-19 Akim Demaille <akim@epita.fr>
18549
18550 * src/print.c (print_actions): Better locality of variables.
18551
720e5c1b
AD
185522001-11-19 Akim Demaille <akim@epita.fr>
18553
18554 * src/derives.c (print_derives): Fix and enrich.
18555 * src/closure.c (print_fderives): Likewise.
18556
fb908786
AD
185572001-11-19 Akim Demaille <akim@epita.fr>
18558
18559 * src/closure.c (itemsetend): Remove, replaced with...
18560 (itemsetsize): new.
18561
125ecb56
AD
185622001-11-19 Akim Demaille <akim@epita.fr>
18563
18564 * src/LR0.c (kernel_end): Remove, replaced with...
18565 (kernel_size): new.
18566
d8cf039f
AD
185672001-11-19 Akim Demaille <akim@epita.fr>
18568
18569 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18570 to clarify.
18571
7bec0760
AD
185722001-11-19 Akim Demaille <akim@epita.fr>
18573
18574 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18575
c87d4863
AD
185762001-11-19 Akim Demaille <akim@epita.fr>
18577
18578 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18579 trace messages.
18580 * src/LR0.c: Likewise.
18581 (allocate_itemsets): Use arrays instead of pointers to clarify.
18582
9bfe901c
AD
185832001-11-19 Akim Demaille <akim@epita.fr>
18584
18585 * src/getargs.c (statistics_flag): Replace with...
18586 (trace_flag): New.
18587 (longopts): Accept --trace instead of --statistics.
18588 * src/getargs.h, src/options.c: Adjust.
18589 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18590 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18591
97db7bd4
AD
185922001-11-19 Akim Demaille <akim@epita.fr>
18593
cc72668c 18594 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
18595 pointers to clarify the code.
18596 (save_reductions, save_shifts): Factor common parts of alternatives.
18597
2c5f66ed
AD
185982001-11-19 Akim Demaille <akim@epita.fr>
18599
18600 * src/LR0.c (new_state, get_state): Complete TRACE code.
18601 * src/closure.c: Include `reader.h' to get `tags', needed by the
18602 trace code.
18603 Rename the conditional DEBUG as TRACE.
18604 Output consistently TRACEs to stderr, not stdout.
18605 * src/derives.c: Likewise.
18606 * src/reduce.c: (inaccessable_symbols): Using if is better style
18607 than goto.
18608 Use `#if TRACE' instead of `#if 0' for tracing code.
18609
300f275f
AD
186102001-11-19 Akim Demaille <akim@epita.fr>
18611
18612 * src/system.h (LIST_FREE, shortcpy): New.
18613 * src/LR0.c: Use them.
18614 * src/output.c (free_itemsets, free_reductions, free_shifts):
18615 Remove, replaced by LIST_FREE.
18616
f59c437a
AD
186172001-11-19 Akim Demaille <akim@epita.fr>
18618
18619 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18620 (REDUCTIONS_ALLOC): New.
18621 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18622 allocation.
18623
6986fd9e
AD
186242001-11-19 Akim Demaille <akim@epita.fr>
18625
18626 * src/LR0.c (new_state): Complete trace code.
18627 * src/nullable.c (set_nullable): Don't translate traces.
18628
4bc30f78
AD
186292001-11-19 Akim Demaille <akim@epita.fr>
18630
18631 * src/print_graph.c (print_core): Better locality of variables.
18632 * src/print.c (print_core): Likewise.
18633
08a946e0
AD
186342001-11-19 Akim Demaille <akim@epita.fr>
18635
18636 * src/vcg.c: You do the output, so you are responsible of the
18637 handling of VCG syntax, in particular: use quotearg.
18638 * src/print_graph.c: Don't.
18639 (print_actions): Don't output the actions as part of the nodes,
18640 since that's the job of the edges.
18641 (print_state): Don't output by hand: fill the node description,
9bfe901c 18642 and ask for its output.
08a946e0 18643
f0473484
AD
186442001-11-19 Akim Demaille <akim@epita.fr>
18645
cc72668c
AD
18646 * src/bison.simple (yyparse): When verbosely reporting an error,
18647 no longer put additional quotes around token names.
f0473484
AD
18648 * tests/calc.at: Adjust.
18649
e41dc700
AD
186502001-11-19 Akim Demaille <akim@epita.fr>
18651
18652 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18653 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18654 * src/output.c: Adjust.
18655
652a871c
AD
186562001-11-19 Akim Demaille <akim@epita.fr>
18657
18658 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18659 (rule_t): this.
18660 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18661
b2ed6e58
AD
186622001-11-19 Akim Demaille <akim@epita.fr>
18663
18664 * src/gram.h (rule_t): New.
18665 (rule_table): New.
18666 (rrhs, rlhs): Remove, part of state_t.
18667 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18668 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18669 * src/reader.c, src/reduce.c: Adjust.
18670
edad7067
AD
186712001-11-19 Akim Demaille <akim@epita.fr>
18672
18673 * src/reader.c (symbols_output): New, extracted from...
18674 (packsymbols): Here.
18675 (reader): Call it.
18676
3feec034
AD
186772001-11-19 Akim Demaille <akim@epita.fr>
18678
18679 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18680 (maxrhs): this new function.
18681
ddcd5fdf
AD
186822001-11-19 Akim Demaille <akim@epita.fr>
18683
cc72668c 18684 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
18685 Adjust.
18686
bb527fc2
AD
186872001-11-19 Akim Demaille <akim@epita.fr>
18688
cc72668c 18689 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
18690 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18691 * src/lalr.c: Adjust.
18692
a845a697
AD
186932001-11-19 Akim Demaille <akim@epita.fr>
18694
18695 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18696 (set_state_table): handle the `lookaheads' members.
18697
f004bf6a
AD
186982001-11-19 Akim Demaille <akim@epita.fr>
18699
cc72668c
AD
18700 * src/lalr.h (lookaheads): Removed array, whose contents is now
18701 a member of...
f004bf6a
AD
18702 (state_t): this structure.
18703 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18704 Adjust.
18705
de326cc0
AD
187062001-11-19 Akim Demaille <akim@epita.fr>
18707
cc72668c
AD
18708 * src/lalr.h (consistent): Removed array, whose contents is now
18709 a member of...
de326cc0
AD
18710 (state_t): this structure.
18711 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18712 Adjust.
18713
90b4416b
AD
187142001-11-19 Akim Demaille <akim@epita.fr>
18715
cc72668c
AD
18716 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18717 contents are now members of...
90b4416b
AD
18718 (state_t): this structure.
18719 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18720 Adjust.
18721
9703cc49
AD
187222001-11-19 Akim Demaille <akim@epita.fr>
18723
18724 * src/lalr.h (state_t): New.
18725 (state_table): Be a state_t * instead of a core **.
18726 (accessing_symbol): Remove, part of state_t.
18727 * src/lalr.c: Adjust.
18728 (set_accessing_symbol): Merge into...
18729 (set_state_table): this.
18730 * src/print_graph.c, src/conflicts.c: Adjust.
18731
d803322e
AD
187322001-11-14 Akim Demaille <akim@epita.fr>
18733
18734 * tests/calc.at, tests/output.at, tests/regression.at,
18735 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18736 now the tests are run in private dirs, therefore AC_CLEANUP and
18737 family can be simplified to 0-ary.
18738 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18739 use abs. path to find config.h.
18740 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18741 stderr, there can be way too much random noise.
18742 Instead pass -Werror to GCC and rely on the exit status.
18743 Reported by Wolfram Wagner.
18744
3d76b07d
AD
187452001-11-14 Akim Demaille <akim@epita.fr>
18746
18747 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18748 defined only if yyoverflow is defined, to avoid `warning: unused
18749 variable `yyvs1''.
18750 Reported by The Test Suite.
18751
09b503c8
AD
187522001-11-14 Akim Demaille <akim@epita.fr>
18753
18754 * src/print.c: Include reduce.h.
18755 Reported by Hans Aberg.
18756
187572001-11-14 Akim Demaille <akim@epita.fr>
18758
18759 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18760 Revert a previous patch: these are really const.
18761 * src/conflicts.c (conflict_report): Additional useless pair of
18762 braces to pacify GCC's warnings for `if () if () {} else {}'.
18763 * src/lex.c (parse_percent_token): Replace equal_offset with
18764 arg_offset.
18765 arg is const.
18766 Be sure to strdup `arg' when used, since there is no reason for
18767 token_buffer not to change.
18768
0f37a994
AD
187692001-11-14 Akim Demaille <akim@epita.fr>
18770
18771 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18772 definition.
18773 * src/main.c (main): Use them.
18774 Suggested by Hans Aberg.
18775
d39d93b8
AD
187762001-11-12 Akim Demaille <akim@epita.fr>
18777
18778 * src/system.h (ngettext): Now that we use ngettext, be sure to
18779 provide a default definition when NLS are not used.
18780
9edcd895
AD
187812001-11-12 Akim Demaille <akim@epita.fr>
18782
18783 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18784 Use @kbd to denote user input.
18785 (Language and Grammar): ANSIfy the example.
18786 Adjust its layout for info/notinfo.
18787 (Location Tracking Calc): Output error messages to stderr.
18788 Output locations in a more GNUtically correct way.
18789 Fix a couple of Englishos.
18790 Adjust @group/@end group pairs.
18791
7da99ede
AD
187922001-11-12 Akim Demaille <akim@epita.fr>
18793
e3aa65c5 18794 %expect was not functioning at all.
7da99ede
AD
18795
18796 * src/conflicts.c (expected_conflicts): Set to -1.
18797 (conflict_report): Use ngettext.
18798 (conflicts_print): Check %expect and make its violation an error.
18799 * doc/bison.texinfo (Expect Decl): Adjust.
18800 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18801 * tests/regression.at (%expect not enough, %expect right)
18802 (%expect too much): New.
18803
ba9dda1a
AD
188042001-11-12 Akim Demaille <akim@epita.fr>
18805
18806 * tests/regression.at (Conflicts): Rename as...
18807 (Unresolved SR Conflicts): this.
18808 (Solved SR Conflicts): New.
18809
337c5bd1
AD
188102001-11-12 Akim Demaille <akim@epita.fr>
18811
18812 * src/reduce.c (print_results): Rename as...
18813 (reduce_output): This.
18814 Output to OUT, passed as argument, instead of output_obstack.
18815 (dump_grammar): Likewise.
18816 (reduce_free): New.
18817 Also free V1.
18818 (reduce_grammar): No longer call reduce_output, since...
18819 * src/print.c (print_results): do it.
18820 * src/main.c (main): Call reduce_free;
18821
c73a41af
AD
188222001-11-12 Akim Demaille <akim@epita.fr>
18823
18824 * src/conflicts.c (print_reductions): Accept OUT as argument.
18825 Output to it, not to output_obstack.
18826 * src/print.c (print_actions): Adjust.
18827
0df87bb6
AD
188282001-11-12 Akim Demaille <akim@epita.fr>
18829
18830 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18831 the result instead of using...
18832 (src_total, rrc_total, src_count, rrc_count): Remove.
18833 (any_conflicts): Remove.
18834 (print_conflicts): Split into...
18835 (conflicts_print, conflicts_output): New.
18836 * src/conflicts.h: Adjust.
18837 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 18838 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
18839 * tests/regression.at (Conflicts): New.
18840 Reported by Tom Lane.
18841
e4d3d4de
AD
188422001-11-12 Akim Demaille <akim@epita.fr>
18843
18844 * tests/regression.at (Invalid input): Remove, duplicate with
18845 ``Invalid input: 1''.
18846
6d7d248e
AD
188472001-11-12 Akim Demaille <akim@epita.fr>
18848
18849 * tests/torture.at (AT_DATA_STACK_TORTURE)
18850 (Exploding the Stack Size with Alloca)
18851 (Exploding the Stack Size with Malloc): New.
18852
e9e4c321
AD
188532001-11-12 Akim Demaille <akim@epita.fr>
18854
18855 * src/bison.simple (YYSTACK_REALLOC): New.
18856 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 18857 Reported by Per Allansson.
e9e4c321 18858
5f7e0832
AD
188592001-11-12 Pascal Bart <pascal.bart@epita.fr>
18860
18861 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18862 define CPP macro, which substitute YYSTYPE by yystype.
18863 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18864 with yyltype/YYLTYPE. This allows inclusion of the generated
18865 header within the parser if the compiler, such as GGC, accepts
18866 multiple equivalent #defines.
18867 From Akim.
18868
e3f1699f
AD
188692001-11-05 Akim Demaille <akim@epita.fr>
18870
18871 * src/reader.c (symbols_output): New, extracted from...
18872 (packsymbols): here.
18873 (reader): Adjust.
18874
65be0866
AD
188752001-11-05 Akim Demaille <akim@epita.fr>
18876
18877 * src/lex.c (parse_percent_token): s/quotearg/quote/.
18878
e4d910bf
AD
188792001-11-05 Akim Demaille <akim@epita.fr>
18880
18881 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
18882 pattern.
18883
951366c1
AD
188842001-11-05 Akim Demaille <akim@epita.fr>
18885
18886 * src/options.h (struct option_table_struct): set_flags is void*.
18887 * src/options.c (longopts): Support `--output' and `%output'.
18888 (usage): Adjust.
18889 * src/lex.h (tok_setopt): Remove, replaced with...
18890 (tok_intopt, tok_stropt): these new guys.
18891 * src/lex.c (getopt.h): Not needed.
18892 (token_buffer, unlexed_token_buffer): Not const.
18893 (percent_table): Promote `-' over `_' in directive names.
18894 Active `%name-prefix', `file-prefix', and `output'.
18895 (parse_percent_token): Accept possible arguments to directives.
18896 Promote `-' over `_' in directive names.
18897
d8988b2f
AD
188982001-11-04 Akim Demaille <akim@epita.fr>
18899
18900 * doc/bison.texinfo (Decl Summary): Split the list into
18901 `directives for grammars' and `directives for bison'.
18902 Sort'em.
18903 Add description of `%name-prefix', `file-prefix', and `output'.
18904 Promote `-' over `_' in directive names.
18905 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
18906 Simplify the description of `--name-prefix'.
18907 Promote `-' over `_' in directive names.
18908 Promote `--output' over `--output-file'.
18909 Fix the description of `--defines'.
18910 * tests/output.at: Exercise %file-prefix and %output.
18911
6468d18e
AD
189122001-11-02 Akim Demaille <akim@epita.fr>
18913
18914 * doc/refcard.tex: Update.
18915
6b7e85b9
AD
189162001-11-02 Akim Demaille <akim@epita.fr>
18917
18918 * src/symtab.h (SUNDEF): New.
18919 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
18920 stand for `uninitialized', instead of 0.
18921 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
18922 * src/lex.c (lex): Adjust.
18923
18924 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
18925 Number it 0.
18926 Let yylex return it instead of a plain 0.
18927 Reported by Dick Streefland.
18928
cd5aafcf
AD
189292001-11-02 Akim Demaille <akim@epita.fr>
18930
18931 * tests/regression.at (Mixing %token styles): New test.
18932
037ca2f1
AD
189332001-11-02 Akim Demaille <akim@epita.fr>
18934
18935 * src/reader.c (parse_thong_decl): Formatting changes.
18936 (token_translations_init): New, extracted from...
18937 (packsymbols): Here.
18938 Adjust.
18939
270a173c
AD
189402001-11-01 Akim Demaille <akim@epita.fr>
18941
18942 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
18943 Check that `9foo.y' produces correct cpp guards.
18944 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
18945 guards.
18946 Reported by Wwp.
18947
561f9a30
AD
189482001-11-01 Akim Demaille <akim@epita.fr>
18949
18950 * tests/regression.at (Invalid input: 2): New.
18951 * src/lex.c (unlexed_token_buffer): New.
18952 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
18953 too.
18954 Reported by Wwp.
18955
f987e9d2
AD
189562001-11-01 Akim Demaille <akim@epita.fr>
18957
18958 * tests/calc.at: Catch up with 1.30.
18959 * configure.in: Bump to 1.49a.
18960 Adjust to newer Autotest.
18961
0846f581
PB
189622001-10-19 Pascal Bart <pascal.bart@epita.fr>
18963
18964 * src/conflicts.c: Move global variables rrc_total and src_total ...
18965 (print_conflicts): here.
18966 * src/output.c (output): Free global variable user_toknums.
18967 * src/lex.c (token_obstack): Become static.
18968
3c1a79b3
AD
189692001-10-18 Akim Demaille <akim@epita.fr>
18970
18971 * tests/atlocal.in (GCC): Add.
18972 * tests/calc.at: s/m4_match/m4_bmatch/.
18973 s/m4_patsubst/m4_bpatsubst/.
18974 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
18975 * configure.in: AC_SUBST(GCC).
18976
5d52e7d0
MA
189772001-10-14 Marc Autret <autret_m@epita.fr>
18978
18979 * src/options.c (create_long_option_table): Fix.
18980
631aa1d3
AD
189812001-10-10 Akim Demaille <akim@epita.fr>
18982
18983 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
18984
f6ec6d13
AD
189852001-10-04 Akim Demaille <akim@epita.fr>
18986
18987 * src/reader.c (parse_union_decl): Push the caracters in
18988 union_obstack, not attrs_obstack.
18989
342b8b6e
AD
189902001-10-04 Akim Demaille <akim@epita.fr>
18991
18992 Merge in the branch 1.29.
18993
18994 * src/reader.c (packsymbols): Use a temporary obstack for
18995 `%%tokendef', since output_stack is already used elsewhere.
18996
18997 2001-10-02 Akim Demaille <akim@epita.fr>
18998
18999 Bump 1.29d.
19000
19001 2001-10-02 Akim Demaille <akim@epita.fr>
19002
19003 Version 1.29c.
19004
19005 2001-10-02 Akim Demaille <akim@epita.fr>
19006
19007 * tests/regression.at (Invalid CPP headers): New.
19008 From Alexander Belopolsky.
19009 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19010
19011 2001-10-02 Akim Demaille <akim@epita.fr>
19012
19013 * tests/regression.at (Invalid input): New.
19014 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19015 Reported by Shura.
19016
19017 2001-10-02 Akim Demaille <akim@epita.fr>
19018
19019 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19020
19021 2001-10-02 Akim Demaille <akim@epita.fr>
19022
19023 * src/output.c (output_parser): Assert `skeleton'.
19024 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19025 systems.
19026 From Shura.
19027
19028 2001-10-01 Marc Autret <autret_m@epita.fr>
19029
19030 * src/lex.h: Echo modifications.
19031 * src/lex.c (unlex): Parameter is now token_t.
19032 From Hans Aberg.
19033
19034 2001-10-01 Marc Autret <autret_m@epita.fr>
19035
19036 * src/main.c: Include lex.h.
19037 From Hans Aberg.
19038
19039 2001-09-29 Akim Demaille <akim@epita.fr>
19040
19041 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19042
19043 2001-09-28 Akim Demaille <akim@epita.fr>
19044
19045 * tests/testsuite.at: Update to newer Autotest.
19046 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19047
19048 2001-09-27 Akim Demaille <akim@epita.fr>
19049
19050 Position independent wrapper.
19051
19052 * tests/bison: Remove.
19053 * tests/bison.in: New.
19054 * configure.in: Adjust.
19055
19056 2001-09-27 Paul Eggert <eggert@twinsun.com>
19057
19058 Port quotearg fixes from tar 1.13.24.
19059
19060 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19061 tm to be declared.
19062 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19063 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19064
19065 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19066 * m4/mbrtowc.m4: New file.
19067 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19068 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19069
19070 2001-09-27 Akim Demaille <akim@epita.fr>
19071
19072 Bump to 1.29c.
19073
19074 2001-09-27 Akim Demaille <akim@epita.fr>
19075
19076 Version 1.29b.
19077
19078 2001-09-25 Akim Demaille <akim@epita.fr>
19079
19080 * src/system.h: Include `xalloc.h'.
19081 Remove it from the C files.
19082 * src/files.c (output_files): Free the obstacks.
19083 * src/lex.c (init_lex): Rename as...
19084 (lex_init): this.
19085 (lex_free): New.
19086 * src/main.c (main): Use it.
19087
19088 2001-09-24 Marc Autret <autret_m@epita.fr>
19089
19090 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19091 to output informations in fout (FILE*).
19092 (open_graph, close_graph): Likewise.
19093 (output_graph, output_edge, output_node): Likewise.
19094 * src/vcg.h: Update function prototypes.
19095 * src/print_graph.c (print_graph): Open output graph file.
19096 (print_actions): Adjust.
19097 * src/files.h: Remove extern declaration.
19098 * src/files.c: Remove graph_obstack declaration.
19099 (open_files): Remove graph_obstack initialization.
19100 (output_files): Remove graph_obstack saving.
19101
19102 2001-09-24 Marc Autret <autret_m@epita.fr>
19103
19104 * src/files.c (compute_output_file_names): Fix.
19105
19106 2001-09-24 Marc Autret <autret_m@epita.fr>,
19107 Akim Demaille <akim@epita.fr>
19108
19109 * src/reader.c (reader): Remove call to free_symtab ().
19110 * src/main.c (main): Call it here.
19111 Include symtab.h.
19112 * src/conflicts.c (initialize_conflicts): Rename as...
19113 (solve_conflicts): this.
19114 * src/print.c (print_core, print_actions, print_state)
19115 (print_grammar): Dump to a file instead a `output_obstack'.
19116 (print_results): Dump `output_obstack', and then proceed with the
19117 FILE *.
19118 * src/files.c (compute_output_file_names, close_files): New.
19119 (output_files): Adjust.
19120 * src/main.c (main): Adjust.
19121
19122 2001-09-23 Marc Autret <autret_m@epita.fr>
19123
19124 * src/files.c (compute_header_macro): Computes header macro name
19125 from spec_defines_file when given.
19126
19127 2001-09-23 Marc Autret <autret_m@epita.fr>
19128
19129 * src/files.c (output_files): Add default extensions.
19130
19131 2001-09-22 Akim Demaille <akim@epita.fr>
19132
19133 * src/conflicts.c (finalize_conflicts): Rename as...
19134 (free_conflicts): this.
19135
19136 2001-09-22 Akim Demaille <akim@epita.fr>
19137
19138 * src/gram.c (gram_free): Rename back as...
19139 (dummy): this.
19140 (output_token_translations): Free `token_translations'.
19141 * src/symtab.c (free_symtab): Free the tag field.
19142
19143 2001-09-22 Akim Demaille <akim@epita.fr>
19144
19145 Remove `translations' as it is always set to true.
19146
19147 * src/gram.h: Adjust.
19148 * src/reader.c (packsymbols, parse_token_decl): Adjust
19149 * src/print.c (print_grammar): Adjust.
19150 * src/output.c (output_token_translations): Adjust.
19151 * src/lex.c (lex): Adjust.
19152 * src/gram.c: Be sure the set pointers to NULL.
19153 (dummy): Rename as...
19154 (gram_free): this.
19155
19156 2001-09-22 Akim Demaille <akim@epita.fr>
19157
19158 * configure.in: Invoke AM_LIB_DMALLOC.
19159 * src/system.h: Use dmalloc.
19160 * src/LR0.c: Be sure to have pointers initialized to NULL.
19161 (allocate_itemsets): Allocate kernel_items only if needed.
19162
19163 2001-09-22 Akim Demaille <akim@epita.fr>
19164
19165 * configure.in: Bump to 1.29b.
19166 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19167 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19168 need xmalloc.c in calc.y.
19169 From Pascal Bart.
19170
19171 2001-09-21 Akim Demaille <akim@epita.fr>
19172
19173 Version 1.29a.
19174 * Makefile.maint, config/config.guess, config/config.sub,
19175 * config/missing: Update from masters.
19176 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19177 upon package.m4.
19178 * configure.in (ALL_LINGUAS): Add `tr'.
19179
19180 2001-09-21 Akim Demaille <akim@epita.fr>
19181
19182 * tests/Makefile.am (package.m4): Move to...
19183 ($(srcdir)/$(TESTSUITE)): here.
19184
19185 2001-09-20 Akim Demaille <akim@epita.fr>
19186
19187 * src/complain.c: No longer try to be standalone: use system.h.
19188 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19189 * src/complain.h: Likewise.
19190 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19191 Remove the unused variable `n'.
19192 From Albert Chin-A-Young.
19193
19194 2001-09-18 Marc Autret <autret_m@epita.fr>
19195
19196 * doc/bison.1: Update.
19197 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19198 descriptions.
19199 (Option Cross Key): Update.
19200 Add --graph.
19201
19202 2001-09-18 Marc Autret <autret_m@epita.fr>
19203
19204 * tests/regression.at: New test (comment in %union).
19205
19206 2001-09-18 Marc Autret <autret_m@epita.fr>
19207
19208 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19209 do that.
19210 Reported by Keith Browne.
19211
19212 2001-09-18 Marc Autret <autret_m@epita.fr>
19213
19214 * tests/output.at: Add tests for --defines and --graph.
19215
19216 2001-09-18 Marc Autret <autret_m@epita.fr>
19217
19218 * tests/output.at: Removes tests of %{header,src}_extension features.
19219
19220 2001-09-18 Akim Demaille <akim@epita.fr>
19221
19222 * tests/Makefile.am (package.m4): New.
19223 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19224 (_AT_CHECK_CALC_ERROR): Likewise.
19225 Factor the `, ' part of verbose error messages.
19226
19227 2001-09-18 Marc Autret <autret_m@epita.fr>
19228
19229 * src/getargs.c (longopts): Declare --defines and --graph as options
19230 with optional arguments.
19231 * src/files.h: Add extern declarations.
19232 * src/files.c (spec_graph_file, spec_defines_file): New.
19233 (output_files): Update.
19234 Remove CPP-outed code.
19235
19236 2001-09-18 Marc Autret <autret_m@epita.fr>
19237
19238 Turn off %{source,header}_extension feature.
19239
19240 * src/files.c (compute_exts_from_gf): Update.
19241 (compute_exts_from_src): Update.
19242 (output_files): CPP-out useless code.
19243 * src/files.h: Remove {header,source}_extension extern declarations.
19244 * src/reader.c (parse_dquoted_param): CPP-out.
19245 (parse_header_extension_decl): Remove.
19246 (parse_source_extension_decl): Remove.
19247 (read_declarations): Remove cases tok_{hdrext,srcext}.
19248 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19249 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19250
19251 2001-09-10 Akim Demaille <akim@epita.fr>
19252
19253 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19254 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19255 (AT_CHECK_OUTPUT): this.
19256 Merely check ls' exit status, its output is useless.
19257
19258 2001-09-10 Akim Demaille <akim@epita.fr>
19259
19260 * tests/calc.at: Use m4_match.
19261 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19262
19263 2001-09-10 Marc Autret <autret_m@epita.fr>,
19264 Akim Demaille <akim@epita.fr>
19265
19266 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19267 enum color_e.
19268 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19269 to `normal'.
19270 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19271 * src/lex.h: Adjust prototype.
19272 (token_t): Add `tok_undef'.
19273 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19274 (parse_percent_token): Now returns token_t.
19275 Add default statement in switch.
19276 (lex): Separate `c' as an input variable, from the token_t result
19277 part.
19278 (unlexed): Is a token_t.
19279
19280 2001-09-10 Akim Demaille <akim@epita.fr>
19281
19282 * configure.in: Bump to 1.29a.
19283
19284 2001-09-07 Akim Demaille <akim@epita.fr>
19285
19286 Version 1.29.
19287
19288 2001-08-30 Akim Demaille <akim@epita.fr>
19289
19290 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19291 * m4/atconfig.m4: Remove.
19292 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19293 * tests/bison: New.
19294 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19295 m4_if, m4_patsubst, and m4_regexp.
19296 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19297 `input' file instead of echo.
19298
19299 2001-08-29 Akim Demaille <akim@epita.fr>
19300
19301 Bump to 1.28e.
19302
19303 2001-08-29 Akim Demaille <akim@epita.fr>
19304
19305 Version 1.28d.
19306
19307 2001-08-29 Paul Eggert <eggert@twinsun.com>
19308
19309 * src/bison.simple (yyparse): Don't take the address of an
19310 item before the start of an array, as that doesn't conform to
19311 the C Standard.
19312
19313 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19314
19315 * doc/bison.texinfo (Location Tracking Calc): New node.
19316
19317 2001-08-29 Paul Eggert <eggert@twinsun.com>
19318
19319 * src/output.c (output): Do not define const, as this now
19320 causes more problems than it cures.
19321
19322 2001-08-29 Akim Demaille <akim@epita.fr>
19323
19324 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19325 the nodes.
19326 Be sure to tag the `detailmenu'.
19327
19328 2001-08-29 Akim Demaille <akim@epita.fr>
19329
19330 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19331 download in a tmp dir.
19332
19333 2001-08-28 Marc Autret <autret_m@epita.fr>
19334
19335 * config/depcomp: New file.
19336
19337 2001-08-28 Marc Autret <autret_m@epita.fr>
19338
19339 * doc/bison.1 (mandoc): Adjust.
19340 From Juan Manuel Guerrero.
19341
19342 2001-08-28 Marc Autret <autret_m@epita.fr>
19343
19344 * src/print_graph.c (print_state): Fix.
19345
19346 2001-08-27 Marc Autret <autret_m@epita.fr>
19347
19348 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19349 char * members.
19350 Echo modifications to the functions prototypes.
19351 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19352
19353 2001-08-27 Marc Autret <autret_m@epita.fr>
19354
19355 * src/vcg.c: Include `xalloc.h'.
19356 (add_colorentry): New.
19357 (add_classname): New.
19358 (add_infoname): New.
19359 * src/vcg.h: Add new prototypes.
19360
19361 2001-08-27 Akim Demaille <akim@epita.fr>
19362
19363 * Makefile.maint: Sync. again with CVS Autoconf.
19364
19365 2001-08-27 Akim Demaille <akim@epita.fr>
19366
19367 * Makefile.maint: Formatting changes.
19368 (po-update, cvs-update, update): New targets.
19369 (AMTAR): Remove.
19370
19371 2001-08-27 Akim Demaille <akim@epita.fr>
19372
19373 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19374 * Makefile.maint: Sync. with CVS Autoconf.
19375
19376 2001-08-27 Marc Autret <autret_m@epita.fr>
19377
19378 * src/vcg.h (struct infoname_s): New.
19379 (struct colorentry_s): New.
19380 (graph_s): New fields {vertical,horizontal}_order in structure.
19381 Add `infoname' field.
19382 Add `colorentry' field;
19383 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19384 (G_HORIZONTAL_ORDER): New.
19385 (G_INFONAME): New.
19386 (G_COLORENTRY): New.
19387 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19388 Add output of `infoname'.
19389 Add output of `colorentry'.
19390
19391 2001-08-27 Marc Autret <autret_m@epita.fr>
19392
19393 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19394 This one shadowed a global parameter.
19395
19396 2001-08-24 Marc Autret <autret_m@epita.fr>
19397
19398 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19399 instead of `unsigned'.
19400 (print_state): Do not call obstack_object_size () in obstack_grow ()
19401 to avoid macro variables shadowing.
19402
19403 2001-08-23 Marc Autret <autret_m@epita.fr>
19404
19405 * src/lex.c (percent_table): Typo: s/naem/name/.
19406 Add graph option.
19407 Normalize new options declarations.
19408
19409 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19410
19411 * tests/suite.at: Exercise %header_extension and %source_extension.
19412
19413 2001-08-16 Marc Autret <autret_m@epita.fr>
19414
19415 * src/reader.c (parse_dquoted_param): New.
19416 (parse_header_extension_decl): Use it.
19417 (parse_source_extension_decl): Likewise.
19418
19419 2001-08-16 Marc Autret <autret_m@epita.fr>
19420
19421 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19422 (get_xxxx_str): Use assert () instead of complain ().
19423 Remove return invokations in default cases.
19424 (get_decision_str): Modify default behaviour. Remove second argument.
19425 Echo modifications on calls.
19426 (output_graph): Fix.
19427
19428 2001-08-16 Marc Autret <autret_m@epita.fr>
19429
19430 * src/getargs.c (usage): Update with ``-g, --graph''.
19431
19432 2001-08-16 Marc Autret <autret_m@epita.fr>
19433
19434 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19435 (Option Cross Key): Likewise.
19436 * doc/bison.1: Update.
19437
1c8c2190
PB
194382001-09-25 Pascal Bart <pascal.bart@epita.fr>
19439
19440 * src/output.c (output_master_parser): Don't finish action_obstack.
19441 (output_parser): Don't care about the muscle action, here.
19442 (prepare): Copy the action_obstack in the action muscle.
19443 (output): Free action_obstack.
19444
180d45ba
PB
194452001-09-23 Pascal Bart <pascal.bart@epita.fr>
19446
19447 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19448 will contain `%union' declaration.
19449 (parse_union_decl): Delete #line directive output.
19450 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19451 informations about %union.
19452 (parse_union_decl): Copy the union_obstack in the muscle stype.
19453 * src/bison.simple: Add new #line directive.
19454 Add typdef %%stype YYSTYPE.
19455
c51d1a19
PB
194562001-09-23 Pascal Bart <pascal.bart@epita.fr>
19457
19458 * src/bison.simple: Add new `#line' directive.
19459
6f9344da
PB
194602001-09-22 Pascal Bart <pascal.bart@epita.fr>
19461
19462 * src/bison.simple: New `#line' directive.
19463 * src/output.c (output_parser): Support new dynamic muscle input_line.
19464
652def80
MA
194652001-09-22 Marc Autret <autret_m@epita.fr>
19466
19467 * src/output.c (output_master_parser): New.
19468 (output_parser): Be more re-entrant.
19469
25b222fa
MA
194702001-09-21 Marc Autret <autret_m@epita.fr>
19471
19472 * src/reader.c (copy_definition, parse_union_decl): Update and use
19473 `linef' muscle.
19474 (copy_action): Likewise.
19475 Use obstack_1grow ().
19476 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19477
6bc35ae5
MA
194782001-09-21 Marc Autret <autret_m@epita.fr>
19479
19480 * src/options.c (option_table): Adjust.
19481 * src/lex.c (parse_percent_token): Fix.
19482
c0629aa1
PB
194832001-09-20 Pascal Bart <pascal.bart@epita.fr>
19484
19485 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 19486
82b6d266
PB
194872001-09-20 Pascal Bart <pascal.bart@epita.fr>
19488
19489 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19490 is now an option_table_struct*.
19491 (option_strcmp): New function option_strcmp.
19492 (parse_percent_token): Call option_strcmp.
19493 * src/getargs.c (xalloc.h, options.h): Include it.
19494 (getargs): Call create_long_option_table.
19495 (getargs): Free longopts at the end of the function.
19496 (shortopts): Move in options.c.
19497 * src/options.c (create_long_option_table): New function. Convert
19498 information from option_table to option structure.
19499 * src/reader.c (options.h): Include it.
19500
19501 * src/Makefile.am: Adjust.
19502 * src/options.c (option_table): Create from longopts and percent_table.
19503 * src/getargs.c (longopts): Delete.
19504 * src/lex.c (struct percent_table_struct): Delete.
19505 (percent_table): Delete.
19506 (options.h): Include it.
19507 * src/options.c: Create.
19508 * src/options.h: Create.
19509 Declare enum opt_access_e.
19510 Define struct option_table_struct.
19511
75f5aaea
MA
195122001-09-20 Marc Autret <autret_m@epita.fr>
19513
19514 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19515 sections of Bison.
19516
f508cb0a
PB
195172001-09-19 Pascal Bart <pascal.bart@epita.fr>
19518
19519 * src/bison.simple: s/%%filename/%%skeleton.
19520 * src/muscle_tab.c (getargs.h): Include it.
19521 (muscle_init): Insert new muscle skeleton.
19522
13105fc1
PB
195232001-09-18 Pascal Bart <pascal.bart@epita.fr>
19524
19525 * src/output.c (output_parser): Delete unused variable actions_dumped.
19526
b0c4483e
PB
195272001-09-07 Pascal Bart <pascal.bart@epita.fr>
19528
19529 * src/output.c (output): Delete call to reader_output_yylsp.
19530 * src/reader.c (reader): Likewise.
ba0fe3c7 19531 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 19532
11d82f03
MA
195332001-09-02 Marc Autret <autret_m@epita.fr>
19534
19535 * src/reader.c: Include muscle_tab.h.
19536 (parse_union_decl): Update.
19537 (parse_macro_decl): Rename parse_muscle_decl.
19538 Update to use renamed functions and variable.
19539 (read_declarations, copy_action, read_additionnal_code, : Updated
19540 with correct variables and functions names.
19541 (packsymbols, reader): Likewise.
342b8b6e 19542
11d82f03 19543 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 19544
11d82f03
MA
19545 * src/output.c: Include muscle_tab.h
19546 In all functions using macro_insert, change by using muscle_insert ().
19547 (macro_obstack): Rename muscle_obstack.
19548 Echo modifications in the whole file.
19549 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19550 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19551 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19552
19553 * src/muscle_tab.h: Update double inclusion macros.
19554 (macro_entry_s): Rename muscle_entry_s.
19555 Update prototypes.
342b8b6e 19556
11d82f03
MA
19557 * src/muscle_tab.c: Include muscle_tab.h.
19558 Rename macro_tabble to muscle_table.
19559 (mhash1, mhash2, mcmp): Use muscle_entry.
19560 (macro_init): Rename muscle_init. Update.
19561 (macro_insert): Rename muscle_insert. Update.
19562 (macro_find): Rename muscle_find. Update.
19563
19564 * src/main.c: Include muscle_tab.h.
19565 (main): Call muscle_init ().
19566 * src/Makefile.am (bison_SOURCES): Echo modifications.
19567
93a37297
MA
195682001-09-02 Marc Autret <autret_m@epita.fr>
19569
f753cd62 19570 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 19571
f753cd62
MA
19572 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19573
195742001-09-02 Marc Autret <autret_m@epita.fr>
19575
19576 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 19577
682d48cd
PB
195782001-09-01 Pascal Bart <pascal.bart@epita.fr>
19579
342b8b6e 19580 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
19581 filename.
19582
087c8fda
MA
195832001-09-01 Marc Autret <autret_m@epita.fr>
19584
19585 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19586 to an explicit value to activate the feature. We do it here.
19587
dda680cb
PB
195882001-08-31 Pascal Bart <pascal.bart@epita.fr>
19589
19590 * src/output.c (prepare): Delete the `filename' muscule insertion.
19591 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19592 (parse_union_decl): Likewise.
19593 * src/macrotab.c (macro_init): Initialize filename by infile.
19594
9e644e64
MA
195952001-08-31 Marc Autret <autret_m@epita.fr>
19596
19597 * src/bison.simple (YYLSP_NEEDED): New definition.
19598 * src/output.c (prepare): Add macro insertion of `locations_flag'
19599
17da6427
PB
196002001-08-31 Pascal Bart <pascal.bart@epita.fr>
19601
19602 * src/output.c (prepare): Delete insertion of previous muscles,
19603 and insert the `prefix' muscles.
19604 * src/macrotab.c (macro_init): Likewise.
19605 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 19606 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
19607 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19608 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 19609 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
19610 name_prefix.
19611
e8cb70b9
PB
196122001-08-31 Pascal Bart <pascal.bart@epita.fr>
19613
19614 * src/main.c (main): Standardize.
19615 * src/output.c (output_table_data, output_parser): Likewise.
19616 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19617
63c2d5de
MA
196182001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19619
342b8b6e 19620 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
19621 %%epilogue.
19622 * src/output.c (output): Rename %%declarations to %%prologue.
19623 * src/bison.simple: Echo modifications.
342b8b6e 19624
d8cb5183
MA
196252001-08-31 Marc Autret <autret_m@epita.fr>
19626
19627 * src/reader.c (readgram): CleanUp.
19628 (output_token_defines): Likewise.
19629 (packsymbols): Likewise.
19630 (reader): Likewise.
19631 * src/output.c (output): CPP-out useless code.
19632
6c686258
PB
196332001-08-31 Pascal Bart <pascal.bart@epita.fr>
19634
342b8b6e 19635 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
19636 output_trailers and output_headers.
19637 * src/output.h: Remove obsolete functions prototypes of output_headers
19638 and output_trailers.
19639
8f451ef7
PB
196402001-08-30 Pascal Bart <pascal.bart@epita.fr>
19641
19642 * src/main.c: Include macrotab.h.
342b8b6e 19643 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
19644 Adjust functions prototypes.
19645 * src/macrotab.c (macro_insert): Constify key and value.
19646 (macro_find): Constify key.
19647 (macro_insert): Include 'xalloc.h'
19648 (macro_insert): Use XMALLOC.
19649 (macro_find): Constify return value.
19650 * src/output.c (output_table_data): Rename table to table_data.
19651 (output_parser): Constify macro_key, macro_value.
19652
997b6fd0 196532001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
19654
19655 * src/reader.c (parse_skel_decl): New.
342b8b6e 19656 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
19657 * src/lex.h (token_t): New token `tok_skel'.
19658 * src/lex.c (percent_table): Add skeleton option entry.
19659 Standardize.
19660
ff48177d
MA
196612001-08-29 Marc Autret <autret_m@epita.fr>
19662
19663 * src/bison.simple: Add %%user_code directive at the end.
19664 * src/reader.c (read_additionnal_code): New.
19665 (reader): Use it.
19666 * src/output.c (output_program): Remove.
19667 (output): Update.
19668
b33160bf
MA
196692001-08-28 Marc Autret <autret_m@epita.fr>
19670
19671 * src/output.c (output_actions): Clean up.
4e5caae2 19672 (output_gram): CPP-out useless code.
b33160bf
MA
19673 * src/reader.c (reader): Clean up, CPP-out useless code.
19674
d1a2daf7
PB
196752001-08-28 Pascal Bart <pascal.bart@epita.fr>
19676
342b8b6e 19677 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 19678 directive.
d1a2daf7
PB
19679 * src/bison.simple: Add `%%definitions'.
19680
2b763dfe
MA
196812001-08-28 Marc Autret <autret_m@epita.fr>
19682
19683 * config/depcomp: New file.
19684
f1a87ef6
PE
196852001-08-27 Paul Eggert <eggert@twinsun.com>
19686
19687 * src/bison.simple (yyparse): Don't take the address of an
19688 item before the start of an array, as that doesn't conform to
19689 the C Standard.
19690
82e236e2
RA
196912001-08-27 Robert Anisko <robert.anisko@epita.fr>
19692
f1a87ef6 19693 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
19694 obstack. It was done too late here.
19695
19696 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19697 completely wrong.
19698 (reader): Initialize the macro obstack here, since we need it to grow
19699 '%define' directives.
19700
19701 * src/reader.h: Declare the macro obstack as extern.
19702
b0cfa28a
RA
197032001-08-27 Robert Anisko <robert.anisko@epita.fr>
19704
19705 * src/output.c (output_parser): Fix. Store single '%' characters in
19706 the output obstack instead of throwing them away.
19707
6fc74234
AD
197082001-08-27 Akim Demaille <akim@epita.fr>
19709
19710 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19711
9c76d118
RA
197122001-08-25 Robert Anisko <robert.anisko@epita.fr>
19713
19714 * lib/Makefile.am: Adjust.
19715
a8289c62
RA
197162001-08-25 Robert Anisko <robert.anisko@epita.fr>
19717
19718 * src/bison.simple: Update and add '%%' directives.
19719
b6610515
RA
197202001-08-25 Robert Anisko <robert.anisko@epita.fr>
19721
19722 * src/reader.c (reader): Remove calls to 'output_headers' and
19723 'output_trailers'. Remove some C output.
19724 (readgram): Disable a piece of code that was writing a default
19725 definition for 'YYSTYPE'.
19726 (reader_output_yylsp): Remove.
19727 (packsymbols): Output token defintions to a macro.
19728 (copy_definition): Disable C output.
6fc74234 19729
b6610515
RA
19730 * src/reader.c (parse_macro_decl): New function used to parse macro
19731 declarations.
19732 (copy_string2): Put the body of copy_string into this new function.
19733 Add a parameter to let the caller choose whether he wants to copy the
19734 string delimiters or not.
19735 (copy_string): Be a simple call to copy_string2 with the last argument
19736 bound to true.
19737 (read_declarations): Add case for macro definition.
19738 (copy_identifier): New.
6fc74234 19739 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
19740 rather than lex.
19741
26f609ff
RA
197422001-08-25 Robert Anisko <robert.anisko@epita.fr>
19743
19744 * src/output.c (prepare): Add prefixed names.
19745 (output_parser): Output semantic actions.
19746 (output_parser): Fix bug on '%%line' directives.
6fc74234 19747
26f609ff
RA
19748 * src/output.c (output_headers): Remove. The C code printed by this
19749 function should now be in the skeletons.
19750 (output_trailers): Remove.
19751 (output): Disable call to 'reader_output_yylsp'.
19752 (output_rule_data): Do not output tables to the table obstack.
19753
19754 * src/output.c: Remove some C dedicated output.
19755 Improve the use of macro and output obstacks.
19756 (output_defines): Remove.
6fc74234 19757
26f609ff
RA
19758 * src/output.c (output_token_translations): Associate 'translate'
19759 table with a macro. No output to the table obstack.
19760 (output_gram): Same for 'rhs' and 'prhs'.
19761 (output_stos): Same for 'stos'.
19762 (output_rule_data): Same for 'r1' and 'r2'.
19763 (token_actions): Same for 'defact'.
19764 (goto_actions): Same for 'defgoto'.
19765 (output_base): Same for 'pact' and 'pgoto'.
19766 (output_table): Same for 'table'.
19767 (output_check): Same for 'check'.
6fc74234 19768
26f609ff
RA
19769 * src/output.c (output_table_data): New function.
19770 (output_short_table): Remove.
19771 (output_short_or_char_table): Remove.
6fc74234 19772
26f609ff
RA
19773 * src/output.c (output_parser): Replace most of the skeleton copy code
19774 with something new. Skeletons are now processed character by character
19775 rather than line by line, and Bison looks for '%%' macros. This is the
19776 first step in making Bison's output process (a lot) more flexible.
19777 (output_parser): Use the macro table.
19778
6f43b113
RA
197792001-08-25 Robert Anisko <robert.anisko@epita.fr>
19780
19781 * src/main.c (main): Initialize the macro table.
19782
dd3127cf
RA
197832001-08-25 Robert Anisko <robert.anisko@epita.fr>
19784
19785 * src/lex.c (percent_table): Add tok_define.
19786 * src/lex.h: Add tok_define.
19787
aa321494
RA
197882001-08-25 Robert Anisko <robert.anisko@epita.fr>
19789
19790 * src/macrotab.c: New file.
19791 * src/macrotab.h: New file.
19792 * src/Makefile.am: Update.
19793
68bd3b6b
RA
197942001-08-25 Robert Anisko <robert.anisko@epita.fr>
19795
19796 * lib/hash.c: New file.
19797 * lib/hash.h: New file.
19798 * lib/Makefile.am: Update.
19799
45f8dd1e
AD
198002001-08-15 Akim Demaille <akim@epita.fr>
19801
19802 Version 1.28c.
19803
40a64a7a 198042001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
19805
19806 * src/reader.c (readgram): Indent output macro YYSTYPE.
19807 (packsymbols): Likewise.
19808 (output_token_defines): Likewise.
19809 * src/files.c: Standardize.
19810 (compute_header_macro): New.
19811 (defines_obstack_save): New. Use compute_header_macro.
19812 (output_files): Update. Use defines_obstack_save.
19813
f9a8293a
AD
198142001-08-15 Akim Demaille <akim@epita.fr>
19815
19816 * doc/bison.texinfo (Table of Symbols): Document
19817 YYSTACK_USE_ALLOCA.
19818
150ca7a7
AD
198192001-08-15 Akim Demaille <akim@epita.fr>
19820
19821 * missing: Update from CVS Automake.
19822 * config/config.guess, config/config.sub, config/texinfo.tex:
19823 Update from gnu.org.
19824
69b5cec4
AD
198252001-08-15 Akim Demaille <akim@epita.fr>
19826
19827 * Makefile.maint: Sync with CVS Autoconf.
19828
f2b5126e
PB
198292001-08-14 Pascal Bart <pascal.bart@epita.fr>
19830
69b5cec4 19831 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
19832 `fdl.texi'.
19833 * doc/fdl.texi: Add to package.
19834
4ecbf796
MA
198352001-08-14 Marc Autret <autret_m@epita.fr>
19836
19837 Turn on %{source,header}_extension features.
19838
69b5cec4 19839 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
19840 source_extension.
19841 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 19842 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
19843 between options.
19844
95fb5662
MA
198452001-08-14 Marc Autret <autret_m@epita.fr>
19846
19847 * src/files.c (compute_base_names): Add extensions computing when
19848 `--file-prefix' used.
19849 Standardize function calls.
19850
78d09da9
MA
198512001-08-13 Marc Autret <autret_m@epita.fr>
19852
69b5cec4 19853 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
19854 defining it (defined but null disables alloca).
19855
5a009f2c
MA
198562001-08-13 Marc Autret <autret_m@epita.fr>
19857
19858 * src/bison.simple (_yy_memcpy): CPP reformat.
19859
1e41465a
PB
198602001-08-13 Pascal Bart <pascal.bart@epita.fr>
19861
19862 * tests/atconfig.in (CPPFLAGS): Fix.
19863
c67a198d
PB
198642001-08-10 Pascal Bart <pascal.bart@epita.fr>
19865
79282c6c 19866 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
19867 `gpl.texi'.
19868 * doc/gpl.texi: Add to package.
19869
09a6de7e
MA
198702001-08-10 Marc Autret <autret_m@epita.fr>
19871
19872 * src/print_graph.h: Fix.
19873 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
19874
b77b9ee0
AD
198752001-08-10 Akim Demaille <akim@epita.fr>
19876
19877 * src/system.h: Provide default declarations for stpcpy, strndup,
19878 and strnlen.
19879
3e259915
MA
198802001-08-10 Robert Anisko <anisko_r@epita.fr>
19881
19882 * doc/bison.texinfo (Locations): Update @$ stuff.
19883
ca96bc2d
MA
198842001-08-09 Robert Anisko <anisko_r@epita.fr>
19885
19886 * src/bison.simple (YYLLOC_DEFAULT): Update.
19887 (yyparse): Adjust.
19888
fdc6758b
MA
198892001-08-08 Marc Autret <autret_m@epita.fr>
19890
b77b9ee0 19891 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
19892 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
19893 Reported by Fabrice Bauzac.
957d4dbf 19894
600cad3b
MA
198952001-08-08 Marc Autret <autret_m@epita.fr>
19896
19897 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
19898 * src/vcg.c (output_node): Fix.
19899 * src/vcg.h: Cleanup.
19900 * src/print_graph.c: Add comments.
b77b9ee0 19901 (node_output_size): New global variable. Simplify the formatting of
600cad3b 19902 the VCG graph output.
b77b9ee0 19903 (print_actions): Unused code is now used. It notifies the final state
600cad3b 19904 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 19905 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
19906 blue.
19907 Get the current node name and node_obstack by argument.
19908 (node_obstack): New variable.
19909 (print_state): Manage node_obstack.
19910 (print_core): Use node_obstack given by argument.
19911 A node is not only computed here but in print_actions also.
19912 (print_graph): CPP out useless code instead of commenting it.
19913
976e528f
AD
199142001-08-07 Pascal Bart <pascal.bart@epita.fr>
19915
19916 * tests/atconfig.in (CPPFLAGS): Fix.
19917
20e8e5ca
AD
199182001-08-07 Akim Demaille <akim@epita.fr>
19919
19920 * src/print_graph.c (quote): New.
19921 (print_core): Use it.
19922
957d4dbf 199232001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 19924
3e3da797
AD
19925 * src/vcg.c (complain.h): Include it.
19926 Unepitaize `return' invocations.
c4b66126 19927 [NDEBUG] (main): Remove.
79282c6c 19928 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
19929 * src/files.c (open_files): Initialize graph_obstack.
19930 * src/print_graph.c (print_actions): CPP out useless code.
19931 (print_core): Don't output the last `\n' in labels.
19932 Use `quote'.
19933 * src/files.c (output_files): Output the VCG file.
19934 * src/main.c (main): Invoke print_graph ();
3e3da797 19935
957d4dbf 199362001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
19937
19938 Automaton VCG graph output.
19939 Using option ``-g'' or long option ``--graph'', you can generate
19940 a gram_filename.vcg file containing a VCG description of the LALR (1)
19941 automaton of your grammar.
19942
19943 * src/main.c: Call to print_graph() function.
19944 * src/getargs.h: Update.
19945 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
19946 (graph_flag): New flag.
19947 (longopts): Update.
19948 (getargs): Add case `g'.
19949 * src/files.c (graph_obstack): New obstack struct.
19950 (open_files): Initialize new obstack.
19951 (output_files): Saves graph_obstack if required.
19952 * src/files.h (graph_obstack): New extern declaration.
19953 * src/Makefile.am: Add new source files.
19954
927c1557 199552001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
19956
19957 * src/print_graph.c, src/print_graph.h (graph): New.
19958 * src/vcg.h: New file.
19959 * src/vcg.c: New file, VCG graph handling.
19960
7333d403
AD
199612001-08-06 Marc Autret <autret_m@epita.fr>
19962
19963 Add of %source_extension and %header_extension which specify
19964 the source or/and the header output file extension.
19965
19966 * src/files.c (compute_base_names): Remove initialisation of
19967 src_extension and header_extension.
19968 (compute_exts_from_gf): Update.
19969 (compute_exts_from_src): Update.
19970 (output_files): Update.
19971 * src/reader.c (parse_header_extension_decl): New.
19972 (parse_source_extension_decl): New.
19973 (read_declarations): New case statements for the new tokens.
19974 * src/lex.c (percent_table): Add entries for %source_extension
19975 and %header_extension.
19976 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
19977
84163231
AD
199782001-08-06 Marc Autret <autret_m@epita.fr>
19979
19980 * configure.in: Bump to 1.28c.
19981 * doc/bison.texinfo: Texinfo thingies.
19982
8303fc42
AD
199832001-08-04 Pascal Bart <pascal.bart@epita.fr>
19984
19985 * tests/atconfig.in (CPPFLAGS): Add.
19986 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
19987
70a84437
AD
199882001-08-03 Akim Demaille <akim@epita.fr>
19989
19990 Version 1.28b.
19991
2ce10144
AD
199922001-08-03 Akim Demaille <akim@epita.fr>
19993
19994 * tests/Makefile.am (check-local): Ship testsuite.
19995 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
19996 Include `string.h'.
19997
1e3e4bc1
AD
199982001-08-03 Akim Demaille <akim@epita.fr>
19999
20000 * configure.in: Try using -Wformat when compiling.
20001
42b45b7f
AD
200022001-08-03 Akim Demaille <akim@epita.fr>
20003
20004 * configure.in: Bump to 1.28b.
20005
8f13fe33
AD
200062001-08-03 Akim Demaille <akim@epita.fr>
20007
20008 * src/complain.c: Adjust strerror_r portability issues.
20009
b37ba92c
AD
200102001-08-03 Akim Demaille <akim@epita.fr>
20011
20012 Version 1.28a.
20013
b0ce6046
AD
200142001-08-03 Akim Demaille <akim@epita.fr>
20015
20016 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20017 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20018 * src/getargs.c: Include complain.h.
20019 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20020 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20021
d01c415b
AD
200222001-08-03 Akim Demaille <akim@epita.fr>
20023
20024 * src/reader.c (readgram): Display hidden chars in error messages.
20025
459dd1a6
AD
200262001-08-03 Akim Demaille <akim@epita.fr>
20027
20028 Update to gettext 0.10.39.
20029
53b74c0c
AD
200302001-08-03 Akim Demaille <akim@epita.fr>
20031
20032 * lib/strspn.c: New.
20033
234a3be3
AD
200342001-08-01 Marc Autret <autret_m@epita.fr>
20035
20036 * doc/bison.texinfo: Update.
20037 * doc/bison.1 (mandoc): Update.
20038 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20039 * src/files.c: Support output files extensions computing.
20040 (src_extension): New static variable.
20041 (header_extension): New static variable.
20042 (tr): New function.
20043 (get_extension_index): New function, gets the index of an extension
20044 filename in a string.
20045 (compute_exts_from_gf): New function, computes extensions from the
20046 grammar file extension.
20047 (compute_exts_from_src): New functions, computes extensions from the
20048 C source file extension, file given by ``-o'' option.
20049 (compute_base_names): Update.
20050 (output_files): Update.
20051
847bf1f5
AD
200522001-08-01 Robert Anisko <anisko_r@epita.fr>
20053
d995fee7 20054 * doc/bison.texi: Document @$.
847bf1f5
AD
20055 (Locations): New section.
20056
d074a105
AD
200572001-07-18 Akim Demaille <akim@epita.fr>
20058
20059 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20060 * config/prev-version.txt, config/move-if-change: New.
20061 * Makefile.am: Adjust.
20062
3419715d
AD
200632001-07-08 Pascal Bart <pascal.bart@epita.fr>
20064
20065 * src/bison.simple (yyparse): Suppress warning `comparaison
20066 between signed and unsigned'.
20067
62ab6972
AD
200682001-07-05 Pascal Bart <pascal.bart@epita.fr>
20069
20070 * src/getargs.h (raw_flag): Remove.
20071 * src/getargs.c: Die on `-r'/`--raw'.
20072 * src/lex.c (parse_percent_token): Die on `%raw'.
20073 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20074 * tests/calc.at: Suppress test with option `--raw'.
20075
1e24cc5b
AD
200762001-07-14 Akim Demaille <akim@epita.fr>
20077
20078 * config/: New.
20079 * configure.in: Require Autoconf 2.50.
20080 Update to gettext 0.10.38.
20081
32dfccf8
AD
200822001-03-16 Akim Demaille <akim@epita.fr>
20083
20084 * doc/bison.texinfo: ANSIfy the examples.
20085
cd5bd6ac
AD
200862001-03-16 Akim Demaille <akim@epita.fr>
20087
20088 * getargs.c (skeleton): New variable.
20089 (longopts): --skeleton is a new option.
20090 (shortopts, getargs): -S is a new option.
20091 * getargs.h: Declare skeleton.
20092 * output.c (output_parser): Use it.
20093
5141b016
AD
200942001-03-16 Akim Demaille <akim@epita.fr>
20095
20096 * m4/strerror_r.m4: New.
20097 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20098 * lib/error.h, lib/error.c: Update.
20099
447992b9
AD
201002001-03-16 Akim Demaille <akim@epita.fr>
20101
20102 * src/getargs.c (longopts): Clean up.
20103
274d42ce
AD
201042001-02-21 Akim Demaille <akim@epita.fr>
20105
20106 * src/reader.c (gensym): `gensym_count' is your own.
20107 Use a static buf to create the symbol name, as token_buffer is no
20108 longer a buffer.
20109
22c821f3
AD
201102001-02-08 Akim Demaille <akim@epita.fr>
20111
20112 * src/conflicts.c (conflict_report): Be sure not to append to res
20113 between two calls, which could happen if both first sprintf were
20114 skipped, but not the first cp += strlen.
20115
18569462
AD
201162001-02-08 Akim Demaille <akim@epita.fr>
20117
20118 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20119 New, from fileutils 4.0.37.
20120 * configure.in: Require Autoconf 2.49c. I took some time before
20121 making this decision. This is the only way out for portability
20122 issues in Bison, it would mean way too much duplicate effort to
20123 import in Bison features implemented in 2.49c since 2.13.
20124 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20125
0d8f3c8a
AD
201262001-02-02 Akim Demaille <akim@epita.fr>
20127
20128 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 20129 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 20130
f17bcd1f
AD
201312001-01-19 Akim Demaille <akim@epita.fr>
20132
20133 Get rid of the ad hoc handling of token_buffer in the scanner: use
20134 the obstacks.
20135
20136 * src/lex.c (token_obstack): New.
20137 (init_lex): Initialize it. No longer call...
20138 (grow_token_buffer): this. Remove it.
20139 Adjust all the places which used it to use the obstack.
20140
511e79b3
AD
201412001-01-19 Akim Demaille <akim@epita.fr>
20142
20143 * src/lex.h: Rename all the tokens:
20144 s/\bENDFILE\b/tok_eof/g;
20145 s/\bIDENTIFIER\b/tok_identifier/g;
20146 etc.
20147 Let them be enums, not #define, to ease debugging.
20148 Adjust all the code.
20149
0d6508ef
AD
201502001-01-18 Akim Demaille <akim@epita.fr>
20151
20152 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20153 * src/lex.c (maxtoken, grow_token_buffer): Static.
20154
6deb4447
AD
201552001-01-18 Akim Demaille <akim@epita.fr>
20156
20157 Since we now use obstacks, more % directives can be enabled.
20158
20159 * src/lex.c (percent_table): Also accept `%yacc',
20160 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20161 `%debug'.
20162 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20163 instead of returning a token.
20164 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20165 * src/reader.c (read_declarations): Adjust.
20166 * src/files.c (open_files): Don't call `compute_base_names', don't
20167 compute `attrsfile' since they depend upon data which might be
20168 *in* the input file now.
20169 (output_files): Do it here.
20170 * src/output.c (output_headers): Document the fact that this patch
20171 introduces a guaranteed SEGV for semantic parsers.
20172 * doc/bison.texinfo: Document them.
20173 * tests/suite.at: Exercise these %options.
20174
ff4423cc
AD
201752000-12-20 Akim Demaille <akim@epita.fr>
20176
20177 Also handle the output file (--verbose) with obstacks.
20178
20179 * files.c (foutput): Remove.
20180 (output_obstack): New.
20181 Adjust all dependencies.
20182 * src/conflicts.c: Return a string.
20183 * src/system.h (obstack_grow_string): Rename as...
20184 (obstack_sgrow): this. Be ready to work with non literals.
20185 (obstack_fgrow4): New.
20186
956dba3a
AD
201872000-12-20 Akim Demaille <akim@epita.fr>
20188
20189 * src/files.c (open_files): Fix the computation of short_base_name
20190 in the case of `-o foo.tab.c'.
20191
337bab46
AD
201922000-12-20 Akim Demaille <akim@epita.fr>
20193
20194 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20195 (copy_dollar): Now that everything uses obstacks, get rid of the
20196 FILE * parameters.
20197
5d3214b8
AD
201982000-12-20 Akim Demaille <akim@epita.fr>
20199
20200 * src/files.c (open_files): Actually the `.output' file is based
20201 on the short_base_name, not base_name.
20202 * tests/suite.at (Checking output file names): Adjust.
20203
29092a57
AD
202042000-12-20 Akim Demaille <akim@epita.fr>
20205
20206 * src/bison.s1: Remove, we now use directly...
20207 * src/bison.simple: this.
20208 * src/Makefile.am: Use pkgdata instead of data.
20209
ea5607fd
AD
202102000-12-20 Akim Demaille <akim@epita.fr>
20211
20212 * src/files.c (guard_obstack): New.
20213 (open_files): Initialize it.
20214 (output_files): Dump it...
20215 * src/files.h: Export it.
20216 * src/reader.c (copy_guard): Use it.
20217
27110317
AD
202182000-12-19 Akim Demaille <akim@epita.fr>
20219
20220 * src/files.c (outfile, defsfile, actfile): Removed as global
20221 vars.
20222 (open_files): Don't compute them.
20223 (output_files): Adjust.
20224 (base_name, short_base_name): Be global.
20225 Adjust dependencies.
20226
19c50364
AD
202272000-12-19 Akim Demaille <akim@epita.fr>
20228
20229 * src/files.c (strsuffix): New.
20230 (stringappend): Be just like strcat but allocate.
20231 (base_names): Eve out from open_files.
20232 Try to simplify the rather hairy computation of base_name and
20233 short_base_name.
20234 (open_files): Use it.
20235 * tests/suite.at (Checking output file names): New test.
20236
573c1d9f
AD
202372000-12-19 Akim Demaille <akim@epita.fr>
20238
20239 * src/system.h (obstack_grow_literal_string): Rename as...
20240 (obstack_grow_string): this.
20241 * src/output.c (output_parser): Recognize `%% actions' instead of
20242 `$'.
20243 * src/bison.s1: s/$/%% actions/.
20244 * src/bison.hairy: Likewise.
20245
ef7ddedd
AD
202462000-12-19 Akim Demaille <akim@epita.fr>
20247
20248 * src/output.c (output_parser): Compute the `#line' lines when
20249 there are.
20250 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20251 Suggested by Hans Aberg.
20252
ff61dabd
AD
202532000-12-19 Akim Demaille <akim@epita.fr>
20254
20255 Let the handling of the skeleton files be local to the procedures
20256 that use it.
20257
20258 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20259 longer static.
20260 (fparser, open_extra_files): Remove.
20261 (open_files, output_files): Don't take care of fparser.
20262 * src/files.h: Adjust.
20263 * src/output.c (output_parser): Open and close the file to the
20264 skeleton.
20265 * src/reader.c (read_declarations): When %semantic_parser, open
20266 fguard.
20267
55b96341
AD
202682000-12-19 Akim Demaille <akim@epita.fr>
20269
20270 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20271 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20272
358c15b7
AD
202732000-12-19 Akim Demaille <akim@epita.fr>
20274
20275 * src/files.c (open_files): Yipee! We no longer need all the code
20276 looking for `/tmp' since we have no tmp file.
20277
7de3329e
AD
202782000-12-19 Akim Demaille <akim@epita.fr>
20279
20280 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20281 New macros.
20282 * src/files.c (open_files): Less dependency on MSDOS etc.
20283
3abcd459
AD
202842000-12-14 Akim Demaille <akim@epita.fr>
20285
20286 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20287 Provide a default definition.
20288 Use it when executing the default @ action.
20289 * src/reader.c (reader_output_yylsp): No longer include
20290 `timestamp' and `text' in the default YYLTYPE.
20291
2a91a95e
AD
202922000-12-12 Akim Demaille <akim@epita.fr>
20293
20294 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20295 (copy_guard): Quote the file names.
20296 Reported by Laurent Mascherpa.
20297
14d3eb9b
AD
202982000-12-12 Akim Demaille <akim@epita.fr>
20299
20300 * src/output.c (output_headers, output_program, output): Be sure
20301 to escape special characters when outputting filenames.
20302 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20303 (output_headers): Don't depend on them, Use ACTSTR.
20304
d7045ec6
AD
203052000-11-17 Akim Demaille <akim@epita.fr>
20306
20307 * lib/obstack.h: Formatting changes.
20308 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20309 prevents type checking.
20310 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20311 cast the value to (void *): assigning a `foo *' to a `void *'
20312 variable is valid.
20313 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20314 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20315 append characters.
20316
6fd54b73
AD
203172000-11-17 Akim Demaille <akim@epita.fr>
20318
20319 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20320 as...
20321 (suite.m4, regression.m4, calc.m4): these.
20322 * tests/atgeneral.m4: Update from CVS Autoconf.
20323
4c50eae6
AD
203242000-11-17 Akim Demaille <akim@epita.fr>
20325
20326 * tests/regression.m4 (%union and --defines): New test,
20327 demonstrating a current bug in the obstack implementation.
20328
a35f64ea
AD
203292000-11-17 Akim Demaille <akim@epita.fr>
20330
20331 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20332 macros.
20333 Use them to declare the variables which are global or local to
20334 `yyparse'.
20335
7de23534
AD
203362000-11-17 Akim Demaille <akim@epita.fr>
20337
20338 * acconfig.h: Remove, no longer used.
20339
aa7815f5
AD
203402000-11-07 Akim Demaille <akim@epita.fr>
20341
20342 * src: s/Copyright (C)/Copyright/g.
20343
5af1f549
AD
203442000-11-07 Akim Demaille <akim@epita.fr>
20345
20346 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20347 defining.
20348 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20349
553e2b22
AD
203502000-11-07 Akim Demaille <akim@epita.fr>
20351
20352 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20353 Merge in a single CPP if/else.
20354
8a4f41d6
AD
203552000-11-07 Akim Demaille <akim@epita.fr>
20356
20357 * src/output.c (output): Remove useless variables.
20358 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20359 argument `data' for consistency with the prototypes.
20360 Qualify it `const'.
20361 (obstack_copy, obstack_copy0): Rename the second argument as
20362 `address' for consistency. Qualify it `const'.
20363 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20364 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20365 `const' their input argument (`data' or `address').
20366 Adjust the corresponding macros to include `const' in casts.
20367
095a3fb5
AD
203682000-11-03 Akim Demaille <akim@epita.fr>
20369
20370 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20371 s/PFILE1/BISON_HAIRY/.
20372 Adjust dependencies.
20373
d1cdce7c
AD
203742000-11-03 Akim Demaille <akim@epita.fr>
20375
090c5ebf 20376 For some reason, this was not applied.
d1cdce7c
AD
20377
20378 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20379 `unlink': it's no longer used.
20380
9311529b
AD
203812000-11-03 Akim Demaille <akim@epita.fr>
20382
20383 * src/files.c (skeleton_find): New function, eved out of...
20384 (open_files, open_extra_files): here.
20385
d8880f69
AD
203862000-11-03 Akim Demaille <akim@epita.fr>
20387
20388 Don't use `atexit'.
20389
20390 * src/files.c (obstack_save): New function.
20391 (done): Rename as...
20392 (output_files): this.
20393 Use `obstack_save'.
20394 * src/main.c (main): Don't use `atexit' to register `done', since
20395 it no longer has to remove tmp files, just call `output_files'
20396 when there are no errors.
20397
0dbb648e
AD
203982000-11-02 Akim Demaille <akim@epita.fr>
20399
20400 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20401 `unlink': it's no longer used.
20402 * src/files.h: Formatting changes.
20403
896fe5c1
AD
204042000-11-02 Akim Demaille <akim@epita.fr>
20405
20406 Remove the last uses of mktemp and unlink/delete.
20407
20408 * src/files.c (fdefines, ftable): Removed.
20409 (defines_ostack, table_obstack): New.
20410 Adjust dependencies of the former into uses of the latter.
20411 * src/output.c (output_short_or_char_table, output_short_table):
20412 Convert to using obstacks.
20413 * src/reader.c (copy_comment2): Accept one FILE * and two
20414 obstacks.
20415 (output_token_defines, reader_output_yylsp): Use obstacks.
20416 * src/system.h (obstack_fgrow3): New.
1f65350a 20417 * po/POTFILES.in: Adjust.
896fe5c1 20418
dd60faec
AD
204192000-11-01 Akim Demaille <akim@epita.fr>
20420
20421 Change each use of `fattrs' into a use of `attrs_obstack'.
20422
20423 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20424 * src/files.c (fattrs): Remove.
20425 (attrs_obstack): New.
20426 Adjust all dependencies.
20427 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20428
8c7ebe49
AD
204292000-11-01 Akim Demaille <akim@epita.fr>
20430
20431 Introduce obstacks.
20432 Change each use of `faction' into a use of `action_obstack'.
20433
20434 * lib/obstack.h, lib/obstack.c: New files.
20435 * src/files.c (faction): Remove.
20436 (action_obstack): New.
20437 Adjust all dependencies.
20438
77aee789
AD
204392000-10-20 Akim Demaille <akim@epita.fr>
20440
20441 * lib/quote.h (PARAMS): New macro. Use it.
20442
43591cec
AD
204432000-10-16 Akim Demaille <akim@epita.fr>
20444
20445 * src/output.c (output_short_or_char_table): New function.
20446 (output_short_table, output_token_translations): Use it.
20447 (goto_actions): Use output_short_table.
20448
1e9798d5
AD
204492000-10-16 Akim Demaille <akim@epita.fr>
20450
20451 * src/symtab.c (bucket_new): New function.
20452 (getsym): Use it.
20453
20454 * src/output.c (output_short_table): New argument to display the
20455 comment associated with the table.
20456 Adjust dependencies.
20457 (output_gram): Use it.
20458 (output_rule_data): Nicer output layout for YYTNAME.
20459
f282676b
AD
204602000-10-16 Akim Demaille <akim@epita.fr>
20461
20462 * src/lex.c (read_typename): New function.
20463 (lex): Use it.
20464 * src/reader.c (copy_dollar): Likewise.
20465
550a72a3
AD
204662000-10-16 Akim Demaille <akim@epita.fr>
20467
20468 * src/reader.c (copy_comment2): Expect the input stream to be on
20469 the `/' which is suspected to open a comment, instead of being
20470 called after `//' or `/*' was read.
20471 (copy_comment, copy_definition, parse_union_decl, copy_action)
20472 (copy_guard): Adjust.
20473
131e2fef
AD
204742000-10-16 Akim Demaille <akim@epita.fr>
20475
20476 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20477 `read_signed_integer'.
20478
79282c5a
AD
204792000-10-16 Akim Demaille <akim@epita.fr>
20480
20481 * src/reader.c (copy_dollar): New function.
20482 (copy_guard, copy_action): Use it.
20483
ff4a34be
AD
204842000-10-16 Akim Demaille <akim@epita.fr>
20485
20486 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20487 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20488 New files, from Fileutils 4.0.27.
20489 * src/main.c (printable_version): Remove.
20490 * src/lex.c, src/reader.c: Use `quote'.
20491
204922000-10-04 Akim Demaille <akim@epita.fr>
20493
20494 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20495
14ded682
AD
204962000-10-04 Akim Demaille <akim@epita.fr>
20497
20498 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20499
8e03724b
AD
205002000-10-04 Akim Demaille <akim@epita.fr>
20501
20502 When a literal string is used to define two different tokens,
20503 `bison -v' segfaults.
20504 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20505
20506 * tests/regression.m4: New file.
20507 Include the core of the sample provided by Piotr Gackiewicz.
20508 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20509 properly.
20510
a9e64249
AD
205112000-10-04 Akim Demaille <akim@epita.fr>
20512
20513 * src/reader.c (parse_expect_decl): Keep `count' within the size
20514 of `buffer'.
20515 From Neil Booth.
20516
da9abf43
AD
205172000-10-02 Paul Eggert <eggert@twinsun.com>
20518
20519 * bison.s1 (yyparse): Assign the default value
20520 unconditionally, to avoid a GCC warning and make the parser a
20521 tad smaller.
20522
c33638bb
AD
205232000-10-02 Akim Demaille <akim@epita.fr>
20524
20525 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20526 options.
20527
444c570a
AD
205282000-10-02 Akim Demaille <akim@epita.fr>
20529
20530 * src/derives.c, src/print.c, src/reduce.c: To ease the
20531 translation, move some `\n' out of the translated strings.
20532
89cab50d
AD
205332000-10-02 Akim Demaille <akim@epita.fr>
20534
20535 The location tracking mechanism is precious for parse error
20536 messages. Nevertheless, it is enabled only when `@n' is used in
20537 the grammar, which is a different issue (you can use it in error
20538 message, but not in the grammar per se). Therefore, there should
20539 be another means to enable it.
20540
20541 * src/getargs.c (getargs): Support `--locations'.
20542 (usage): Report it.
20543 * src/getargs.h (locationsflag): Export it.
20544 * src/lex.c (percent_table): Support `%locations'.
20545 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20546 with `locationsflag'.
20547 * doc/bison.texinfo: Document `--locations' and `%locations'.
20548 Sort the options.
20549 * tests/calc.m4: Test it.
20550
20551 For regularity of the names, replace each
20552 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20553 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20554 In addition replace each `flag' with `_flag'.
20555
d6c2cba0
AD
205562000-10-02 Akim Demaille <akim@epita.fr>
20557
20558 Also test parse error messages, including with YYERROR_VERBOSE.
20559
20560 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20561 associative).
20562 Use it to check the computations.
20563 Use it to check `nonassoc' is honored.
20564 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20565 `--yyerror-verbose'.
20566 (_AT_CHECK_CALC): Adjust to this option.
20567 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20568
5a35a6cb
AD
205692000-10-02 Akim Demaille <akim@epita.fr>
20570
20571 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20572 the latter demonstrates a flaw in the handling of non debugging
20573 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20574 was used in order to simplify:
20575
20576 #if YYDEBUG
20577 if (yydebug)
20578 {
20579 ...
20580 }
20581 #endif
20582
20583 into
20584
20585 if (yydebug)
20586 {
20587 ...
20588 }
20589
20590 unfortunately this leads to a CPP conflict when
20591 `--name-prefix=foo' is used since it produces `#define yydebug
20592 foodebug'.
20593
20594 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20595 (YYDPRINTF): New macro.
20596 Spread its use.
20597 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20598 the bison options.
20599 Also test `--verbose', `--defines' and `--name-prefix'.
20600
71da9eea
AD
206012000-10-02 Akim Demaille <akim@epita.fr>
20602
20603 Improve the readability of the produced parsers.
20604
20605 * src/bison.s1: Formatting changes.
20606 Improve the comment related to the `$' mark.
20607 (yydefault): Don't fall through to `yyresume': `goto' there.
20608 * src/output.c (output_parser): When the `$' is met, skip the end
20609 of its line.
20610 New variable, `number_of_dollar_signs', to check there's exactly
20611 one `$' in the parser skeleton.
20612
95e36146
AD
206132000-10-02 Akim Demaille <akim@epita.fr>
20614
20615 * lib/xstrdup.c: New file, from the fileutils.
20616 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20617 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20618 instead of strlen + xmalloc + strcpy.
20619 * src/symtab.c (copys): Remove, use xstrdup instead.
20620
d7020c20
AD
206212000-10-02 Akim Demaille <akim@epita.fr>
20622
20623 * src/gram.h (associativity): New enum type which replaces the
20624 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20625 `right_assoc', `left_assoc' and `non_assoc'.
20626 Adjust all dependencies.
20627 * src/reader.c: Formatting changes.
20628 (LTYPESTR): Don't define it, use it as a literal in
20629 `reader_output_yylsp'.
20630 * src/symtab.h (symbol_class): New enum type which replaces the
20631 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20632 `sunknown', `stoken and `snterm'.
20633
1916f98e
AD
206342000-10-02 Akim Demaille <akim@epita.fr>
20635
20636 * src/getargs.c (fixed_outfiles): Rename as...
20637 (yaccflag): for consistency and accuracy.
20638 Adjust dependencies.
20639
d7913476
AD
206402000-10-02 Akim Demaille <akim@epita.fr>
20641
20642 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20643 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20644 difficult and introduced a lot of core dump. It turns out that
20645 Bison used an implementation of `xmalloc' based on `calloc', and
20646 at various places it does depend upon the initialization to 0. I
20647 have not tried to isolate the pertinent places, and all the former
20648 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20649 someone should address this issue.
20650
20651 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20652 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20653 files.
20654 Adjust dependencies.
20655 * src/warshall.h: New file.
20656 Propagate.
20657
340ef489
AD
206582000-10-02 Akim Demaille <akim@epita.fr>
20659
20660 Various anti-`extern in *.c' changes.
20661
20662 * src/system.h: Include `assert.h'.
20663
b2ca4022
AD
206642000-10-02 Akim Demaille <akim@epita.fr>
20665
20666 * src/state.h (nstates, final_state, first_state, first_shift)
20667 (first_reduction): Move their exportation from here...
20668 * src/LR0.h: to here.
20669 Adjust dependencies.
20670 * src/getargs.c (statisticsflag): New variable.
20671 Add support for `--statistics'.
20672 Adjust dependencies.
20673
20674 Remove a lot of now useless `extern' statements in most files.
20675
403b315b
AD
206762000-10-02 Akim Demaille <akim@epita.fr>
20677
20678 * src/LR0.h: New file.
20679 Propagate its use.
20680
07a58c13
AD
206812000-10-02 Akim Demaille <akim@epita.fr>
20682
20683 * src/print.h: New file.
20684 Propagate its use.
20685 * src/print.c: Formatting and ordering changes.
20686 (verbose, terse): Replace with...
20687 (print_results): this new function.
20688 Adjust dependencies.
20689
0619caf0
AD
206902000-10-02 Akim Demaille <akim@epita.fr>
20691
20692 * src/conflicts.c (conflict_report): New function.
20693 (conflict_log, verbose_conflict_log): Replace with...
20694 (print_conflicts): this function.
20695 Adjust dependencies.
20696 * src/conflicts.h: New file.
20697 Propagate its inclusion.
20698
3519ec76
AD
206992000-10-02 Akim Demaille <akim@epita.fr>
20700
20701 * src/nullable.h: New file.
20702 Propagate its inclusion.
20703 * src/nullable.c: Formatting changes.
20704
015acc48
AD
207052000-10-02 Akim Demaille <akim@epita.fr>
20706
20707 * src/reduce.h: New file.
20708 Propagate its inclusion.
20709 * src/reduce.c: Topological sort and other formatting changes.
20710 (bool, TRUE, FALSE): Move their definition to...
20711 * src/system.h: here.
20712
8963a27b
AD
207132000-10-02 Akim Demaille <akim@epita.fr>
20714
20715 * src/files.c: Formatting changes.
20716 (tryopen, tryclose, openfiles): Rename as...
20717 (xfopen, xfclose, open_files): this.
20718 (stringappend): static.
20719 * src/files.h: Complete the list of exported symbols.
20720 Propagate its use.
20721
a70083a3
AD
207222000-10-02 Akim Demaille <akim@epita.fr>
20723
20724 * src/reader.h: New file.
20725 Propagate its use instead of tedious list of `extern' and
20726 prototypes.
20727 * src/reader.c: Formatting changes, topological sort,
20728 s/register//.
20729
abadc117
AD
207302000-10-02 Akim Demaille <akim@epita.fr>
20731
20732 * src/lex.h: Prototype `lex.c' exported functions.
20733 * src/reader.c: Adjust.
20734 * src/lex.c: Formatting changes.
20735 (safegetc): Rename as...
20736 (xgetc): this.
20737
720d742f
AD
207382000-10-02 Akim Demaille <akim@epita.fr>
20739
20740 * src/lalr.h: New file.
20741 Propagate its inclusion instead of prototypes and `extern'.
20742 * src/lalr.c: Formatting changes, topological sorting etc.
20743
f2acea59
AD
207442000-10-02 Akim Demaille <akim@epita.fr>
20745
20746 * src/output.c (token_actions): Introduce a temporary array,
20747 YYDEFACT, that makes it possible for this function to use
20748 output_short_table.
20749
d019d655
AD
207502000-10-02 Akim Demaille <akim@epita.fr>
20751
20752 `user_toknums' is output as a `short[]' in `output.c', while it is
20753 defined as a `int[]' in `reader.c'. For consistency with the
20754 other output tables, `user_toknums' is now defined as a table of
20755 shorts.
20756
20757 * src/reader.c (user_toknums): Be a short table instead of an int
20758 table.
20759 Adjust dependencies.
20760
20761 Factor the short table outputs.
20762
20763 * src/output.c (output_short_table): New function.
20764 * src/output.c (output_gram, output_stos, output_rule_data)
20765 (output_base, output_table, output_check): Use it.
20766
6c89f1c1
AD
207672000-10-02 Akim Demaille <akim@epita.fr>
20768
20769 * src/output.c (output): Topological sort of the functions, in
20770 order to get rid of the `static' prototypes.
20771 No longer use `register'.
20772 * src/output.h: New file.
20773 Propagate its inclusion in files explicitly prototyping functions
20774 from output.c.
20775
d9efd181
AD
207762000-09-21 Akim Demaille <akim@epita.fr>
20777
20778 * src/atgeneral.m4: Update from Autoconf.
20779
c29240e7 207802000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
20781
20782 * src/closure.h: New file.
20783 * src/closure.c: Formatting changes, topological sort over the
20784 functions, use of closure.h.
20785 (initialize_closure, finalize_closure): Rename as...
20786 (new_closure, free_closure): these. Adjust dependencies.
20787 * src/LR0.c: Formatting changes, topological sort, use of
20788 cloture.h.
20789 (initialize_states): Rename as...
20790 (new_states): this.
20791 * src/Makefile.am (noinst_HEADERS): Adjust.
20792
499daa50
AD
207932000-09-20 Akim Demaille <akim@epita.fr>
20794
20795 * src/acconfig.h: Don't protect config.h against multiple
20796 inclusion.
20797 Don't define PARAMS.
20798 * src/system.h: Define PARAMS.
20799 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20800 purpose of config.h. system.h must not try to fix wrong
20801 definitions in config.h.
20802
cc84fd5d
AD
208032000-09-20 Akim Demaille <akim@epita.fr>
20804
20805 * src/derives.h: New file.
20806 * src/main.c, src/derives.h: Use it.
20807 Formatting changes.
20808 * src/Makefile.am (noinst_HEADERS): Adjust.
20809
db5b3a89
AD
208102000-09-20 Akim Demaille <akim@epita.fr>
20811
20812 * tests/atgeneral.m4: Update from Autoconf.
20813 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20814 (AT_CHECK_CALC): New macros.
20815 Use these macros to test bison with options `', `--raw',
20816 `--debug', `--yacc', `--yacc --debug'.
20817
ceed8467
AD
208182000-09-19 Akim Demaille <akim@epita.fr>
20819
20820 * src/output.c: Formatting changes.
20821 * src/machine.h: Remove, leaving its contents in...
20822 * src/system.h: here.
20823 Include stdio.h.
20824 Adjust all dependencies on stdio.h and machine.h.
20825 * src/getargs.h: New file.
20826 Let all `extern' declarations about getargs.c be replaced with
20827 inclusion of `getargs.h'.
20828 * src/Makefile.am (noinst_HEADERS): Adjust.
20829
20830 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20831 scope.
20832 (yyerror): Returns void, not int.
20833 * doc/bison.texinfo: Formatting changes.
20834
05a1d24b
AD
208352000-09-19 Akim Demaille <akim@epita.fr>
20836
20837 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20838 portable.
20839
cbd25751
AD
208402000-09-18 Akim Demaille <akim@epita.fr>
20841
20842 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20843 * src/Makefile.am (INCLUDES): Don't.
20844 Be ready to fetch headers in lib/.
20845
13863333
AD
208462000-09-18 Akim Demaille <akim@epita.fr>
20847
20848 * doc/bison.texinfo: Update the copyright.
20849 ANSIfy and GNUify the examples.
20850 Remove the old menu.
20851
0d533154
AD
208522000-09-18 Akim Demaille <akim@epita.fr>
20853
20854 First set of tests: use the `calc' example from the documentation.
20855
20856 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20857 is defined only when YYDEBUG is.
20858 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20859 * src/files.c (tryopen, tryclose): Formatting changes.
20860 Move to the top and be static.
20861 * src/reader.c (read_signed_integer): Likewise.
20862 * tests/calc.m4: New file.
20863 * Makefile.am, suite.m4: Adjust.
20864 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20865
e79137ac
AD
208662000-09-18 Akim Demaille <akim@epita.fr>
20867
20868 Add support for an Autotest test suite for Bison.
20869
20870 * m4/m4.m4, m4/atconfig.m4: New files.
20871 * m4/Makefile.am (EXTRA_DIST): Adjust.
20872 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
20873 files.
20874 * src/getargs.c: Display a more standard --version message.
20875 * src/reader.c (reader): Formatting changes.
20876 No longer depend upon VERSION_STRING.
20877 * configure.in: No longer use `dnl'.
20878 Set up the test suite and the new directory `tests/.
20879 (VERSION_STRING): Remove.
20880
27821bff
AD
208812000-04-14 Akim Demaille <akim@epita.fr>
20882
20883 * src/reader.c (copy_comment2): New function, same as former
20884 `copy_comment', but outputs into two FILE *.
20885 (copy_comment): Use it.
20886 (parse_union_decl): Use it.
20887 (get_type, parse_start_decl): Use the same `invalid' message.
20888 (parse_start_decl, parse_union_decl): Use the same `multiple'
20889 message.
20890 (parse_union_decl, copy_guard, copy_action): Use the same
20891 `unmatched' message.
20892 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
20893
cfe5fbc0
AD
208942000-03-31 Akim Demaille <akim@epita.fr>
20895
20896 * src/files.c (tryopen, tryclose): Move to the top.
20897 Be static.
20898
cb7db13e
AD
208992000-03-31 Akim Demaille <akim@epita.fr>
20900
20901 * src/main.c (main): Don't call `done', exit does it.
20902
a0f6b076
AD
209032000-03-31 Akim Demaille <akim@epita.fr>
20904
36281465
AD
20905 * allocate.c: s/return (foo)/return foo/.
20906 * lalr.c: Likewise.
20907 * LR0.c: Likewise.
20908 * output.c: Likewise.
20909 * reader.c: Likewise.
20910 * symtab.c: Likewise.
20911 * vmsgetargs.c: Likewise.
20912
209132000-03-31 Akim Demaille <akim@epita.fr>
20914
20915 Clean up the error reporting functions.
a0f6b076
AD
20916
20917 * src/report.c: New file.
20918 * src/report.h: Likewise.
20919 * src/Makefile.am: Adjust.
20920 * m4/error.m4: New file.
20921 * m4/Makefile.am: Adjust.
20922 * configure.in (jm_PREREQ_ERROR): Call it.
20923 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
20924 Remove.
20925 (fatal, fatals): Remove. All callers use complain.c::fatal.
20926 (warn, warni, warns, warnss, warnss): Remove. All callers use
20927 complain.c::complain.
20928 (toomany): Remove, use fatal instead.
20929 * src/files.c (done): No argument, use complain_message_count.
20930 * src/main.c (main): Register `done' to `atexit'.
20931
20932 * src/getargs.c (usage): More `fputs', less `fprintf'.
20933
18539825
AD
209342000-03-28 Akim Demaille <akim@epita.fr>
20935
20936 * lib/: New directory.
20937 * Makefile.am (SUBDIRS): Adjust.
20938 * configure.in: Adjust.
20939 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
20940 useless.
20941 * src/alloca.c: Moved to lib/.
20942 * src/getopt.c: Likewise.
20943 * src/getopt1.c: Likewise.
20944 * src/getopt.h: Likewise.
20945 * src/ansi2knr.c: Likewise.
20946 * src/ansi2knr.1: Likewise.
20947 * src/Makefile.am: Adjust.
20948 * lib/Makefile.am: New file.
20949
9f306f2a
AD
209502000-03-28 Akim Demaille <akim@epita.fr>
20951
20952 * src/getargs.c (usage): Refresh the help message.
20953
0ba347b6
AD
209542000-03-17 Akim Demaille <akim@epita.fr>
20955
20956 * src/getopt1.c: Updated from textutils 2.0e
20957 * src/getopt.c: Likewise.
20958 * src/getopt.h: Likewise.
20959
dbe7f271
AD
209602000-03-17 Akim Demaille <akim@epita.fr>
20961
20962 * src/Makefile.am (bison.simple): Fix the awk program: quote only
20963 the file name, not the whole `#line LINE FILE'.
20964
75bbe78d
AD
209652000-03-17 Akim Demaille <akim@epita.fr>
20966
20967 On syntax errors, report the token on which we choked.
20968
aa5fd0ee
AD
20969 * src/bison.s1 (yyparse): In the label yyerrlab, when
20970 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 20971
7b306f52
AD
209722000-03-17 Akim Demaille <akim@epita.fr>
20973
aa5fd0ee 20974 * src/reader.c (copy_at): New function.
7b306f52
AD
20975 (copy_guard): Use it.
20976 (copy_action): Use it.
20977
e87b5700
AD
209782000-03-17 Akim Demaille <akim@epita.fr>
20979
20980 Be kind to translators, save some useless translations.
20981
aa5fd0ee 20982 * src/main.c (banner): New function.
e87b5700
AD
20983 (fatal_banner): Use it.
20984 (warn_banner): Use it.
20985
ae3c3164
AD
209862000-03-17 Akim Demaille <akim@epita.fr>
20987
aa5fd0ee
AD
20988 * src/reader.c (copy_definition): Use copy_string and
20989 copy_comment. Removed now unused `match', `ended',
20990 `cplus_comment'.
ae3c3164
AD
20991 (copy_comment, copy_string): Moved, to be visible from
20992 copy_definition.
20993
4dc58e7c
AD
209942000-03-17 Akim Demaille <akim@epita.fr>
20995
aa5fd0ee
AD
20996 * src/reader.c (copy_string): Declare `static inline'. No
20997 problems with inline, since it is checked by configure.
4dc58e7c
AD
20998 (copy_comment): Likewise.
20999
0a6384c4
AD
210002000-03-17 Akim Demaille <akim@epita.fr>
21001
aa5fd0ee 21002 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 21003
3cef001a
AD
210042000-03-17 Akim Demaille <akim@epita.fr>
21005
aa5fd0ee 21006 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
21007 (copy_action): Use it. Removed now unused `match', `ended',
21008 `cplus_comment'.
21009 (copy_guard): Likewise.
21010
ca36d2ef
AD
210112000-03-17 Akim Demaille <akim@epita.fr>
21012
aa5fd0ee 21013 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
21014 (copy_action): Use it.
21015 (copy_guard): Likewise.
21016
6666f98f
AD
210172000-03-17 Akim Demaille <akim@epita.fr>
21018
21019 Change the handling of @s so that they behave exactly like $s.
21020 There is now a pseudo variable @$ (readble and writable), location
21021 of the lhs of the rule (by default ranging from the location of
21022 the first symbol of the rhs, to the location of the last symbol,
21023 or, if the rhs is empty, YYLLOC).
21024
21025 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21026 yyval.
21027 (yyparse): When providing a default semantic action, provide a
21028 default location action.
21029 (after the $): No longer change `*YYLSP', just stack YYLOC the
21030 same way you stack YYVAL.
21031 * src/reader.c (read_declarations): Use warns.
21032 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21033 (copy_action, case '@'): Likewise.
21034 Use a standard error message, to save useless work from
21035 translators.
21036
41aca2e0
AD
210372000-03-17 Akim Demaille <akim@epita.fr>
21038
aa5fd0ee
AD
21039 * src/bison.s1: Formatting and cosmetics changes.
21040 * src/reader.c: Likewise.
41aca2e0
AD
21041 Update the Copyright notice.
21042
dc08c1d5
AD
210432000-03-17 Akim Demaille <akim@epita.fr>
21044
aa5fd0ee
AD
21045 * src/bison.s1 (#line): All set to `#line' only, since the
21046 Makefile now handles them.
dc08c1d5 21047
9ee3c97b
AD
210482000-03-16 Akim Demaille <akim@epita.fr>
21049
21050 * src/output.c (output_rule_data): Output the documentation of
21051 some of the tables.
21052 (Copyright notice): Update.
21053 Formatting changes.
21054
0de741ca
AD
210552000-03-16 Akim Demaille <akim@epita.fr>
21056
21057 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21058 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21059 One `#if YYDEBUG' remains, since it uses variables which are
21060 defined only if `YYDEBUG != 0'.
21061
bb10be54
AD
210622000-03-16 Akim Demaille <akim@epita.fr>
21063
21064 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21065 and related variables so that the similarities are highlighted.
21066
b07b484a
AD
210672000-03-16 Akim Demaille <akim@epita.fr>
21068
21069 * src/bison.s1: Properly indent CPP directives.
21070
361f60b3
AD
210712000-03-16 Akim Demaille <akim@epita.fr>
21072
21073 * src/bison.s1: Properly indent the `alloca' CPP section.
21074
8c44d3ec
AD
210752000-03-16 Akim Demaille <akim@epita.fr>
21076
21077 Do not hard code values of directories in `configure.in'.
21078 Update the `configure' tool chain.
21079
21080 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21081 src/makefile.am.
21082 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21083 (AC_OUTPUT): Add m4/Makefile.
21084 Bump to bison 1.28a, 1.29 has never been released.
21085 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21086 handled via src/Makefile.am.
21087 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21088 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21089 autoheader.
21090 * Makefile.am (SUBDIRS): Add m4.
21091 (ACLOCAL_AM_FLAGS): New variable.
21092 (AUTOMAKE_OPTIONS): Add check-news.
21093 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21094 the proper line number and file name.
21095 (DEFS): Propagate the location of bison library files and of the
21096 locale files.
21097 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21098 builddir.
21099 * acinclude.m4: Remove, replaced by the directory m4.
21100 * m4/Makefile.am (EXTRA_DIST): New variable.
21101 * m4/gettext.m4: New file, from the fileutils.
21102 * m4/lcmessage.m4: Likewise
21103 * m4/progtest.m4: Likewise.
21104 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21105
f95997e7
AD
211062000-03-10 Akim Demaille <akim@epita.fr>
21107
21108 * src/closure.c:
21109 Formatting changes of various comments.
21110 Respect the GNU coding standards at various places.
21111 Don't use `_()' when no translation is needed.
21112
211131999-12-13 Jesse Thilo <jthilo@gnu.org>
21114
21115 * src/files.c:
21116 OS/2 honors TMPDIR environment variable.
21117
211181999-12-13 Jesse Thilo <jthilo@gnu.org>
21119
21120 * doc/bison.texinfo: Tweaked spelling and grammar.
21121 Updated ISBN.
21122 Removed reference to price of printed copy.
21123 Mention BISON_SIMPLE and BISON_HAIRY.
21124
211251999-12-13 Jesse Thilo <jthilo@gnu.org>
21126
21127 * configure.in, NEWS:
21128 Bison 1.29 released.
21129
211301999-10-27 Jesse Thilo <jthilo@gnu.org>
21131
21132 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21133 Added reference card.
21134
211351999-07-26 Jesse Thilo <jthilo@gnu.org>
21136
21137 * po/ru.po: Added Russian translation.
21138
211391999-07-26 Jesse Thilo <jthilo@gnu.org>
21140
21141 * configure.in: Added Russian translation.
21142
211431999-07-06 Jesse Thilo <jthilo@gnu.org>
21144
21145 * configure.in, NEWS, README:
21146 Released version 1.28.
21147
211481999-06-14 Jesse Thilo <jthilo@gnu.org>
21149
21150 * src/system.h:
21151 Squashed redefinition warning on some systems.
21152
21153 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21154 Have configure build version string instead of relying on ANSI string
21155 concatentation.
21156
211571999-06-14 Jesse Thilo <jthilo@gnu.org>
21158
21159 * po/POTFILES.in: Got rid of version.c.
21160
211611999-06-14 Jesse Thilo <jthilo@gnu.org>
21162
21163 * acconfig.h, configure.in:
21164 Have configure build version string instead of relying on ANSI string
21165 concatentation.
21166
211671999-06-08 Jesse Thilo <jthilo@gnu.org>
21168
21169 * doc/bison.1:
21170 Dropped mention of `+' for long-named options.
21171
211721999-05-30 Jesse Thilo <jthilo@gnu.org>
21173
21174 * src/files.c: Added <unistd.h> for unlink().
21175
21176 * src/Makefile.am, src/system.h:
21177 I18n fixes.
21178
211791999-05-30 Jesse Thilo <jthilo@gnu.org>
21180
21181 * README: Added a FAQ list.
21182
21183 * configure.in, acconfig.h:
21184 I18n fixes.
21185
211861999-05-30 Jesse Thilo <jthilo@gnu.org>
21187
21188 * doc/FAQ, doc/Makefile.am:
21189 Added a FAQ list.
21190
211911999-05-19 Jesse Thilo <jthilo@gnu.org>
21192
21193 * src/alloc.h, src/symtab.h, src/version.c:
21194 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21195
211961999-04-18 Jesse Thilo <jthilo@gnu.org>
21197
21198 * src/.cvsignore, src/Makefile.am:
21199 Reorganized: sources in `src', documentation in `doc'.
21200
21201 * src/lex.c (literalchar):
21202 fixed the code for escaping double quotes (thanks
21203 Jonathan Czisny.)
21204
212051999-04-18 Jesse Thilo <jthilo@gnu.org>
21206
21207 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21208 Adjusted paths to reflect directory reorganization.
21209
212101999-04-18 Jesse Thilo <jthilo@gnu.org>
21211
21212 * doc/.cvsignore, doc/Makefile.am:
21213 Reorganized: sources in `src', documentation in `doc'.
21214
212151999-04-18 Jesse Thilo <jthilo@gnu.org>
21216
21217 * configure.in:
21218 Updated AC_INIT file to reflect directory reorganization.
21219
21220 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21221 Reorganized: sources in `src', documentation in `doc'.
21222
212231999-04-13 Jesse Thilo <jthilo@gnu.org>
21224
21225 * src/allocate.c:
21226 Don't declare calloc() and realloc() if not necessary.
21227
212281999-04-13 Jesse Thilo <jthilo@gnu.org>
21229
21230 * configure.in, acconfig.h, acinclude.m4:
21231 Don't declare calloc() and realloc() if not necessary.
21232
212331999-03-23 Jesse Thilo <jthilo@gnu.org>
21234
21235 * po/.cvsignore: Added i18n support.
21236
212371999-03-23 Jesse Thilo <jthilo@gnu.org>
21238
21239 * acconfig.h, configure.in, Makefile.am:
21240 Added i18n support.
21241
212421999-03-22 Jesse Thilo <jthilo@gnu.org>
21243
21244 * src/bison.s1: Fixed #line numbers.
21245
212461999-03-15 Jesse Thilo <jthilo@gnu.org>
21247
21248 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21249 Added PO files from Translation Project.
21250
212511999-03-03 Jesse Thilo <jthilo@gnu.org>
21252
21253 * Makefile.am:
21254 Added support for non-ANSI compilers (ansi2knr).
21255
212561999-02-16 Jesse Thilo <jthilo@gnu.org>
21257
21258 * configure.in: Bumped version number to 1.27.
21259
21260 * Makefile.am:
21261 Added `bison.simple' to list of files removed by `make distclean'.
21262
212631999-02-12 Jesse Thilo <jthilo@gnu.org>
21264
21265 * src/files.c, src/files.h:
21266 Defined locations of parser files in config.h instead of Makefile.
21267
212681999-02-12 Jesse Thilo <jthilo@gnu.org>
21269
21270 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21271 Defined locations of parser files in config.h instead of Makefile.
21272
212731999-02-09 Jesse Thilo <jthilo@gnu.org>
21274
21275 * Makefile.am:
21276 Removed inappropriate use of $< macro.
21277
212781999-02-05 Jesse Thilo <jthilo@gnu.org>
21279
21280 * po/Makefile.in.in, po/POTFILES.in:
21281 Add `po' directory skeleton.
21282
212831999-01-27 Jesse Thilo <jthilo@gnu.org>
21284
21285 * README: Document help-bison list.
21286
21287 * configure.in: Add check for mkstemp().
21288
212891999-01-20 Jesse Thilo <jthilo@gnu.org>
21290
21291 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21292 Hush a few compiler warnings.
21293
21294 * src/files.c:
21295 Add tryclose(), which verifies that fclose was successful.
21296 Hush a couple of compiler warnings.
21297
212981999-01-20 Jesse Thilo <jthilo@gnu.org>
21299
21300 * Makefile.am, OChangeLog:
21301 ChangeLog is now automatically generated. Include the old version as
21302 OChangeLog.
21303
213041999-01-14 Jesse Thilo <jthilo@gnu.org>
21305
21306 * 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:
21307 Update FSF address.
21308
213091999-01-14 Jesse Thilo <jthilo@gnu.org>
21310
21311 * doc/bison.texinfo: Fix formatting glitch.
21312
21313 * doc/bison.texinfo: Update FSF address.
21314
213151999-01-14 Jesse Thilo <jthilo@gnu.org>
21316
21317 * acconfig.h: Update FSF address.
21318
213191999-01-08 Jesse Thilo <jthilo@gnu.org>
21320
21321 * src/system.h:
21322 Don't define PACKAGE here, since config.h defines it.
21323
213241998-12-30 Jesse Thilo <jthilo@gnu.org>
21325
21326 * src/reader.c: Update copyright date.
21327
21328 * src/main.c:
21329 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21330 favor of output directly to stderr (avoids buffer overruns).
21331
21332 * src/reader.c: Some checks for premature EOF.
21333
21334 * 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:
21335 Use prototypes if the compiler understands them.
21336
21337 * src/files.c: Honor TMPDIR on Unix hosts.
21338 Use prototypes if the compiler understands them.
21339
21340 * src/reader.c:
21341 Fix a couple of buffer overrun bugs.
21342 Use prototypes if the compiler understands them.
21343
21344 * src/system.h: Include unistd.h and ctype.h.
21345 Use #ifdef instead of #if for NLS symbols.
21346
213471998-12-30 Jesse Thilo <jthilo@gnu.org>
21348
21349 * doc/bison.texinfo:
21350 Delete comment "consider using @set for edition number, etc..." since
21351 we now are doing so.
21352
213531998-12-30 Jesse Thilo <jthilo@gnu.org>
21354
21355 * configure.in:
21356 Use prototypes if the compiler understands them.
21357
21358 * NEWS: Document 1.26 highlights.
21359
21360 * Makefile.am: Require Automake 1.3 or later.
21361
21362 * acconfig.h:
21363 Use prototypes if the compiler understands them.
21364
213651998-12-29 Jesse Thilo <jthilo@gnu.org>
21366
21367 * src/version.c:
21368 Use VERSION symbol from automake for version number.
21369
213701998-12-29 Jesse Thilo <jthilo@gnu.org>
21371
21372 * acconfig.h, configure.in, version.cin:
21373 Use VERSION symbol from automake for version number.
21374
213751998-11-28 Jesse Thilo <jthilo@gnu.org>
21376
21377 * Makefile.am:
21378 Distribute original version of simple parser (bison.s1), not built
21379 version (bison.simple).
21380
213811998-11-28 Jesse Thilo <jthilo@gnu.org>
21382
21383 * doc/bison.texinfo: Add info dir entry.
21384
21385 * doc/bison.texinfo:
21386 Let automake put version number into documentation.
21387
213881998-11-26 Jesse Thilo <jthilo@gnu.org>
21389
21390 * src/bison.cld, src/build.com, src/vmshlp.mar:
21391 Add non-RCS files from /gd/gnu/bison.
21392
213931998-11-26 Jesse Thilo <jthilo@gnu.org>
21394
21395 * doc/bison.1:
21396 Document the BISON_HAIRY and BISON_SIMPLE variables.
21397
213981998-11-25 Jesse Thilo <jthilo@gnu.org>
21399
21400 * src/version.c: Build version.c automatically.
21401
21402 * src/reader.c:
21403 Fix token numbering (used to start at 258, not 257).
21404
21405 * src/system.h: Include config.h.
21406
21407 * src/getargs.c: Update bug report address.
21408
21409 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21410 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21411
214121998-11-25 Jesse Thilo <jthilo@gnu.org>
21413
21414 * Makefile.am:
21415 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21416
21417 * configure.in, version.cin:
21418 Build version.c automatically.
21419
21420 * AUTHORS: Add AUTHORS file.
21421
21422 * README: Update bug report address.
21423
21424 * bison.simple:
21425 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21426
21427 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21428 Add automake stuff.
21429
214301998-11-25 Jesse Thilo <jthilo@gnu.org>
21431
21432 * doc/bison.texinfo: Clean up some formatting.
21433
214341998-05-05 Richard Stallman <rms@gnu.org>
21435
21436 * doc/bison.texinfo:
21437 Explain better why to make a pure parser.
21438
214391998-01-05 Richard Stallman <rms@gnu.org>
21440
21441 * src/files.c (openfiles):
21442 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21443 find a temporary directory, if possible. Do not unlink files while
21444 they are open.
21445
214461997-08-25 Richard Stallman <rms@gnu.org>
21447
21448 * src/reader.c (stack_offset;):
21449 Change some warni to warns.
21450
21451 * src/lex.c (literalchar): Use warns, not warni.
21452
214531997-06-28 Richard Stallman <rms@gnu.org>
21454
21455 * src/bison.s1: Add a Bison version comment.
21456
21457 * src/main.c (fatal, warn, berror):
21458 Use program_name.
21459
214601997-06-28 Richard Stallman <rms@gnu.org>
21461
21462 * Makefile.in (bison_version): New variable.
21463 (dist): Use that variable.
21464 (bison.s1): Substitute the Bison version into bison.simple.
21465
21466 * bison.simple: Add a Bison version comment.
21467
214681997-06-18 Richard Stallman <rms@gnu.org>
21469
21470 * src/main.c (fatal, warn, berror):
21471 Make error messages standard.
21472 (toomany): Improve error message text.
21473
21474 * 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:
21475 new.h renamed to alloc.h.
21476
214771997-06-18 Richard Stallman <rms@gnu.org>
21478
21479 * Makefile.in: new.h renamed to alloc.h.
21480
214811997-05-24 Richard Stallman <rms@gnu.org>
21482
21483 * src/lex.c (literalchar):
21484 Fix the code for escaping \, " and '.
21485
21486 (lex): Avoid trouble when there are many chars
21487 to discard in a char literal with just several chars in it.
21488
214891997-05-17 Richard Stallman <rms@gnu.org>
21490
21491 * src/bison.s1:
21492 Use malloc, if using alloca is troublesome.
21493 (YYSTACK_USE_ALLOCA): New flag macro.
21494 Define it for some systems and compilers.
21495 (YYSTACK_ALLOC): New macro.
21496 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21497 If it was malloc'd, free it.
21498
214991997-05-17 Richard Stallman <rms@gnu.org>
21500
21501 * bison.simple:
21502 Use malloc, if using alloca is troublesome.
21503 (YYSTACK_USE_ALLOCA): New flag macro.
21504 Define it for some systems and compilers.
21505 (YYSTACK_ALLOC): New macro.
21506 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21507 If it was malloc'd, free it.
21508
215091997-04-23 Richard Stallman <rms@gnu.org>
21510
21511 * src/bison.s1:
21512 (alloca) [__hpux]: Always define as __builtin_alloca.
21513
215141997-04-23 Richard Stallman <rms@gnu.org>
21515
21516 * bison.simple:
21517 (alloca) [__hpux]: Always define as __builtin_alloca.
21518
215191997-04-22 Richard Stallman <rms@gnu.org>
21520
21521 * src/bison.s1:
21522 [__hpux]: Include alloca.h (right for HPUX 10)
21523 instead of declaring alloca (right for HPUX 9).
21524
21525 * src/bison.s1 (__yy_memcpy):
21526 Declare arg `count' as unsigned int.
21527 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21528
215291997-04-22 Richard Stallman <rms@gnu.org>
21530
21531 * bison.simple:
21532 [__hpux]: Include alloca.h (right for HPUX 10)
21533 instead of declaring alloca (right for HPUX 9).
21534
21535 * bison.simple (__yy_memcpy):
21536 Declare arg `count' as unsigned int.
21537 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21538
215391997-01-03 Richard Stallman <rms@gnu.org>
21540
21541 * src/allocate.c: [__STDC__ or _MSC_VER]:
21542 Declare calloc and realloc to return void *.
21543
215441997-01-02 Richard Stallman <rms@gnu.org>
21545
21546 * src/system.h:
21547 [_MSC_VER]: Include stdlib.h and process.h.
21548 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21549
21550 * src/main.c (main): Return FAILURE as a value.
21551 (printable_version): Declare arg as int, not char.
21552
215531997-01-02 Richard Stallman <rms@gnu.org>
21554
21555 * Makefile.in (dist):
21556 Explicitly check for symlinks, and copy them.
21557
215581996-12-19 Richard Stallman <rms@gnu.org>
21559
21560 * src/files.c:
21561 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21562
215631996-12-18 Paul Eggert <eggert@gnu.org>
21564
21565 * src/bison.s1 (yyparse):
21566 If __GNUC__ and YYPARSE_PARAM are both defined,
21567 declare yyparse to have a void * argument.
21568
215691996-12-18 Paul Eggert <eggert@gnu.org>
21570
21571 * bison.simple (yyparse):
21572 If __GNUC__ and YYPARSE_PARAM are both defined,
21573 declare yyparse to have a void * argument.
21574
215751996-12-17 Richard Stallman <rms@gnu.org>
21576
21577 * src/reduce.c (nbits): Add some casts.
21578
215791996-08-12 Richard Stallman <rms@gnu.org>
21580
21581 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21582
215831996-08-12 Richard Stallman <rms@gnu.org>
21584
21585 * bison.simple: Test _MSDOS as well as _MSDOS_.
21586
215871996-07-31 Richard Stallman <rms@gnu.org>
21588
21589 * src/bison.s1:
21590 [__sun && __i386]: Include alloca.h.
21591
215921996-07-31 Richard Stallman <rms@gnu.org>
21593
21594 * bison.simple:
21595 [__sun && __i386]: Include alloca.h.
21596
215971996-07-30 Richard Stallman <rms@gnu.org>
21598
21599 * src/bison.s1: Comment change.
21600
21601 * src/bison.s1: Test _MSDOS_, not MSDOS.
21602
216031996-07-30 Richard Stallman <rms@gnu.org>
21604
21605 * bison.simple: Comment change.
21606
21607 * bison.simple: Test _MSDOS_, not MSDOS.
21608
216091996-06-01 Richard Stallman <rms@gnu.org>
21610
21611 * 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:
21612 Insert `_' macro around many string constants.
21613
21614 * src/main.c:
21615 Insert `_' macro around many string constants.
21616
21617 (main): Call setlocale, bindtextdomain and textdomain.
21618
21619 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21620 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21621 [ENABLE_NLS]: Include libintl.h.
21622 [ENABLE_NLS] (gettext): Define.
21623 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21624 (N_, PACKAGE, LOCALEDIR): New macros.
21625
216261996-06-01 Richard Stallman <rms@gnu.org>
21627
21628 * POTFILES.in: New file.
21629
21630 * Makefile.in (allocate.o):
21631 Define target explicitly.
21632
21633 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21634 (LDFLAGS): Set to @LDFLAGS@.
21635 (configure): Run autoconf only if preceding `cd' succeeds.
21636 (bison.s1): Redirect output to temporary file then move the
21637 temporary to the target, rather than redirecting directly to bison.s1.
21638 (clean): Remove config.status and config.log.
21639 (distclean): Don't remove config.status here.
21640
216411996-05-12 Richard Stallman <rms@gnu.org>
21642
21643 * src/bison.s1:
21644 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21645
216461996-05-12 Richard Stallman <rms@gnu.org>
21647
21648 * bison.simple:
21649 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21650
216511996-05-11 Richard Stallman <rms@gnu.org>
21652
21653 * src/bison.s1 (__yy_memcpy):
21654 Really reorder the args, as was supposedly done on Feb 14 1995.
21655 (yyparse): Calls changed accordingly.
21656
216571996-05-11 Richard Stallman <rms@gnu.org>
21658
21659 * Makefile.in (dist): Don't use $(srcdir).
21660
21661 * bison.simple (__yy_memcpy):
21662 Really reorder the args, as was supposedly done on Feb 14 1995.
21663 (yyparse): Calls changed accordingly.
21664
216651996-01-27 Richard Stallman <rms@gnu.org>
21666
21667 * src/output.c (output_rule_data):
21668 Test YYERROR_VERBOSE in the conditional
21669 around the definition of ttyname.
21670
216711995-12-29 Richard Stallman <rms@gnu.org>
21672
21673 * src/bison.s1:
21674 Fix line numbers in #line commands.
21675
216761995-12-29 Richard Stallman <rms@gnu.org>
21677
21678 * bison.simple:
21679 Fix line numbers in #line commands.
21680
216811995-12-27 Richard Stallman <rms@gnu.org>
21682
21683 * src/bison.s1 (YYPARSE_PARAM_DECL):
21684 In C++, make it always null.
21685 (YYPARSE_PARAM_ARG): New macro.
21686 (yyparse): Use YYPARSE_PARAM_ARG.
21687
216881995-12-27 Richard Stallman <rms@gnu.org>
21689
21690 * bison.simple (YYPARSE_PARAM_DECL):
21691 In C++, make it always null.
21692 (YYPARSE_PARAM_ARG): New macro.
21693 (yyparse): Use YYPARSE_PARAM_ARG.
21694
216951995-11-29 Richard Stallman <rms@gnu.org>
21696
21697 * doc/bison.texinfo:
21698 Describe literal string tokens, %raw, %no_lines, %token_table.
21699
217001995-11-29 Daniel Hagerty <hag@gnu.org>
21701
21702 * doc/bison.texinfo: Fixed update date
21703
217041995-10-16 Richard Stallman <rms@gnu.org>
21705
21706 * src/version.c: Version 1.25.
21707
217081995-10-16 Richard Stallman <rms@gnu.org>
21709
21710 * NEWS: *** empty log message ***
21711
217121995-10-16 Richard Stallman <rms@gnu.org>
21713
21714 * doc/bison.1, doc/bison.rnh:
21715 Add new options.
21716
217171995-10-15 Richard Stallman <rms@gnu.org>
21718
21719 * src/vmsgetargs.c, src/getargs.c:
21720 Added -n, -k, and -raw switches.
21721 (noparserflag, toknumflag, rawtoknumflag): New variables.
21722
21723 * src/symtab.h (SALIAS):
21724 New #define for adding aliases to %token.
21725 (struct bucket): Added `alias' field.
21726
21727 * src/reduce.c (reduce_grammar):
21728 Revise error message.
21729 (print_notices): Remove final `.' from error message.
21730
21731 * src/reader.c (reader_output_yylsp):
21732 New function.
21733 (readgram): Use `#if 0' around code that accepted %command
21734 inside grammar rules: The documentation doesn't allow it,
21735 and it will fail since the %command processors scan for the next %.
21736 (parse_token_decl): Extended the %token
21737 declaration to allow a multi-character symbol as an alias.
21738 (parse_thong_decl): New function.
21739 (read_declarations): Added %thong declarations.
21740 (read_declarations): Handle NOOP to deal with allowing
21741 % declarations as another means to specify the flags.
21742 (readgram): Allow %prec prior to semantics embedded in a rule.
21743 (skip_to_char, read_declarations, copy_definition)
21744 (parse_token_decl, parse_start_decl, parse_type_decl)
21745 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21746 (get_type_name, copy_guard, copy_action, readgram)
21747 (get_type, packsymbols): Revised most error messages.
21748 Changed `fatal' to `warnxxx' to avoid aborting for error.
21749 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21750 (read_declarations): Improve the error message for
21751 an invalid character. Do not abort.
21752 (read_declarations, copy_guard, copy_action): Use
21753 printable_version to avoid unprintable characters in printed output.
21754 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21755 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21756 Allow the type of a non-terminal can be given
21757 more than once, as long as all specifications give the same type.
21758
21759 * src/output.c:
21760 (output_headers, output_trailers, output, output_gram)
21761 (output_rule_data): Implement noparserflag variable.
21762 Implement toknumflag variable.
21763 (output): Call reader_output_yylsp to output LTYPESTR.
21764
21765 * src/main.c (main):
21766 If reader sees an error, don't process the grammar.
21767 (fatals): Updated to not use VARARGS1.
21768 (printable_version, int_to_string, warn, warni, warns, warnss)
21769 (warnsss): New error reporting functions. Avoid abort for error.
21770
21771 * src/lex.h:
21772 Added THONG and NOOP for alias processing.
21773 Added SETOPT for the new code that allows setting options with %flags.
21774
21775 * src/lex.c:
21776 Include getopt.h. Add some extern decls.
21777 (safegetc): New function to deal with EOF gracefully.
21778 (literalchar); new function to deal with reading \ escapes.
21779 (lex): Use literalchar.
21780 (lex): Implemented "..." tokens.
21781 (literalchar, lex, parse_percent_token): Made tokenbuffer
21782 always contain the token. This includes growing the token
21783 buffer while reading an integer.
21784 (parse_percent_token): Replaced if-else statement with percent_table.
21785 (parse_percent_token): Added % declarations as another
21786 way to specify the flags -n, -l, and -r. Also added hooks for
21787 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21788 major changes to files.c.
21789 (lex) Retain in the incoming stream a character following
21790 an incorrect '/'.
21791 (skip_white_space, lex): Revised most error messages
21792 and changed fatal to warn to avoid aborting.
21793 (percent_table): Added %thong declarations.
21794
21795 * src/gram.h: Comment changes.
21796
21797 * src/files.c (openfiles, open_extra_files, done):
21798 Add faction flag
21799 and actfile file. Handle noparserflag. Both for -n switch.
21800
21801 * src/conflicts.c (resolve_sr_conflict):
21802 Remove use of alloca.
21803
218041995-06-01 Jim Meyering <meyering@gnu.org>
21805
21806 * doc/bison.texinfo: *** empty log message ***
21807
218081995-05-06 Richard Stallman <rms@gnu.org>
21809
21810 * src/bison.s1: Comment change.
21811
218121995-05-06 Richard Stallman <rms@gnu.org>
21813
21814 * bison.simple: Comment change.
21815
218161995-05-03 Richard Stallman <rms@gnu.org>
21817
21818 * src/version.c: Version now 1.24.
21819
21820 * src/bison.s1: Change distribution terms.
21821
21822 * src/version.c: Version now 1.23.
21823
218241995-05-03 Richard Stallman <rms@gnu.org>
21825
21826 * doc/bison.texinfo:
21827 Rewrite "Conditions for Using Bison".
21828 Update version to 1.24.
21829
218301995-05-03 Richard Stallman <rms@gnu.org>
21831
21832 * bison.simple: Change distribution terms.
21833
218341995-02-23 Richard Stallman <rms@gnu.org>
21835
21836 * src/files.c: Test __VMS_POSIX as well as VMS.
21837
218381995-02-14 Jim Meyering <meyering@gnu.org>
21839
21840 * src/bison.s1 (__yy_memcpy):
21841 Renamed from __yy_bcopy to avoid
21842 confusion. Reverse FROM and TO arguments to be consistent with
21843 those of memcpy.
21844
218451995-02-14 Jim Meyering <meyering@gnu.org>
21846
21847 * bison.simple (__yy_memcpy):
21848 Renamed from __yy_bcopy to avoid
21849 confusion. Reverse FROM and TO arguments to be consistent with
21850 those of memcpy.
21851
218521994-11-10 David J. MacKenzie <djm@gnu.org>
21853
21854 * NEWS: reformat
21855
21856 * NEWS: New file.
21857
21858 * Makefile.in (DISTFILES): Include NEWS.
21859
21860 * Makefile.in (DISTFILES):
21861 Include install-sh, not install.sh.
21862
21863 * configure.in: Update to Autoconf v2 macro names.
21864
218651994-10-05 David J. MacKenzie <djm@gnu.org>
21866
21867 * Makefile.in: fix typo
21868
21869 * Makefile.in (prefix, exec_prefix):
21870 Let configure set them.
21871
218721994-09-28 David J. MacKenzie <djm@gnu.org>
21873
21874 * Makefile.in: Set datadir to $(prefix)/share.
21875
218761994-09-15 Richard Stallman <rms@gnu.org>
21877
21878 * src/bison.s1:
21879 Update copyright notice and GPL version.
21880
218811994-09-15 Richard Stallman <rms@gnu.org>
21882
21883 * bison.simple:
21884 Update copyright notice and GPL version.
21885
218861994-07-12 Richard Stallman <rms@gnu.org>
21887
21888 * src/reduce.c, src/reader.c:
21889 entered into RCS
21890
218911994-05-05 David J. MacKenzie <djm@gnu.org>
21892
21893 * Makefile.in: entered into RCS
21894
218951994-03-26 Richard Stallman <rms@gnu.org>
21896
21897 * src/bison.s1: entered into RCS
21898
218991994-03-26 Richard Stallman <rms@gnu.org>
21900
21901 * bison.simple: entered into RCS
21902
219031994-03-25 Richard Stallman <rms@gnu.org>
21904
21905 * src/main.c: entered into RCS
21906
219071994-03-24 Richard Stallman <rms@gnu.org>
21908
21909 * src/conflicts.c: entered into RCS
21910
219111994-01-02 Richard Stallman <rms@gnu.org>
21912
21913 * Makefile.in: *** empty log message ***
21914
219151993-11-21 Richard Stallman <rms@gnu.org>
21916
21917 * src/bison.s1: *** empty log message ***
21918
219191993-11-21 Richard Stallman <rms@gnu.org>
21920
21921 * doc/bison.texinfo: entered into RCS
21922
21923 * doc/bison.texinfo: *** empty log message ***
21924
219251993-11-21 Richard Stallman <rms@gnu.org>
21926
21927 * bison.simple: *** empty log message ***
21928
219291993-10-25 David J. MacKenzie <djm@gnu.org>
21930
21931 * doc/bison.texinfo: *** empty log message ***
21932
219331993-10-19 Richard Stallman <rms@gnu.org>
21934
21935 * src/bison.s1: *** empty log message ***
21936
219371993-10-19 Richard Stallman <rms@gnu.org>
21938
21939 * bison.simple: *** empty log message ***
21940
219411993-10-14 Richard Stallman <rms@gnu.org>
21942
21943 * src/bison.s1: *** empty log message ***
21944
219451993-10-14 Richard Stallman <rms@gnu.org>
21946
21947 * bison.simple: *** empty log message ***
21948
219491993-09-14 David J. MacKenzie <djm@gnu.org>
21950
21951 * doc/bison.texinfo: *** empty log message ***
21952
219531993-09-13 Noah Friedman <friedman@gnu.org>
21954
21955 * Makefile.in: *** empty log message ***
21956
219571993-09-10 Richard Stallman <rms@gnu.org>
21958
21959 * src/conflicts.c: *** empty log message ***
21960
21961 * src/system.h: entered into RCS
21962
219631993-09-10 Richard Stallman <rms@gnu.org>
21964
21965 * doc/bison.1: entered into RCS
21966
219671993-09-06 Noah Friedman <friedman@gnu.org>
21968
21969 * src/version.c: entered into RCS
21970
219711993-09-06 Noah Friedman <friedman@gnu.org>
21972
21973 * Makefile.in: *** empty log message ***
21974
219751993-07-30 David J. MacKenzie <djm@gnu.org>
21976
21977 * Makefile.in: *** empty log message ***
21978
219791993-07-24 Richard Stallman <rms@gnu.org>
21980
21981 * src/bison.s1: *** empty log message ***
21982
219831993-07-24 Richard Stallman <rms@gnu.org>
21984
21985 * bison.simple: *** empty log message ***
21986
219871993-07-08 David J. MacKenzie <djm@gnu.org>
21988
21989 * Makefile.in: *** empty log message ***
21990
219911993-07-04 Richard Stallman <rms@gnu.org>
21992
21993 * src/bison.s1: *** empty log message ***
21994
219951993-07-04 Richard Stallman <rms@gnu.org>
21996
21997 * bison.simple: *** empty log message ***
21998
219991993-06-26 David J. MacKenzie <djm@gnu.org>
22000
22001 * src/getargs.c: entered into RCS
22002
220031993-06-26 David J. MacKenzie <djm@gnu.org>
22004
22005 * doc/bison.texinfo: *** empty log message ***
22006
22007 * doc/bison.1: New file.
22008
220091993-06-25 Richard Stallman <rms@gnu.org>
22010
22011 * src/getargs.c: New file.
22012
220131993-06-16 Richard Stallman <rms@gnu.org>
22014
22015 * src/bison.s1: *** empty log message ***
22016
220171993-06-16 Richard Stallman <rms@gnu.org>
22018
22019 * bison.simple: *** empty log message ***
22020
220211993-06-03 Richard Stallman <rms@gnu.org>
22022
22023 * src/bison.s1: New file.
22024
220251993-06-03 Richard Stallman <rms@gnu.org>
22026
22027 * doc/bison.texinfo: *** empty log message ***
22028
220291993-06-03 Richard Stallman <rms@gnu.org>
22030
22031 * bison.simple: New file.
22032
220331993-05-19 Richard Stallman <rms@gnu.org>
22034
22035 * doc/bison.texinfo: New file.
22036
220371993-05-07 Noah Friedman <friedman@gnu.org>
22038
22039 * Makefile.in: *** empty log message ***
22040
220411993-04-28 Noah Friedman <friedman@gnu.org>
22042
22043 * src/reader.c: *** empty log message ***
22044
220451993-04-23 Noah Friedman <friedman@gnu.org>
22046
22047 * src/alloc.h: entered into RCS
22048
220491993-04-20 David J. MacKenzie <djm@gnu.org>
22050
22051 * src/version.c: *** empty log message ***
22052
22053 * src/files.c, src/allocate.c:
22054 entered into RCS
22055
22056 * src/reader.c: *** empty log message ***
22057
22058 * src/lex.c: entered into RCS
22059
22060 * src/conflicts.c: New file.
22061
22062 * src/symtab.c: entered into RCS
22063
22064 * src/alloc.h: New file.
22065
22066 * src/LR0.c: entered into RCS
22067
220681993-04-18 Noah Friedman <friedman@gnu.org>
22069
22070 * src/reader.c: New file.
22071
22072 * src/version.c: *** empty log message ***
22073
220741993-04-18 Noah Friedman <friedman@gnu.org>
22075
22076 * Makefile.in: *** empty log message ***
22077
220781993-04-17 Noah Friedman <friedman@gnu.org>
22079
22080 * Makefile.in: *** empty log message ***
22081
220821993-04-15 Richard Stallman <rms@gnu.org>
22083
22084 * src/main.c, src/files.c:
22085 New file.
22086
220871993-04-15 Noah Friedman <friedman@gnu.org>
22088
22089 * configure.in: entered into RCS
22090
22091 * configure.in: *** empty log message ***
22092
22093 * configure.in: New file.
22094
220951993-04-14 Richard Stallman <rms@gnu.org>
22096
22097 * Makefile.in: New file.
22098
220991993-04-13 Richard Stallman <rms@gnu.org>
22100
22101 * src/version.c: New file.
22102
221031993-03-25 Richard Stallman <rms@gnu.org>
22104
22105 * src/output.c: entered into RCS
22106
221071992-09-25 Richard Stallman <rms@gnu.org>
22108
22109 * configure.bat: entered into RCS
22110
221111992-06-22 Richard Stallman <rms@gnu.org>
22112
22113 * src/vmsgetargs.c: entered into RCS
22114
221151992-06-22 Richard Stallman <rms@gnu.org>
22116
22117 * doc/bison.rnh: entered into RCS
22118
221191992-04-20 David J. MacKenzie <djm@gnu.org>
22120
22121 * README: entered into RCS
22122
221231992-01-22 Richard Stallman <rms@gnu.org>
22124
22125 * src/machine.h: entered into RCS
22126
221271991-12-21 Richard Stallman <rms@gnu.org>
22128
22129 * src/lalr.c, src/closure.c:
22130 entered into RCS
22131
221321991-12-20 Richard Stallman <rms@gnu.org>
22133
22134 * src/state.h: entered into RCS
22135
221361991-12-18 Richard Stallman <rms@gnu.org>
22137
22138 * src/print.c, src/nullable.c, src/derives.c:
22139 entered into RCS
22140
221411991-11-03 David J. MacKenzie <djm@gnu.org>
22142
22143 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22144 entered into RCS
22145
221461988-09-09 Richard Stallman <rms@gnu.org>
22147
22148 * src/bison.hairy: entered into RCS
22149
221501987-12-16 Richard Stallman <rms@gnu.org>
22151
22152 * REFERENCES: entered into RCS
dc546b0f 22153
f294a2c2 22154
04098407 22155 -----
f294a2c2 22156
04098407 22157 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
f490771b
JD
22158 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
22159 2007, 2008, 2009 Free Software Foundation, Inc.
f294a2c2 22160
04098407
PE
22161 Copying and distribution of this file, with or without
22162 modification, are permitted provided the copyright notice and this
22163 notice are preserved.