]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/lalr.c (state_lookahead_tokens_count): Correct comment.
[bison.git] / ChangeLog
CommitLineData
e459fb0e
JD
12009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
4
c4be5517
JD
52009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
6
7 Some M4 cleanup in the testsuite.
8 Suggested by Eric Blake at
9 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
10 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
11 complicate the code by distinguishing between a missing value
12 and an empty string value for an optional argument. This fix is
13 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
14 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
15 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
16 arguments are not needed because of the following changes.
17 Fix stale comments.
18 Bison developers should use GNU M4 and should not use
19 POSIXLY_CORRECT when building the test suite, so do not
20 complicate the code by avoiding $10 and above.
21 Do not quote an empty string value for an optional argument, and
22 do not distinguish between a missing value and an empty string
23 value.
24
feeb56cd
JD
252009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
26
27 Revert unnecessary column realignment in --help output.
28 Reported by Akim Demaille at
29 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
30 * src/getargs.c (usage): Here.
31
629e4def
AR
322009-07-04 Alex Rozenman <rozenman@gmail.com>
33
34 Alphabetical order in src/local.mk.
35 * src/local.mk: Adjust.
36
872b52bc
AR
372009-07-04 Alex Rozenman <rozenman@gmail.com>
38
39 Style changes and factoring.
40 * src/named-ref.h: Add comments.
41 * src/parse-gram.y: Readability and style changes.
42 * src/reader.c: Factoring: assign_named_ref function.
43 * src/scan-code.l: Factoring and style changes. Rename
44 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
45 Use "unsigned" type for variant index. Improve readablity.
46 * src/scan-gram.l: Change error messages and add comments.
47 * src/symlist.h: symbol_list_null: New function decl.
48 * src/symlist.c: symbol_list_null: Implement here.
49 * tests/named-refs.at: Adjust for new error messages.
50
83ea2423
EB
512009-06-29 Eric Blake <ebb9@byu.net>
52
53 scan-code: avoid compiler warnings
54 * src/scan-code.l (parse_named_ref): Use correct specifiers.
55
5ece73ea
AD
562009-06-29 Akim Demaille <demaille@gostai.com>
57
58 build: avoid concurrent extraction of calc++.
59 * examples/calc++/Makefile.am (calc.stamp): New.
60 Depend on it to create the sources of calc++ so that concurrent
61 builds don't launch several "extexi" in parallel.
62 Not only this is inefficient, this also builds incorrect sources
63 with several extractions mixed together.
64
ad597a78
AD
652009-06-29 Akim Demaille <demaille@gostai.com>
66
67 parse.error: fix.
68 * data/bison.m4: Move code related to specific variables after the
69 definition of the variable-maintaining macros so that we don't
70 "invoke" b4_percent_define_check_values before it is defined.
71
31b850d2
AD
722009-06-29 Akim Demaille <demaille@gostai.com>
73
74 variables: parse.error
75
76 Implement, document, and test the replacement of %error-verbose
77 by %define parse.error "verbose".
78 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
79 values of the parse.error variable.
80 Make "simple" its default value.
81 Check the valid values.
82 * src/parse-gram.y: Use %define parse.error.
83 (PERCENT_ERROR_VERBOSE): New token.
84 Support it.
85 * src/scan-gram.l: Support %error-verbose.
86
87 * doc/bison.texinfo (Decl Summary): Replace the documentation of
88 %define error-verbose by that of %define parse.error.
89 * NEWS: Document it.
90
91 * tests/actions.at, tests/calc.at: Use parse.error instead of
92 %error-verbose.
93
b9f1d9a4
AR
942009-06-27 Alex Rozenman <rozenman@gmail.com>
95
96 Implement support for named symbol references.
97 * src/parse-gram.y: Add new syntax (named_ref.opt).
98 * src/reader.c: Store named refs in symbol lists.
99 * src/reader.h: New argument for symbol_append and
100 action_append functions.
101 * src/scan-code.h: Add new field (named_ref) into
102 code_props data structure. Keeps named ref of midrule
103 actions.
104 * src/scan-code.l: Support for named refs in semantic
105 action code. New function 'parse_named_ref'.
106 * src/scan-gram.l: Support bracketed id.
107 * src/symlist.c: Store named refs in symbol lists.
108 * src/symlist.h: New field in symbol list: named_ref.
109 * src/named-ref.h: New file, a struct for named_ref.
110 * src/named-ref.cp: New file, named_ref_new function.
111 * src/local.mk: Add two new files.
112 * tests/testsuite.at: Include new test group:
113 * tests/named-refs.at: this new file.
114
b5c212b6
AD
1152009-06-25 Akim Demaille <demaille@gostai.com>
116
117 hash: check insertion for memory exhaustion.
118 * src/uniqstr.c (uniqstr_new): New.
119
67501061
AD
1202009-06-24 Akim Demaille <demaille@gostai.com>
121
122 variables: rename namespace as api.namespace.
123 Discussed in
124 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
125
126 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
127 New.
128 (b4_percent_define_use): New.
129 Use it where applicable.
130 * data/c++.m4: Replace uses of the variable "namespace" by
131 "api.namespace".
132 Default the latter to the former.
133 * doc/bison.texinfo (Decl Summary): Document "namespace" as
134 obsolete.
135 Document api.namespace.
136 Use @samp to document %define uses, keep @code for identifiers.
137 * NEWS: Likewise.
138 * tests/c++.at, tests/input.at: Test api.namespace instead of
139 namespace. (The tests passed with namespace.)
140
41976786
AD
1412009-06-11 Akim Demaille <demaille@gostai.com>
142
143 style changes.
144 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
145 * src/print-xml.c: Style changes.
146 * tests/conflicts.at: Comment changes.
147
44bb9084
AD
1482009-06-11 Akim Demaille <demaille@gostai.com>
149
150 xml: beware of user strings used to give a %prec to rules.
151 * tests/conflicts.at (%prec with user strings): New.
152 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
153 XML output.
154
04d1e39d
AD
1552009-06-11 Akim Demaille <demaille@gostai.com>
156
157 hash: check insertion for memory exhaustion.
158 * src/muscle-tab.c (muscle_insert, muscle_grow)
159 * src/state.c (state_hash_insert): Check the return value of
160 hash_insert.
161
a8873669
AD
1622009-06-11 Akim Demaille <demaille@gostai.com>
163
164 tests: honor TESTSUITEFLAGS in every check target.
165 * tests/local.mk (RUN_TESTSUITE): New.
166 (check-local, installcheck-local, maintainer-check-g++)
167 (maintainer-check-posix, maintainer-check-valgrind): Use it.
168
8893145a
AD
1692009-06-10 Akim Demaille <demaille@gostai.com>
170
171 deterministic test suite.
172 Some consistency checks on symbols are performed after all the
173 symbols were read, by an iteration over the symbol table. This
174 traversal is nondeterministic, which can be a problem for test
175 cases.
176 Avoid this.
177 Addresses another form of nondeterminism reported by Joel E. Denny.
178 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
179
180 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
181 test in two.
182 Use different file names for the three tests to make the
183 maintenance easier.
184
92d7a23a
AD
1852009-06-10 Akim Demaille <demaille@gostai.com>
186
187 gnulib: update.
188 * gnulib: Update to latest.
189 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
190 * m4/.gitignore: Regen.
191 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
192 Call xalloc_die on hash_insert failures.
193 Requested by the new __warn_unused_result__ attribute of
194 hash_insert.
195
12cf133f
AD
1962009-06-10 Akim Demaille <demaille@gostai.com>
197
198 deterministic user-token-number redeclaration errors.
199 Address nondeterminism reported by Joel E. Denny.
200 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
201
202 * src/uniqstr.h: Comment changes.
203 * src/location.h (boundary_cmp, location_cmp): New.
204 * src/symtab.c (user_token_number_redeclaration): New.
205 (symbol_translation): Use it.
206 * tests/input.at (Numbered tokens): Adjust the expected output.
207
796a2b0a
AD
2082009-05-25 Akim Demaille <demaille@gostai.com>
209
210 build: avoid ignored errors.
211 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
212 errors, they pollute the output.
213
0b6d43c5
JD
2142009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
215
216 Convert multiple variable definition warnings to complaints.
217 * NEWS (2.5): Add a new entry for that change.
218 * doc/bison.texinfo (Decl Summary): Update %define entry.
219 (Bison Options): Update -D/--define/-F/--force-define entry.
220 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
221 * src/muscle-tab.h (muscle_percent_define_insert): Update
222 comments.
223 * tests/input.at (`%define errors'): Update.
224 (`%define, --define, --force-define'): Update.
225
de5ab940
JD
2262009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
227
228 -F/--force-define and relative %define/-D/--define priorities.
229 * NEWS (2.5): Add documentation to -D/--define entry.
230 * build-aux/cross-options.pl: Hard-code association of
231 --force-define with %define.
232 * doc/bison.texinfo (Decl Summary): In %define entry,
233 cross-reference command-line options.
234 (Bison Options): Add documentation to -D/--define entry.
235 (Option Cross Key): Widen column for --force-define row.
236 * src/getargs.c (usage): Document -F/--force-define. Realign
237 options in output.
238 (short_options, long_options, getargs): Parse -F/--force-define,
239 and update muscle_percent_define_insert invocations.
240 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
241 (muscle_percent_define_insert): Add argument with that type.
242 * src/muscle-tab.c (muscle_percent_define_insert): Implement
243 -F/--force-define behavior and priorities.
244 (muscle_percent_define_ensure): Update
245 muscle_percent_define_insert invocation.
246 * src/parse-gram.y (prologue_declaration): Update
247 muscle_percent_define_insert invocations.
248 * tests/input.at (`%define, --define'): Rename to...
249 (`%define, --define, --force-define'): ... this and extend.
250
f8e7258f
JD
2512009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
252
253 Update some comments to make sense for -D.
254 * data/bison.m4 (b4_check_user_names): In header comments, say
255 "user occurrence" instead of "grammar occurrence".
256 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
257 (muscle_percent_code_grow): Likewise just for consistency.
258
b987342b
JD
2592009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
260
261 * data/c++.m4 (b4_namespace_close): Simplify slightly.
262
4977e0a7
JD
2632009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
264
265 Handle a trailing `:' in a user-supplied C++ namespace better.
266 * data/c++.m4 (b4_namespace_close): Don't let it be printed
267 among the closing braces here. This fix might make the
268 generated code easier to debug, but otherwise it should be
269 insignificant because a trailing `:' is a C++ error already.
270
9b04dad7
AD
2712009-05-19 Akim Demaille <demaille@gostai.com>
272
273 remove useless variable.
274 * src/getargs.c (skeleton_arg): Remove now useless variable.
275 Should help the compiler see that this printf-like call is sane.
276
4c6622c2
AD
2772009-05-15 Akim Demaille <demaille@gostai.com>
278
279 Rename token.prefix as api.tokens.prefix.
280 Discussed here.
281 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
282
283 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
284 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
285 (token.prefix): Rename as...
286 (api.tokens.prefix): this.
287
3c248d70
AD
2882009-05-11 Akim Demaille <demaille@gostai.com>
289
290 doc: use C++ headers.
291 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
292 headers.
293
99c08fb6
AD
2942009-05-11 Akim Demaille <demaille@gostai.com>
295
296 doc: token.prefix
297 * doc/bison.simple (Decl Summary): Document token.prefix.
298 (Calc++ Parser): Various fixes.
299 Formatting changes.
300 Use token.prefix.
301 Introduce a macro TOKEN to shorten the code and make it more
302 readable.
303 (Calc++ Scanner): Adjust.
304 * NEWS (Variable token.prefix): New.
305
84a1cb5a
AD
3062009-05-04 Akim Demaille <demaille@gostai.com>
307
308 bison: catch bad symbol names.
309 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
310 * tests/input.at: Adjust.
311
cdf3f113
AD
3122009-05-04 Akim Demaille <demaille@gostai.com>
313
314 identifiers: dashes are letters.
315 Dashes can now start identifiers (symbols and directives).
84a1cb5a 316
cdf3f113
AD
317 * src/scan-gram.l ({letter}): Add dash.
318 ({id}): Remove it.
319 * tests/input.at (Symbols): Adjust.
320 Remove stray comment.
321 * tests/regression.at (Invalid inputs): Adjust error message.
322 * doc/bison.texinfo (Symbols): Update.
323
98a345a2
JD
3242009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
325
326 Declare %code to be a permanent feature.
327 * NEWS (2.4.2): Here.
328 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
329 experimental.
330 (Decl Summary): Likewise.
331
67212941
JD
3322009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
333
334 Convert underscores to dashes in some %define variable names.
335 For now, just api.push-pull and lr.keep-unreachable-states.
336 Maintain old names for backward compatibility.
337 * NEWS (2.5): Document.
338 * data/c.m4 (b4_identification): Update comment.
339 * data/yacc.c: Update access.
340 * doc/bison.texinfo: Update.
341 * etc/bench.pl.in (bench_push_parser): Update use.
342 * src/files.c (tr): Move to...
343 * src/getargs.c, src/getargs.h (tr): ... here because I can't
344 think of a better place to expose it. My logic is that, for all
345 uses of tr so far, command-line arguments can be involved, and
346 getargs.h is already included.
347 * src/main.c (main): Update access.
348 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
349 variable names to new variable names before assigning value.
350 * src/reader.c (reader): Update setting default.
351 * tests/calc.at: Update uses.
352 * tests/conflicts.at (Unreachable States After Conflict
353 Resolution): Update use.
354 * tests/input.at (%define enum variables): Update use.
355 (%define backward compatibility): New test group.
356 * tests/push.at: Update uses.
357 * tests/reduce.at: Update uses.
358 * tests/torture.at: Update uses.
359
ba5c6d94
JD
3602009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
361
362 Set all front-end %define defaults in one place.
363 * src/main.c (main): Move lr.keep_unreachable_states default...
364 * src/reader.c (reader): ... to here.
365
5bab9d08
JD
3662009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
367
368 Rename lr.default_reductions to lr.default-reductions.
369 * NEWS (2.5): Here.
370 * doc/bison.texinfo: Here.
371 * src/lalr.c (initialize_LA): Here.
372 * src/print.c (print_reductions): Here.
373 * src/reader.c (reader): Here.
374 * src/tables.c (action_row): Here.
375 * tests/input.at (%define enum variables): Here.
376 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
377
d521ee19
JD
3782009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
379
380 Pacify ./configure --enable-gcc-warnings.
381 * tests/input.at (Symbols): Prototype yyerror and yylex.
382
3832009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
384
385 Document how `%define "var" "value"' is not M4-friendly.
386 * src/parse-gram.y (variable): In comments here.
387
8f0d265e
JD
3882009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
389
390 Clean up recent patches a little.
391 Reported by Akim Demaille.
392 * doc/bison.texinfo (Understanding): Fix typos.
393 * src/print.c (print_reductions): Don't use negated variable.
394
f4909773
JD
3952009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
396
397 List accepted values for a %define enum variable with an invalid value.
398 Suggested by Akim Demaille at
399 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
400 * data/bison.m4 (_b4_percent_define_check_values): Implement.
401 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
402 * tests/input.at (%define lr.default_reductions invalid values): Merge
403 into...
404 (%define enum variables): ... here, and update output.
405
110ef36a
JD
4062009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
407
408 Rename "default rule" to "default reduction".
409 This includes changing variable names in code, changing
410 comments, and renaming %define lr.default_rules to %define
411 lr.default_reductions.
412 * NEWS (2.5): Update IELR documentation.
413 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
414 documentation.
415 * data/glr.c, data/lalr1.java: Sync copyright dates.
416 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
417 and lr.type documentation. Make some other wording
418 improvements.
419 (Glossary): Adjust cross-references and Default Reduction
420 definition.
421 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
422 Remove a confusing comment pointed out by Akim Demaille.
423 (initialize_LA): Adjust code.
424 * src/print-xml.c (print_reductions): Adjust code.
425 * src/print.c (print_reductions): Adjust code.
426 * src/reader.c (reader): Adjust code.
427 * src/tables.c (action_row): Adjust code.
428 (token_actions): Adjust code.
429 * src/tables.h: Adjust YYDEFACT documentation.
430 * tests/input.at (%define lr.default_rules invalid values):
431 Rename test group to...
432 (%define lr.default_reductions invalid values): ... this, and
433 update grammar file and expected output.
434 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
435 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
436
746ee38c
AD
4372009-04-21 Akim Demaille <demaille@gostai.com>
438
439 tests: check the use of dashes and periods in symbols.
440 * tests/input.at (Symbol): New test group.
441
eb45ef3b
JD
4422009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
443
444 Document %define lr.type and lr.default_rules.
445 * NEWS (2.5): Add an entry.
446 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
447 besides just LALR(1) and GLR(1).
448 * doc/bison.texinfo (Introduction): Likewise.
449 (Language and Grammar): Bison is no longer limited to LALR(1)
450 restrictions.
451 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
452 when trying to distinguish from GLR. Talk about LR(1) grammars
453 rather than LALR(1) grammars.
454 (Decl Summary): In %define api.push_pull entry, say it applies
455 to deterministic parsers in C rather than LALR(1) parsers in C.
456 Add lr.default_rules entry.
457 Add lr.type entry.
458 (Mystery Conflicts): Bison is no longer limited to LALR(1)
459 restrictions.
460 (Generalized LR Parsing): Same changes as for the previous GLR
461 section.
462 (Memory Management): Say deterministic rather than LALR(1).
463 (Understanding): Correct some bison output.
464 Index discussion of "accepting state".
465 Say deterministic rather than LALR(1).
466 (Bison Options): In --yacc entry, say deterministic rather than
467 LALR(1).
468 In --report, --graph, and --xml entries, just don't mention
469 LALR(1).
470 (C++ Parsers): Say deterministic rather than LALR(1).
471 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
472 (Glossary): Add Accepting State, Consistent State, Default Rule,
473 and IELR(1) definitions.
474 In Generalized LR (GLR) definition, make same changes as in
475 previous GLR sections.
476 In LALR(1) definition, say Bison uses LALR(1) by default rather
477 than implying Bison is limited to LALR(1).
478 (LocalWords): Add IELR.
479
db34f798
JD
4802009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
481
482 Finish implementing %define lr.type.
483 Its value can be "LALR", "IELR", or "canonical LR".
484 * lib/timevar.def (TV_IELR_PHASE1): New var.
485 (TV_IELR_PHASE2): New var.
486 (TV_IELR_PHASE3): New var.
487 (TV_IELR_PHASE4): New var.
488 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
489 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
490 Sbitset.h, ielr.h, and ielr.c.
491 * src/getargs.h, src/getargs.c (enum trace, trace_args,
492 trace_types): Add trace_ielr.
493 * src/lalr.h, src/lalr.c (ngotos): Export it.
494 (F): Rename to...
495 (goto_follows): ... this, update all uses, and export it.
496 (set_goto_map): Export it.
497 (map_goto): Export it.
498 (compute_lookahead_tokens): Don't free goto_follows yet. Now
499 handled in ielr.
500 (initialize_LA): Export it. Move lookback allocation to...
501 (lalr): ... here because, for canonical LR, initialize_LA must
502 be invoked but lookback and much of the rest of LALR isn't
503 needed.
504 * main.c (main): Instead of lalr, invoke ielr, which invokes
505 lalr.
506 * src/reader.c (reader): Default lr.type to "LALR".
507 Default lr.default_rules to "accepting" if lr.type is "canonical
508 LR". Leave the default as "all" otherwise.
509 Check for a valid lr.type value.
510 * src/state.h, src/state.c (struct state_list): Add state_list
511 member.
512 (state_new): Initialize state_list member to NULL.
513 (state_new_isocore): New function, exported.
514 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
515 exercises all values of lr.type.
516 (GNU AWK Grammar): Rename test group to...
517 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
518 AT_TEST_EXISTING_GRAMMAR.
519 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
520 (GNU pic Grammar): Rename test group to...
521 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
522 AT_TEST_EXISTING_GRAMMAR.
523 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
524 all values of lr.type.
525 (Single State Split): New test groups using AT_TEST_LR_TYPE.
526 (Lane Split): Likewise.
527 (Complex Lane Split): Likewise.
528 (Split During Added Lookahead Propagation): Likewise.
529
7fe11bb5
JD
5302009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
531
532 Add new files for IELR and canonical LR implementation.
533 * src/AnnotationList.c: New.
534 * src/AnnotationList.h: New.
535 * src/InadequacyList.c: New.
536 * src/InadequacyList.h: New.
537 * src/Sbitset.c: New.
538 * src/Sbitset.h: New.
539 * src/ielr.c: New.
540 * src/ielr.h: New.
541
7254f6a8
JD
5422009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
543
544 Implement %define lr.default_rules.
545 Its value describes the states that are permitted to contain
546 default rules: "all", "consistent", or "accepting".
547 * src/reader.c (reader): Default lr.default_rules to "all".
548 Check for a valid lr.default_rules value.
549 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
550 is "accepting", then only mark the accepting state as
551 consistent.
552 (initialize_LA): Tell state_lookahead_tokens_count whether
553 lr.default_rules is "accepting".
554 * src/tables.c (action_row): If lr.default_rules is not "all",
555 then disable default rules in inconsistent states.
556 * src/print.c (print_reductions): Use this opportunity to
557 perform some assertions about whether lr.default_rules was
558 obeyed correctly.
559 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
560 helps with checking the parser tables for a grammar.
561 * tests/input.at (%define lr.default_rules invalid values): New
562 test group.
563 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
564 AT_TEST_TABLES_AND_PARSE.
565 (`no %define lr.default_rules'): New test group generated by
566 AT_TEST_LR_DEFAULT_RULES.
567 (`%define lr.default_rules "all"'): Likewise.
568 (`%define lr.default_rules "consistent"'): Likewise.
569 (`%define lr.default_rules "accepting"'): Likewise.
570
72e727f2
AD
5712009-04-20 Akim Demaille <demaille@gostai.com>
572
573 Formatting change.
574
90462b8d
AD
5752009-04-20 Akim Demaille <demaille@gostai.com>
576
577 bison: factoring.
578 * src/output.c (token_definitions_output): Use symbol_id_get
579 instead of duplicating its logic.
580 * TODO (YYERRCODE): Extend.
581
4f646c37
AD
5822009-04-20 Akim Demaille <demaille@gostai.com>
583
71b00ed8
AD
584 variables: prefer error-verbose to error_verbose.
585 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
586 instead of error_verbose.
587 * src/scan-gram.l (%error-verbose): Map to the error-verbose
588 variable.
589 * doc/bison.texinfo: Promote %define error-verbose instead of
590 %error-verbose.
591 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
592
5932009-04-15 Akim Demaille <demaille@gostai.com>
594
4f646c37
AD
595 variables: accept dashes.
596 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
597 underscores.
598 * src/scan-gram.l ({id}): Also accept dashes after the initial
599 letter.
600 ({directive}): Use {id}.
601 * src/parse-gram.y: Comment and formatting changes.
602 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
603 symbols.
604 * src/complain.h, src/complain.c (yacc_at): New.
605 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
606 symbol names.
607 * src/output.c (token_definitions_output): Do not #define token
608 names with dashes.
609
184e3179
AD
6102009-04-20 Akim Demaille <demaille@gostai.com>
611
612 Consistently refer to Yacc, not YACC.
613 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
614
41253c3a
JD
6152009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
616
617 Pacify make maintainer-check-posix.
618 * tests/input.at (%define, --define): Move bison command-line
619 options before grammar file name.
620
197b82ba
JD
6212009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
622
623 Document semicolon warnings.
624 * NEWS (2.5): Here.
625
0c90a1f5
AD
6262009-04-14 Akim Demaille <demaille@gostai.com>
627
628 variables: use `parse.assert' instead of `assert'.
629 * TODO (assert): Remove.
630 * data/bison.m4 (b4_assert_if): Replace with...
631 (b4_parse_assert_if): this.
632 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
633 * doc/bison.texinfo (Decl Summary): Document parse.assert.
634
fa819509
AD
6352009-04-14 Akim Demaille <demaille@gostai.com>
636
16dc0d90 637 variables: use `parse.trace' instead of `debug'.
fa819509
AD
638 * src/getargs.c (getargs): Map -t to %define trace.parse.
639 * src/scan-gram.l (%debug): Map to %define trace.parse.
640 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
641 names to `_' in macro names.
642 (b4_debug_if): Replace with...
643 (b4_parse_trace_if): this.
644 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
645 * data/yacc.c: Adjust.
646 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
647 Use @code to label the variable list.
648 Document the variable parse.trace.
649 (Tracing): Promote the parse.trace variable.
650 * TODO: %printer is not documented.
651
f7dae1ea
AD
6522009-04-14 Akim Demaille <demaille@gostai.com>
653
654 doc: minor fixes.
655 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
656 (Table of Symbols): Remove duplicate entry for %debug.
657
3535c071
EB
6582009-04-10 Eric Blake <ebb9@byu.net>
659
660 submodules: update to latest
661 * submodules/autoconf: Use latest upstream Autoconf.
662
cf48f675
EB
6632009-04-06 Eric Blake <ebb9@byu.net>
664
665 Work around autoconf 2.63b bug in testsuite.
666 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
667 autoconf bug related to # in test.
668
50cca368
JD
6692009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
670
671 * NEWS (2.5): New section. Describe new -D/--define feature.
672
3583d96b
AD
6732009-04-06 Akim Demaille <demaille@gostai.com>
674
675 Regen.
676 * src/parse-gram.h, src/parse-gram.c: Regen.
677
00f5d575
AD
6782009-04-06 Akim Demaille <demaille@gostai.com>
679
680 rename muscle_tab.* as muscle-tab.* for consistency.
681 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
682 * src/muscle-tab.h, src/muscle-tab.c: these.
683 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
684 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
685
76bf5102
AD
6862009-04-06 Akim Demaille <demaille@gostai.com>
687
688 Makefile: introduce $(BISON).
689 * src/local.mk (BISON): New.
690 (YACC): Use it.
691
bc0f5737
AD
6922009-04-06 Akim Demaille <demaille@gostai.com>
693
694 parser: handle %locations as %define locations.
695 * src/getargs.h, src/getargs.c (locations_flag): Remove.
696 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
697 to set "locations" to true.
698 * src/output.c (prepare): Don't output "locations".
699 * src/scan-gram.l (%locations): Handle it as a %<flag>.
700 * src/parse-gram.y: It's no longer a token.
701 Don't handle it.
702 * data/bison.m4 (b4_locations_if): Define it with
703 b4_percent_define_if_define.
704 * data/c.m4, data/glr.cc: Adjust.
705
697c912f
AD
7062009-04-06 Akim Demaille <demaille@gostai.com>
707
708 Regen.
709 * src/parse-gram.c: Regen.
710
4920ae8b
AD
7112009-04-06 Akim Demaille <demaille@gostai.com>
712
713 muscle: factor the handling of obsolete of obsolete directives.
714 Suggested by Joel E. Denny.
50cca368 715
4920ae8b
AD
716 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
717 New, extracted from...
718 * src/parse-gram.y (prologue_declaration: pure-parser): here.
719 Remove it.
720 (prologue_declaration: "%<flag>"): Use
721 muscle_percent_define_ensure.
722 (%error-verbose, %pure-parser): No longer tokens.
723 * src/scan-gram.l (pure-parser): Return as a %<flag>.
724
1d5b3c08
JD
7252009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
726
727 Fix options documentation.
728 * build-aux/cross-options.pl: As in --help output, write optional
729 arguments as [=ARG] not =[ARG].
730 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
731
62c99cf4
JD
7322009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
733
734 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
735 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
736 requirements for a correct m4 are stricter.
737 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
738 * configure.ac: Update to use AC_PROG_GNU_M4.
739 Reported by Eric Blake.
740
1c93f35b
JD
7412009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
742
743 Help with updating web manual.
744 * HACKING: Incorporate instructions from gnulib/doc/README.
745 * bootstrap.conf (gnulib_modules): Add gendocs.
746
86cfae0a
AD
7472009-04-03 Akim Demaille <demaille@gostai.com>
748
749 Regen.
750 * src/parse-gram.h, src/parse-gram.c: Regen.
751
ba061fa6
AD
7522009-04-03 Akim Demaille <demaille@gostai.com>
753
754 Factor %FLAG at scan level.
755 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
756 definitions and associated rules, replaced by....
757 (PERCENT_FLAG): this new token type, and rule.
758 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
759 Use it for %debug and %error-verbose.
760
b19ebeb3
AD
7612009-04-03 Akim Demaille <demaille@gostai.com>
762
763 Regen.
764 * src/parse-gram.h, src/parse-gram.c: Regen.
765
001a16a9
AD
7662009-04-03 Akim Demaille <demaille@gostai.com>
767
768 Treat %debug as %define debug.
769 * data/bison.m4 (b4_debug_if): New.
770 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
771 * data/lalr1.java: Use it instead of b4_debug_flag.
772 * src/getargs.h, src/getargs.c (debug_flag): Remove.
773 * src/output.c (prepare): Don't output it.
774 * src/parse-gram.y: Treat %debug as %define debug.
775
7762009-04-03 Akim Demaille <demaille@gostai.com>
777
778 Treat %error-verbose as %define error_verbose.
779 This allows to pass -Derror_verbose on the command line. Better
780 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
781 ERROR_VERBOSE being defined as false or true.
782 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
783 on b4_percent_define_ifdef, for does not check the defined value,
784 but only whether the symbol is defined, rely on
785 b4_percent_define_flag_if, so that a value of "false" is processed
786 as a false.
787 If not defined, define the flag to "false".
788 (b4_error_verbose_if): New.
789 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
790 b4_error_verbose_flag.
791 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
792 * src/output.c (prepare): Don't output it.
793 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
794
92822aff
JD
7952009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
796
797 Fix strange %define locations for default values.
798 Reported by Akim Demaille at
799 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
800 and discussed again starting at
801 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
802 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
803 because location information is bogus.
804 Use angle brackets to delimit fake file name because square brackets
805 look like underexpanded m4. Choose a better fake file name.
806 Use negative line numbers.
807 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
808 * src/location.c (location_print): If line for a boundary is negative,
809 only print that boundary's file name.
810 * src/location.h: Document that.
811 * tests/skeletons.at (%define Boolean variables: invalid skeleton
812 defaults): Update output.
813
e021191b
JD
8142009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
815
816 Pacify ./configure --enable-gcc-warnings.
817 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
818 in lib won't compile with it.
819 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
820
78f65418
AD
8212009-03-31 Akim Demaille <demaille@gostai.com>
822
823 bootstrap: --help to stdout.
824 * bootstrap (usage): Don't send --help to stderr.
825 Use a here doc instead of a long string.
826
f7e241f4
AD
8272009-03-31 Akim Demaille <demaille@gostai.com>
828
829 bootstrap: README-hacking no longer exists
830 * bootstrap (checkout_only_file): Set to HACKING.
831
31d3e510
AD
8322009-03-26 Akim Demaille <demaille@gostai.com>
833
834 doc: merge HACKING and README-hacking.
835 Two files is confusing.
836 Reported by Alexandre Duret-Lutz.
1f9d8248 837
31d3e510
AD
838 * README-hacking: Merge into...
839 * HACKING (Working from the repository): here.
840
81535bfa
AD
8412009-03-26 Akim Demaille <demaille@gostai.com>
842
843 doc: update README-hacking.
844 * README-hacking: We now use git and git submodules.
845 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
846
56f772e9
AD
8472009-03-26 Akim Demaille <demaille@gostai.com>
848
849 lalr1.cc: avoid GCC 4.3 warnings.
850 GCC 4.3 now warns about "a || b && c" and asks for explicit
851 parentheses.
852 Reported by Alexandre Duret-Lutz.
853 * data/location.cc: Update copyright years.
854 (Position::operator==): Use parens to make precedence explicit.
855 Compare lines and columns first, as they are more likely to be
856 different, and they are faster to compare.
857
11c073b7
AD
8582009-03-26 Akim Demaille <demaille@gostai.com>
859
860 gnulib: update.
861 * gnulib: Update to latest.
862 * src/local.mk (AM_CFLAGS): Move to...
863 * Makefile.am: here.
864 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
865 AM_CFLAGS.
866
91be6b28
AD
8672009-03-02 Akim Demaille <demaille@gostai.com>
868
869 Comment changes.
870
cbf25ce7
AD
8712009-03-02 Akim Demaille <demaille@gostai.com>
872
873 Share b4_yytranslate_define.
874 * data/lalr1.cc (b4_yytranslate_define): Move to...
875 * data/c++.m4: here.
876
882f02ed
AD
8772009-03-02 Akim Demaille <demaille@gostai.com>
878
879 Use locations in the variant example.
1f9d8248
AD
880 Yes, this obfuscates the point of this example, variants only.
881 But glr.cc cannot work (yet?) without locations. This change
882 makes it easier to use this example with glr.cc.
11c073b7 883
882f02ed
AD
884 * examples/variant.yy (assert): %define it.
885 (locations): Request them.
886 (yylex): Bind the location to the stage.
887
0623bacc
AD
8882009-03-02 Akim Demaille <demaille@gostai.com>
889
890 Dub make_TOKEN as a public type interface.
891 * data/c++.m4 (b4_symbol_constructor_declare)
892 (b4_symbol_constructor_define): New empty stubs.
893 (b4_public_types_declare, b4_public_types_define): Use them.
894 * data/lalr1.cc (b4_symbol_constructor_declare)
895 (b4_symbol_constructor_declare_)
896 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
897 Move to...
898 * data/variant.hh: here.
899 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
900 needed.
901 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
902 b4_symbol_constructor_declare, as it is now done by
903 b4_public_types_define and b4_public_types_declare.
904
5f5a90df
AD
9052009-03-02 Akim Demaille <demaille@gostai.com>
906
907 Coding style changes.
908 * data/lalr1.cc (b4_symbol_constructor_declaration_)
909 (b4_symbol_constructor_declarations)
910 (b4_symbol_constructor_definition_)
911 (b4_symbol_constructor_definitions)
912 (b4_yytranslate_definition): Rename as...
913 (b4_symbol_constructor_declare_)
914 (b4_symbol_constructor_declare)
915 (b4_symbol_constructor_define_)
916 (b4_symbol_constructor_define)
917 (b4_yytranslate_define): these.
918 * data/variant.hh (b4_variant_definition): Rename as...
919 (b4_variant_define): this.
920
b47b6ff7
AD
9212009-03-02 Akim Demaille <demaille@gostai.com>
922
923 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
924 * data/bison.m4 (b4_percent_define_if_define): New.
925 * data/c++.m4 (b4_variant_if): Move to...
926 * data/bison.m4: Here, using b4_percent_define_if_define.
927 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
928 * data/bison.m4: Here, using b4_percent_define_if_define.
929
1d6b689b
AD
9302009-03-02 Akim Demaille <demaille@gostai.com>
931
932 Dub symbol_type_base as a public type.
933 * data/c++.m4 (b4_public_types_declare): Now define
934 symbol_type_base and symbol_type.
935 (b4_public_types_define): New.
936 In both cases, the definitions are taken verbatim from lalr1.cc.
937 * data/lalr1.cc: Adjust.
938
4f84717d
AD
9392009-03-02 Akim Demaille <demaille@gostai.com>
940
941 b4_public_types_declare.
942 * data/c++.m4 (b4_public_types_declare): New.
943 * data/glr.cc, data/lalr1.cc: Use it.
944
b9e4eb5b
AD
9452009-03-02 Akim Demaille <demaille@gostai.com>
946
947 b4_semantic_type_declare.
948 * data/c++.m4 (b4_semantic_type_declare): New.
949 Factors and generalizes what was in glr.cc and lalr1.cc.
950 * data/variant.hh (b4_semantic_type_declare): Redefine it for
951 variants.
952 * data/lalr1.cc, data/glr.cc: Use it.
953
6a6e7f0c
AD
9542009-02-26 Akim Demaille <demaille@gostai.com>
955
956 Upgrade gnulib.
957 * gnulib: Upgrade from master.
958 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
959 Regen.
960
e9e61b00
AD
9612009-02-25 Akim Demaille <demaille@gostai.com>
962
963 Remove useless arguments.
964 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
965 relevant.
966
3eead995
AD
9672009-02-25 Akim Demaille <demaille@gostai.com>
968
969 Comment changes.
970 * data/lalr1.cc: here.
971
87f28efe
AD
9722009-02-25 Akim Demaille <demaille@gostai.com>
973
974 Fix glr.cc's debug level handling.
975 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
976 glr.c which is used.
977 (debug_level, set_debug_level): Adjust.
978
9be2a009
AD
9792009-02-25 Akim Demaille <demaille@gostai.com>
980
981 Copyright years.
982 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
983
07a6e87d
AD
9842009-02-25 Akim Demaille <demaille@gostai.com>
985
986 Style changes.
987 * etc/bench.pl.in (generate_grammar_list): Consitently use
988 location_type, not yy::location.
989
33c78bd2
AD
9902009-02-25 Akim Demaille <demaille@gostai.com>
991
992 Comment change.
993 * data/lalr1.cc: here.
994
49572920
AD
9952009-02-19 Akim Demaille <demaille@gostai.com>
996
997 Make yyparser::error public.
998 * data/lalr1.cc: here.
999 There is no good reason to keep it private (and it is convenient
1000 to use it from the scanner for instance). It is already public in
1001 glr.cc.
1002
88654b47
AD
10032009-02-19 Akim Demaille <demaille@gostai.com>
1004
1005 Comment changes.
1006 * data/glr.cc: here.
1007
4524c55b
AD
10082009-02-19 Akim Demaille <demaille@gostai.com>
1009
1010 Remove trailing blanks.
6a6e7f0c
AD
1011 The epilogue has its own ending \n, no need to add another.
1012
4524c55b
AD
1013 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
1014 epilogue.
1015 * data/glr.cc: dnl when extending the epilogue.
1016 Remove stray "private:".
1017
6ceccee8
AD
10182009-02-19 Akim Demaille <demaille@gostai.com>
1019
1020 Use b4_c_modern.
1021 * data/c.m4 (b4_c_function_decl): Here.
1022
9c6a8966
AD
10232009-02-19 Akim Demaille <demaille@gostai.com>
1024
1025 Comment changes.
1026 * data/lalr1.cc: here.
1027
507aa0e2
AD
10282009-02-19 Akim Demaille <demaille@gostai.com>
1029
1030 Extract variant.hh
1031 * data/variant.hh: New, extracted from...
1032 * data/lalr1.cc: here.
1033 Adjust.
1034 * data/local.mk: Adjust.
1035
51bacae6
AD
10362009-02-19 Akim Demaille <demaille@gostai.com>
1037
1038 Extract stack.hh from lalr1.cc.
1039 * data/stack.hh: New.
1040 * data/lalr1.cc: Extract from here.
1041 * data/local.mk: Adjust.
1042
06c3084f
JD
10432009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1044
1045 Add reminder about uploading public key to keys.gnupg.net.
1046 * HACKING (Release Procedure): Here.
1047
0ea583d2
AD
10482009-01-28 Akim Demaille <demaille@gostai.com>
1049
1050 * NEWS: Update information about 2.4.1 and 2.4.2.
1051
402b123d
AD
10522008-11-04 Akim Demaille <demaille@gostai.com>
1053
1054 Reformat NEWS.
1055 * NEWS: Use more outline-mode markup.
1056 Suggested by Jim Meyering.
1057
74553c98
AD
10582009-01-08 Akim Demaille <demaille@gostai.com>
1059
1060 Fix grep portability issues.
1061 Grep on Solaris does not support -q.
1062 Reported by Summum Bonum.
1063
1064 * NEWS: Add a stub for 2.4.2.
1065 * THANKS: Add Summum Bonum.
1066 * tests/atlocal.in (EGREP): New.
1067 (CC, CXX, XSLTPROC): Make it possible to override them via
1068 envvars.
1069 * tests/java.at: Use $EGREP instead of egrep.
1070 Use AT_CHECK's ignore instead of grep's -q.
1071
84eedf86
AD
10722008-12-11 Akim Demaille <demaille@gostai.com>
1073
1074 Pass the token type to yysyntax_error.
1075 * data/yacc.c (yysyntax_error): Take the transated token instead
1076 of the raw number.
1077 Adjust callers.
1078 * TODO: Update.
1079
5860cc8c
AD
10802008-12-11 Akim Demaille <demaille@gostai.com>
1081
1082 Formatting changes.
1083 * data/glr.c: Formatting changes.
1084
2b008529
AD
10852008-12-11 Akim Demaille <demaille@gostai.com>
1086
1087 Propagate i18n changes into glr.c.
1088 * TODO: Update.
1089 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
1090 building the error message format dynamically.
1091 * data/lalr1.java: Formatting changes.
1092
2cd1af95
AD
10932008-12-11 Akim Demaille <demaille@gostai.com>
1094
1095 Use testsuite -C.
1096 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
1097 Solves problems when top_srcdir is an absolute path.
1098 Suggested by Eric Blake.
1099 * configure.ac: Require Autoconf 2.62.
1100
eeb29422
AD
11012008-12-11 Akim Demaille <demaille@gostai.com>
1102
1103 Simplify the i18n of the error messages.
1104 * data/lalr1.cc: Comment changes.
1105 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
1106 lalr1.cc instead of building dynamically the format string.
1107
6617622c
AD
11082008-12-08 Akim Demaille <demaille@gostai.com>
1109
1110 Fix portability issue in the test suite.
1111 * tests/local.at (AT_MATCHES_CHECK): New.
1112 Based on Perl instead of Sed. Sed has too many portability
1113 pitfalls, not ever Sed is GNU Sed.
1114 * tests/actions.at (Fix user actions without a trailing semicolon):
1115 Use it.
1116
2ca1136c
AD
11172008-12-08 Akim Demaille <demaille@gostai.com>
1118
1119 Update data/README.
1120 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1121
6c63b895
AD
11222008-12-08 Akim Demaille <demaille@gostai.com>
1123
1124 Install autoconf as a submodule to get m4sugar.
1125 * .gitmodules: Add submodules/autoconf.
1126 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1127 submodules/autoconf.
1128
417e31d2
AD
11292008-12-08 Akim Demaille <demaille@gostai.com>
1130
1131 Test token.prefix in all the skeletons.
1132 * data/java.m4 (b4_token_enum): Use the token.prefix.
1133 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
1134 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
1135 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
1136 * tests/java.at: Comment changes.
1137 (AT_CHECK_JAVA_MINIMAL): Define the END token.
1138 (Java parser class and package names): Add token.prefix check.
1139
97abf544
AD
11402008-12-08 Akim Demaille <demaille@gostai.com>
1141
1142 Fix regeneration of atconfig.
1143 * tests/local.mk (tests/atconfig): The rule was incorrect, but
1144 remove it: now that there is no tests/Makefile.am, the top-level
1145 Makefile properly updates atconfig when needed.
1146
e8cd1ad6
DJ
11472008-12-07 Di-an Jan <dianj@freeshell.org>
1148
1149 Implement the FIXME that ends an user action with a semicolon
1150 if it seems necessary.
1151 * src/scan-code.l (flex rules section): Flag cpp directive from
1152 any `#' to the first unescaped end-of-line. Semicolon is not
1153 needed after `;', `{', '}', or cpp directives and is needed after
1154 any other token (whitespaces and comments have no effect).
1155 * tests/actions.at (Fix user actions without a trailing semicolon):
1156 New test.
1157 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1158 to make user actions complete statements.
1159 Adjust column numbers in error messages.
1160 * tests/regression.at (Fix user actions without a trailing semicolon):
1161 Remove. Covered by new test.
1162
ce9447fc
AD
11632008-12-07 Akim Demaille <demaille@gostai.com>
1164
1165 Update gnulib.
1166 * gnulib: Update from master.
1167
d333175f
EB
11682008-12-05 Eric Blake <ebb9@byu.net>
1169
1170 Avoid compiler warning.
1171 * src/output.c (muscle_insert_item_number_table): Delete unused
1172 function.
1173
215b40ac
EB
11742008-12-02 Eric Blake <ebb9@byu.net>
1175
1176 Build testsuite with newer autoconf.
1177 * tests/output.at (m4_expand): Don't override in newer autoconf,
1178 where the underlying implementation changed.
1179 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1180 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1181 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1182 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1183 since some of them contain unbalanced ')'.
1184
3bb21113
AD
11852008-12-01 Akim Demaille <demaille@gostai.com>
1186
1187 Use b4_symbol for printers and destructors everywhere.
1188 * data/bison.m4 (b4_symbol_action_location): New.
1189 * data/c.m4 (b4_symbol_actions): Remove.
1190 Adjust all callers to use by b4_symbol_foreach and the corresponding
1191 b4_symbol_printer/destructor macro.
1192 * data/glr.cc: Adjust.
1193 * data/lalr1.java: Adjust the %destructor sanity check.
1194 * src/output.c (symbol_code_props_output): Remove, we no longer
1195 need the b4_symbol_printers/destructors tables.
1196
fb7c5b1f
AD
11972008-12-01 Akim Demaille <demaille@gostai.com>
1198
1199 Use b4_symbol_case_.
1200 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
1201 b4_symbol_case_.
1202
cf6fb222
AD
12032008-12-01 Akim Demaille <demaille@gostai.com>
1204
1205 Move b4_symbol based macro to bison.m4.
1206 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
1207 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
1208 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
1209 (b4_type_foreach): Move to...
1210 * data/bison.m4: Here.
1211 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
1212 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 1213
e3c52a63
AD
12142008-12-01 Akim Demaille <demaille@gostai.com>
1215
1216 b4_symbol/type_foreach.
1217 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
1218 Use them.
1219
2bde9113
AD
12202008-12-01 Akim Demaille <demaille@gostai.com>
1221
1222 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
1223 Instead of defining complex list of tuples to define various
1224 properties of the symbols, we now prefer to define symbols as
1225 "structs" in m4: using the symbol key (its number), and the
1226 property name, b4_symbol gives it value. Use this to handle
1227 destructors and printers.
1228
2bde9113
AD
1229 * src/output.c (CODE_PROP): New.
1230 (prepare_symbol_definitions): Use it to define the printer and
1231 destructor related attributes of the symbols.
1232 * data/lalr1.cc (b4_symbol_actions): Rename as...
1233 (b4_symbol_action): this.
1234 Use b4_symbol instead of 6 arguments.
1235 (b4_symbol_printer, b4_symbol_destructor): New.
1236 Use them instead of b4_symbol_actions.
1237
44494bf6
AD
12382008-12-01 Akim Demaille <demaille@gostai.com>
1239
1240 Avoid capturing variables too easily.
1241 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
1242 v__ and p__ instead of v and p.
1243
fad814bd
AD
12442008-12-01 Akim Demaille <demaille@gostai.com>
1245
1246 Remove spurious empty line before syncline.
1247 * data/bison.m4 (b4_syncline): Don't output an empty line before
1248 the output.
1249
feda5527
AD
12502008-11-26 Akim Demaille <demaille@gostai.com>
1251
1252 Convert lib/Makefile.am into lib/local.mk.
1253 The real problem is rather gnulib.mk, which itself is extracted
1254 from a Makefile.am that gnulib expects to the "recursive". The
1255 tool prefix-gnulib-mk converts such a gnulib.mk to be
1256 non-recursive. Also, some AC_SUBST variables need to be adjusted.
1257
1258 * etc/prefix-gnulib-mk: New.
1259 * bootstrap (slurp): Use it to convert further gnulib.mk.
1260 No longer try to avoid re-creation of lib/gnulib.mk as the changes
1261 are deeper.
1262 * lib/Makefile.am: Rename as...
1263 * lib/local.mk: this.
1264 Adjust to be prefixed.
1265 * Makefile.am, configure.ac: Adjust.
1266 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
1267
56ddee7f
AD
12682008-11-26 Akim Demaille <demaille@gostai.com>
1269
1270 s/_FLAGS/FLAGS/.
1271 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
1272 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
1273 Reported by Eric Blake.
1274
728e89a0
AD
12752008-11-26 Akim Demaille <demaille@gostai.com>
1276
1277 Use b4_parser_tables_define in glr.cc.
1278 * data/glr.c: Use b4_parser_tables_define instead of defining the
1279 (deterministic integral) tables by hand.
1280
2c1bf9bd
AD
12812008-11-26 Akim Demaille <demaille@gostai.com>
1282
1283 Use b4_parser_tables_define in Java.
1284 * data/java.m4 (b4_typed_parser_table): Rename as...
1285 (b4_typed_parser_table_define): this, for consistency.
1286 Accept a comment as $4.
1287 Move $2 into yy*_.
1288 (b4_integral_parser_table): Rename as...
1289 (b4_integral_parser_table_define): this.
1290 * data/lalr1.java: Adjust all uses.
1291 Use b4_parser_tables_define instead of generation by hand.
1292
ba206cf4
AD
12932008-11-26 Akim Demaille <demaille@gostai.com>
1294
1295 Prepare the convergence bw C style and Java table generation.
1296 * data/bison.m4 (b4_tables_map, b4_tables_declare)
1297 (b4_tables_define): Rename as...
1298 (b4_integral_parser_tables_map, b4_parser_tables_declare)
1299 (b4_parser_tables_define): these.
1300 * data/c.m4 (b4_table_define): Rename as...
1301 (b4_integral_parser_table_define): this.
1302 * data/lalr1.cc: Adjust.
1303 (b4_table_define, b4_table_declare): Rename as...
1304 (b4_integral_parser_table_define)
1305 (b4_integral_parser_table_declare): these.
1306 (yyrline_): Move the comment where it is actually used.
1307 * data/yacc.c: Adjust.
1308 (yyrline): Use b4_integral_parser_table_define.
1309
d12f8e49
AD
13102008-11-26 Akim Demaille <demaille@gostai.com>
1311
1312 Regen.
1313 * src/parse-gram.h, src/parse-gram.c: Regen.
1314
0991e29b
AD
13152008-11-26 Akim Demaille <demaille@gostai.com>
1316
1317 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
1318 * data/lalr1.cc (b4_tables_map): Move to...
1319 * data/bison.m4: here.
1320 Update the comment for yytable during the flight.
1321 (b4_tables_declare, b4_tables_define): New.
1322 * data/lalr1.cc: Use them.
1323 * data/c.m4 (b4_table_define): New.
1324 * data/yacc.c: Use b4_tables_define instead of output the tables
1325 by hand.
1326 * tests/regression.at (Web2c Actions): Adjust the expected output,
1327 the order of the tables changed.
1328
3d3bc1fe
AD
13292008-11-26 Akim Demaille <demaille@gostai.com>
1330
1331 Get rid of (yy)rhs and (yy)prhs.
1332 These tables are no longer needed in the parsers, and they don't seem to
1333 be useful. They are not documented either.
feda5527 1334
3d3bc1fe
AD
1335 * src/output.c (prepare_rules): Get rid of rhs and prhs.
1336 Adjust the computation of (yy)r2.
1337
08c81469
AD
13382008-11-26 Akim Demaille <demaille@gostai.com>
1339
1340 Rule length is unsigned.
1341 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
1342
932b0c96
AD
13432008-11-26 Akim Demaille <demaille@gostai.com>
1344
1345 Get rid of lalr1-split.cc.
1346 It was no longer maintainer.
feda5527 1347
932b0c96
AD
1348 * data/lalr1-split.cc: Remove.
1349 * etc/bench.pl.in (bench_fusion_parser): Remove.
1350 Adjust.
1351
8452c667
AD
13522008-11-26 Akim Demaille <demaille@gostai.com>
1353
1354 Use yy* consistently.
1355 * data/glr.c: Now that yyrhs no longer exists as a global
1356 variable, rename local "rhs" variables into "yyrhs" for
1357 consistency.
1358
783aa653
AD
13592008-11-25 Akim Demaille <demaille@gostai.com>
1360
1361 Get rid of yyrhs and yyprhs in glr.c.
1362 * data/glr.c (yyrhs, yyprhs): Remove.
1363 Instead, use the state stack and yystos.
1364
6130b755
AD
13652008-11-25 Akim Demaille <demaille@gostai.com>
1366
1367 Flag glr tests.
1368 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
1369 as an Autotest keyword.
1370
95a7b1c9
AD
13712008-11-25 Akim Demaille <demaille@gostai.com>
1372
1373 Prefer TESTSUITE_FLAGS.
1374 TESTSUITEFLAGS is barely readable.
feda5527 1375
95a7b1c9
AD
1376 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
1377 for backward compatibility.
1378 Use the former instead of the latter.
1379
b4f18401
AD
13802008-11-25 Akim Demaille <demaille@gostai.com>
1381
1382 Get rid of yyrhs and yyprhs in larl1.java.
1383 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
1384 (yy_reduce_print): Rather, use yystos_ and the state stack.
1385
c265fd6b
AD
13862008-11-25 Akim Demaille <demaille@gostai.com>
1387
1388 Formatting changes.
1389
68dbdee8
AD
13902008-11-25 Akim Demaille <demaille@gostai.com>
1391
1392 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
1393 They were used to get the symbol types, given a rule number, when
1394 displaying the top of the stack before a reduction. But the
1395 symbol type is available from the state stack. This has two be
1396 benefits: two tables less in the parser (making it smaller), and a
1397 more consistent use of the three stacks which will help to fuse
1398 them.
feda5527 1399
68dbdee8
AD
1400 * data/yacc.c (yyprhs, yyrhs): Remove.
1401 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
1402 (yy_reduce_print): Take yyssp as argument.
1403 Use it, together with yystos, to get the symbol type.
1404 * tests/regression.at (Web2c Report): Remove these tables from the
1405 expected output.
1406
6ab1adbe
AD
14072008-11-25 Akim Demaille <demaille@gostai.com>
1408
1409 b4_tables_map.
1410 The point is to factor the generation of the tables across skeletons.
1411 This is language dependant.
feda5527 1412
6ab1adbe
AD
1413 * data/c.m4 (b4_comment_): New.
1414 Should be usable to define how to generate tables independently of
1415 the language.
1416 (b4_c_comment): New.
1417 (b4_comment): Bounce to b4_c_comment.
1418 Now support $2 = [PREFIX] for indentation.
1419 * data/lalr1.cc (b4_table_declare): Don't output a comment if
1420 there is no comment.
1421 Indent it properly when there is one.
1422 Output the ending semicolon.
1423 (b4_table_define): Space changes.
1424 Output the ending semicolon.
1425 (b4_tables_map): New.
1426 Use it twice instead of declaring and defining the (integral)
1427 tables by hand.
1428
0fddb3d5
AD
14292008-11-25 Akim Demaille <demaille@gostai.com>
1430
1431 b4_table_declare.
1432 * data/lalr1.cc (b4_table_declare): New.
1433 Use it to declare the tables defined with b4_table_define.
1434 (b4_table_define): Declare a third arg to match b4_table_declare
1435 signature.
1436 Move all the comments around invocations of b4_table_define into
1437 the invocations itselves.
1438 Move things around to have the order for declarations and
1439 definitions.
1440
c4ddc0fb
AD
14412008-11-25 Akim Demaille <demaille@gostai.com>
1442
1443 Formatting changes.
1444 * data/lalr1.java: here.
1445
e0c653e7
AD
14462008-11-25 Akim Demaille <demaille@gostai.com>
1447
1448 b4_args is more general than only C++.
1449 * data/lalr1.cc (b4_args, _b4_args): Move to...
1450 * data/bison.m4: here.
1451
4182a0a1
DJ
14522008-11-21 Di-an Jan <dianj@freeshell.org>
1453
1454 Implement no-XXX arguments for --warnings, --report, --trace.
1455 * src/getargs.c (flags_argmatch): Handles no-XXX.
1456 Fix typo in doxygen comment.
1457
01466c3e
AD
14582008-11-21 Akim Demaille <demaille@gostai.com>
1459
1460 Display the changes in cross-options.texi.
1461 * build-aux/cross-options.pl ($sep): New, to separate items.
1462 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
1463 changes.
1464
a7c09cba
DJ
14652008-11-20 Di-an Jan <dianj@freeshell.org>
1466
1467 Improves options in the manual.
1468 * doc/bison.texinfo (-g, -x): Add space before argument.
1469 (Option Cross Key): Implement FIXME: listing directives also.
1470 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1471 (Short Option): Special case -d. Put arguments inside @option.
feda5527 1472 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
1473 src/scan-gram.l (actual name passed as the first argument)
1474 with special case for %define.
1475 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
1476 to build-aux/cross-options.pl.
1477 * src/getargs.c (usage): Document limitations of cross-options.pl.
1478 * src/scan-gram.l: Likewise.
1479
6c88b51e
JD
14802008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1481
1482 Fix unexpanded macros in GLR defines file.
1483 Reported by Csaba Raduly at
1484 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1485 * THANKS (Csaba Raduly): Add.
1486 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1487 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1488 lexer in a separate module that includes the defines file.
1489 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
1490 source.
1491 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1492 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1493 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1494 (AT_DATA_SOURCE_PROLOGUE): New.
1495 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1496 (AT_DATA_SOURCE): New.
1497 (AT_FULL_COMPILE): Extend to support an additional source file.
1498
1e034807
AD
14992008-11-18 Akim Demaille <demaille@gostai.com>
1500
1501 More TODO.
1502 * TODO: More short term issues.
1503
e3dda35c
AD
15042008-11-18 Akim Demaille <demaille@gostai.com>
1505
1506 Regen.
1507 * src/parse-gram.h, src/parse-gram.c: Regen.
1508
bd187d7b
AD
15092008-11-18 Akim Demaille <demaille@gostai.com>
1510
1511 Use b4_subtract where possible.
1512 * data/lalr1.cc (b4_subtract): Move to...
1513 * data/bison.m4: here.
1514 * data/glr.c (b4_rhs_data): Use it.
1515 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
1516
6085ab0d
AD
15172008-11-18 Akim Demaille <demaille@gostai.com>
1518
1519 Remove incorrect mode specification.
1520 * data/glr.cc: Don't pretend it's C code.
1521
9ce405ce
JD
15222008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1523
1524 Simplify last patch slightly.
1525 * src/getargs.c (getargs): Here.
1526
a8beef7e
JD
15272008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1528
1529 Fix last warning from --enable-gcc-warnings.
1530 * src/getargs.c (getargs): Don't assign const address to non-const
1531 pointer.
1532
d50eea6d
JD
15332008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1534
1535 Don't let maintainer-*-check targets force a version update.
1536 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1537 handled.
1538
f5f419de
DJ
15392008-11-17 Di-an Jan <dianj@freeshell.org>
1540
1541 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1542 Align menus. Adjust word wrapping. Use node names for menu names.
1543 (Examples): Don't abbreviate node names.
1544 (LocalWords): Remove abbreviations.
1545 (Copying): Make description a sentence.
d50eea6d 1546 (Java Action Features): Remove period to match the rest of menu.
f5f419de 1547
d73e55e0
DJ
15482008-11-17 Di-an Jan <dianj@freeshell.org>
1549
1550 Handles several --enable-gcc-warnings.
1551 * src/getargs.c (command_line_location): Set parameters to void.
1552 * src/output.c (symbol_type_name_cmp): Make static.
1553 (symbols_by_type_name): Set parameters to void.
1554 (symbol_definitions_output): Remove unused parameter. Rename as...
1555 (prepare_symbol_definitions): this.
1556 (muscles_output): Move symbol_definitions_output to...
1557 (output): here as prepare_symbol_definitions.
1558 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 1559 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 1560
68c989de
DJ
15612008-11-17 Di-an Jan <dianj@freeshell.org>
1562
1563 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
1564 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
1565
23ce6f4c
AD
15662008-11-16 Akim Demaille <demaille@gostai.com>
1567
1568 Add missing $(EXEEXT).
1569 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
1570 "src/bison$(EXEEXT)".
1571 Reported by Di-an Jan.
1572
dd704c35
AD
15732008-11-15 Akim Demaille <demaille@gostai.com>
1574
1575 * TODO: Update.
1576
dab244d5
AD
15772008-11-15 Akim Demaille <demaille@gostai.com>
1578
1579 Formatting changes.
1580 * tests/input.at: here.
1581
4b4da9fb
AD
15822008-11-15 Akim Demaille <demaille@gostai.com>
1583
1584 Remove duplicate header inclusion.
1585 * src/LR0.c: here.
1586
4ea3f53d
AD
15872008-11-15 Akim Demaille <demaille@gostai.com>
1588
1589 * src/parse-gram.h, src/parse-gram.c: Regen.
1590
cb823b6f
AD
15912008-11-15 Akim Demaille <demaille@gostai.com>
1592
1593 Support parametric types.
b06df3c2
AD
1594
1595 There are two issues to handle: first scanning nested angle
1596 bracket pairs to support types such as std::pair< std::string,
1597 std::list<std::string> > >.
1598
1599 Another issue is to address idiosyncracies of C++: do not glue two
1600 closing angle brackets together (otherwise it's operator>>), and
1601 avoid sticking blindly a TYPE to the opening <, as it can result
1602 in '<:' which is a digraph for '['.
1603
cb823b6f
AD
1604 * src/scan-gram.l (brace_level): Rename as...
1605 (nesting): this.
1606 (SC_TAG): New.
1607 Implement support for complex tags.
b06df3c2 1608 (tag): Accept
cb823b6f
AD
1609 , but not <.
1610 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
1611 (b4_symbol_variant): Leave space around types as parameters.
1612 * examples/variant.yy: Use nested template types and leading ::.
1613 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
1614 Rename as...
1615 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
1616 * tests/c++.at: Test parametric types.
1617
7b6e6753
AD
16182008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1619
1620 Test token.prefix.
1621 This is not sufficient, but we test at least that the make_SYMBOL
1622 interface is not affected by token.prefix. A more general test
1623 will be implemented when the support of token.prefix is generalized
1624 to more skeletons.
b06df3c2 1625
7b6e6753
AD
1626 * tests/c++.at: One more variant test, using token.prefix.
1627
dddec537
AD
16282008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1629
1630 Test the make_TOKEN interface.
1631 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
1632 Factor the common code in yylex.
1633 Use it to test "%define lex_symbol".
1634
7d3e21ba
AD
16352008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1636
1637 Formatting change.
1638
4fc55348
AD
16392008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1640
1641 Simplify code for variants bench marks.
1642 * etc/bench.pl.in (&generate_grammar_list): Define and use
1643 location_type.
1644 Factor the common code in yylex.
1645
070e6509
AD
16462008-11-15 Akim Demaille <demaille@gostai.com>
1647
1648 Better error message.
1649 * bootstrap (find_tool): Fix the error message.
1650
0078681b
AD
16512008-11-15 Akim Demaille <demaille@gostai.com>
1652
1653 Update variant.yy to newest interface.
1654 * examples/variant.yy: Define lex_symbol.
1655 Adjust.
1656
ff084799
AD
16572008-11-15 Akim Demaille <demaille@gostai.com>
1658
1659 Don't use locations in variant.yy.
1660 * examples/variant.yy: Adjust to not using locations.
1661
b0d79ec6
AD
16622008-11-15 Akim Demaille <demaille@gostai.com>
1663
1664 Comment changes.
1665 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
1666 comments for the license.
1667
d4977ce3
AD
16682008-11-15 Akim Demaille <demaille@gostai.com>
1669
1670 Remove tests/Makefile.am.
1671 * tests/Makefile.am: Rename as...
1672 * tests/local.mk: this.
1673 * Makefile.am, configure.ac: Adjust.
1674 * Makefile.am (DISTCLEANFILES): Define.
1675 (maintainer-check, maintainer-xml-check, maintainer-push-check):
1676 Remove, we no longer need to bounce to the real targets.
1677
87f1149a
AD
16782008-11-15 Akim Demaille <demaille@gostai.com>
1679
1680 Comment changes.
1681
36415906
AD
16822008-11-15 Akim Demaille <demaille@gostai.com>
1683
1684 djgpp/local.mk.
1685 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
1686 * djgpp/local.mk: this new file.
1687
e2c2f696
AD
16882008-11-15 Akim Demaille <demaille@gostai.com>
1689
1690 Remove doc/Makefile.am.
1691 * doc/Makefile.am: Rename as...
1692 * doc/local.mk: this.
1693 Adjust paths
1694 * Makefile.am, configure.ac: Adjust.
1695 * Makefile.am (MOSTLYCLEANFILES): New.
1696 * src/local.mk: Adjust.
1697
2ead32e6
AD
16982008-11-15 Akim Demaille <demaille@gostai.com>
1699
1700 Move sc_tight_scope into maint.mk.
b06df3c2
AD
1701 It does not work, and I don't know how it was supposed to work: it
1702 seems to be looking for sources in the build tree. I just moved
1703 it at a better place, fixing it is still required.
1704
2ead32e6
AD
1705 * src/local.mk (echo): Remove.
1706 (sc_tight_scope): Move to...
1707 * maint.mk: here.
1708
2df9ec37
AD
17092008-11-15 Akim Demaille <demaille@gostai.com>
1710
1711 Regen.
1712 * src/parse-gram.h, src/parse-gram.h: Regen.
1713
0305d25e
AD
17142008-11-15 Akim Demaille <demaille@gostai.com>
1715
1716 Remove src/Makefile.am.
1717 * src/Makefile.am: Rename as...
1718 * src/local.mk: this.
1719 Prefix all the paths with src/.
1720 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
1721 (AM_CPPFLAGS): Find find in builddir/src.
1722 (YACC): Move the flags into...
1723 (AM_YFLAGS): here.
1724 * maint.mk (sc_tight_scope): Disable.
1725 It used to bounce to the version in src/Makefile.am which is now
1726 part of this very Makefile.
1727 * Makefile.am, configure.ac: Adjust.
1728 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
1729 include "..." to find files "here": we are no longer in src/, so
1730 qualify the includes with src/.
1731 * doc/Makefile.am (PREPATH): No longer include the top_builddir
1732 prefix.
1733 (.x.1): Adjust to be able to create src/foo from the top level
1734 Makefile, instead of going bounce to src/Makefile the creation of
1735 foo.
1736
5277c0a3
AD
17372008-11-15 Akim Demaille <demaille@gostai.com>
1738
1739 Remove useless variable.
1740 * doc/Makefile.am (srcsrcdir): Remove.
1741
6a5aa0cd
AD
17422008-11-15 Akim Demaille <demaille@gostai.com>
1743
1744 Remove data/Makefile.am.
1745 * data/Makefile.am: Rename as...
1746 * data/local.mk: this.
1747 Adjust paths.
1748 * Makefile.am, configure.ac: Adjust.
1749
7cb794dc
AD
17502008-11-15 Akim Demaille <demaille@gostai.com>
1751
1752 Remove etc/Makefile.am.
1753 * etc/Makefile.am: Rename as...
1754 * etc/local.mk: this.
1755 Adjust.
1756 * Makefile.am, configure.ac: Adjust.
1757
cd409e3b
AD
17582008-11-15 Akim Demaille <demaille@gostai.com>
1759
1760 Remove examples/local.mk.
1761 examples/calc++/Makefile.am might be interesting to keep as is, since
1762 it is an example in itself.
2df9ec37 1763
cd409e3b
AD
1764 * examples/Makefile.am: Rename as...
1765 * examples/local.mk: this.
1766 Adjust.
1767 * Makefile.am, configure.ac: Adjust.
1768
9a1e4214
AD
17692008-11-15 Akim Demaille <demaille@gostai.com>
1770
1771 Remove build-aux/Makefile.am.
1772 Recursive Makefiles are really way too slow, let's get rid of some of
1773 them.
2df9ec37 1774
9a1e4214
AD
1775 * build-aux/Makefile.am: Rename as...
1776 * build-aux/local.mk: this.
1777 Adjust paths.
1778 * Makefile.am, configure.ac: Adjust.
1779
0634493c
AD
17802008-11-15 Akim Demaille <demaille@gostai.com>
1781
1782 Provide convenience constructors for locations and positions.
1783 * data/location.cc (position::position): Accept file, line and
1784 column as arguments with default values.
1785 Always qualify initial line and column literals as unsigned.
1786 (location::location): Provide convenience constructors.
1787
fe1b448a
AD
17882008-11-15 Akim Demaille <demaille@gostai.com>
1789
b06df3c2
AD
1790 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
1791 token type.
fe1b448a
AD
1792 Using template buys us nothing, and makes it uselessly complex to
1793 construct a symbol. Besides, it could not be generalized to other
1794 languages, while make_FOO would work in C/Java etc.
2df9ec37 1795
fe1b448a
AD
1796 * data/lalr1.cc (b4_symbol_): New.
1797 (b4_symbol): Use it.
1798 (b4_symbol_constructor_declaration_)
1799 (b4_symbol_constructor_definition_): Instead of generating
1800 specializations of an overloaded template function, just generate
1801 several functions whose names are forged from the token names
1802 without the token.prefix.
1803 (b4_symbol_constructor_declarations): Generate them for all the
1804 symbols, not just by class of symbol type, now that instead of
1805 specializing a function template by the token, we generate a
1806 function named after the token.
1807 (b4_symbol_constructor_specialization_)
1808 (b4_symbol_constructor_specializations): Remove.
1809 * etc/bench.pl.in: Adjust to this new API.
1810
5679f311
AD
18112008-11-13 Akim Demaille <demaille@gostai.com>
1812
1813 %define token.prefix.
b06df3c2
AD
1814 Provide a means to add a prefix to the name of the tokens as
1815 output in the generated files. Because of name clashes, it is
1816 good to have such a prefix such as TOK_ that protects from names
1817 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 1818
5679f311
AD
1819 * data/bison.m4 (token.prefix): Empty by default.
1820 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
1821 * data/lalr1.cc (b4_symbol): Ditto.
1822
3204049e
AD
18232008-11-13 Akim Demaille <demaille@gostai.com>
1824
1825 Compute at M4 time some of the subtractions.
90290ce5 1826 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
1827 (b4_rhs_data): Use it.
1828
202598d3
AD
18292008-11-13 Akim Demaille <demaille@gostai.com>
1830
1831 symbol::token.
b06df3c2 1832 This allows the user to get the type of a token returned by yylex.
2df9ec37 1833
202598d3
AD
1834 * data/lalr1.cc (symbol::token): New.
1835 (yytoknum_): Define when %define lex_symbol, independently of
1836 %debug.
1837 (yytoken_number_): Move into...
1838 (symbol::token): here, since that's the only use.
1839 The other one is YYPRINT which was not officially supported
1840 by lalr1.cc, and anyway it did not work since YYPRINT uses this
1841 array under a different name (yytoknum).
1842
fc2476c7
AD
18432008-11-13 Akim Demaille <demaille@gostai.com>
1844
1845 YYERRCODE.
1846 * TODO (YYERRCODE): Mention the case of $undef.
1847
865f1e9f
AD
18482008-11-13 Akim Demaille <demaille@gostai.com>
1849
1850 TODO: YYPRINT.
1851 * TODO (YYPRINT): New.
1852
cb0b136a
AD
18532008-11-13 Akim Demaille <demaille@gostai.com>
1854
1855 Comment changes.
1856 * data/lalr1.cc, data/yacc.c: Fix the description of the
1857 yytranslate and yytoknum tables.
1858
2c086d29
AD
18592008-11-13 Akim Demaille <demaille@gostai.com>
1860
1861 Define make_symbol in the header.
b06df3c2
AD
1862 To reach good performances these functions should be inlined (yet
1863 this is to measure precisely). To this end they must be available
1864 to the caller.
2df9ec37 1865
2c086d29
AD
1866 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
1867 location_type with the class name.
1868 Since will now be output in the header, declare "inline".
1869 No longer use b4_symbol_constructor_specializations, but
1870 b4_symbol_constructor_definitions in the header.
1871 Don't call it in the *.cc file.
1872
1c4af381
AD
18732008-11-13 Akim Demaille <demaille@gostai.com>
1874
1875 Define yytranslate in the header for lex_symbol.
1876 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
1877 into the header file when using %define lex_symbol.
1878 (yytranslate_): Declare inline.
1879
e51b0a82
AD
18802008-11-13 Akim Demaille <demaille@gostai.com>
1881
b06df3c2
AD
1882 Define the constructors of symbol_type in
1883 b4_symbol_constructor_definitions.
e51b0a82 1884 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
1885 forthcoming patch will move elsewhere. Hence the interest of
1886 putting them together.
2df9ec37 1887
b06df3c2
AD
1888 The stack_symbol_type does not need to be moved, it is used only
1889 by the parser.
2df9ec37 1890
e51b0a82
AD
1891 * data/lalr1.cc: Move symbol_type and symbol_base_type
1892 constructors into...
1893 (b4_symbol_constructor_definitions): here.
1894 Adjust.
1895
78835571
AD
18962008-11-13 Akim Demaille <demaille@gostai.com>
1897
1898 Make it easier to move the definition of yytranslate_.
1899 Forthcoming changes will make it possible to use yytranslate_
1900 from outside the parser implementation file.
2df9ec37 1901
78835571
AD
1902 * data/lalr1.cc (b4_yytranslate_definition): New.
1903 Use it.
1904
c1e6c88c
AD
19052008-11-13 Akim Demaille <demaille@gostai.com>
1906
1907 Remove useless class specification.
1908 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
1909 to refer to the class name to use a type defined by the class for
1910 arguments of member functions.
1911
4654b0c0
AD
19122008-11-13 Akim Demaille <demaille@gostai.com>
1913
1914 Finer input type for yytranslate.
1915 This patch is debatable: the tradition expects yylex to return an int
1916 which happens to correspond to token_number (which is an enum). This
1917 allows for instance to return characters (such as '*' etc.). But this
1918 goes against the stronger typing I am trying to have with the new
1919 lex interface which return a symbol_type. So in this case, feed
1920 yytranslate_ with a token_type.
2df9ec37 1921
4654b0c0
AD
1922 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
1923 expect a token_type.
1924
dd735e4e
AD
19252008-11-13 Akim Demaille <demaille@gostai.com>
1926
1927 Honor lex-params in %define lex_symbol mode.
1928 * data/lalr1.cc: Use b4_lex_param.
1929
6659366c
AD
19302008-11-13 Akim Demaille <demaille@gostai.com>
1931
1932 Simplify names.
1933 * src/output.c (symbol_definitions_output): Rename symbol
1934 attributes type_name and has_type_name as type and has_type.
1935 * data/lalr1.cc: Adjust uses.
1936
e9805e57
AD
19372008-11-13 Akim Demaille <demaille@gostai.com>
1938
1939 Use b4_type_names for the union type.
b06df3c2
AD
1940 The union used to compute the size of the variant used to iterate
1941 over the type of all the symbols, with a lot of redundancy. Now
1942 iterate over the lists of symbols having the same type-name.
2df9ec37 1943
e9805e57
AD
1944 * data/lalr1.cc (b4_char_sizeof_): New.
1945 (b4_char_sizeof): Use it.
1946 Adjust to be called with a list of numbers instead of a single
1947 number.
1948 Adjust its caller for new-line issues.
1949
aea10ef4
AD
19502008-11-13 Akim Demaille <demaille@gostai.com>
1951
1952 Define the "identifier" of a symbol.
b06df3c2
AD
1953 Symbols may have several string representations, for instance if
1954 they have an alias. What I call its "id" is a string that can be
1955 used as an identifier. May not exist.
2df9ec37 1956
b06df3c2
AD
1957 Currently the symbols which have the "tag_is_id" flag set are
1958 those that don't have an alias. Look harder for the id.
2df9ec37 1959
aea10ef4
AD
1960 * src/output.c (is_identifier): Move to...
1961 * src/symtab.c (is_identifier): here.
1962 * src/symtab.h, src/symtab.c (symbol_id_get): New.
1963 * src/output.c (symbol_definitions_output): Use it to define "id"
1964 and "has_id".
1965 Remove the definition of "tag_is_id".
1966 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
1967 "tag_is_id" were used to produce code.
1968 We still use "tag" for documentation.
1969
2ea7730c
AD
19702008-11-11 Akim Demaille <demaille@gostai.com>
1971
1972 Locations are no longer required by lalr1.cc.
1973 * data/lalr1.cc (_b4_args, b4_args): New.
1974 Adjust all uses of locations to make them optional.
1975 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
1976 (AT_CHECK_NAMESPACE): Check the use of locations.
1977 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
1978 without locations with lalr1.cc.
1979 Test these cases.
1980 * tests/output.at: Check lalr1.cc with and without location
1981 support.
1982 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
1983 Don't use locations.
1984
7ca2266a
AD
19852008-11-11 Akim Demaille <demaille@gostai.com>
1986
1987 AT_FULL_COMPILE.
1988 * tests/local.at (AT_FULL_COMPILE): New.
1989 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
1990
1a7a65f9
AD
19912008-11-11 Akim Demaille <demaille@gostai.com>
1992
1993 Support parens in calc++.
1994 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
1995 * examples/calc++/test (run): Check the expected output.
1996 Adjust callers.
1997 Check parens too.
1998
c944f7f2
AD
19992008-11-11 Akim Demaille <demaille@gostai.com>
2000
2001 Simplify lalr1.cc since %defines is mandatory.
2002 * data/lalr1.cc: Remove useless calls to b4_defines_if.
2003
dada3cd1
AD
20042008-11-11 Akim Demaille <demaille@gostai.com>
2005
2006 TODO: yyfmt.
2007 * TODO (yysyntax_error): New item.
2008
422c18f4
AD
20092008-11-11 Akim Demaille <demaille@gostai.com>
2010
2011 Prefer M4 to CPP.
2012 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
2013 YYERROR_VERBOSE.
2014
a0ffc175
AD
20152008-11-11 Akim Demaille <demaille@gostai.com>
2016
2017 Support i18n of the parse error messages.
2018 * TODO (lalr1.cc/I18n): Remove.
2019 * data/lalr1.cc (yysyntax_error_): Support the translation of the
2020 error messages, as done in yacc.c.
2021 Stay within the yy* pseudo namespace.
2022
00a8a083
AD
20232008-11-11 Akim Demaille <demaille@gostai.com>
2024
2025 More TODO.
2026 * TODO (single stack, yysyntax_error): New.
2027
09277875
AD
20282008-11-11 Akim Demaille <demaille@gostai.com>
2029
2030 Make it possible to return a symbol_type from yylex.
2031 * data/lalr1.cc (b4_lex_symbol_if): New.
2032 (parse): When lex_symbol is defined, expected yylex to return the
2033 complete lookahead.
2034 * etc/bench.pl.in (generate_grammar_list): Extend to support this
2035 yylex interface.
2036 (bench_variant_parser): Exercise it.
2037
64c1b92a
AD
20382008-11-11 Akim Demaille <demaille@gostai.com>
2039
2040 Remove useless bench case.
2041 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
2042 no longer used.
2043
2722aa42
AD
20442008-11-11 Akim Demaille <demaille@gostai.com>
2045
2046 Improve display of directives.
2047 * etc/bench.pl.in (parse_term): Don't add useless eol.
2048
918eb7c5
AD
20492008-11-11 Akim Demaille <demaille@gostai.com>
2050
2051 Use string_cast in the bench.
2052 * etc/bench.pl.in (generate_grammar_list): Define and use
2053 string_cast.
2054
39be9022
AD
20552008-11-11 Akim Demaille <demaille@gostai.com>
2056
2057 Replace yychar with a Boolean.
2058 * data/lalr1.cc (parse::yychar): Replace by...
2059 (parse::yyempty): this.
2060
a2e3fa77
AD
20612008-11-11 Akim Demaille <demaille@gostai.com>
2062
2063 Factor the tables.
2064 * TODO: New item.
2065
aba12ad1
AD
20662008-11-11 Akim Demaille <demaille@gostai.com>
2067
2068 Let yytranslate handle the eof case.
2069 * data/lalr1.cc (yytranslate_): Handle the EOF case.
2070 Adjust callers.
2071 No longer expect yychar to be equal to yyeof_, rather, test the
2072 lookahead's (translated) kind.
2073
27cb5b59
AD
20742008-11-11 Akim Demaille <demaille@gostai.com>
2075
2076 yychar cannot be empty in yyerrlab.
2077 * TODO (yychar == yyempty_): New.
2078 * data/lalr1.cc: Remove the handling of this case.
2079 This eases forthcoming changes related to yychar and yytranslate.
2080
fce629c0
AD
20812008-11-11 Akim Demaille <demaille@gostai.com>
2082
2083 Bench: syntactic sugar for %define/#define.
2084 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
2085 (&bench_push_parser, bench_variant_parser): Use this feature.
2086 (&eat): New.
2087 Use it.
2088
ce671960
AD
20892008-11-11 Akim Demaille <demaille@gostai.com>
2090
2091 Less memory pressure on the "list" bench.
2092 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
2093 the values, to limit memory pressure.
2094
2873fdf8
AD
20952008-11-11 Akim Demaille <demaille@gostai.com>
2096
2097 Introduce make_symbol.
b06df3c2
AD
2098 make_symbol provides a means to construct a full symbol (kind,
2099 value, location) in a single shot. It is meant to be a Symbol
2100 constructor, parameterized by the symbol kind so that overloading
2101 would prevent incorrect kind/value pairs. Unfortunately
2102 parameterized constructors do not work well in C++ (unless the
2103 parameter also appears as an argument, which is not acceptable),
2104 hence the use of a function instead of a constructor.
2df9ec37 2105
2873fdf8
AD
2106 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2107 (b4_symbol_constructor_declarations)
2108 (b4_symbol_constructor_specialization_)
2109 (b4_symbol_constructor_specializations)
2110 (b4_symbol_constructor_definition_)
2111 (b4_symbol_constructor_definitions): New.
2112 Use them where appropriate to generate declaration, declaration of
2113 the specializations, and implementations of the templated
2114 overloaded function "make_symbol".
2115 (variant::variant): Always define a default ctor.
2116 Also provide a copy ctor.
2117 (symbol_base_type, symbol_type): New ctor overloads for value-less
2118 symbols.
2119 (symbol_type): Now public, so that functions such as yylex can use
2120 it.
2121
8be046d7
AD
21222008-11-11 Akim Demaille <demaille@gostai.com>
2123
2124 Inform m4 whether a tag is a valid id.
2125 * src/output.c (is_identifier): New.
2126 (symbol_definitions_output): Use it to define tag_is_id.
2127 But maybe this should be done at m4 level?
2128
de62edee
AD
21292008-11-11 Akim Demaille <demaille@gostai.com>
2130
2131 Test 214 was failing: it greps with a pattern containing [ ]*
2132 which obviously meant to catch spaces and tabs, but contained only
2133 spaces. Tabulations in sources are a nuisance, so to simplify the
2134 matter, get rid of all the tabulations in the Java sources. The
2135 other skeletons will be treated equally later.
2136
2137 * data/java.m4, data/lalr1.java: Untabify.
2138 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
2139 tabulations are no longer generated.
2140
905f0697
PB
21412008-11-11 Paolo Bonzini <bonzini@gnu.org>
2142
2143 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
2144 * configure.ac: Adjust usage.
2145 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2146 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2147 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
2148
09ccae9b
DJ
21492008-11-10 Di-an Jan <dianj@freeshell.org>
2150
2151 Workaround Java's ``code too large'' problem for parser tables
2152 in most cases, by using one function per initialization.
2153 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
2154 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
2155 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
2156 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
2157 (yytname_): Use b4_typed_parser_table.
2158 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
2159 ``code too large'' error.
2160
1979121c
DJ
21612008-11-10 Di-an Jan <dianj@freeshell.org>
2162
2163 * NEWS: Document them.
de62edee 2164
1979121c
DJ
2165 General Java skeleton improvements.
2166 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
2167 using gcj < 4.3 in the testsuite, according to comments in
2168 gnulib/m4/javacomp.m4.
2169 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
2170 location_type, position_type): Remove extraneous brackets from
2171 b4_percent_define_default.
2172 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
2173 m4_define and m4_define_default.
2174 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
2175 which marks the end of user code with appropriate syncline, like all
2176 the other skeletons.
2177 (b4_user_post_prologue): Add. Don't silently drop.
2178 (yylex): Remove.
2179 (parse): Inline yylex.
2180 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
2181 (%{...%}): Fix typo of %code imports.
2182 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
2183
2184 Support annotations on parser class with %define annotations.
2185 * data/lalr1.java (annotations): Add to parser class modifier.
2186 * doc/bison.texinfo (Java Parser Interface): Document
2187 %define annotations.
2188 (Java Declarations Summary): Document %define annotations.
2189 * tests/java.at (Java parser class modifiers): Test annotations.
2190
2191 Do not generate code for %error-verbose unless requested.
2192 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
2193 Make private. Make conditional on %error-verbose.
2194 (getErrorVerbose, setErrorVerbose): New.
2195 (yytnamerr_): Make conditional on %error-verbose.
2196 (yysyntax_error): Make some code conditional on %error-verbose.
2197 * doc/bison.texinfo (Java Bison Interface): Remove the parts
2198 about %error-verbose having no effect.
2199 (getErrorVerbose, setErrorVerbose): Document.
2200
2201 Move constants for token names to Lexer interface.
2202 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
2203 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
2204 (parse): Qualify EOF to Lexer.EOF.
2205 * doc/bison.texinfo (Java Parser Interface): Move documentation of
2206 EOF and token names to Java Lexer Interface.
2207 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
2208
2209 Make yyerror public.
2210 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
2211 (yyerror): Change to public. Add Javadoc comments. Use longer
2212 parameter names. Make the body rather than the declarator
2213 conditional on %locations.
2214 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
2215
2216 Allow user to add code to the constructor with %code init.
2217 * data/java.m4 (b4_init_throws): New, for %define init_throws.
2218 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
2219 Add %code init to the front of the constructor body.
2220 * doc/bison.texinfo (YYParser.YYParser): Document %code init
2221 and %define init_throws.
2222 (Java Declarations Summary): Document %code init and
2223 %define init_throws.
2224 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
2225 (Java constructor init and init_throws): Add tests.
de62edee 2226
42f832d6
AD
22272008-11-10 Akim Demaille <demaille@gostai.com>
2228
2229 Update TODO.
2230 * TODO (-D): is implemented.
2231 (associativity): Same precedence must have the same associativity.
2232 For instance, how can a * b / c be parsed if * is %left and / is
2233 %right?
2234 (YYERRORCODE, YYFAIL, YYBACKUP): New.
2235
247efe34
AD
22362008-11-10 Akim Demaille <demaille@gostai.com>
2237
2238 Formatting changes.
2239
5d731440
AD
22402008-11-10 Akim Demaille <demaille@gostai.com>
2241
2242 More information about the symbols.
2243 * src/output.c (type_names_output): Document all the symbols,
2244 including those that don't have a type-name.
2245 (symbol_definitions_output): Define "is_token" and
2246 "has_type_name".
2247 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
2248 type-name, now that they are defined too in b4_type_names.
2249
21db118b
AD
22502008-11-10 Akim Demaille <demaille@gostai.com>
2251
2252 Regen.
2253
6ed15cde
AD
22542008-11-10 Akim Demaille <demaille@gostai.com>
2255
2256 Make parser::yytranslate static.
b06df3c2
AD
2257 Small speedup (1%) on the list grammar. And makes yytranslate_
2258 available in non member functions.
de62edee 2259
6ed15cde
AD
2260 * data/lalr1.cc (yytranslate_): Does not need to be a instance
2261 function.
2262
30bb2edc
AD
22632008-11-10 Akim Demaille <demaille@gostai.com>
2264
2265 Avoid trailing spaces.
2266 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
2267 * data/lalr1.cc: Don't indent before rule and symbol actions, as
2268 they can be empty, and anyway this incorrectly indents the first
2269 action.
2270
b3a28fd4
AD
22712008-11-10 Akim Demaille <demaille@gostai.com>
2272
2273 Comment changes.
2274
914202bd
AD
22752008-11-10 Akim Demaille <demaille@gostai.com>
2276
2277 Use "enum" for integral constants.
2278 This is just nicer to read, I observed no speedup.
de62edee 2279
914202bd
AD
2280 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
2281 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
2282 (yyuser_token_number_max_, yyundef_token_): Move into...
2283 (yytranslate_): here.
2284
c17f9a4a
AD
22852008-11-10 Akim Demaille <demaille@gostai.com>
2286
2287 Shortcuts in bench directives.
2288 * etc/bench.pl.in (parse_dirs): New.
2289 Use it.
2290 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
2291 Create the benches in "benches/".
2292
b9855ea5
AD
22932008-11-10 Akim Demaille <demaille@gostai.com>
2294
2295 Formatting changes.
2296 * data/lalr1.cc: here.
2297
6e097787
AD
22982008-11-10 Akim Demaille <demaille@gostai.com>
2299
2300 Adjust verbose message to using emacs.
2301 * etc/bench.pl.in: Inform compilation-mode when we change the
2302 directory.
2303 (generate_grammar_list): Recognize %define "variant" in addition
2304 to %define variant.
2305
4c3cc7da
AD
23062008-11-10 Akim Demaille <demaille@gostai.com>
2307
2308 Classify symbols by type-name.
2309 * src/uniqstr.h (UNIQSTR_CMP): New.
2310 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
2311 (type_names_output): New.
2312 (muscles_output): Use it.
2313 * data/lalr1.cc (b4_symbol_action_): Remove.
2314 (b4_symbol_case_, b4_type_action_): New.
2315 Adjust uses of b4_symbol_action_ to use b4_type_action_.
2316
d69c9694
AD
23172008-11-10 Akim Demaille <demaille@gostai.com>
2318
2319 Change the handling of the symbols in the skeletons.
2320 Before we were using tables which lines were the symbols and which
2321 columns were things like number, tag, type-name etc. It is was
2322 difficult to extend: each time a column was added, all the numbers had
2323 to be updated (you asked for colon $2, not for "tag"). Also, it was
2324 hard to filter these tables when only a subset of the symbols (say the
2325 tokens, or the nterms, or the tokens that have and external number
2326 *and* a type-name) was of interest.
de62edee 2327
d69c9694
AD
2328 Now instead of monolithic tables, we define one macro per cell. For
2329 instance "b4_symbol(0, tag)" is a macro name which contents is
2330 self-decriptive. The macro "b4_symbol" provides easier access to
2331 these cells.
de62edee 2332
d69c9694
AD
2333 * src/output.c (type_names_output): Remove.
2334 (symbol_numbers_output, symbol_definitions_output): New.
2335 (muscles_output): Call them.
2336 (prepare_symbols): Define b4_symbols_number.
2337
5263bea9
AD
23382008-11-10 Akim Demaille <demaille@gostai.com>
2339
2340 --trace=muscles
2341 * src/getargs.h, src/getargs.c (trace_muscle): New.
2342 (trace_types, trace_args): Support it.
2343 * src/output.c (output_skeleton): Use it.
2344
4175f6bb
AD
23452008-11-10 Akim Demaille <demaille@gostai.com>
2346
2347 muscles_output.
2348 * src/output.c (muscles_output): New, extracted from...
2349 (output_skeleton): here.
2350 Adjust.
2351
1de69d6a
AD
23522008-11-10 Akim Demaille <demaille@gostai.com>
2353
2354 Formatting changes.
2355
36db78a7
AD
23562008-11-10 Akim Demaille <demaille@gostai.com>
2357
2358 Update the variant example.
2359 * examples/variant.yy: Formatting changes.
2360 One stage build.
2361
e5eb92e7
AD
23622008-11-10 Akim Demaille <demaille@gostai.com>
2363
2364 Support constructor with an argument.
2365 This improves the "list" bench by 2%.
de62edee 2366
e5eb92e7
AD
2367 * data/lalr1.cc (variant::build): Add an overloaded version with
2368 an argument.
2369 * tests/c++.at (AT_CHECK_VARIANT): Check it.
2370
76307410
AD
23712008-11-10 Akim Demaille <demaille@gostai.com>
2372
2373 Test variants.
2374 * tests/c++.at (AT_CHECK_VARIANTS): New.
2375 Use it with and without %define assert.
2376
d78f0ac9
AD
23772008-11-10 Akim Demaille <demaille@gostai.com>
2378
2379 Add %precedence support.
2380 Unfortunately it is not possible to reuse the %prec directive. This
2381 is because to please POSIX, we do not require to end the rules with a
2382 semicolon. As a result,
de62edee 2383
d78f0ac9 2384 foo: bar %prec baz
de62edee 2385
d78f0ac9
AD
2386 is ambiguous: either a rule which precedence is that of baz, or a rule,
2387 and then a declaration of the precedence of the token baz.
de62edee 2388
d78f0ac9
AD
2389 * doc/bison.texinfo: Document %precedence.
2390 (Precedence Only): New.
2391 * src/assoc.h, src/assoc.c (precedence_assoc): New.
2392 * src/conflicts.c (resolve_sr_conflict): Support it.
2393 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
2394 Parse it.
2395 * tests/calc.at: Use %precedence for NEG.
2396 * tests/conflicts.at (%precedence does not suffice)
2397 (%precedence suffices): New tests.
2398
c85be41a
AD
23992008-11-09 Akim Demaille <demaille@gostai.com>
2400
2401 Make benches in a sub dirs.
2402 * etc/bench.pl.in ($dir): New.
2403 Use it.
2404 Check the use of constructors with an argument.
2405 (bench_variant_parser): Fix.
2406
db65ca1f
AD
24072008-11-09 Akim Demaille <demaille@gostai.com>
2408
2409 fix eof condition
2410
9b0efa5b
AD
24112008-11-09 Akim Demaille <demaille@gostai.com>
2412
2413 Fix --help.
2414
432ac57a
AD
24152008-11-09 Akim Demaille <demaille@gostai.com>
2416
2417 Require the generation of parse-gram.output.
2418 * src/Makefile.am (YACC): Pass --report=all.
2419
deef2a0a
AD
24202008-11-09 Akim Demaille <demaille@gostai.com>
2421
2422 Formatting changes.
2423
df72984a
AD
24242008-11-09 Akim Demaille <demaille@gostai.com>
2425
2426 Update TODO.
2427 * TODO: Remove obsolete items.
2428 Update others.
2429
f10e19fd
AD
24302008-11-09 Akim Demaille <demaille@gostai.com>
2431
2432 Enhance bench.pl.
2433 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
2434 (@token, $grammar, $bench): New.
2435 (generate_grammar_variant): Rename as...
2436 (generate_grammar_list): this.
2437 (generate_grammar): Adjust.
2438 (bench_grammar): Rename as...
2439 (bench): this.
2440 Use it in the various bench-marking routines.
2441 (-b, -g): New options.
2442
5de9c593
AD
24432008-11-09 Akim Demaille <demaille@gostai.com>
2444
2445 Use a static hierarchy for symbols in the C++ parser.
2446 * data/lalr1.cc (symbol_base_type, symbol_type)
2447 (stack_symbol_type): Make it a static hierarchy.
2448 Adjust dependencies.
2449
757f8f98
AD
24502008-11-09 Akim Demaille <demaille@gostai.com>
2451
2452 bench.pl -d, --directive.
2453 * etc/bench.pl.in (@directive): New.
2454 (&bench_grammar): Use it.
2455 (&bench_list_grammar): New, to provide access to the "variant"
2456 grammar.
2457 Use it.
2458 (getopts): Support -d, --directive.
2459
d3be4f6d
AD
24602008-11-09 Akim Demaille <demaille@gostai.com>
2461
2462 Use inline for small operations.
2463 * data/lalr1.cc (symbol_base_type, symbol_type)
2464 (stack_symbol_type): Declare constructor and other operations as
2465 inline.
2466 (yy_destroy_): Inline.
2467
1f7d007b
AD
24682008-11-09 Akim Demaille <demaille@gostai.com>
2469
2470 Introduce a hierarchy for symbols.
2471 * data/lalr1.cc (symbol_base_type, symbol_type): New.
2472 (data_type): Rename as...
2473 (stack_symbol_type): this.
2474 Derive from symbol_base_type.
2475 (yy_symbol_value_print_): Merge into...
2476 (yy_symbol_print_): this.
2477 Rename as...
2478 (yy_print_): this.
2479 (yydestruct_): Rename as...
2480 (yy_destroy_): this.
2481 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
2482 (parser::parse): yyla is now of symbol_type.
2483 Use its type member instead of yytoken.
2484
bc0b0477
AD
24852008-11-09 Akim Demaille <demaille@gostai.com>
2486
2487 Rename data_type and stack_symbol_type.
2488 * data/lalr1.cc (data_type): Rename as...
2489 (stack_symbol_type): this.
2490
57295d14
AD
24912008-11-09 Akim Demaille <demaille@gostai.com>
2492
2493 Handle semantic value and location together.
2494 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
2495 yydata.value and yydata.location.
2496 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
2497 (YY_SYMBOL_PRINT): Now take semantic value and location as a
2498 single arg.
2499 Adjust all callers.
2500 (yydestruct_): New overload for a stack symbol.
2501
e9b0834e
AD
25022008-11-09 Akim Demaille <demaille@gostai.com>
2503
2504 Push a complete symbol, not connected parts.
2505 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
2506 state, value and location.
2507 Adjust callers.
2508
6082531a
AD
25092008-11-09 Akim Demaille <demaille@gostai.com>
2510
2511 Agregate yylval and yylloc.
2512 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
2513 (parser::yyla): this.
2514
33c195cc
AD
25152008-11-09 Akim Demaille <demaille@gostai.com>
2516
2517 Rely on the state stack to display reduction traces.
b06df3c2
AD
2518 To display rhs symbols before a reduction, we used information
2519 about the rule reduced, which required the tables yyrhs and
2520 yyprhs. Now use rely only on the state stack to get the same
2521 information.
de62edee 2522
33c195cc
AD
2523 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
2524 Use them.
2525 (parser::yyrhs_, parser::yyprhs_): Remove.
2526 (parser::yy_reduce_print_): Use the state stack.
2527
e1f93869
AD
25282008-11-09 Akim Demaille <demaille@gostai.com>
2529
2530 Fuse yyval and yyloc into yylhs.
2531 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
2532 yylhs.
2533 (parse): Replace yyval and yyloc with yylhs.value and
2534 yylhs.location.
2535 After a user action, compute yylhs.state earlier.
2536 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
2537 fresh error_token.
2538
2935744b
DJ
25392008-11-09 Di-an Jan <dianj@freeshell.org>
2540
2541 Remove unused variable.
2542 * src/output.c (type_names_output): Remove unused variable sep.
2543
bbf9ca37
PB
25442008-11-09 Paolo Bonzini <bonzini@gnu.org>
2545
2546 Change tests/output.at quoting.
2547 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
2548 expanding arguments.
2549
d9a9b96b
JD
25502008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2551
2552 Don't add a semicolon to actions for %skeleton or %language.
2553 It breaks Java test cases as reported by Akim Demaille.
2554 * src/scan-code.l: Implement.
2555
51365192
JD
25562008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2557
2558 Clean up %skeleton and %language priority implementation.
2559 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
2560 remove static qualifier because others will soon need to see it.
2561 (language_prio): Likewise.
2562 (getargs): Use command_line_prio rather than 0.
2563 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
2564 enum fields.
2565 (skeleton_prio): Extern it.
2566 (language_prio): Extern it.
2567 * src/parse-gram.y: Use grammar_prio rather than 1.
2568
9380cfd0
AD
25692008-11-07 Akim Demaille <demaille@gostai.com>
2570
2571 Moving push traces into yypush_.
2572 * data/lalr1.cc (yypush_): Now takes a optional trace message.
2573 Adjust all uses.
2574
8901f32e
AD
25752008-11-07 Akim Demaille <demaille@gostai.com>
2576
2577 The single-stack C++ parser is now the standard one.
2578 * data/lalr1.cc: Rename as...
2579 * data/lalr1-split.cc: this.
2580 * data/lalr1-fusion.cc: Rename as...
2581 * data/lalr1.cc: this.
2582 * etc/bench.pl.in: Adjust.
2583
8cdabf02
AD
25842008-11-07 Akim Demaille <demaille@gostai.com>
2585
2586 Avoid empty-if warnings.
2587 Reported by Quentin Hocquet.
de62edee 2588
8cdabf02
AD
2589 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
2590 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
2591
5a893c2b
AD
25922008-11-07 Akim Demaille <demaille@gostai.com>
2593
2594 Pass command line location to skeleton_arg and language_argmatch.
2595 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
2596 The location argument is now mandatory.
2597 Adjust all dependencies.
2598 (getargs): Use command_line_location.
2599
58697c6d
AD
26002008-11-07 Akim Demaille <demaille@gostai.com>
2601
2602 -D, --define.
2603 * src/getargs.c (usage): Document -D.
2604 Fix help string for --locations.
2605 (command_line_location): New.
2606 (short_options, long_options, getargs): Support -D, --define.
2607 (getargs): Move -d support at the right place.
2608 * doc/bison.texinfo (Bison Options): Update.
2609 * tests/input.at (%define, --define): New.
2610
9fe5a457
AD
26112008-11-07 Akim Demaille <demaille@gostai.com>
2612
2613 Initialize the muscle table before parsing the command line.
2614 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2615 (getargs): Define file_name.
2616 * src/main.c (main): Initialize muscle_tab before calling
2617 getargs.
2618 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2619 its value is not available yet.
2620
56c5eca9
AD
26212008-11-07 Akim Demaille <demaille@gostai.com>
2622
2623 Locations without columns for command line arguments.
2624 * src/location.c (location_print): Don't display negative columns.
2625 * src/location.h: Document this.
2626
9b9e0a7d
AD
26272008-11-07 Akim Demaille <demaille@gostai.com>
2628
2629 Fix --help.
2630 * src/getargs.c (usage): Fix help string for -W.
2631
74eae918
AD
26322008-11-07 Akim Demaille <demaille@gostai.com>
2633
2634 Handle more general types of option arguments.
2635 * build-aux/cross-options.pl: The argument ends at the first
2636 space, not the first non-symbol character.
2637 Use @var for each word appearing the argument description.
2638
a3d4c6fb
AD
26392008-11-07 Akim Demaille <demaille@gostai.com>
2640
2641 Destroy the variants that remain on the stack in case of error.
2642 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
2643 destructor.
2644 Display the value only if yymsg is nonnull.
2645 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
2646
2d32fc9f
AD
26472008-11-07 Akim Demaille <demaille@gostai.com>
2648
2649 Add "%define assert" to variants.
2650 This is used to help the user catch cases where some value gets
2651 ovewritten by a new one. This should not happen, as this will
2652 probably leak.
de62edee 2653
2d32fc9f
AD
2654 Unfortunately this uncovered a bug in the C++ parser itself: the
2655 lookahead value was not destroyed between two calls to yylex. For
2656 instance if the previous lookahead was a std::string, and then an int,
2657 then the value of the std::string was correctly taken (i.e., the
2658 lookahead was now an empty string), but std::string structure itself
2659 was not reclaimed.
de62edee 2660
2d32fc9f
AD
2661 This is now done in variant::build(other&) (which is used to take the
2662 value of the lookahead): other is not only stolen from its value, it
2663 is also destroyed. This incurs a new performance penalty of a few
2664 percent, and union becomes faster again.
de62edee 2665
2d32fc9f
AD
2666 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
2667 (b4_variant_if): New.
2668 (variant::built): New.
2669 Use it whereever the status of the variant changes.
2670 * etc/bench.pl.in: Check the penalty of %define assert.
2671
f6038cb8
AD
26722008-11-07 Akim Demaille <demaille@gostai.com>
2673
2674 Use "%define variant" in bench.pl.
2675 * etc/bench.pl.in: No longer use the pseudo directive %variants,
2676 just use %define variants.
2677
ccde1f98
AD
26782008-11-07 Akim Demaille <demaille@gostai.com>
2679
2680 Regen.
2681 * src/parse-gram.h, src/parse-gram.c: Regen.
2682
58bd33b7
JD
26832008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2684
2685 Fix user actions without a trailing semicolon.
2686 Reported by Sergei Steshenko at
2687 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2688 * THANKS (Sergei Steshenko): Add.
2689 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2690 * tests/regression.at (Fix user actions without a trailing semicolon):
2691 New test case.
2692
639867b5
AD
26932008-11-04 Akim Demaille <demaille@gostai.com>
2694
2695 Use b4_copyright_years.
2696 * data/yacc.c (b4_copyright_years): New.
2697 Fix its value according to the comments in the file.
2698 Use it and undefine it.
2699
3c262606
AD
27002008-11-04 Akim Demaille <demaille@gostai.com>
2701
2702 Formatting changes.
2703 * data/lalr1-fusion.cc, src/parse-gram.y: here.
2704
a2b93d52
AD
27052008-11-04 Akim Demaille <demaille@gostai.com>
2706
2707 Formatting changes.
2708 * data/lalr1-fusion.cc: here.
2709
3a2803df
AD
27102008-11-04 Akim Demaille <demaille@gostai.com>
2711
2712 Use strict on bench.pl.
2713 * etc/bench.pl.in (&run, &generate_grammar): New.
2714 Rename the grammar generating functions for consistency.
2715 Change the interface so that the list of benches to run is passed
2716 as (optionless) arguments.
2717 (&compile): Use &run.
2718
a0d4650a
AD
27192008-11-04 Akim Demaille <demaille@gostai.com>
2720
2721 Remove spurious initial empty lines.
2722 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2723 * data/yacc.c: End the @output lines with an @.
2724
cac9e09b
AD
27252008-11-04 Akim Demaille <demaille@gostai.com>
2726
2727 Improve the display of sizes.
2728 * etc/bench.p.in: Higher precision.
2729 Sort by decreasing size.
2730
4af4348a
AD
27312008-11-04 Akim Demaille <demaille@gostai.com>
2732
2733 Don't memcpy C++ structures.
2734 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
2735 arguments.
2736 (variant::build): New overload for
2737 copy-construction-that-destroys.
2738 (variant::swap): New.
2739 (parser::yypush_): Use it in variant mode.
2740
ef05c4d6
AD
27412008-11-04 Akim Demaille <demaille@gostai.com>
2742
2743 Better defaults for bench.pl.
2744 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
2745 default values.
2746 Adjust &verbose uses.
2747 (-q, --quiet): New.
2748
9718cfa9
AD
27492008-11-04 Akim Demaille <demaille@gostai.com>
2750
2751 Make variant.yy more complex.
2752 std::list cannot be copied via memcpy, they are more demanding than
2753 std::string. Use one std::list to strengthen the test.
de62edee 2754
9718cfa9
AD
2755 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
2756 Adjust.
2757 Create a list of strings, instead of a single large string.
2758
a6df593d
AD
27592008-11-04 Akim Demaille <demaille@gostai.com>
2760
2761 bench.pl --bench.
2762 * etc/bench.pl.in (--bench, $bench): New.
2763
006a0303
AD
27642008-11-04 Akim Demaille <demaille@gostai.com>
2765
2766 Sort methods.
2767 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
2768 Define it after as().
2769
faef3466
AD
27702008-11-04 Akim Demaille <demaille@gostai.com>
2771
2772 Useless parens.
2773 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
2774
2141aded
AD
27752008-11-04 Akim Demaille <demaille@gostai.com>
2776
2777 Issue missing synclines after user actions.
2778 * data/c.m4 (b4_case): Issue synclines on the output file.
2779
e426d17b
AD
27802008-11-04 Akim Demaille <demaille@gostai.com>
2781
2782 Remove trailing empty line.
2783 * data/lalr1-fusion.cc: Don't add an empty line after the user's
2784 epilogue.
2785
a9ce3f54
AD
27862008-11-04 Akim Demaille <demaille@gostai.com>
2787
2788 Fix output of copyright years.
2789 * data/bison.m4 (b4_copyright): Fix the indentation of the
2790 copyright year paragraph.
2791 Use b4_copyright_years when no years are given.
2792 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
2793 (b4_copyright_years): New.
2794 Use it.
2795
59c544c2
AD
27962008-11-04 Akim Demaille <demaille@gostai.com>
2797
2798 Avoid the spurious initial empty line.
2799 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
2800 the end of @output request to suppress the empty line that
2801 results.
2802
96b15448
AD
28032008-11-04 Akim Demaille <demaille@gostai.com>
2804
2805 Remove parser::rhs_number_type.
2806 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
2807 (yyrhs_): Use b4_table_define.
2808
f0633174
AD
28092008-11-04 Akim Demaille <demaille@gostai.com>
2810
2811 Fix iteration type.
2812 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
2813
417b8004
AD
28142008-11-04 Akim Demaille <demaille@gostai.com>
2815
2816 Factor the declaration of the integer tables.
2817 * data/lalr1-fusion.cc (b4_table_define): New.
2818 Use it.
2819
1a5246c6
AD
28202008-11-03 Akim Demaille <demaille@gostai.com>
2821
2822 Fix indentation of tables in lalr1.cc
2823 * data/lalr1-fusion.cc: Fix the indentation.
2824
f8a95c9c
AD
28252008-11-03 Akim Demaille <demaille@gostai.com>
2826
2827 Destroy the lhs symbols after reduction.
2828 * data/lalr1-fusion.cc (parse): After the user action, when in
2829 variant mode, destroy the lhs symbols.
2830
d7f4d823
AD
28312008-11-03 Akim Demaille <demaille@gostai.com>
2832
2833 Simplify yysyntax_error_ use.
2834 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
2835 type, but make it unnamed in the declaration when it is not used.
2836
8b9c89fb
AD
28372008-11-03 Akim Demaille <demaille@gostai.com>
2838
2839 Let yy::variant::build return an lvalue.
2840 * data/lalr1-fusion.cc (variant::build): Return a reference to the
2841 object.
2842
83243c24
AD
28432008-11-03 Akim Demaille <demaille@gostai.com>
2844
2845 Define yy::variant only when needed.
2846 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
2847 used.
2848
429b4848
AD
28492008-11-03 Akim Demaille <demaille@gostai.com>
2850
2851 Bench the three-stack lalr1.cc.
2852 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
2853 one-stack one.
2854
414c76a4
AD
28552008-11-03 Akim Demaille <demaille@gostai.com>
2856
2857 Fail on parse error in calc++.
2858 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
2859 status.
2860 * examples/calc++/test ($me, $number, $exit, run): New.
2861 Use them to propagate errors to the exit status.
2862
8a5783fd
AD
28632008-11-03 Akim Demaille <demaille@gostai.com>
2864
2865 Don't specify the skeleton twice in the example.
2866 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
2867 file does what is needed.
2868
0cc5bead
AD
28692008-11-03 Akim Demaille <demaille@gostai.com>
2870
2871 bench: Improve output.
2872 * etc/bench.pl.in (bench_grammar): Tune the printf format.
2873
5b421a4e
AD
28742008-11-03 Akim Demaille <demaille@gostai.com>
2875
2876 bench: check impact of %debug on variants.
2877 * etc/bench.pl.in (variant_grammar): Fix the computation of
2878 $variant.
2879 Generate a grammar file that can work with or without %debug.
2880 Do use the @directive.
2881 (bench_variant_parser): Check impact of %debug.
2882 (@directives): Rename all the occurrences to...
2883 (@directive): this, for consistency.
2884
d11ee647
AD
28852008-11-03 Akim Demaille <demaille@gostai.com>
2886
2887 bench: report the size too.
2888 * etc/bench.pl.in ($iterations): Defaults to -3.
2889 (&bench_grammar): Require hireswallclock.
2890 Compute and display the size of the result.
2891 More comments.
2892
e1b74b92
AD
28932008-11-03 Akim Demaille <demaille@gostai.com>
2894
2895 bench: More use of the verbosity level.
2896 * etc/bench.pl.in ($verbose, &verbose): New.
2897 Use them.
2898 More POD documentation.
2899
7e5f9c54
AD
29002008-11-03 Akim Demaille <demaille@gostai.com>
2901
2902 bench.pl: a command line interface
2903 * etc/bench.pl.in: More doc.
2904 Some fixes in the documentation.
2905 ($cflags, $iterations, &help, &getopt): New.
2906 Use them.
2907 (&variant_grammar): Let the number of stages be 10 times what is
2908 specified.
2909
7109a18d
AD
29102008-11-03 Akim Demaille <demaille@gostai.com>
2911
2912 Bench the use of Boost.Variants.
2913 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
2914 New.
2915 (&compile): Be ready to compile C++ parsers.
2916 (&bench_push_parser): Move debug information to the outermost
2917 level.
2918 * THANKS: Add Michiel De Wilde.
2919
922730fe
AD
29202008-11-03 Akim Demaille <demaille@gostai.com>
2921
2922 bench.pl: Pass directives as a list instead of as a string.
2923 * etc/bench.pl.in (&directives): New.
2924 (&triangular_grammar, &calc_grammar): Use it to format the Bison
2925 directives.
2926 (&triangular_grammar): Do use the directives (were ignored).
2927 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
2928 directives.
2929
7484f1d4
AD
29302008-11-03 Akim Demaille <demaille@gostai.com>
2931
2932 Improve genericity of bench.pl.
2933 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
2934 argument.
2935 (&bench_push_parser): New.
2936 Call it.
2937
15129f25
AD
29382008-11-03 Akim Demaille <demaille@gostai.com>
2939
2940 Add documentation to bench.pl.
2941 * etc/bench.pl.in: Comment changes.
2942
0e0ed236
AD
29432008-11-03 Akim Demaille <demaille@gostai.com>
2944
2945 Fuse the three stacks into a single one.
de62edee 2946
b06df3c2
AD
2947 In order to make it easy to perform benchmarks to ensure that
2948 there are no performance loss, lalr1.cc is forked into
2949 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
2950 lalr1.cc.
2951
2952 Meanwhile, to make sure that lalr1-fusion.cc is correctly
2953 exercized by the test suite, the user must install a symbolic link
2954 from lalr1.cc to it.
de62edee 2955
b06df3c2
AD
2956 Instead of having three stacks (state, value, location), use a
2957 stack of triples. This considerably simplifies the code (and it
2958 will be easier not to require locations as currently does the C++
2959 parser), and also gives a 10% speedup according to
2960 etc/bench (probably mainly since memory allocation is done once
2961 instead of three times).
de62edee 2962
0e0ed236
AD
2963 Another motivation is to make it easier to destruct properly
2964 semantic values: now that they are bound to their state (hence
2965 symbol type) it will be easier to call the appropriate destructor.
de62edee 2966
0e0ed236 2967 These changes should probably benefit the C parser too.
de62edee 2968
b06df3c2
AD
2969 * data/lalr1.cc: Copy as...
2970 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
2971 (b4_rhs_value, b4_rhs_location): New definitions overriding those
2972 from c++.m4.
2973 (state_stack_type, semantic_stack_type, location_stack_type)
2974 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
2975 (data_type, stack_type, yystack_): New.
2976 (YYLLOC_DEFAULT, yypush_): Adjust.
2977 (yyerror_range): Now based on data_type, not location_type.
2978
7dedf26e
AD
29792008-11-03 Akim Demaille <demaille@gostai.com>
2980
2981 Push the state, value, and location at the same time.
2982 This is needed to prepare a forthcoming patch that fuses the three
2983 stacks into one.
de62edee 2984
7dedf26e
AD
2985 * data/lalr1.cc (parser::yypush_): New.
2986 (parser::yynewstate): Change the semantics: instead of arriving to
2987 this label when value and location have been pushed, but yystate
2988 is to be pushed on the state stack, now the three of them must
2989 have been pushed before. yystate still must be the new state.
2990 This allows to use yypush_ everywhere instead of individual
2991 handling of the stacks.
2992
c4585f1e
AD
29932008-11-03 Akim Demaille <demaille@gostai.com>
2994
2995 Prefer references to pointers.
2996 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
2997 definition to use references instead of pointers.
2998 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
2999 Take the value and location as references.
3000 Adjust callers.
3001
56017c17
AD
30022008-11-03 Akim Demaille <demaille@gostai.com>
3003
3004 stack::size instead of stack::height.
3005 * data/lalr1.cc (stack::height): Rename as...
3006 (stack::size): this.
3007 Fix the output type.
3008 Comment changes.
3009
5ab8c47b
AD
30102008-11-03 Akim Demaille <demaille@gostai.com>
3011
3012 Use variants to support objects as semantic values.
b06df3c2
AD
3013 This patch was inspired by work by Michiel De Wilde. But he used
3014 Boost variants which (i) requires Boost on the user side, (ii) is
3015 slow, and (iii) has useless overhead (the parser knows the type of
3016 the semantic value there is no reason to duplicate this
3017 information as Boost.Variants do).
3018
3019 This implementation reserves a buffer large enough to store the
3020 largest objects. yy::variant implements this buffer. It was
3021 implemented with Quentin Hocquet.
de62edee 3022
5ab8c47b
AD
3023 * src/output.c (type_names_output): New.
3024 (output_skeleton): Invoke it.
3025 * data/c++.m4 (b4_variant_if): New.
3026 (b4_symbol_value): If needed, provide a definition for variants.
3027 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
3028 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
3029 (b4_char_sizeof, yy::variant): New.
3030 (parser::parse): If variants are requested, define
3031 parser::union_type, parser::variant, change the definition of
3032 semantic_type, construct $$ before running the user action instead
3033 of performing a default $$ = $1.
3034 * examples/variant.yy: New.
3035 Based on an example by Michiel De Wilde.
3036
1fa5d8bb
AD
30372008-11-03 Akim Demaille <demaille@gostai.com>
3038
3039 Parameterize the extraction of semantic values.
3040 To make future changes easier, no longer rely on ".TYPE" being the
3041 way to get a semantic value.
de62edee 3042
1fa5d8bb
AD
3043 * data/c.m4 (b4_symbol_value): New.
3044 Use it.
3045 * data/c++.m4, data/yacc.c: Use it.
3046 * data/glr.c: Use b4_symbol_value.
3047 (b4_rhs_data): New.
3048 Use it.
3049
91ba8a55
AD
30502008-11-03 Akim Demaille <demaille@gostai.com>
3051
3052 Prepare easier M4 changes.
3053 * data/lalr1.cc: Use escaped [] instead of literals to prepare
3054 future changes.
3055
c9ba9e59
JD
30562008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3057
3058 Initiate further development.
3059 * NEWS: Create an empty section for new entries.
3060 * gnulib: Update submodule to HEAD.
3061
bfb40910
JD
30622008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3063
3064 * NEWS: Version 2.4.
3065
241fda7a
JD
30662008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3067
3068 Prepare for next release.
3069 * NEWS: Briefly mention changes since 2.3b.
3070 * README: Say GNU m4 1.4.6, which we've been requiring in release
3071 announcements already, not 1.4.3, which breaks the build.
3072
ed4d67dc
JD
30732008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3074
3075 Say %language is experimental.
3076 We're thinking of extending it's effect on output file naming. See the
3077 thread at
3078 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
3079 * NEWS: Say it's experimental.
3080 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
3081 recommend it over %skeleton for now.
3082 (Bison Options): Likewise.
3083 (C++ Bison Interface): Use %skeleton not %language.
3084 (Calc++ Parser): Use %skeleton not %language.
3085 * src/getargs.c (usage): Say it's experimental.
3086
e254a580
DJ
30872008-11-01 Di-an Jan <dianj@freeshell.org>
3088 Paolo Bonzini <bonzini@gnu.org>
3089
3090 Support all Java parser class modifiers.
3091 * data/java.m4 (b4_percent_define_get3): New.
3092 (b4_final_if, b4_strictfp_if): New.
3093 * data/lalr1.java (final, strictfp, extends, implements): Support.
3094 * doc/bison.texinfo (final, strictfp, extends, implements): Add
3095 documentation.
3096 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
3097 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
3098 (AT_CHECK_JAVA_GREP): New.
3099 (Java parser class modifiers): New test.
3100 (Java parser class extends and implements): New test.
3101
3102 Model exception propagation better with throws and lex_throws.
3103 * data/java.m4 (b4_list2): New.
3104 (throws): Change default.
3105 * data/lalr1.java (yyaction): Add throws.
3106 (parse): Add lex_throws in addition to throws.
3107 * doc/bison.texinfo (throws, lex_throws): Add documentation.
3108 * tests/java.at (Java throws specifications): New test.
3109
3110 Improve documentation for Java parsers.
3111 * doc/bison.texinfo (Java Parsers): Add subsections.
3112 Don't quote first argument of %define.
3113 (Java Bison Interface): Document output files. Move documentation
3114 of parser class and merge into Java Parser Interface. Document
3115 features that error out. Document directives with no effect.
3116 Move note about Javadoc higher.
3117 (Java Semantic Values): Explicitly mention stype.
3118 Document that generic types cannot be used.
3119 (Java Location Values): Use @deftypeivar. Document constructors.
3120 Correct return value for toString.
3121 (Java Parser Interface): List undocumented constants/fields.
3122 Move documentation of fields added by %parse-param closer to list
3123 of members. Document that token names are added as fields.
3124 Document constructors accurately. Remove error method.
3125 (Java Scanner Interface): Move note on %pure-parser to Java Bison
3126 Interface. Describe %code lexer and yylex accutately.
3127 Remove documentation that does not match the code.
3128 (Java Action Features): New.
3129 (Java Differences): Add reference. Add item on semantic values.
3130 Add note about @{ ... @}. Clarify %% epilogue placement.
3131 (Java Declarations Summary): New.
3132
3133 Fix Java skeleton.
3134 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
3135 (b4_remove_comma): Quote test argument.
3136 (b4_identification): Remove "bison" field.
3137 * tests/java.at (Java parser class and package names): New test.
3138 (Java %parse-param and %lex-param): New test.
3139 (Java stype, position_class and location_class): New test.
3140
f259e4e6
PB
31412008-10-31 Di-an Jan <dianj@freeshell.org>
3142
3143 * data/lalr1.jave: Update copyright years.
3144 (YYParser): Correct name of "generated from" file in Javadoc:
3145 use b4_file_name instead of @ofile@.
3146 (Location constructor): Correct Javadoc parameter name.
3147 (yylloc): Add missing opening m4 quote after b4_location_if.
3148 This removes a stray [ in the Javadoc of Lexer.getStartPos.
3149 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
3150 (YYParser constructor): Correct Javadoc parameter name.
3151
cae5057f
JD
31522008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
3153
3154 Always put auxiliary code files in the same dir as other output files.
3155 * src/files.c (compute_file_name_parts): When the user specifies
3156 --output but not --file-prefix, extract the directory prefix from the
3157 file prefix not from the grammar file name. This affects the location
3158 of files like location.hh generated by the C++ skeleton. The includes
3159 in the other output files require this fix.
3160 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
3161 for expected output files.
3162 (Output files): Add a test for the above.
3163
4af432ba
JD
31642008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
3165
3166 * gnulib: Update submodule to HEAD.
3167
e26d4e43
JD
31682008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3169
3170 Update copyright year.
3171 * src/files.c: Here.
3172
c0ee9e21
DJ
31732008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
3174
3175 Don't overwrite the input file.
3176 * src/files.c (output_file_name_check): Fatal error if using input file
3177 for output.
3178 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
3179 argument.
3180 (Conflicting output files): Add test.
3181
482dc52f
AD
31822008-10-28 Akim Demaille <demaille@gostai.com>
3183
3184 Space changes.
3185 * data/lalr1.cc: Formatting changes.
3186
52cbbe84
AD
31872008-10-28 Akim Demaille <demaille@gostai.com>
3188
3189 Don't define debugging functions when !YYDEBUG.
3190 * data/lalr1.cc (debug_stream, set_debug_stream)
3191 (debug_level_type, debug_level, set_debug_level): Don't
3192 declare them when YYDEBUG is not defined.
3193 The implementation are already YYDEBUG-aware.
3194
0925d5bf
AD
31952008-10-28 Akim Demaille <demaille@gostai.com>
3196
3197 Prefer "continue" for empty loop bodies.
3198 * etc/bench.pl.in: Use "continue" instead of {}.
3199
cf98343c
AD
32002008-10-28 Akim Demaille <demaille@gostai.com>
3201
3202 Space and comments changes.
3203 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
3204 * data/c.m4, data/lalr1.cc: Space changes.
3205
9f467b7d
AD
32062008-10-28 Akim Demaille <demaille@gostai.com>
3207
3208 Make gnulib a submodule.
3209 * gnulib: New.
3210 * .gitmodules (gnulib): New.
3211
0f0e1ace
JD
32122008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3213
3214 Fix yyerror_range for user-defined location type in C++. Reported by
3215 Georg Sauthoff at
3216 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3217 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3218 * THANKS (Georg Sauthoff): Add.
3219
548e2104
JD
32202008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3221
3222 Update several administrative files mainly to facilitate releasing.
3223 * HACKING (Administrivia): Make the git-merge-changelog notes more
3224 helpful.
3225 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3226 (Release Procedure): Update for git and add numerous details that were
3227 previously missing.
3228 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3229 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3230 that announcements don't claim we bootstrapped with whatever bison
3231 happened to be in PATH. Add flex as a bootstrap tool.
3232 * Makefile.maint: Remove, previously replaced by maint.mk.
3233 * Makefile.cfg: Remove, and migrate settings to...
3234 * cfg.mk: ... here for the sake of `make announcement'.
3235 * bootstrap.conf (gnulib_modules): Add announce-gen.
3236 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3237 Berry.
3238
ddf17a6e
PB
32392008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3240
3241 Small but important bugfixes for the Java skeleton.
3242 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3243 (yy_symbol_print): Call toString on yyvaluep.
3244
e1145ad8
AD
32452008-08-29 Akim Demaille <demaille@gostai.com>
3246
3247 Clarify UPDATED use.
215b40ac 3248 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 3249 not to the release date of Bison.
215b40ac 3250 Reported by Joel E. Denny.
e1145ad8 3251
0df72d78
AD
32522008-08-29 Akim Demaille <demaille@gostai.com>
3253
3254 * README: Update FAQ pointer.
3255 Reported by Joel E. Denny.
3256
9a90b6bb
EB
32572008-08-27 Eric Blake <ebb9@byu.net>
3258
3259 Resync m4sugar from autoconf.
3260 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3261 (m4_init): Adjust to latest m4.git changes.
3262 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3263 effects.
3264 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3265 (_m4_list_cmp): Reduce side effects.
3266
65015668
AD
32672008-08-27 Akim Demaille <demaille@gostai.com>
3268
3269 Check yyerrok in calc.at.
215b40ac
EB
3270 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3271 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3272 expected.
65015668 3273
98e26a92
AD
32742008-08-27 Akim Demaille <demaille@gostai.com>
3275
3276 Support yyerrok in lalr1.cc.
3277 YYBACKUP is still to import back into lalr1.cc.
215b40ac 3278 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 3279
86c0e784
JD
32802008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3281
3282 For maintainer-check*, don't recompile for a $(VERSION) update.
3283 * cfg.mk: New file.
3284 (_is-dist-target): Override the one in GNUmakefile.
3285 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3286
88511166
JD
32872008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3288
3289 Update for recent change to gnulib.
3290 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3291 string.h now.
3292
6bbb2ed5
EB
32932008-08-15 Eric Blake <ebb9@byu.net>
3294
d67c52e8
EB
3295 Remaining m4sugar merge from autoconf.
3296 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3297 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3298 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3299 * src/output.c (output_skeleton): Tell m4 how to find it.
3300
6bbb2ed5
EB
3301 Partial m4sugar merge from autoconf: m4_map.
3302 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3303 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3304 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3305 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3306 for empty list.
3307 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3308 Likewise.
3309 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3310 declares it.
3311
8dce3875
JD
33122008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3313
3314 Keep .version and PACKAGE_VERSION in sync.
3315 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3316 dependency, and add comments justifying this in more detail. Discussed
3317 starting at
3318 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3319
882a1fbf
EB
33202008-08-06 Eric Blake <ebb9@byu.net>
3321
a3764451
EB
3322 Partial m4sugar merge from autoconf: m4_shiftn.
3323 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3324 (m4_shift2, m4_shift3): New macros.
3325 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3326 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3327 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3328 * data/java.m4 (b4_remove_comma): Likewise.
3329
882a1fbf
EB
3330 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3331 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3332 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3333 (m4_init): Consolidate wrapped text into single m4_wrap.
3334 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3335 in wrapped text.
3336
a30e920d
EB
33372008-08-05 Eric Blake <ebb9@byu.net>
3338
dfcc5959
EB
3339 Partial m4sugar merge from autoconf: builtins, version.m4.
3340 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3341 (m4_prepend): Remove, as it is unused and inherently quadratic,
3342 whereas m4_append is linear in newer m4.
3343 (m4_mkstemp): New builtin.
3344 (m4_symbols): Make rename conditional.
3345 (m4_version_prereq): Ensure fatal error if used in bison, which
3346 intentionally lacks version.m4.
3347
a30e920d
EB
3348 Fix comments in m4sugar.
3349 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3350
445b7470
JD
33512008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3352
3353 Update for recent .gitignore fix in Gnulib.
3354 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3355 anchored .gitignore entries.
3356
a1e50014
JD
33572008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3358
3359 Set gnu or gnits strictness.
3360 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3361 development and gnits strictness for releases. Based on Eric Blake's
3362 suggestion at
3363 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3364
d43f77e7
PB
33652008-07-31 Paolo Bonzini <bonzini@gnu.org>
3366
3367 * NEWS: Clarify documentation of %language.
3368
fee2ed87
PB
33692008-07-31 Paolo Bonzini <bonzini@gnu.org>
3370
3371 Support usage of git-merge-changelog.
3372 * .gitattributes: New.
3373 * HACKING: Document usage of git-merge-changelog.
3374 * bootstrap: Install git-merge-changelog entries in .git/config
3375 if appropriate.
3376
78029cd5
JD
33772008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3378
3379 Remove remaining dependence on CVS Id keyword.
3380 * ChangeLog: For the sake of people still using CVS, don't use dollars
3381 when mentioning Id.
3382 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3383 unusual anyway.
3384 * data/xslt/xml2dot.xsl: Likewise.
3385 * data/xslt/xml2text.xsl: Likewise.
3386 * data/xslt/xml2xhtml.xsl: Likewise.
3387 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3388 * doc/Makefile.am (neutralize): Remove, no longer needed.
3389 (.x.1): Don't use neutralize.
3390 (edit): Don't substitute for ID.
3391 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3392
c53d18b1
JD
33932008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3394
3395 Fix dependence on computed configure variables.
3396 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3397 $(top_srcdir)/configure.ac so that changes to computed variables, such
3398 as PACKAGE_VERSION, are seen.
3399 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3400
5523ac79
JD
34012008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3402
3403 Update copyright dates for recent changes.
3404 * Makefile.am: Here.
3405 * src/Makefile.am: Here.
3406 * src/reduce.c: Here.
3407 * tests/reduce.at: Here.
3408
8fa36911
JD
34092008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3410
3411 Use git-version-gen for version names between releases.
3412 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3413 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3414 * .prev-version: New.
3415 * .version.in: Remove.
78029cd5 3416 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
3417 revision.
3418 * GNUmakefile: Remove, now copied from Gnulib.
3419 * Makefile.am: Add code suggested by comments in
3420 build-aux/git-version-gen.
3421 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3422 .prev-version, and .version.
3423 * NEWS (2.3b+): Rename to...
3424 (?.?): ... this because we're dropping the "+" version naming scheme,
3425 but, in general, we still can't be sure of our next release name.
3426 * bootstrap: Add a quick hack to remove from .gitignore the
3427 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3428 entry. This should really be fixed in gnulib instead.
3429 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3430 * configure.ac (AC_INIT): Set version name by invoking
3431 build-aux/git-version-gen.
3432 (AC_CONFIG_FILES): Remove .version, now generated by
3433 build-aux/git-version-gen.
3434 * maint.mk: New, copied from coreutils.
3435 * doc/.cvsignore (bison.1): Add.
3436 * doc/.gitignore (/bison.1): Add.
3437 * doc/bison.1: Remove, generated.
3438 * src/.cvsignore (revision.c): Remove.
3439 * src/.gitignore (/revision.c): Remove.
3440 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3441 (BUILT_SOURCES): Remove revision.c.
3442 (revision.c): Remove.
3443 * src/getargs.c (version): Don't print revision after the VERSION.
3444 * src/revision.h: Remove.
3445
bcf07cb7
JD
34462008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3447
3448 Fix untranslatable composition of sentences. Reported by Goran
3449 Uddeborg at
3450 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3451 * THANKS (Goran Uddeborg): Add.
3452 * src/reduce.c (reduce_print): Report the number of nonterminals and
3453 rules useless in the grammar in separate sentences.
3454 * tests/reduce.at (Useless Rules): Update output.
3455 (Reduced Automaton): Likewise.
3456 (Underivable Rules): Likewise.
3457 (Empty Language): Likewise.
3458
9aacab9a
JD
34592008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3460
3461 Fix some .gitignore and .cvsignore problems.
3462 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3463 (insert_vc_ignore): ... this new function, which prepends `/' to all
3464 .gitignore entries before passing them to insert_sorted_if_absent.
3465 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3466 .cvsignore files are maintained even though Bison developers run
3467 bootstrap while using Git.
3468 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3469 unneeded by Bison.
3470 (gnulib): Add.
3471 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3472 unneeded. Reported by Eric Blake.
3473 * lib/.gitignore (/*~): Add.
3474 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3475 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3476 Blake.
3477 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3478
a9fc7990
JD
34792008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3480
3481 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3482 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3483 * bootstrap.conf (gnulib_modules): Add unsetenv.
3484 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3485 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3486 (/setenv.m4): Add.
3487 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3488 the first argument because it may become position-dependent, and unset
3489 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3490 Add comments explaining these issues in more detail.
3491
0f1d6f10
JD
34922008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3493
3494 Add .gitignore everywhere based on .cvsignore.
3495 * .gitignore: New.
3496 * build-aux/.gitignore: New.
3497 * data/.gitignore: New.
3498 * doc/.gitignore: New.
3499 * etc/.gitignore: New.
3500 * examples/.gitignore: New.
3501 * examples/calc++/.gitignore: New.
3502 * lib/.gitignore: New.
3503 * m4/.gitignore: New.
3504 * po/.gitignore: New.
3505 * runtime-po/.gitignore: New.
3506 * src/.gitignore: New.
3507 * tests/.gitignore: New.
3508
7bd1665a
JD
35092008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3510
3511 * NEWS (2.3b+): New section, empty for now.
3512 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3513
72c5b982
JD
35142008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3515
3516 * NEWS (2.3b): Update release date since there has been a delay in
3517 getting the announcements and tarballs out.
3518
bd02cd5d
JD
35192008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3520
3521 * NEWS: Version 2.3b.
3522 * configure.ac (AC_INIT): Likewise.
3523 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3524
9126263e
JD
35252008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3526
3527 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
3528 been doing it for years.
3529 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
3530 (Release Procedure): Add FIXME about make alpha being unmaintained.
3531
fa6aa7b3
JD
35322008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
3533
3534 * data/yacc.c: Reformat m4 a little for readability.
3535 * src/lalr.c (build_relations): Correct comment.
3536
d30b312d
JMG
35372008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3538
3539 DJGPP specific issue.
3540 * djgpp/config.sed: Fixes required to run configure scripts generated
3541 by autoconf 2.62.
3542
138d4cd9
JD
35432008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3544
3545 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
3546 coordinator@translationproject.org.
3547
8f7e2e1f
JD
35482008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3549
3550 * THANKS: Add Eric Blake.
3551
f55efa38
JD
35522008-04-23 Eric Blake <ebb9@byu.net>
3553
3554 Revert prior patch, by working around autoconf regression.
3555 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
3556 ("Output file name: ("): Uncomment test.
3557 ("Output file name: )"): Likewise.
3558 Based on an idea from Noah Misch.
3559
096c9f9d
JD
35602008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3561
3562 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
3563 2.61. Reported by Juan Manuel Guerrero at
3564 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
3565 * tests/output.at ("Output file name: ("): Comment out test case for
3566 now.
3567 ("Output file name: )"): Likewise.
3568
0f664b89
JD
35692008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3570
3571 * GNUmakefile: Update git-version-gen invocation so make dist
3572 succeeds.
3573
1cfe6375
JD
35742008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3575
3576 Update to the current gnulib CVS repository, and fix trigraph handling
3577 in Bison.
3578 * bootstrap: Update gnulib CVS repository URL.
3579 (symlink_to_dir): Encapsulate the code that guarantees the destination
3580 directory exists into...
3581 (check_dst_dir): ... this new function, and...
3582 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
3583 fail when copying files into lib/uniwidth/.
3584 * src/output.c (prepare_symbols): When writing yytname muscles, where
3585 symbol names will be encoded in C-string literals, tell quotearg to
3586 escape trigraphs. This used to be the default in gnulib.
3587 * tests/regression.at (Token definitions): Because of the change in
3588 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
3589 escapes trigraphs in symbol names. Thus, yytname no longer has
3590 trigraphs unnecessarily doubly escaped. Update test case output.
3591 Extend test case to be sure Bison's own error messages will no longer
3592 have trigraphs in symbol names unnecessarily escaped once.
3593
74c52fc8
JD
35942008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
3595
3596 Fix make dist infinite loop reported by Juan Manuel Guerrero at
3597 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
3598 * .cvsignore: Add .version.
3599 * .version.in: New.
3600 * bootstrap.conf (gnulib_modules): Add git-version-gen.
3601 * configure.ac (AC_CONFIG_FILES): Add .version.
3602 * build-aux/.cvsignore: Add git-version-gen.
3603
8e55b3aa
JD
36042008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3605
3606 * NEWS (2.3a+): Mention that -g now takes an argument.
3607 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
3608 consistency. Update the -g and -x entries now that they take
3609 arguments. Use brackets to indicate optional arguments.
3610 * src/getargs.c (usage): Explain the relationship between arguments of
3611 long and short options more completely. Document --defines and -d
3612 separately since the former takes an argument but, for POSIX Yacc, the
3613 latter does not.
3614 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 3615 (getargs): Sort cases.
8e55b3aa 3616
59c5ac72
AD
36172008-02-28 Akim Demaille <demaille@gostai.com>
3618
3619 * doc/bison.texinfo: Fix a few typos.
3620
118d4978
AD
36212008-02-28 Akim Demaille <akim@epita.fr>
3622
3623 * doc/bison.texinfo (Bison Options): Document -W.
3624 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3625
7020f1e9
AD
36262008-02-28 Akim Demaille <akim@epita.fr>
3627
3628 * src/getargs.c (short_options): Split and sort for readability.
3629 -g and -x take optional arguments, just like their long options.
3630 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3631 understand.
3632 Fix the handling of $opt which resulted in all the argument to be
3633 considered as optional.
3634
59da312b
JD
36352008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3636
3637 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3638 say its interface is experimental.
3639 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3640 Java.
3641 (Bison Options): In the -L and --language entry, mention Java.
3642 (Java Bison Interface): Say the interface is experimental.
3643 * src/getargs.c (usage): Mention -L and --language.
3644
3645 * NEWS (2.3a+): Say the push parsing interface is experimental.
3646 * doc/bison.texinfo (Push Decl): Likewise.
3647 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3648 (Push Parser Function): Likewise.
3649 (Pull Parser Function): Likewise.
3650 (Parser Create Function): Likewise.
3651 (Parser Delete Function): Likewise.
3652 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3653 yypull_parse, and yypush_parse entries.
3654
3655 * NEWS (2.3a+): Mention XML support, and say the schema is
3656 experimental.
3657 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3658 * src/getargs.c (usage): Say the XML schema is experimental.
3659
3660 * NEWS (2.3a+): Say option instead of flag.
3661
2bb3ebec
WP
36622008-02-21 Wojciech Polak <polak@gnu.org>
3663
3664 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3665 text.
3666
333e670c
JD
36672008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3668
3669 Fix impure push parser compile error reported by Bob Rossi at
3670 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3671 * data/yacc.c: Clean up whitespace in the output a little.
3672 (yypstate_allocated): Define for impure push parsers regardless of
3673 whether the pull interface is also requested.
3674 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3675 check impure push parsers without the pull interface.
3676
3677 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3678 yyerror takes arguments specified by %parse-param while yypstate_new
3679 does not.
3680 * doc/bison.texinfo (Parser Create Function): Document that
3681 yypstate_new returns 0 for multiple impure parser instances.
3682 * tests/push.at (Push Parsing: Multiple impure instances): Update
3683 expected stderr output.
3684
798096e1
JD
36852008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3686
3687 * runtime-po/POTFILES.in (push.c): Remove.
3688
9ca7f077
JD
36892008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3690
3691 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3692 * data/push.c: Rename to...
3693 * data/yacc.c: ... this, overwriting it.
3694 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3695 `%push-pull-parser' -> `%define api.push_pull "both"'.
3696 Remove old yacc.c tests, and update push.c tests to yacc.c.
3697
42ee26bb
JD
36982008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3699
3700 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3701 `"%code top" blocks' instead of `%code "top" blocks'.
3702 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3703 Clean up whitespace in the output a little.
3704
b1cc23c4
JD
37052008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3706
3707 Fix documentation problems reported by Tim Josling at
3708 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3709 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3710 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3711 integers. Explain the effect of literal string aliases on error
3712 messages. Copy token 0 documentation from the C++ skeleton
3713 documentation.
3714
ab7f29f8
JD
37152008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3716
3717 Accept a token number in a %left, %right, or %nonassoc for POSIX
3718 conformance. Reported by Tim Josling at
3719 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3720 * NEWS (2.3a+): Mention.
3721 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3722 and code numbers are treated by precedence declarations.
3723 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3724 of symbols.1.
3725 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3726 of symbol.
3727 (symbol.prec): New, just like symbol but allows INT.
3728 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3729 longer holds.
3730 * tests/regression.at (Token number in precedence declaration): New
3731 test case.
3732
a924ef36
JMG
37332008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3734
3735 DJGPP specific issues.
3736 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3737 be changed. Copyright timestamp adjusted.
3738 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3739 be changed. Copyright timestamp adjusted.
3740 * djgpp/config.site: Copyright timestamp adjusted.
3741 * djgpp/config_h.sed: Copyright timestamp adjusted.
3742 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3743 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3744 filename translation list.
3745 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3746 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3747 files shall be created. Before trying to use the temp dir where the
3748 environment variable points to check that the dir really exists. If
3749 not default to the cwd as temp dir. Copyright timestamp adjusted.
3750 * djgpp/subpipe.h: Copyright timestamp adjusted.
3751 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3752
389c8cfd
PE
37532008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3754
3755 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3756
5d1cfef4
PE
37572008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3758
3759 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3760 Problem reported by Claudio Saavedra in
3761 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3762
e2dcf996
WP
37632008-01-05 Wojciech Polak <polak@gnu.org>
3764
3765 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3766 document's title with the input grammar file name.
3767
da730230
JD
37682007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3769
3770 Automate regression testing of the XML/XSLT implementation. Discussed
3771 starting at
3772 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3773 * configure.ac (XSLTPROC): New substitution.
3774 * Makefile.am (maintainer-xml-check): New phony target invoking...
3775 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3776 invoking make maintainer-check with BISON_TEST_XML=1.
3777 * tests/atlocal.in (XSLTPROC): New.
3778 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3779 not to report reachable memory when Bison is expected to have a
3780 non-zero exit status and (2) to compare XML/XSLT output with --graph
3781 and --report=all output for every working grammar when
3782 BISON_TEST_XML=1.
3783 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3784 (AT_BISON_CHECK_XML): New.
3785 (AT_QUELL_VALGRIND): New.
3786 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3787 (AT_CHECK): ... don't redefine this since this was the old way to
3788 quell Valgrind.
3789 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3790 AT_BISON_CHECK invocations.
3791 * tests/c++.at: Likewise.
3792 * tests/calc.at: Likewise.
3793 * tests/conflicts.at: Likewise.
3794 * tests/cxx-type.at: Likewise.
3795 * tests/existing.at: Likewise.
3796 * tests/glr-regression.at: Likewise.
3797 * tests/headers.at: Likewise.
3798 * tests/input.at: Likewise.
3799 * tests/java.at: Likewise.
3800 * tests/output.at: Likewise.
3801 * tests/push.at: Likewise.
3802 * tests/reduce.at: Likewise.
3803 * tests/regression.at: Likewise.
3804 * tests/sets.at: Likewise.
3805 * tests/skeletons.at: Likewise.
3806 * tests/synclines.at: Likewise.
3807 * tests/torture.at: Likewise.
3808 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3809 tends to hang xsltproc.
3810 (Big horizontal): Likewise.
3811
408476bc
JD
38122007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3813
3814 In XML output, remove redundant class attribute on symbol element.
3815 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3816 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3817 look up a symbol to determine whether it's a nonterminal or terminal.
3818 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3819 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3820
3821 Add prec/assoc information to XML output.
3822 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3823 %prec, add a percent_prec attribute.
3824 * src/print-xml.c (print_grammar): For each terminal that has a
3825 precedence or associativity, add a prec or assoc attribute.
3826 (xml_indent): New.
3827 (xml_puts): Use xml_indent.
3828 (xml_printf): Use xml_indent.
3829 * src/print-xml.h (xml_indent): Prototype.
3830
3831 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3832 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3833
d4a26c48
JD
38342007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3835
3836 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3837 (bison:ruleByNumber): ... this for clarity.
3838 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3839 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3840 (xsl:template match="reduction"): Update.
3841 (xsl:template match="item"): Update.
3842 (xsl:template match="reduction"): Update.
3843
3844 In the XML output, don't print the list of rules where symbols appear.
3845 Compute it in XSLT instead. Discussed at
3846 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3847 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3848 (bison:ruleByRhs): New.
3849 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3850 bison:ruleByRhs.
3851 (xsl:template match="terminal/rule"): Remove.
3852 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3853 bison:ruleByRhs.
3854 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3855 Remove.
3856 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3857 bison:ruleByRhs and mode="number-link" for rule template.
3858 (xsl:template match="terminal/rule"): Remove.
3859 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3860 bison:ruleByRhs and mode="number-link" for rule template.
3861 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3862 Rewrite as...
3863 (xsl:template match="rule" mode="number-link"): ... this.
3864 * src/print-xml.c (print_grammar): Don't print the list of rules.
3865
ef1b4273
JD
38662007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3867
3868 Don't let --report affect XML output; always print all information.
3869 Discussed at
3870 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3871 * src/conflicts.c (log_resolution): Implement.
3872 * src/print-xml.c (print_core): Implement.
3873 (print_state): Implement.
3874 (print_xml): Implement.
3875
3876 * NEWS (2.3a+): Fix quotes.
3877 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3878 don't let %verbose clear the list specified by --report.
3879
0f6cd9e3
AD
38802007-11-26 Akim Demaille <akim@epita.fr>
3881
3882 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3883
d80fb37a
JD
38842007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3885
3886 In the XML output, list useless and unused symbols and rules with the
3887 useful ones and add a "usefulness" attribute. Discussed starting at
3888 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3889 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3890 (grammar_rules_print_xml): Print all rules instead of just those
3891 useful in the grammar, and add a "usefulness" attribute.
3892 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3893 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3894 (print_grammar): Print all nonterminals instead of just useful ones,
3895 and add a "usefulness" attribute to nonterminals and terminals.
3896 (print_xml): Don't print a separate "reductions" or
3897 "rules-useless-in-parser" element.
3898 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3899 (reduce_xml): Remove.
3900 (reduce_token_unused_in_grammar): New.
3901 (reduce_nonterminal_useless_in_grammar): New.
3902 * src/reduce.h (reduce_xml): Remove prototype.
3903 (reduce_token_unused_in_grammar): Add prototype.
3904 (reduce_nonterminal_useless_in_grammar): Add prototype.
3905 * data/xslt/xml2text.xsl: Update for XML changes.
3906 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3907 * tests/reduce.at (Useless Terminals): Update output.
3908 (Useless Rules): Update output.
3909 (Reduced Automaton): Update output.
3910
3911 Say "Terminals unused in grammar" instead of "Unused terminals".
3912 * NEWS (2.3a+): Update.
3913 * doc/bison.texinfo (Understanding): Update example output.
3914 * src/reduce.c (reduce_output): Implement.
3915 * data/xslt/xml2text.xsl: Implement.
3916 * data/xslt/xml2xhtml.xsl: Implement.
3917
1bb2bd75
JD
39182007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3919
3920 Accept --report-file=FILE to override the default `.output' filename.
3921 * NEWS (2.3a+): Mention.
3922 * doc/bison.texinfo (Bison Options): Add an entry.
3923 * src/files.c (compute_output_file_names): Don't override
3924 spec_verbose_file if already set.
3925 * src/getargs.c (usage): Document --report-file.
3926 (REPORT_FILE_OPTION): New anonymous enum member.
3927 (long_options): Add entry for it.
3928 (getargs): Add case for it setting spec_verbose_file.
3929
3930 * build-aux/cross-options.pl: Don't record a short option just because
3931 there's an arg.
3932 * doc/.cvsignore: Add yacc.1.
3933
a005a9c4
AD
39342007-11-14 Akim Demaille <akim@epita.fr>
3935
3936 * doc/yacc.1.in: New.
3937 * configure.ac, doc/Makefile.am: Adjust.
3938 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3939 config.h symbol.
3940 Use AC_SUBST for assignments too.
3941 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3942
cff03fb2
JD
39432007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3944
3945 * src/gram.c: Remove comments that duplicate comments in gram.h.
3946
3947 When reporting useless rules and nonterminals, say "useless in grammar"
3948 instead of "useless", and say "useless in parser" instead of "never
3949 reduced". Discussed starting at
3950 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3951 * NEWS (2.3a+): Mention this change.
3952 * data/xslt/xml2text.xsl: Update output text and expected input XML
3953 element names to match changes below.
3954 * data/xslt/xml2xhtml.xsl: Likewise.
3955 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3956 Contents: "Rules useless in parser due to conflicts".
3957 * doc/bison.texinfo (Decl Summary): Reword a little.
3958 (Understanding): Update example output for changes below.
3959 * src/gram.c: (rule_useful_p): Rename to...
3960 (rule_useful_in_grammar_p): ... this.
3961 (rule_useless_p): Rename to...
3962 (rule_useless_in_grammar_p): ... this.
3963 (rule_never_reduced_p): Rename to...
3964 (rule_useless_in_parser_p): ... this.
3965 (grammar_rules_print): Update for renames.
3966 (grammar_rules_print_xml): Update for renames.
3967 (grammar_rules_never_reduced_report): Rename to...
3968 (grammar_rules_useless_report): ... this since it is used for either
3969 kind of useless rule.
3970 * src/gram.h: Reword comments and update function names in prototypes.
3971 * src/main.c (main): Say "rule useless in parser due to conflicts".
3972 * src/print-xml.c (print_rules_never_reduced): Rename to...
3973 (print_rules_useless_in_parser): ... this, and rename output XML
3974 element "rules-never-reduced" to "rules-useless-in-parser".
3975 (print_xml): Update for rename.
3976 * src/print.c (print_results): Say "Rules useless in parser due to
3977 conflicts".
3978 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3979 (nonterminals_reduce): Say "nonterminal useless in grammar".
3980 (reduce_output): Say "Nonterminals useless in grammar".
3981 Say "Rules useless in grammar".
3982 (reduce_xml): Rename output XML element "useless" to
3983 "useless-in-grammar".
3984 (reduce_print): Don't report the count of grammatically useless rules
3985 as "rules never reduced" just because %yacc is specified.
3986 In the correct report of this count, say nonterminal(s) and rule(s)
3987 "useless in grammar".
3988 * tests/conflicts.at (S/R in initial): Update expected output.
3989 (Defaulted Conflicted Reduction): Likewise.
3990 (Unreachable States After Conflict Resolution): Likewise.
3991 * tests/existing.at (GNU pic Grammar): Likewise.
3992 * tests/reduce.at (Useless Nonterminals): Likewise.
3993 (Useless Rules): Likewise.
3994 (Reduced Automaton): Likewise.
3995 (Underivable Rules): Likewise.
3996 (Empty Language): Likewise.
3997
66f0441d
JD
39982007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3999
4000 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4001 here document and before the EOF so that BSD's implementation of Bourne
4002 shell doesn't parse the delimiter as part of the here document.
4003 * doc/.cvsignore: Add cross-options.texi.
4004 * src/getargs.c (usage): Add a blank line after the warning categories.
4005
d0ee4105
PB
40062007-11-08 Paolo Bonzini <bonzini@gnu.org>
4007
4008 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4009
e8b1fb9b
AD
40102007-11-05 Akim Demaille <akim@epita.fr>
4011
4012 Remove Id: from bison.1.
4013 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
4014 (perl -0777 -pi -e 's/\.PP\nId): New.
4015 (.x.1): Use it to ignore the version control revision.
4016
2f7a96b5
AD
40172007-11-05 Akim Demaille <demaille@gostai.com>
4018
4019 * build-aux/Makefile.am: Ship cross-options.pl.
4020 * doc/Makefile.am: Always refer to cross-options.texi with
4021 $(srcdir).
4022 (MAINTAINERCLEANFILES): Add it.
4023
f4101aa6
AD
40242007-11-04 Akim Demaille <demaille@gostai.com>
4025
4026 Generate the long/short option cross-table.
4027 * build-aux/cross-options.pl: New.
4028 * doc/Makefile.am (cross-options.texi): New.
4029 * doc/bison.texinfo: Use it.
4030
727a1401
AD
40312007-11-04 Akim Demaille <demaille@gostai.com>
4032
4033 Generate bison.1 using help2man.
4034 * doc/common.x, doc/bison.x: New.
4035 * doc/Makefile.am (bison.1, .x.1): New.
4036 The code is taken from autoconf-2.61/man/Makefile.am.
4037 * configure.ac: Look for help2man.
4038
6aeb9c57
AD
40392007-11-04 Akim Demaille <demaille@gostai.com>
4040
4041 Complete --help.
4042 * src/getargs.c (usage): Document -W, make it clear that -d,
4043 -g and -x have optional arguments.
4044
d7be4085
AD
40452007-11-04 Akim Demaille <demaille@gostai.com>
4046
4047 Find sha1sum when named gsha1sum.
4048 * bootstrap (find_tool): New.
4049 ($SHA1SUM): New.
4050
d9df47b6
JD
40512007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4052
4053 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
4054 at
4055 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
4056 * NEWS (2.3a+): Mention.
4057 * data/bison.m4 (b4_pure_if): Don't define it here.
4058 * data/c.m4 (b4_identification): Depend on individual skeletons to
4059 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
4060 values of the %define variables api.pure or api.push_pull. Define
4061 YYPURE, YYPUSH, and YYPULL accordingly.
4062 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
4063 glr.cc has already defined b4_pure_flag.
4064 * data/push.c: Define b4_pure_if based on `%define api.pure'.
4065 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 4066 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
4067 * doc/bison.texinfo (Pure Decl): Update.
4068 (Push Decl): Update.
4069 (Decl Summary): Add api.pure to %define entry.
4070 In %pure-parser entry, say it's deprecated and reference %define.
4071 (Pure Calling): Update.
4072 (Error Reporting): Update.
4073 (C++ Scanner Interface): Update.
4074 (How Can I Reset the Parser): Update.
4075 (Table of Symbols): In %pure-parser entry, say it's deprecated and
4076 reference %define.
4077 * src/getargs.c (pure_parser): Remove global variable.
4078 * src/getargs.h (pure_parser): Remove extern.
4079 * src/output.c (prepare): Don't define pure_flag muscle.
4080 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
4081 wrapper around `%define api.pure'.
4082 * tests/calc.at (Simple LALR Calculator): Update.
4083 (Simple GLR Calculator): Update.
4084 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
4085 Update.
4086 (GLR: Resolve ambiguity, pure, locations): Update.
4087 (GLR: Merge conflicting parses, pure, no locations): Update.
4088 (GLR: Merge conflicting parses, pure, locations): Update.
4089 * tests/glr-regression.at (Uninitialized location when reporting
4090 ambiguity): Update
4091 * tests/input.at (Unused %define api.pure): New test case.
4092 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
4093 AT_PURE_IF and AT_PURE_AND_LOC_IF.
4094 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4095
c373bf8b
JD
40962007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4097
4098 %define push_pull -> %define api.push_pull. Discussed starting at
4099 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
4100 * data/push.c: Expect the new name.
4101 * data/yacc.c: Likewise.
4102 * doc/bison.texinfo (Push Decl): Update.
4103 (Decl Summary): Update %define entry.
4104 (Push Parser Function): Update.
4105 (Pull Parser Function): Update.
4106 (Parser Create Function): Update.
4107 (Parser Delete Function): Update.
4108 * tests/calc.at (Simple LALR Calculator): Update.
4109 * tests/input.at (%define enum variables): Update.
4110 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4111 (Push Parsing: Multiple impure instances): Update.
4112 (Push Parsing: Unsupported Skeletons): Update.
4113 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
4114 (Exploding the Stack Size with Malloc): Update.
4115
4116 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
4117 other entries some.
4118
32f19b6b
JD
41192007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
4120
4121 For the XML output's terminal element, rename @number to @token-number,
4122 and add @symbol-number. In the nonterminal element, rename @number to
4123 @symbol-number. Discussed starting at
4124 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
4125 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
4126 renames.
4127 (xsl:template match="nonterminal"): Likewise.
4128 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
4129 (xsl:template match="nonterminal"): Likewise.
4130 * src/print-xml.c (print_grammar): Implement.
4131
255a6b90
JD
41322007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4133
4134 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
4135 2007-10-11 change, the child elements here are items not rules.
408476bc 4136 (xsl:template match="item"): New.
255a6b90
JD
4137 (xsl:template match="rule"): Update for new reduced itemset.
4138 (xsl:template match="point"): Remove.
4139 (xsl:template match="empty"): For consistency with --graph, don't
4140 output "/* empty */".
4141 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
4142 line-wrap, don't pass a negative value as first-line-length since this
4143 won't work with the following changes.
4144 (xsl:template name="line-wrap"): Simplify slightly.
4145 (xsl:template name="ws-search"): Eliminate recursion.
4146 * src/print_graph.c (print_core): Don't print a reduction's lookahead
4147 set next to an item whose dot is not at the end of the RHS even if it
4148 happens to be associated with the same rule.
4149
88c78747
JD
41502007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4151
31984206
JD
4152 Add %define lr.keep_unreachable_states.
4153 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
4154 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
4155 * src/main.c (main): Implement it.
4156 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4157 Extend to test it, and fix a typo.
4158
41592007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4160
4161 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
4162 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
4163 the example .output text.
4164 * tests/regression.at (Extra lookahead sets in report): Improve wording
4165 of comments.
4166
b7a70162
WP
41672007-10-17 Wojciech Polak <polak@gnu.org>
4168
4169 * src/print-xml.c (print_grammar): Renamed
4170 <terminal> and <nonterminal> attributes:
4171 "type" to "number" and "symbol" to "name".
4172 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
4173 Use new attribute names.
4174 (xsl:template match="nonterminal"): Likewise.
4175 * data/xslt/xml2xhtml.xsl: Likewise.
4176
a0de5091
JD
41772007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
4178
4179 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
4180 (Option Cross Key): Likewise.
4181
4182 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
4183 next to an item whose dot is not at the end of the RHS even if it
4184 happens to be associated with the same rule.
4185 * src/print.c (print_core): Likewise.
4186 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
4187 (Resolved SR Conflicts): Update output.
4188 * tests/regression.at (Extra lookahead sets in report): New test case.
4189
4c20d18d
WP
41902007-10-11 Wojciech Polak <polak@gnu.org>
4191
4192 * src/print-xml.c (print_core): Remove item set
4193 redundancy.
4194 * data/xslt/bison.xsl (bison:ruleNumber): New key.
4195 Improve processing time. Suggested by Joel E. Denny.
4196 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
4197 Write xsl:param "required" attribute as comment.
4198 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
4199 (xsl:template match="rule"): Support new reduced itemset.
4200 (xsl:template match="point"): Remove.
4201 * data/xslt/xml2xhtml.xsl: Likewise.
4202
f506ad1c
JD
42032007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4204
4205 * src/getargs.c (version): Update copyright year.
4206
21f1b063
JD
42072007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4208
4209 Make xml2dot.xsl and --graph produce the same output.
4210 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
4211 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4212 escaped later.
4213 (xsl:template name="output-node"): Use the new escape template instead
4214 of the string-replace template directly.
4215 (xsl:template name="output-edge"): Likewise.
4216 (xsl:template name="escape"): New, escapes backslashes and newlines in
4217 addition to quotation marks.
4218 * src/graphviz.c (start_graph, output_node, output_edge): Add
4219 whitespace to output for legibility.
4220
4221 Make xml2text.xsl and --report produce the same output, and remove the
4222 XML "conflicts" element since a conflict summary is easily extracted
4223 from the automaton.
4224 * data/xslt/bison.xsl: New.
4225 (xsl:template match="state" mode="bison:count-conflicts): New.
4226 * data/xslt/xml2text.xsl: Import bison.xsl.
4227 (xsl:template match="bison-xml-report"): Instead of styling the
4228 "conflicts" element, style the "automaton" element with mode
4229 "conflicts". Unlike the former, the latter lists S/R and R/R
4230 conflicts for a state on the same line.
4231 (xsl:template match="conflicts"): Remove.
4232 (xsl:template match="conflict"): Remove.
4233 (xsl:template match="terminal"): Line-wrap the list of rules in which
4234 the terminal is used.
4235 (xsl:template match="nonterminal"): Likewise for nonterminals.
4236 (xsl:template match="automaton" mode="conflicts"): New.
4237 (xsl:template match="state" mode="conflicts"): New.
4238 (xsl:template name="line-wrap"): New.
4239 (xsl:template name="ws-search"): New.
4240 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4241 (xsl:template match="bison-xml-report"): Instead of styling the
4242 "conflicts" element, style the "automaton" element with mode
4243 "conflicts."
4244 (xsl:template match="conflicts"): Remove.
4245 (xsl:template match="conflict"): Remove.
4246 (xsl:template match="automaton" mode="conflicts"): New.
4247 (xsl:template match="state" mode="conflicts): New.
4248 * src/conflicts.c (conflicts_output_xml): Remove.
4249 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4250 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4251 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4252 the corresponding XSLT is easier. Also, never wrap between a word and
4253 the comma that follows it.
4254
793fbca5
JD
42552007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4256
4257 Improve C++ namespace support. Discussed starting at
4258 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4259 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4260 b4_namespace_close): New macros that interpret the %define variable
4261 "namespace" so its value can contain "::" to indicate nested
4262 namespaces.
4263 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4264 the above macros.
4265 * data/lalr1.cc (b4_namespace): Likewise.
4266 * data/location.cc (b4_namespace): Likewise.
4267 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4268 inside a new table in the general %define entry. Document `%define
4269 namespace' there as well. Point the %name-prefix entry to it since it
4270 explains it more completely in the case of C++.
4271 (C++ Bison Interface): Mention `%define namespace' instead of
4272 %name-prefix.
4273 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4274 entry suffices.
4275 * tests/c++.at (Relative namespace references): New test case.
4276 (Absolute namespace references): New test case.
4277 (Syntactically invalid namespace references): New test case.
4278 * tests/input.at (C++ namespace reference errors): New test case.
4279
35b8730d
JD
42802007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4281
4282 Add syncline support and location accessor to internal %define
4283 interfaces.
4284 * data/bison.m4 (b4_percent_define_get_loc): New.
4285 (b4_percent_define_get_syncline): New.
4286 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4287 (b4_percent_define_default): Record defining location as line 1 rather
4288 than 0 for the sake of synchronizing #line's, and define
4289 b4_percent_define_syncline(VARIABLE).
4290 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4291 * src/muscle_tab.c (muscle_syncline_grow): New.
4292 (muscle_code_grow): Use muscle_syncline_grow.
4293 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4294 define b4_percent_define_syncline(VARIABLE).
4295 (muscle_percent_define_get_loc): New.
4296 (muscle_percent_define_get_syncline): New.
4297 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4298 remove some unused variables.
4299 (muscle_percent_define_default): Record defining location as line 1
4300 rather than 0 for the sake of synchronizing #line's, and define
4301 b4_percent_define_syncline(VARIABLE).
4302 (muscle_percent_define_check_values): Use
4303 muscle_percent_define_get_loc.
4304 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4305 (muscle_percent_define_get_syncline): Prototype.
4306 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4307 defaults): Update output for location change.
4308 (Complaining during macro argument expansion): Extend to test
4309 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4310
7dc4a694
JD
43112007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4312
4313 Fix some error-reporting macro bugs.
4314 * data/bison.m4 (b4_cat): New.
4315 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4316 to stdout so they don't become arguments to other macros. Update
4317 comments and add examples.
4318 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4319 add examples.
4320 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4321 after printing the error directive so that M4 doesn't report subsequent
4322 problems that are induced by this problem.
4323 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4324 instead of just in them. Recognize @\n in both places. Both expand to
4325 the empty string. Needed by b4_cat.
4326 * tests/skeletons.at (Complaining during macro argument expansion):
4327 New test case.
4328 (Fatal errors make M4 exit immediately): New test case.
4329
d4bd2295
JD
43302007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4331
4332 Implement --print-datadir.
4333 * src/getargs.c (usage): Mention.
4334 (PRINT_DATADIR_OPTION): New anonymous enum member.
4335 (long_options): Add entry for it.
4336 (getargs): Add case for it calling compute_pkgdatadir.
4337 * src/output.c (output_skeleton): Encapsulate data directory
4338 computation from here...
4339 (prepare): ... and from here...
4340 (compute_pkgdatadir): ... into this new function.
4341 * src/output.h (compute_pkgdatadir): Prototype.
4342
34cdeddf
JD
43432007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4344
4345 * src/print-xml.c (escape_bufs): New static global variable
4346 replacing...
4347 (xml_escape_n): ... the static local variable buf here.
4348 (print_xml): Free memory for escape_bufs.
4349 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4350
d782395d
JD
43512007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4352
4353 Replace `%push-parser' and `%push-pull-parser' with
4354 `%define push_pull "push"' and `%define push_pull "both"'.
4355 `%define push_pull "pull"' is the default.
4356 * doc/bison.texinfo (Push Decl, Push Parser Function,
4357 Pull Parser Function, Parser Create Function, Parser Delete Function):
4358 Update declarations.
4359 (Decl Summary, Table of Symbols): Replace %push-parser and
4360 %push-pull-parser entries with a %define push_pull entry.
4361 * data/bison.m4 (b4_percent_define_check_values): New macro.
4362 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4363 definitions...
4364 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4365 definitions...
4366 * data/push.c: ... to here and compute them from the value of the
4367 %define variable push_pull.
4368 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4369 parsing requests here...
4370 * data/yacc.c: ... hack this to switch to push.c any time
4371 b4_use_push_pull_flag or the %define variable push_pull is set. This
4372 will go away when we mv push.c yacc.c.
4373 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4374 push parsing is not supported since unused %define variables are
4375 reported anyway.
4376 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4377 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4378 comments for consistency with b4_percent_define_check_values.
4379 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4380 muscles.
4381 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4382 Remove.
4383 (prologue_declaration): Remove %push-parser and %push-pull-parser
4384 rules.
4385 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4386 * tests/calc.at: Update declarations.
4387 * tests/input.at (%define enum variables): New test case.
4388 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4389 declaration.
4390 (Push Parsing: Multiple impure instances): Update declaration.
4391 (Push Parsing: Unsupported Skeletons): New test case.
4392 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4393 declaration.
4394 (Exploding the Stack Size with Malloc): Update declaration.
4395
3f999f78
WP
43962007-09-24 Wojciech Polak <polak@gnu.org>
4397
4398 Add XSLT transformations.
4399
4400 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4401 * data/xslt/xml2text.xsl: Transform XML into plain text.
4402 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4403 * data/Makefile.am (xsltdir): New variable.
4404 (dist_xslt_DATA): Add xslt/*.xsl files.
4405
a4f75309
PE
44062007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4407
4408 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4409 Problem reported by Wojciech Polak.
4410 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4411 (xml_printf): Undo change I made on 21 September; that is,
4412 indent 2 spaces, not 1.
4413
ad5feac4
JD
44142007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4415
4416 Pacify ./configure --enable-gcc-warnings.
4417 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4418 `char const *' instead of `char *'.
4419 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4420 local variable `sep'.
4421
41d7a5f2
PE
44222007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4423
4424 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4425 elsewhere.
4426 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4427 (xml_printf): Indent just 1 space for level.
4428 (e_char, xlate_char): Remove.
4429 (xml_escape_string): Rewrite to avoid undefined behavior (used
4430 storage that was freed from the stack).
4431 (xml_escape_n): Don't bother checking for subscript error.
4432
3f999f78
WP
44332007-09-21 Wojciech Polak <polak@gnu.org>
4434
4435 Add Bison XML Automaton Report.
41d7a5f2
PE
4436
4437 Add support for an -x option to generate an XML report.
4438 It is not documented yet.
4439 * src/print-xml.c: New file.
4440 * src/print-xml.h: Likewise.
4441 * lib/timevar.def (TV_XML): New var.
4442 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4443 * src/conflicts.c: Include print-xml.h.
4444 (solved_conflicts_xml_obstack): New var.
4445 (log_resolution, conflicts_solve, conflicts_free):
4446 Add support for XML report.
4447 (conflicts_output_val): New function.
4448 * src/conflicts.h (conflicts_output_val): New decl.
4449 * src/files.c (spec_xml_file): New var.
4450 (compute_output_file_names, output_file_names_free): Add XML support.
4451 * src/files.h (spec_xml_file): New decl.
4452 * src/getargs.c (xml_flag): New var.
4453 (usage, short_options, long_options, getargs): Add XML support.
4454 * src/getargs.h (xml_flag): New decl.
4455 * src/gram.c: Include print-xml.h.
4456 (rule_lhs_print_xml, rule_rhs_print_xml):
4457 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4458 New functions.
4459 * src/gram.h: Declare external ones.
4460 * src/main.c: Include print-xml.h.
4461 (main): Add XML support.
4462 * src/reduce.c: Include print-xml.h.
4463 (reduce_xml): New function.
4464 * src/reduce.h: Declare it.
4465 * src/state.c: Include print-xml.h.
4466 (state_new): Add XML support.
4467 (state_rule_lookahead_tokens_print_xml): New function.
4468 * src/state.h: Declare it.
4469 (struct state): New member solved_conflicts_xml.
4470 * src/symtab.c (symbol_class_get_string): New function.
4471 * src/symtab.h: Declare it.
4472
6d8e724d
PE
44732007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4474
4475 * GNUmakefile: Switch to coreutils's version.
4476 * bootstrap: Likewise.
4477 * Makefile.cfg: Adjust to new GNUmakefile.
4478 * README-hacking: Likewise.
4479
4480 Import from gnulib:
4481
4482 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4483 Bruno Haible <bruno@clisp.org>
4484
4485 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4486 and is a script that invokes bison. Tighten the code. Add comments.
4487
922bdd7f
JD
44882007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4489
4490 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4491 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4492 * doc/bison.texinfo (Decl Summary): Fix.
4493 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4494 * tests/input.at (Boolean %define variables): Update output.
4495 * tests/skeletons.at (%define boolean variables: invalid skeleton
4496 defaults): Rename to...
4497 (%define Boolean variables: invalid skeleton defaults): ... this and
4498 update output.
4499
1b17b01d
JD
45002007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4501
4502 In impure push mode, don't allow more than one yypstate to be allocated
4503 since multiple impure parsers would corrupt yynerrs.
4504 * data/push.c (yypstate_allocated): New static global variable
4505 initialized to 0.
4506 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4507 exhaustion if yypstate_allocated is 1, but still return 2.
4508 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4509 already 1. Otherwise, set it to 1.
4510 (yypstate_delete): Set it to 0.
4511 * tests/push.at (Push Parsing: Multiple impure instances): New test
4512 case.
4513
9987d1b3
JD
45142007-08-17 Bob Rossi <bob@brasko.net>
4515
4516 * doc/bison.texinfo (Push Decl): Document the push parser.
4517 (Table of Symbols): Ditto.
4518 (Pure Decl): Ditto.
4519 (Decl Summary): Ditto.
4520 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4521 Parser Create Function, Parser Delete Function):
4522 Add new push parser symbols.
4523 (Table of Symbols): Document push-parser, push-pull-parser,
4524 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4525
f16b0819
PE
45262007-08-15 Paul Eggert <eggert@cs.ucla.edu>
4527
4528 Update to GPLv3.
4529 * doc/gpl-3.0.texi: New file.
4530 * doc/gpl.texi: Remove.
4531 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
4532 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
4533 * README-hacking, TODO, bootstrap, bootstrap.conf:
4534 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
4535 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
4536 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
4537 * data/lalr1.cc, data/lalr1.java, data/location.cc:
4538 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
4539 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
4540 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
4541 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
4542 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
4543 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
4544 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
4545 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
4546 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
4547 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
4548 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
4549 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
4550 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
4551 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
4552 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
4553 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
4554 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
4555 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
4556 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
4557 * src/complain.c, src/complain.h, src/conflicts.c:
4558 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
4559 * src/files.h, src/flex-scanner.h, src/getargs.c:
4560 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
4561 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
4562 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
4563 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
4564 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
4565 * src/print.c, src/print.h, src/print_graph.c:
4566 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
4567 * src/reduce.h, src/relation.c, src/relation.h:
4568 * src/revision.h, src/scan-code.h, src/scan-code.l:
4569 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
4570 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
4571 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
4572 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
4573 * tests/Makefile.am, tests/actions.at, tests/c++.at:
4574 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
4575 * tests/existing.at, tests/glr-regression.at:
4576 * tests/headers.at, tests/input.at, tests/java.at:
4577 * tests/local.at, tests/output.at, tests/push.at:
4578 * tests/reduce.at, tests/regression.at, tests/sets.at:
4579 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
4580 * tests/torture.at:
4581 Update to GPLv3.
4582
728c4be2
JD
45832007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4584
4585 Get rid of broken %no-parser, -n, and --no-parser implementation and
4586 documentation.
4587 * TODO: Don't mention them.
4588 * doc/bison.1: Likewise.
4589 * doc/bison.texinfo (Decl Summary): Likewise.
4590 (Bison Options): Likewise.
4591 (Option Cross Key): Likewise.
4592 * src/getargs.c (no_parser_flag): Remove global variable.
4593 (usage): Don't print description of -n and --no-parser.
4594 (long_options): Remove --no-parser entry here.
4595 (getargs): Remove -n case in the switch here.
4596 * src/getargs.h (no_parser_flag): Remove extern.
4597 * tests/regression.at (Web2c Actions): Remove comment that mentions
4598 --no-parser.
4599
5d31a216
JD
46002007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4601
4602 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
4603 name user variables starting with `yy'. Just pass NULL instead of a
4604 dummy local &yylval to yypush_parse.
4605 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
4606 starting with `yy'.
4607
a2ea208d
JD
46082007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
4609
4610 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
4611 true since it's then always used regardless of whether yyoverflow is
4612 defined. Reported by Christian Burger at
4613 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
4614 * THANKS: Add Christian Burger.
4615
91661ebb
JD
4616 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4617 node names: say "Decl Summary" not "Bison Declaration Summary".
4618
cbd50549
JD
46192007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
4620
4621 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
4622 determine whether this function has already complained about an invalid
4623 value for a %define boolean variable, don't check whether Bison has
4624 ever examined the value. As written, the check was a tautology.
4625 Instead, record and check for this complaint using a separate muscle.
4626
eb1b0740
JD
46272007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4628
4629 Fix push parsing memory leak reported by Brandon Lucia at
4630 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4631 * THANKS: Add Brandon Lucia.
4632 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4633 but the parse never completed and thus freed it.
4634 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4635 * tests/testsuite.at: Include push.at.
4636 * test/push.at: New.
4637 (Push Parsing: Memory Leak for Early Deletion): New test case.
4638
9d774aff
JD
46392007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4640
4641 Improve handling of multiple S/R conflicts in the same state and of S/R
4642 conflicts involving multiple reductions.
4643 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4644 set for a state here or Bison will abort if it is reassigned on a
4645 later conflicted reduction in the same state.
4646 Similarly, don't finalize and assign the solved conflicts report here
4647 or it will be lost if it is reassigned on a later conflicted reduction
4648 in the same state.
4649 (set_conflicts): Instead, assign them both here after all S/R conflicts
4650 in the state have been fully examined.
4651 * src/print.c (shift_set): Rename to...
4652 (no_reduce_set): ... this.
4653 (print_reductions): Update for rename, and add %nonassoc error action
4654 tokens to no_reduce_set so that, when printing the first remaining
4655 reduction on an error action token, the reduction is enclosed in
4656 brackets.
4657 (print_results): Update for rename.
4658 * tests/conflicts.at (Solved conflicts report for multiple reductions
4659 in a state): New test case.
4660 (%nonassoc error actions for multiple reductions in a state): New test
4661 case.
4662
4663 * src/main.c (main): Don't depend on C99 features.
4664
10159d2a
JD
46652007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4666
4667 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
4668 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4669 uniwidth.
10159d2a 4670
953b3935
JD
46712007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4672
4673 * bootstrap (slurp): Create target directories that don't exist.
4674 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4675
6ce2d93a
JD
46762007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4677
4678 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4679 than item number.
4680 * closure.c (closure): Likewise.
4681 * state.h (reductions): Comment sorting of rules.
4682 (state): Comment sorting of items.
4683
ce3448d5
JD
46842007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4685
4686 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4687 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4688 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4689 definition in order to avoid Gnulib headers since we don't use config.h
4690 here.
4691 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4692 rather than AT_DATA so that config.h is included.
4693
8a86eef0
JD
46942007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4695
4696 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4697 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4698 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4699 and so that YYFPRINTF is guaranteed to be defined here.
4700
b1a81613
JD
47012007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4702
4703 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4704 with...
4705 (muscle_percent_define_check_values): ... this more helpful function.
4706 Again, it's not used yet, but it will be.
4707 * src/muscle_tab.h: Likewise.
4708
71b61d4d
JD
4709 Improve some comments in parser table construction.
4710 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4711 (generate_states): Don't mention ruleset, which is internal to closure.
4712 * src/closure.c (closure): Explain sorting of core and itemset, which
4713 is required for this function to behave correctly.
4714 * src/closure.h (closure): Mention sorting.
4715
2a6b783d
JD
47162007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4717
4718 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4719 move the check for disabled transitions to an aver since conflict
4720 resolution hasn't happened yet.
4721
4722 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4723 labels a state as inconsistent just because it has error transitions.
4724 The original form of this check appeared in revision 1.1 of lalr.c,
4725 which was committed on 1991-12-21. Now (at least), changing the
4726 consistency label on such a state appears to have no useful effect in
4727 any of the places it is examined, which I enumerate below. The key
4728 point to understanding each item in this enumeration is that a state
4729 with an error transition is labelled consistent in the first place only
4730 if it has no rules, so the check cannot matter for states that have
4731 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4732 to try to identify its conflicts, and a state must have *rules* to have
4733 conflicts. (2) Labelling a state as inconsistent will affect how
4734 action_row sets the default *rule* for the state. (3) Labelling a
4735 state as inconsistent will cause build_relations to add lookback edges
4736 to *rules* in that state.
4737 * src/state.h (struct state): Word the comment for member consistent
4738 more carefully.
4739
14462c2b
JD
47402007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4741
4742 Don't depend on C99 features.
4743 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4744 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4745 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4746 * src/state.c (state_mark_reachable_states): Fix for-loop.
4747 (state_remove_unreachable_states): Fix for-loop.
4748
4749 Don't widen struct state with member reachable just to temporarily
4750 record reachability. Instead, use a local bitset.
4751 * src/state.h (struct state): Remove member.
4752 * src/state.c (state_new): Don't initialize it.
4753 (state_mark_reachable_states): Rename to...
4754 (state_record_reachable_states): ... this, and use bitset.
4755 (state_remove_unreachable_states): Use bitset.
4756
5a43d418
JD
47572007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4758
4759 * src/Makefile.am (yacc): Quote target action commands properly so
4760 that the yacc script isn't corrupt. Reported by Hans Aberg at
4761 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4762
0c650a20
JD
4763 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4764 the case of pure parsers. Reported by Frans Englich at
4765 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4766 * THANKS: Add Frans Englich.
4767
61fee93e
JD
4768 * NEWS (2.3a+): In the %code entry, reference section `Bison
4769 Declaration Summary' from the manual now since the %code summary has
4770 moved there.
4771 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4772 in the rules section must be terminated by semicolons.
4773
f124d423
JD
47742007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4775
4776 Extend the front-end API for %define variables to more completely
4777 mirror the back-end. This will be useful in the future.
4778 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4779 Update comments to mention the new front-end counterparts of these
4780 macros.
4781 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4782 for muscle_string_decode and muscle_location_decode.
4783 (muscle_string_decode): New static function.
4784 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4785 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4786 functions.
4787 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4788 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4789 implementation more closely.
4790 (muscle_percent_define_invalid_value): New function.
4791 * src/muscle_tab.h (muscle_percent_define_get,
4792 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4793 Prototype.
4794
75ad86ee
JD
47952007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4796
4797 * NEWS (2.3a+): Mention yesterday's state-removal change.
4798 (2.3a): Remove the %language entry, which was added after 2.3a.
4799 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4800 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4801 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4802 tests/existing.at: Update copyright date.
4803
5967f0cf
JD
48042007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4805
4806 If conflict resolution makes states unreachable, remove those states,
4807 report rules that are then unused, and don't report conflicts in those
4808 states.
4809 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4810 New global function.
4811 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4812 function.
4813 * src/main.c (main): After conflict resolution, remove the unreachable
4814 states and update all data structures that reference states by number.
4815 * src/state.c (state_new): Initialize each state's reachable member to
4816 false.
4817 (state_mark_reachable_states): New static function.
4818 (state_remove_unreachable_states): New global function.
4819 * src/state.h (struct state): Add member bool reachable.
4820 (state_remove_unreachable_states): Prototype.
4821 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4822 New test case.
4823 * tests/existing.at (GNU pic Grammar): Update test case output now that
4824 an unused rule is discovered.
4825
b09f4f48
JD
48262007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4827
4828 Minor code cleanup in parser table construction.
4829 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4830 (new_itemsets, save_reductions): Update for rename to nitemset.
4831 * src/closure.c (nritemset): Rename to...
4832 (nitemset): ... this since the "r" appears to meaningless and isn't
4833 used in the comments.
4834 (closure): Update for rename.
4835 * src/closure.h (nritemset): Update extern to...
4836 (nitemset): ... this.
4837 * src/lalr.c (LA): Fix a typo in comments.
4838 * src/print.c (print_core): Update for rename to nitemset.
4839 * src/print_graph.c (print_graph): Likewise.
4840 * src/state.h: Fix some typos in header comments.
4841
bbb44d83
PE
48422007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4843
9b33de72
PE
4844 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4845 still sticks to ASCII. Sorry!
4846
bbb44d83
PE
4847 * README-hacking: New file, taken mostly from coreutils, with changes
4848 for Bison. Contains much of the contents of:
4849 * README-cvs: Remove.
4850 * bootstrap: Sync from gnulib.
4851 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4852 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4853
29553547
JD
48542007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4855
4856 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4857 Setzer.
4858 (Java Differences): Fix some typos.
4859 * THANKS: Add Sebastian Setzer.
4860
01b477c6
PB
48612007-03-07 Paolo Bonzini <bonzini@gnu.org>
4862
730739e4
AD
4863 * data/java.m4 (b4_single_class_if): Remove.
4864 (b4_abstract_if): Look at "%define abstract".
4865 (b4_lexer_if): New.
4866 (b4_union_name): Rename...
4867 (b4_yystype): ... to this. Map to "%define stype".
4868 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4869 b4_maybe_throws): Fix quoting.
4870 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4871 * data/lalr1.java (Lexer interface): Always define.
4872 (Lexer interface within parser class): Remove.
4873 (YYLexer class): New, used when "%code lexer" is present.
4874 (constructor): When "%code lexer" is used, pass %lex-param
4875 to the lexer constructor.
4876 (yylex, yyparse): Remove %lex-param from method invocations
4877 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4878
4879 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4880 abstract". Rename "%define union_name" to "%define stype".
4881 Rename method names according to previous patch.
4882 (Java Scanner Interface): Describe "%code lexer" instead of
4883 "%pure-parser" and "%define single_class".
4884 (Java Differences): Mention "%code lexer".
4885
4886 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4887 Include scanner here, using macros from tests/local.at.
4888 (AT_DATA_CALC_Y): Remove final argument.
4889 (_AT_CHECK_JAVA_CALC): Likewise.
4890 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4891 of %locations and %error-verbose.
4892 (main): Test with and without %lex-param.
4893 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4894 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 4895
122bea3a
JMG
48962007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4897
4898 DJGPP spefic issue. Inhibit the use of disallowed characters for
4899 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4900 and concern testsuite case 46.
4901 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4902 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4903 * djgpp/config.bat: Inhibit the use of disallowed characters.
4904
9611cfa2
JD
49052007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4906
4907 Miscellaneous %define and %code cleanup.
4908 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4909 values are interpreted.
4910 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4911 documentation a little more.
4912 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4913 muscle_percent_define_insert, muscle_percent_code_grow): New
4914 functions/macros.
4915 * src/muscle_tab.h (muscle_percent_define_insert,
4916 muscle_percent_code_grow): Prototype.
4917 * src/parse-gram.y (prologue_declaration): Use
4918 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4919 %define and %code directives.
4920
4921 Make it easy to share %define boolean variables between the front-end
4922 and back-end. Though not used yet, this will be useful in the future.
4923 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4924 Bison uses of names rather than just skeleton uses of names.
4925 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4926 b4_percent_define_skeleton_variables(VARIABLE) to
4927 b4_percent_define_bison_variables(VARIABLE).
4928 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4929 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4930 b4_percent_code_bison_qualifiers(QUALIFIER).
4931 (b4_check_user_names_wrap): Update for renames.
4932 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4933 muscle_percent_define_default): New functions mimicking
4934 b4_percent_define_flag_if and b4_percent_define_default.
4935
4936 For %define variables, report locations for invalid values and
bbb44d83 4937 redefinitions.
9611cfa2
JD
4938 * data/bison.m4 (b4_percent_define_flag_if): Read
4939 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4940 value for VARIABLE.
4941 (b4_percent_define_default): Save a special location in
4942 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4943 must later be reported as invalid.
4944 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4945 functions.
4946 (muscle_percent_define_insert): Record the location of VARIABLE in
4947 muscle percent_define_loc(VARIABLE), and use it to report the previous
4948 location for a redefinition.
4949 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4950 (muscle_percent_define_default): Update like b4_percent_define_default.
4951 (muscle_grow_user_name_list): Rename to...
4952 (muscle_user_name_list_grow): ... this for consistency and use
4953 muscle_location_grow.
4954 * src/muscle_tab.h (muscle_location_grow): Prototype.
4955 * tests/input.at (%define errors): Update expected output.
4956 * tests/skeletons.at (%define boolean variables: invalid skeleton
4957 defaults): New test case.
4958
0bf92491
JD
49592007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4960
4961 * src/print.c (lookahead_set, state_default_rule): Remove.
4962 (print_reductions): Replace state_default_rule invocation with
4963 equivalent use of yydefact, which was computed in token_actions in
4964 tables.c.
4965 (print_results): Don't allocate lookahead_set.
4966
d3b12988
PB
49672007-02-27 Paolo Bonzini <bonzini@gnu.org>
4968
4969 * data/lalr1.java: Prefix all private members with yy.
4970
f57a7536
JD
49712007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4972
4973 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 4974 Sebastien Fricker at
f57a7536 4975 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 4976 * THANKS: Add Sebastien Fricker.
f57a7536
JD
4977 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4978 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4979 accept a variable number of arguments.
4980
6404a5bf
JD
49812007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4982
4983 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4984
e4e09639
JMG
49852007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4986
4987 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4988 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4989 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4990
d7e0a1a7
PE
49912007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4992
4993 Undo my 2007-02-07 change, switching back to the c-strcase module
4994 introduced in the 2007-02-03 change. Bruno Haible reported that
4995 the 2007-02-07 change would be dangerous in Turkish if we add a
4996 language whose name contains "i", since "i" is not lowercase "I"
4997 in Turkish.
4998 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4999 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5000 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5001 * m4/.cvsignore: Remove strcase.m4.
5002 * src/getargs.c: Revert 2007-02-07 change, as follows.
5003 Include c-strcase.h.
5004 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5005
deee93a1
JD
50062007-02-11 Bruno Haible <bruno@clisp.org>
5007
5008 Enable the Java related testsuite tests when the only Java compiler
5009 found is a gcj < 4.3. Discussed at
5010 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5011 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
5012
574add85
JD
50132007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
5014
5015 * data/Makefile.am: Update copyright date.
5016 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
5017 yypstate_new returns NULL.
5018 (yypstate_new): Return NULL if malloc does.
5019 * src/reader.c (packgram): Move translation of rule actions from the
5020 beginning of packgram to...
5021 (check_and_convert_grammar): ... here right before packgram is invoked
5022 so it's easier to write more complete comments, and remove redundant
5023 code.
5024
e785ccf7
JD
50252007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
5026
5027 As in semantic actions, make @$ in %initial-action, %destructor, and
5028 %printer imply %locations.
5029 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
5030 scanning @$.
5031 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
5032 (@$ in %initial-action implies %locations,
5033 @$ in %destructor implies %locations,
5034 @$ in %printer implies %locations): ... these new test cases.
5035
1cfe1ed7
PE
50362007-02-07 Paul Eggert <eggert@cs.ucla.edu>
5037
5038 Undo most of the 2007-02-03 change, switching to the strcase module
5039 now that gnulib strcase has been fixed.
5040 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
5041 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
5042 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
5043 * m4/.cvsignore: Add strcase.m4.
5044 * src/getargs.c: Revert 2007-02-03 change, as follows.
5045 Don't include c-strcase.h.
5046 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
5047 strcasecmp has "unspecified behavior" outside the POSIX locale,
5048 but it works fine in practice if at least one argument is ASCII,
5049 as is the case in Bison.
5050
0049ec86
PB
50512007-02-07 Paolo Bonzini <bonzini@gnu.org>
5052
5053 * tests/java.at: Skip tests if only one of javac/java is present.
5054 Reported by Joel E. Denny.
5055 * tests/atlocal.in: Adjust copyright years.
5056
50572007-02-05 Paolo Bonzini <bonzini@gnu.org>
5058
5059 * data/lalr1.java (Stack): Work around old verifiers that disallow
5060 access to the private fields of an inner class, from the outer class.
5061 We can make Stack's fields public because user code doesn't have access
5062 to the instance of Stack used by parse(). Reported by Paul Eggert.
5063
2c2b7220
PE
50642007-02-03 Paul Eggert <eggert@cs.ucla.edu>
5065
5066 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
5067 the right spot for these files?
5068 * bootstrap.conf (gnulib_modules): Add c-strcase.
5069 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
5070 c-strncasecmp.c.
5071 * src/getargs.c: Include c-strcase.h.
5072 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
5073 to avoid unspecified behavior.
5074
b2b81dae
JD
50752007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
5076
5077 * doc/bison.texinfo (Decl Summary): Correct typo.
5078
c1d19e10
PB
50792007-01-30 Paolo Bonzini <bonzini@gnu.org>
5080
5081 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
5082 Complain if the value does not match empty, "true" or "false".
5083 * data/c++.m4: Adjust default definitions of %define variables.
5084 * data/java.m4: Adjust default definitions of %define variables.
5085 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
5086 to above behavior.
5087 * tests/input.at (Boolean %define variables): Test new behavior.
5088
8405b70c
PB
50892007-01-29 Paolo Bonzini <bonzini@gnu.org>
5090
5091 * NEWS: Mention java.
5092 * TODO: Remove things that are done.
5093 * bootstrap.conf: Add javacomp-script and javaexec-script.
5094 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
5095
5096 * data/Makefile.am: Add new files.
5097 * data/java-skel.m4: New.
5098 * data/java.m4: New.
5099 * data/lalr1.java: New.
5100
5101 * doc/bison.texinfo: Put "A Complete C++ Example" under
5102 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
5103 under Other Languages.
5104
5105 * src/getargs.c (valid_languages): Add Java.
5106 * src/getargs.h (struct bison_language): Update size of string fields.
5107
5108 * tests/Makefile.am: Add java.at.
5109 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
5110 * tests/java.at: New.
5111 * tests/testsuite.at: Include it.
5112
3eb82471
JD
51132007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
5114
5115 Clean up.
5116 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
5117 at_directive_argv arguments so these no longer have to be global
5118 variables. Also, update the implementation for the following changes.
5119 (fail_for_at_directive_too_many_args,
5120 fail_for_at_directive_too_few_args): Add at_directive_name argument.
5121 (at_directive_name): Remove as at_directive_argv[0] will be used for
5122 this now.
5123 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
5124 for the directive name.
5125 (at_directive_argc, at_directive_argv): Make these local within
5126 skel_lex instead of global.
5127 (INITIAL): Update directive start action for above changes.
5128 (SC_AT_DIRECTIVE_ARG): Rename to...
5129 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
5130 (SC_AT_DIRECTIVE_SKIP_WS): Update.
5131 (scan_skel): Move yylex_destroy to...
5132 (skel_scanner_free): ... here.
5133 * tests/skeletons.at (installed skeleton file name): Rename to...
5134 (installed skeleton file names): ... this.
5135
148d66d8
JD
51362007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
5137
5138 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5139 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
5140 Summary" not "Directives".
5141 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
5142 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
5143 since the former is now the more complete one.
5144 (Prologue Alternatives): Likewise and do the same for %defines.
5145 (Table of Symbols): Add summary of %code, add summary of %define, and
5146 move full %code documentation to...
5147 (Decl Summary): ... here for consistency with other entries in these
5148 sections.
5149 Move %define entry in order to keep this list alphabetized.
5150 Reword %define entry a little to put less emphasis on the skeleton
5151 concept, which most users shouldn't have to think about.
5152
665f0c24
PE
51532007-01-26 Paul Eggert <eggert@cs.ucla.edu>
5154
5155 Adjust to recent gnulib changes.
5156 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
5157 Add string.h, string_.h, unistd_.h, wchar_.h.
5158 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
5159 * src/system.h: Don't include <stpcpy.h>; this is now done by
5160 <string.h>.
5161
592d0b1e
PB
51622007-01-23 Paolo Bonzini <bonzini@gnu.org>
5163
5164 Simplify implementation of unqualified %code, implement macros for
5165 uniform treatment of boolean %define flags. Document %define.
5166 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
5167 b4_percent_code_ifdef): New.
5168 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
5169 * data/c++.m4: Define default value for global_tokens_and_yystype.
5170 * data/glr.cc: Likewise.
5171 * data/location.cc: Use b4_percent_define_flag_if.
5172
148d66d8 5173 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
5174
5175 * src/parse-gram.y (Unqualified %code): Change muscle name to
5176 b4_percent_code().
5177 (content.opt): Default to empty.
5178
a7867f53
JD
51792007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5180
5181 Implement support for relative and absolute skeleton file names.
5182 Discussed starting at
5183 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
5184 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
5185 (Bison Options): Document in --skeleton entry.
5186 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
5187 full_skeleton can't necessarily hold all of pkgdatadir.
5188 If the specified skeleton file name contains a `/', don't prepend
5189 pkgdatadir.
5190 * src/parse-gram.y (prologue_declaration): If the specified skeleton
5191 file name contains a `/', prepend the grammar file directory.
5192 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
5193 * skeletons.at: New file.
5194 (relative skeleton file names): New test case.
5195 (installed skeleton file names): New test case.
5196 * tests/testsuite.at: Include skeletons.at.
5197
5198 * bootstrap: Update copyright to 2007.
5199
830c9b18
PB
52002007-01-17 Paolo Bonzini <bonzini@gnu.org>
5201
5202 * bootstrap: Remove occurrences of .#bootmp from the files.
5203
a8c2e813
AD
52042007-01-17 Akim Demaille <akim@epita.fr>
5205
5206 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5207 nonterminals.
5208 Use per-type %printer.
5209
279cabb6
JD
52102007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5211
5212 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5213 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5214 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5215 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5216 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5217 tests/glr-regression.at, tests/input.at, tests/local.at,
5218 tests/output.at, tests/torture.at: Update copyright to 2007.
5219
bb32f4f2
AD
52202007-01-16 Akim Demaille <akim@epita.fr>
5221
5222 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5223 error code.
5224 (Calc++ Scanner): Exit with failure if we can't open the input
5225 file.
5226 Accept "-" standing for stdin.
5227 (Calc++ Top Level): Print the result only if the parsing was
5228 successful.
5229
7cff04b5
AD
52302007-01-16 Akim Demaille <akim@epita.fr>
5231
5232 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5233
a4e25e1d
JD
52342007-01-15 Paolo Bonzini <bonzini@gnu.org>
5235 and Joel E. Denny <jdenny@ces.clemson.edu>
5236
5237 Clean up %define and %code implementation in M4 some. Most
5238 importantly, rename all related macros to be in the b4_percent_define
5239 and b4_percent_code namespaces. Also, complete support for `.' in
5240 %define variable names and %code qualifiers.
5241 * data/bison.m4 (b4_check_user_names): Check for special
5242 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5243 m4_foreach loops.
5244 (b4_get_percent_define, b4_get_percent_code): Rename to...
5245 (b4_percent_define_get, b4_percent_code_get): ... these.
5246 Extend documentation with examples.
5247 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5248 b4_percent_define_skeleton_variables and
5249 b4_percent_code_skeleton_qualifiers.
5250 Expect any value for the %define variable `foo' to be stored in the
5251 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5252 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5253 expect any unqualified %code blocks to be stored in a macro named
5254 `b4_percent_code_unqualified'.
5255 Use m4_indir so that %define variable names and %code qualifiers can
5256 contain `.', which is allowed by the grammar parser.
5257 (b4_percent_define_default): New macro to set a default value for a
5258 %define variable.
5259 (m4_wrap): Update wrapped code, and fix some underquoting.
5260 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5261 Expect grammar uses of %define variables and %code qualifiers to be
5262 defined in b4_percent_define_user_variables and
5263 b4_percent_code_user_qualifiers.
5264 * data/c++.m4: Use b4_percent_define_default rather than
5265 m4_define_default. Fix some underquoting. Skeleton usage of %define
5266 variable define_location_comparison now implies skeleton usage of
5267 %define variable filename_type.
5268 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5269 data/push.c, data/yacc.c: Update macro names.
5270 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5271 muscle names.
5272
e37c665c
JMG
52732007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5274
5275 DJGPP specific issues.
5276
5277 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5278 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5279
7d2d521f
JD
52802007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5281
5282 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5283 run parsers in all tests so that Valgrind is invoked during
5284 maintainer-check-valgrind.
5285 (Duplicate representation of merged trees): Free all semantic values.
5286 (Duplicated user destructor for lookahead): Likewise.
5287
e0ac9b4b
JD
52882007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5289
5290 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5291 command-line prefix.
5292 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5293 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5294 miss Valgrind messages.
5295 (Exploding the Stack Size with Malloc): Likewise.
5296
78143faa
JD
52972007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5298
5299 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5300 locals. Reported by Juan Manuel Guerrero at
5301 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5302 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5303 Fix some indentation also.
5304 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5305 explaining this issue.
5306
7ecec4dd
JD
53072007-01-09 Paolo Bonzini <bonzini@gnu.org>
5308 and Joel E. Denny <jdenny@ces.clemson.edu>
5309
5310 Simplify union and prologue handling, and escape union and lex/parse
5311 params with digraphs.
5312 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5313 values to the empty string since these are no longer guaranteed
5314 initialized by the front-end.
5315 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5316 braces around b4_user_stype since this is no longer done by the
5317 front-end.
5318 * src/files.c, src/files.h (pre_prologue_obstack,
5319 post_prologue_obstack): Remove.
5320 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5321 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5322 with digraphs. This fixes lex params and parse params.
5323 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5324 * src/output.c (prepare): Remove muscle insertion of the prologues.
5325 (output): Remove freeing of pre_prologue_obstack and
5326 post_prologue_obstack.
5327 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5328 than prologue_augment for prologue parsing so you don't need prologue
5329 obstacks.
5c80250c
JD
5330 (grammar_declaration): For %union RHS, use `braceless' instead of
5331 "{...}" so that braces are already stripped and code is escaped with
5332 digraphs.
7ecec4dd
JD
5333 * src/reader.c (prologue_augment): Remove.
5334 (reader): Remove initialization of pre_prologue_obstack and
5335 post_prologue_obstack.
5336 * src/reader.h (prologue_augment): Remove.
5337
5338 * data/c.m4: Remove stray parenthesis.
5339
16dc6a9e
JD
53402007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5341
5342 Remove quotes from variables names in %define directives and from
5343 qualifiers in %code directives, and restrict the characters that are
5344 allowed in them to M4-friendly ones. For %define, continue to support
5345 the quoted form as a deprecated feature. Discussed starting at
5346 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5347 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5348 %code.
5349 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
5350 (Decl Summary): In %defines entry, update mention of `%code requires'
5351 and `%code provides'.
16dc6a9e
JD
5352 (C++ Location Values): Update %define uses.
5353 (Calc++ Parser Interface): Likewise.
5354 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 5355 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
5356 * src/parse-gram.y (prologue_declaration): For %define variables, use
5357 `variable' instead of `STRING'.
5358 (grammar_declaration): For %code qualifiers, use `ID' instead of
5359 `STRING'.
5360 (variable): New nonterminal that takes an `ID' or a `STRING'.
5361 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5362 and %define uses.
5363 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5364 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5365 (%define errors): Update %define uses.
5366
e9813cd4
JD
53672007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5368
5369 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5370 instead of muscle_insert for %define values so that M4-special
5371 characters are replaced with digraphs.
5372 * tests/input.at (%define errors): Extend to check weird values.
5373
6afc30cc
JD
53742007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5375
5376 Instead of having skeletons declare all valid %define variables and
5377 %code qualifiers, provide macros that retrieve the associated values
5378 and build these lists automatically. Thus Bison will now warn when a
5379 variable or qualifier is not used by the skeleton in the current
5380 invocation regardless of whether it might sometimes be used by that
5381 skeleton in other invocations. Also, move all %define value macros to
5382 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5383 form, which is replaced by %code.
5384 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5385 (b4_check_user_names): ... this, and change the series of valid name
5386 arguments to a single list argument for names used in the skeleton
5387 similar to the existing list argument for names used in the grammar.
5388 Warn instead of complaining.
5389 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5390 values and %code code, to format %code code properly, and to build
5391 lists of all %define variables and %code qualifiers used in the
5392 skeleton: b4_skeleton_percent_define_variables and
5393 b4_skeleton_percent_code_qualifiers.
5394 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5395 Remove, and...
5396 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5397 the skeleton names lists can finish building first. In place of
5398 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5399 expect the lists b4_user_percent_define_variables and
5400 b4_user_percent_code_qualifiers.
5401 * data/c++.m4: Where setting default values for b4_parser_class_name,
5402 b4_location_type, b4_filename_type, b4_namespace, and
5403 b4_define_location_comparison, update their names to the
5404 b4_percent_define_ namespace.
5405 * data/glr.c: Don't use b4_check_percent_define_variables and
5406 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5407 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5408 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 5409 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
5410 * data/location.cc: Use b4_get_percent_define.
5411 * data/push.c: Don't use b4_check_percent_define_variables and
5412 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5413 * data/yacc.c: Likewise, and don't call m4_exit in
5414 b4_use_push_for_pull_if or m4_wrap code will never execute.
5415 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5416 Rename to...
5417 (muscle_grow_user_name_list): ... this for consistency with the
5418 terminology used in bison.m4.
5419 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5420 %define variable names, and rename muscle used_percent_define_variables
5421 to user_percent_define_variables.
5422 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5423 user_percent_code_qualifiers.
5424 (content): Remove.
5425 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5426 {CODE} form is no longer accepted.
5427 * tests/input.at (Reject bad %code qualifiers): Rename to...
5428 (Reject unused %code qualifiers): ... this, and update test output.
5429 (%define error): Update test output.
5430
7eb8a0bc
JD
54312007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5432
5433 Check for unrecognized %define variables similar to checking for
5434 unrecognized %code qualifiers. Check for redefined %define variables.
5435 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5436 generalizes...
5437 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5438 (b4_check_percent_define_variables): New, also wraps it.
5439 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5440 variables using b4_check_percent_define_variables.
5441 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5442 all those exercised in the test suite and all those listed in the
5443 `Default values' section of c++.m4. Are there others?
5444 * data/push.c, data/yacc.c: Declare no valid %define variables.
5445 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5446 similar to muscle_find, but it works even when the muscle stores a
5447 const value.
5448 (muscle_grow_used_name_list): New function for constructing the used
5449 name list muscles that b4_check_for_unrecognized_names requires.
5450 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5451 %define'd more than once. Define the b4_used_percent_define_variables
5452 muscle with muscle_grow_used_name_list.
5453 (grammar_declaration): Abbreviate %code code with
5454 muscle_grow_used_name_list.
5455 * tests/input.at (%define errors): New.
5456
3fc65ead
JD
54572007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5458
5459 Provide warn_at, complain_at, and fatal_at function callbacks to the
5460 skeletons, and use this for %code qualifier complaints.
5461 * data/bison.m4 (b4_error_at): New, invoked by...
5462 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5463 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5464 @fatal_at(...@) directives.
5465 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5466 qualifiers in b4_used_percent_code_qualifiers and to use
5467 b4_complain_at.
5468 * src/location.c, src/location.h (boundary_set_from_string): New global
5469 function.
5470 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5471 function.
5472 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5473 to b4_used_percent_code_qualifiers.
5474 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5475 function.
5476 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5477 (lineno): Rename to...
5478 (out_lineno): ... this so I don't misunderstand it again.
5479 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5480 here; these newlines are in the input but not the output file.
5481 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5482 (at_directive_perform): ... this new static function, and add handling
5483 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5484 directives.
5485 * tests/input.at (Reject bad %code qualifiers): Update test output with
5486 locations and extend.
5487
5488 * tests/output.at (Output file name: [, Output file name: ]): Remove
5489 bogus comment about these tests failing.
5490
1c7b7e1d
JD
54912007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5492
5493 Clean up b4_check_percent_code_qualifiers a little.
5494 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5495 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5496 documentation and add examples.
5497 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5498 qualifiers here.
5499
08af01c2
JD
55002007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5501
5502 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5503 unreliable -- especially when they're hidden inside another macro.
5504 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5505 data/c.m4: Remove m4_divert(-1).
5506 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5507 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5508 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 5509 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
5510 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5511 pushed and popped by m4sugar, should be first on the stack.
5512
5513 Provide warn, complain, and fatal function callbacks to the skeletons.
5514 This provides more flexibility than m4_fatal, improves the error
5515 message format, and captures messages for translation. Discussed
5516 starting at
5517 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5518 * data/bison.m4 (b4_error): New, invoked by...
5519 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5520 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5521 directives. Because these M4 macros might be called when the current
5522 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5523 the previous removal of uses of m4_divert, which caused trouble.
5524 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5525 m4_fatal to report unrecognized %code qualifiers.
5526 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
5527 push parser requests.
5528 * data/glr.c: Use b4_complain instead of m4_fatal to report
5529 non-deterministic push parser requests.
5530 Update @output usage to @output(...@) form.
5531 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
5532 report missing %defines. Update @output usage to @output(...@) form.
5533 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
5534 @output(...@) form.
5535 * src/main.c (main): Invoke skel_scanner_free.
5536 * src/scan-skel.h (skel_scanner_free): Prototype new function.
5537 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
5538 obstack_for_string from flex-scanner.h.
5539 (YY_DECL): Use to declare skel_lex static.
5540 (decode_at_digraphs): Remove; now handled in the new
5541 SC_AT_DIRECTIVE_ARG start condition.
5542 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
5543 functions.
5544 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
5545 at_directive_argv): New static globals.
5546 (INITIAL): Use fail_for_invalid_at.
5547 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
5548 recognize the start of a generalized `@directive(...@)' form and
5549 start...
5550 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
5551 directive args (using the new obstack_for_string), to decode the
5552 contained @ diagraphs, and to perform the directive. It recognizes
5553 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
5554 @output(...@).
5555 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
5556 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
5557 `@,'.
5558 (scan_skel): Initialize obstack_for_string on the first call.
5559 (skel_scanner_free): New function to free obstack_for_string.
5560 * tests/input.at (Reject bad %code qualifiers): Update test output.
5561
8e0a5e9e
JD
55622007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
5563
5564 Consolidate the 4 prologue alternative directives (%code, %requires,
5565 %provides, and %code-top) into a single %code directive with an
5566 optional qualifier field. Discussed at
5567 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
5568 * NEWS (2.3a+): Rewrite the existing entry for the prologue
5569 alternatives.
5570 * doc/bison.texinfo (Prologue Alternatives): Update.
5571 (Decl Summary): Update to %code "requires" and %code "provides".
5572 (Calc++ Parser): Update to %code "requires".
148d66d8 5573 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
5574 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
5575 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
5576 are replaced by b4_percent_code_provides and b4_percent_code_requires,
5577 which are skeleton-specific.
5578 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
5579 declare what %code qualifiers it supports and to complain if any other
5580 qualifiers were used in the grammar.
5581 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
5582 and b4_user_code([b4_percent_code_provides]) in place of
5583 b4_user_requires and b4_user_provides.
5584 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
5585 Add b4_user_code([b4_percent_code_top]) and
5586 b4_user_code([b4_percent_code]).
5587 Invoke b4_check_percent_code_qualifiers.
5588 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5589 PERCENT_REQUIRES): Remove.
5590 (grammar_declaration): Remove RHS's for %code-top, %provides, and
5591 %requires. Rewrite the %code RHS as the unqualified form defining the
5592 muscle b4_percent_code. Add another RHS for the qualified %code form,
5593 which defines muscles of the form b4_percent_code_QUALIFIER and the
5594 b4_used_percent_code_qualifiers muscle.
5595 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5596 PERCENT_REQUIRES): Remove.
5597 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
5598 %code "requires" and %code "provides".
5599 * tests/input.at (Reject bad %code qualifiers): New.
5600
95021767
JD
56012007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5602
5603 Use the new code_props interface for destructors and printers.
5604 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5605 printer_location members, and change the type of the destructor and
5606 printer members to code_props.
5607 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
5608 symbol_printer_get, semantic_type_destructor_set,
5609 semantic_type_printer_set, default_tagged_destructor_set,
5610 default_tagless_destructor_set, default_tagged_printer_set,
5611 default_tagless_printer_set): Use code_props in arguments and return
5612 types in place of char const * and location.
5613 (symbol_destructor_location_get, symbol_printer_location_get): Remove
5614 since the locations are now contained in the return of
5615 symbol_destructor_get and symbol_printer_get.
5616 * src/output.c (symbol_destructors_output, symbol_printers_output):
5617 Replace with...
5618 (symbol_code_props_output): ... this to eliminate duplicate code.
5619 (output_skeleton): Update to use symbol_code_props_output.
5620 * src/reader.c (symbol_should_be_used): Update use of
5621 symbol_destructor_get.
5622 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5623 Update uses of the various _destructor_set and _printer_set functions.
5624 * src/symtab.c: (default_tagged_destructor_location,
5625 default_tagless_destructor_location, default_tagged_printer_location,
5626 default_tagless_printer_location): Remove since we...
5627 (default_tagged_destructor, default_tagless_destructor,
5628 default_tagged_printer, default_tagless_printer): ... change the type
5629 of these to code_props.
5630 (symbol_new, semantic_type_new, symbol_destructor_set,
5631 semantic_type_destructor_set, symbol_destructor_get,
5632 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5633 symbol_check_alias_consistency, default_tagged_destructor_set,
5634 default_tagless_destructor_set, default_tagged_printer_set,
5635 default_tagless_printer_set): Update.
5636 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5637 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5638 code_props members.
5639 (symbol_print): Use SYMBOL_CODE_PRINT.
5640
f6857bbf
JD
56412007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5642
5643 Use the new code_props interface for rule actions.
5644 * src/symlist.h (symbol_list): Replace action, action_location, and
5645 used members with a code_props action_props member.
5646 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5647 grammar_midrule_action, grammar_current_rule_merge_set,
5648 grammar_current_rule_symbol_append, packgram): Update.
5649 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5650 * src/scan-code.l (handle_action_dollar): Update.
5651 (translate_rule_action): Remove, no longer used.
5652 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5653
7c0c6181
JD
56542007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5655
5656 Use the new code_props interface in parse-gram.y.
5657 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5658 Update all uses of translate_* functions to use the new code_props
5659 interface and to use gram_scanner_last_string_free and
5660 code_scanner_last_string_free where possible.
5661 (grammar_declaration): symbol_list_destructor_set and
5662 symbol_list_printer_set now perform the translation, so don't do it
5663 here. Use gram_scanner_last_string_free where possible.
5664 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5665 translate_code): Remove, no longer used.
5666 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5667 symbol_list_printer_set): Perform code translation here rather than
5668 depending on the caller to do so.
5669
5670 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5671 * src/scan-gram.h (gram_last_string): Remove declaration.
5672 * src/scan-gram.l (last_string): Declare it static.
5673
28e52c0d
JD
56742007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5675
5676 Encapsulate code properties and related functionality for the various
5677 destructors, printers, and actions into a code_props structure and
5678 interface. This patch merely implements code_props in scan-code.h and
5679 scan-code.l. Future patches will rewrite other modules to use it.
5680 Discussed starting at
5681 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5682 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5683 consistently initialize const structs that have an empty location
5684 field.
5685 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5686 to ensure consistency.
5687 * src/scan-code.h (code_props): New structure.
5688 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5689 function, macro, and const global variable for initializing a
5690 code_props with no code.
5691 (code_props_plain_init, code_props_symbol_action_init,
5692 code_props_rule_action_init, code_props_translate_code): The rest of
5693 the new code_props functional interface. Among other things, the init
5694 functions set the code_props kind field so that
5695 code_props_translate_code will know whether to behave like
5696 translate_symbol_action, translate_rule_action, or translate_code.
5697 These old translate functions must remain until all other modules are
5698 updated to use the new code_props interface.
5699 (code_scanner_last_string_free): New function similar to
5700 gram_scanner_last_string_free.
5701 (code_scanner_free): Add documentation.
5702 * src/scan-code.l: Implement the new interface.
5703 (code_lex): Make it static, add a code_props* argument, and remove the
5704 rule argument.
5705 (last_string): New static global similar to the one in scan-gram.l.
5706 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5707 instead of rule.
5708 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5709 code_props since Bison may one day use this information for destructors
5710 and printers.
5711 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5712 (handle_action_dollar): Use symbol_list_n_get and set used flag
5713 directly since symbol_list_n_used_set is removed.
5714 (translate_action): Add a code_props* argument and remove the rule,
5715 action, and location arguments. Pass the code_props* on to code_lex.
5716 (translate_rule_action, translate_symbol_action, translate_code):
5717 Rewrite as wrappers around the new code_props interface.
5718 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5719 it would eventually need to break the encapsulation of code_props.
5720
96034983
JD
57212007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5722
5723 * etc/.cvsignore: New.
5724
945e396c
JD
57252007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5726
5727 Add maintainer-push-check to run maintainer-check using push parsing in
5728 place of pull parsing where available.
5729 * Makefile.am (maintainer-push-check): New.
5730 * data/bison.m4 (b4_use_push_for_pull_if): New.
5731 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5732 appropriately based on their existing values.
5733 (yypush_parse): Don't print push-parser-specific diagnostics if push
5734 parsing is being used in place of pull parsing.
5735 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5736 push.c.
5737 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5738 variable, and insert b4_use_push_for_pull_flag into muscles.
5739 * tests/Makefile.am (maintainer-push-check): New.
5740
7d596384
JD
57412006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5742
5743 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5744 (whether successful or failed) so that yypush_parse can be invoked
5745 again to start a new parse using the same yypstate.
5746 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5747 check multiple yypull_parse invocations on the same yypstate. For pull
5748 mode, extend to check multiple yyparse invocations.
5749 (Exploding the Stack Size with Alloca): Extend to try with
5750 %push-pull-parser.
5751 (Exploding the Stack Size with Malloc): Likewise.
5752
5753 * tests/calc.at (Simple LALR Calculator): Don't specify
5754 %skeleton "push.c" since %push-pull-parser implies that now.
5755 * tests/headers.at (export YYLTYPE): Don't check for the push
5756 declarations. Otherwise, this test case can't be used to see if push
5757 mode can truly emulate pull mode.
5758 * tests/input.at (Torturing the Scanner): Likewise.
5759 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5760 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5761 AT_YACC_IF, which now includes the case of push mode since %skeleton
5762 need not be used for push mode. This will be more intuitive once
5763 push.c is renamed to yacc.c.
5764
7172e23e
JD
57652006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5766
5767 For push mode, convert yyparse from a macro to a function, invoke yylex
5768 instead of passing a yylexp argument to yypull_parse, and don't
5769 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5770 Discussed starting at
5771 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5772 * data/bison.m4 (b4_pull_if): New.
5773 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5774 * data/push.c: Improve M4 quoting a little.
5775 (b4_generate_macro_args, b4_parenthesize): Remove.
5776 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5777 any time a pull parser is requested.
5778 Don't #define this as a wrapper around yypull_parse. Instead, when
5779 both push and pull are requested, make it a function that does that
5780 same thing.
5781 (yypull_parse): If there's a b4_prefix, #define this to
5782 b4_prefix[pull_parse] when both push and pull are requested.
5783 Don't define this as a function unless both push and pull are
5784 requested.
5785 Remove the yylexp argument and hard-code yylex invocation instead.
5786 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5787 %push-parser.
5788 * src/getargs.c (pull_parser): New global initialized to true.
5789 * getargs.h (pull_parser): extern it.
5790 * src/output.c (prepare): Insert pull_flag muscle.
5791 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5792 (prologue_declaration): Set both push_parser and pull_parser = true for
5793 %push-pull-parser. Set push_parser = true and pull_parser = false for
5794 %push-parser.
5795 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5796 %push-parser since there's no backward-compatibility concern here.
5797 Scan %push-pull-parser.
5798 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5799 instead of %push-parser.
5800 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5801 prototype it in the module that calls yyparse.
5802 * tests/input.at (Torturing the Scanner): Likewise.
5803 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5804
2e7944cb
JD
58052006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5806
5807 Update etc/bench.pl. Optimize push mode a little (the yyn change
5808 deserves most of the credit).
5809 * Makefile.am (SUBDIRS): Add etc subdirectory.
5810 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5811 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5812 yytoken, yyval, and yyloc declarations to...
5813 (yyparse or yypush_parse): ... here to improve performance. For
5814 yypush_parse invocations after the first, be sure to assign yyn its old
5815 value again.
5816 (yypstate_new): Don't bother initializing the yyresult field since the
5817 initial value isn't used.
5818 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5819 remove the #define that, in push mode, set it to yyps->NAME.
5820 * etc/Makefile.am: New.
5821 * etc/bench.pl: Remove and build it instead from...
5822 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5823 "tests/bison" from the build directory by default rather than just
5824 invoking "bison" from $PATH.
5825 (calc_grammar): Update push parser code: don't declare yylval globally,
5826 don't define yyparse_wrapper, and don't #define yyparse.
5827 (bench_grammar): Update to check all working combinations of yacc.c,
5828 push.c, impure, pure, pull, and push.
5829
c3d50342
JD
58302006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5831
5832 For push mode, add pull wrappers around yypush_parse.
5833 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5834 (yypull_parse): New function wrapping yypush_parse.
5835 (yyparse): New #define wrapping yypull_parse.
5836 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5837 is declared.
5838 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5839 prototype yylex in the module that calls yyparse, and don't prototype
5840 yyparse there. Otherwise, the yyparse expansion won't compile.
5841 * tests/input.at (Torturing the Scanner): Likewise.
5842
94ebeba5
JD
58432006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5844
5845 Enable push parsers to operate in impure mode. Thus, %push-parser no
5846 longer implies %pure-parser. The point of this change is to move
5847 towards being able to test the push parser code by running the entire
5848 test suite as if %push-parser had been declared.
5849 * data/push.c (yypush_parse): For impure mode, remove the
5850 yypushed_char, yypushed_val, and yypushed_loc arguments.
5851 Instead, declare these as local variables initialized to the global
5852 yychar, yylval, and yylloc.
5853 For the first yypush_parse invocation only, restore the initial values
5854 of these global variables when it's time to read a token since they
5855 have been overwritten.
5856 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5857 %push-parser.
5858 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5859 %pure-parser along with %push-parser since this test case was designed
5860 for pure push parsers.
5861 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5862 (AT_YACC_OR_PUSH_IF): New.
5863 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5864 add a note that it's still wrong for some cases (as it has been for a
5865 while).
5866 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5867 %push-parser no longer implies %pure-parser.
5868
a0633178
JD
58692006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5870
5871 Remove some unnecessary differences between the pull parser code and
5872 the push parser code. This patch enables yynerrs in push mode.
5873 * data/push.c: Reformat M4 a little.
5874 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5875 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5876 because push mode is on. Instead, if pure mode is on, move yynerrs
5877 to...
5878 (b4_declare_parser_state_variables): ... here.
5879 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5880 to yyps->NAME so it can be used in yypush_parse.
5881 (yypush_parse): Don't omit uses of yynerrs in push mode.
5882
8646b6a3
JD
58832006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5884
5885 Fix bug such that the first pushed token's value and location are
5886 sometimes overwritten (sometimes by %initial-action) before being used.
5887 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5888 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5889 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5890 more closely mimic the pull parser logic.
5891 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5892 time to read a token, which is after any initialization of yylval and
5893 yylloc.
5894 (gottoken): Rename label to...
5895 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5896 user namespace.
5897
9baf4d74
JD
58982006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5899
5900 Rearrange initialization of the parser state variables so that the
5901 skeleton doesn't have to have a copy for pull mode and another for push
5902 mode. This patch also fixes at least a bug such that yylloc was not
5903 initialized (with b4_location_initial_line and
5904 b4_location_initial_column) upon calling yypush_parse. However, that
5905 initialization now overwrites the first token's location;
5906 %initial-action assigning @$ already did the same thing, and both bugs
5907 will be fixed in a later patch.
5908 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5909 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5910 yyss, yyvs, yyls, and yystacksize.
5911 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5912 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5913 yylsp.
5914 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5915 yyps->NAME so it can be used in yypush_parse.
5916 (yyparse or yypush_parse): For yypush_parse, don't print the
5917 "Starting parse" diagnostic for invocations after the first.
5918 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5919 yypush_parse, only do it for the first invocation.
5920 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5921 initialization to occur in yypush_parse but only on the first
5922 invocation.
5923
23522164
JD
59242006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5925
5926 * data/push.c: Add CPP guards around push parser declarations in both
5927 the header and the code file.
5928 In the code file, move the push parser declarations to the same place
5929 they appear in the header file.
5930 Clean up the M4 some, especially the inconsistent underquoting in
5931 some b4_c_function_def and b4_c_function_decl uses.
5932
bb010fe5
JD
59332006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5934
5935 Encapsulate the push parser state variables into an M4 macro so the
5936 push skeleton doesn't have to list them again for pull mode's yyparse.
5937 For push mode, remove yypush_parse's local equivalents of these
5938 variables to eliminate unnecessary copying between the two sets at
5939 run-time. This patch also fixes at least a bug related to multiple
5940 %initial-action invocations in push mode.
5941 * data/push.c (b4_declare_parser_variables): Rename to...
5942 (b4_declare_scanner_communication_variables): ... this for clarity and
5943 update both uses.
5944 (b4_declare_yyparse_variables): Remove and move its contents to the one
5945 spot where it was invoked.
5946 (b4_declare_parser_state_variables): New macro containing the parser
5947 state variables required by push mode.
5948 (struct yypstate): Replace all fields but yynew with
5949 b4_declare_parser_state_variables.
5950 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5951 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5952 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5953 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5954 parser state variable declarations with
5955 b4_declare_parser_state_variables.
5956 Don't initialize parser state variables when calling yypush_parse since
5957 yypstate_new already does that.
5958 Invoke the user's initial action only upon the first yypush_parse
5959 invocation.
5960 Remove all code that copies between the local parser state variables
5961 and the yypstate.
5962
2d212f8c
JD
59632006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5964
5965 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5966 prevent a name collision in a future patch where these names will
5967 sometimes be #define'd.
5968 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5969 since it no longer has the same name as the existing argument.
5970 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5971
e6e704dc
JD
59722006-12-19 Paolo Bonzini <bonzini@gnu.org>
5973 and Joel E. Denny <jdenny@ces.clemson.edu>
5974
5975 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5976 that the argument is case-insensitive, and there's no `=' here.
5977 For the %skeleton entry, mention that %language is better.
5978 (Bison Options): Likewise for --language and --skeleton. Move the
5979 --skeleton entry so that the `Tuning the parser' section is sorted
5980 alphabetically on long options.
5981 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5982 %language directive in detail here; cross-reference the %language
5983 documentation instead.
5984 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5985 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 5986 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
5987 * examples/extexi (normalize): Instead of replacing every %require
5988 argument with the current Bison version, just substitute for
5989 `@value{VERSION}'. This guarantees that we're testing what actually
5990 appears in the documentation.
5991 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5992 rather than `@VERSION@'.
5993
0e021770
PE
59942006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5995
fd575f05
PE
5996 * NEWS: Reword the %language news a bit, and put it earlier.
5997
0e021770
PE
5998 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5999 Rewrite to simplify the logic.
6000 (language_argmatch): Likewise.
fd575f05
PE
6001 (program_name): We now own this var.
6002 * src/getargs.h (struct bison_language): Use char[] rather than
6003 const char *.
0e021770
PE
6004
6005 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6006 Java is supported.
6007 * src/complain.c (program_name): Remove decl; no longer needed.
6008 * src/main.c (program_name): Remove; now belongs to getargs.
6009
60102006-12-18 Paolo Bonzini <bonzini@gnu.org>
6011
6012 * NEWS: Document %language.
6013
6014 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
6015
6016 * data/c-skel.m4, data/c++-skel.m4: New files.
6017 * data/glr.c: Complain on push parsers.
6018
6019 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
6020 over %skeleton.
148d66d8 6021 (Decl Summary): Document %language and %skeleton.
0e021770
PE
6022 (Command line): Document -L.
6023
6024 * examples/extexi: Rewrite %require directive.
6025 * examples/calc++/Makefile.am: Pass VERSION to extexi.
6026
6027 * src/files.c (compute_exts_from_gc): Look in language structure
6028 for .y extension.
6029 (compute_file_name_parts): Check whether .tab should be added.
6030 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
6031 (language, skeleton_arg, language_argmatch): New.
6032 (long_options): Add --language.
6033 (getargs): Use skeleton_arg, add -L/--language.
6034 * src/getargs.h: Include location.h.
6035 (struct bison_language, language, skeleton_arg, language_argmatch): New.
6036 * src/output.c (prepare): Pick default skeleton from struct language.
6037 Don't dispatch C skeletons here.
6038 * src/parse-gram.y (PERCENT_LANGUAGE): New.
6039 (prologue_declaration): Add "%language" rule, use skeleton_arg.
6040 * src/scan-gram.l ("%language"): New rule.
6041
6042 * tests/calc.at: Test %skeleton and %language.
6043 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
6044 (AT_GLR_IF): Look for %skeleton "glr.cc".
6045 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
6046 (AT_YACC_IF): Reject %language.
6047
5691bf57
PE
60482006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6049
db06f0ce
PE
6050 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
6051 since it wasn't used; only the typedef name 'semantic_type' is needed.
6052 Also, omit trailing white space.
6053
5691bf57
PE
6054 * bootstrap: Sync from coreutils.
6055 (gnulib_extra_files): Add build-aux/announce.gen.
6056 (slurp): Adjust .gitignore files like .cvsignore files.
6057 * build-aux/announce-gen: Remove from CVS, since bootstrap
6058 now creates this.
6059
791934e4
JD
60602006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
6061
6062 Make %push-parser imply %pure-parser. This fixes several bugs; see
6063 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
6064 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
6065 pure_parser = true.
6066 * data/push.c: Don't bother testing b4_push_if when deciding whether
6067 to expand b4_declare_parser_variables globally.
6068 (yypush_parse): Likewise in here.
6069
6070 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
6071 (yy_reduce_print): Reformat M4 for readability.
6072
ee5abb37
JD
60732006-12-15 Bob Rossi <bob@brasko.net>
6074 and Joel Denny <jdenny@ces.clemson.edu>
6075
6076 * data/push.c (yypstate): Add typedef, and update all uses of
6077 struct yypstate to just yypstate.
6078 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
6079
16ca01f9
JD
60802006-12-14 Bob Rossi <bob@brasko.net>
6081
6082 * data/push.c (yypush_parse): Declare prototype regardless of
6083 %locations option.
6084
ab8e7e1a
JD
60852006-12-14 Bob Rossi <bob@brasko.net>
6086
6087 * data/push.c (yyparse): Remove the prototype and the #define when in
6088 push-parser mode.
6089
9bf32be3
JD
60902006-12-13 Bob Rossi <bob@brasko.net>
6091
6092 * data/push.c (yypstate_init): Rename to...
6093 (yypstate_new): ... this and use b4_c_function_def.
6094 (yypstate_delete): New.
6095 (yypush_parse): Change parameters yynval and yynlloc to be const.
6096 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
6097 yypstate_delete functions.
6098
f02e2948
JD
60992006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
6100
6101 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
6102 strange test case titles. Reported by Bob Rossi.
6103
38eb7751
PE
61042006-12-13 Paul Eggert <eggert@cs.ucla.edu>
6105
6106 * TODO: Add pointer to Sylvain Schmitz's work on static detection
6107 of potential ambiguities in GLR grammers.
6108
bd9d212b
JD
61092006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
6110
6111 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
6112 `bison ', use m4_index instead of m4_substr since chopping up a string
6113 containing M4-special characters causes problems here.
6114
6115 Fix a couple of bugs related to special characters in user-specified
6116 file names, and make it easier for skeletons to compute output file
6117 names with the same file name prefix as Bison-computed output file
6118 names.
6119 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
6120 b4_parser_file_name and b4_spec_defines_file instead of
6121 @output_parser_name@ and @output_header_name@, which are now redundant.
6122 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
6123 b4_parser_file_name, b4_spec_defines_file, and the new
6124 @basename(FILENAME@) instead of @output_parser_name@ and
6125 @output_header_name@, which inappropriately escaped the file names as
6126 C string literals.
6127 * src/files.c (all_but_ext): Remove static qualifier.
6128 (compute_output_file_names): Move `free (all_but_ext)' to...
6129 (output_file_names_free): ... here since all_but_ext is needed later.
6130 * src/files.h (all_but_ext): Extern.
6131 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
6132 exactly what MUSCLE_INSERT_STRING used to do.
6133 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
6134 characters are escaped properly.
6135 * src/output.c (prepare): Define muscle file_name_all_but_ext as
6136 all_but_ext.
6137 For pkgdatadir muscle, maintain previous functionality by using
6138 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
6139 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
6140 digraphs would never be expanded. Hopefully no one has M4-special
6141 characters in his Bison installation path.
6142 * src/scan-skel.l: Don't parse @output_header_name@ and
6143 @output_parser_name@ anymore since they're now redundant.
6144 In @output, use decode_at_digraphs.
6145 Parse a new @basename command that invokes last_component.
6146 (decode_at_digraphs): New.
6147 (BASE_QPUTS): Remove unused.
6148 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
6149 (Output file name): New tests.
6150
3f7ca628
JD
61512006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
6152
6153 Warn about output files that are generated by the skeletons and that
6154 conflict with other output files.
6155 * data/glr.c: Don't generate the header file here when glr.cc does.
6156 * src/files.c (file_names, file_names_count): New static globals.
6157 (compute_output_file_names): Invoke output_file_name_check for files
6158 not generated by the skeletons and remove existing checks.
6159 (output_file_name_check): New function that warns about conflicting
6160 output file names.
6161 (output_file_names_free): Free file_names.
6162 * src/files.h (output_file_name_check): Declare.
6163 * src/scan-skel.l: Invoke output_file_name_check for files generated by
6164 the skeletons.
6165 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
6166 (Conflicting output files): New tests.
6167
178e123e
PE
61682006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6169
6170 * doc/bison.texinfo: Fix a couple of typos.
6171
61722006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
6173
6174 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
6175 Rename to...
6176 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
6177 update all uses.
6178 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
6179 (yypush_parse): Rename yypvars argument to yyps and remove redundant
6180 local pv.
6181 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
6182 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
6183
ea17f233
JD
61842006-12-07 Bob Rossi <bob@brasko.net>
6185 and Joel Denny <jdenny@ces.clemson.edu>
6186
6187 * data/push.c (yypvarsinit): Change return type from void* to struct
6188 yypvars*. No longer cast to void* on return.
6189 (struct yypvars): Remove yylen since it need not be remembered between
6190 yypushparse invocations.
6191 (yypushparse): Don't copy between yylen and pv->yylen.
6192
55a30bda
JD
61932006-12-05 Bob Rossi <bob@brasko.net>
6194
6195 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
6196 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
6197 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
6198 (struct yypvars): Remove b4_declare_parser_variables.
6199 (yypvarsinit): Remove init code for removed variables.
6200 (global scope): Do not declare b4_declare_parser_variables if
6201 push or pure mode.
6202 (yypushparse): Add b4_declare_parser_variables.
6203 Init new local variables, and remove init code for removed
6204 yypvars variables.
6205 (yyparse): Delete.
6206 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6207 and yyparse for other modes.
6208 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6209 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6210 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6211 (AT_PURE_LEX_IF): True if pure or push parser.
6212
85894313
JD
62132006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6214
6215 Document Yacc prologue alternatives and default %destructor's and
6216 %printer's as experimental. Don't mention Java yet. Discussed at
6217 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6218 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6219 (2.3a): Annotate this entry to say the old forms of these features were
6220 also experimental.
6221 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 6222 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
6223 of Java (we'll want this back eventually).
6224
02975b9a
JD
62252006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6226
6227 Support a file name argument to %defines. Deprecate `=' in
6228 %file-prefix, %name-prefix, and %output. Discussed at
6229 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6230 * NEWS (2.3a+): Mention.
148d66d8 6231 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
6232 form of %defines, and remove `=' from entries for %file-prefix,
6233 %name-prefix, and %output.
6234 * src/parse-gram.y (prologue_declaration): Implement.
6235 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6236 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6237 all but one occurrence of %name-prefix.
6238 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6239 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6240 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6241 occurrence of each of %file-prefix and %output. Add check for %defines
6242 with argument.
6243 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6244 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6245 Remove the `=' from %output.
6246
287b314e
JD
62472006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6248
6249 Don't escape $ in test case titles since Autoconf 2.61 now does that
6250 correctly.
6251 * tests/actions.at (Default %printer and %destructor are not for error
6252 or $undefined): Here.
6253 (Default %printer and %destructor are not for $accept): Here.
6254 * tests/input.at (Invalid $n and @n): Here.
6255
3ebecc24
JD
62562006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6257
6258 Rename <!> to <>. Discussed starting at
6259 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6260 * NEWS (2.3a+): Update.
148d66d8 6261 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
6262 Update.
6263 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6264 * src/scan-gram.l (INITIAL): Implement.
6265 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6266 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6267 comment.
6268 * tests/actions.at (Default tagless %printer and %destructor,
6269 Default tagged and per-type %printer and %destructor,
6270 Default %printer and %destructor are not for error or $undefined,
6271 Default %printer and %destructor are not for $accept,
6272 Default %printer and %destructor for mid-rule values): Update.
6273 * tests/input.at (Default %printer and %destructor redeclared,
6274 Unused values with default %destructor): Update.
6275
26b8a438
JD
62762006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6277
6278 Don't let %prec take a nonterminal.
6279 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6280 token.
6281 * tests/input.at (%prec takes a token): New test checking that %prec
6282 won't take a nonterminal.
6283
07c39ae9
JD
62842006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6285
405d53b7
JD
6286 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6287 it was double-quoted.
07c39ae9
JD
6288 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6289 grammar is maintained with Bison's highest standards.
6290 * src/getargs.c: Fix some typos in Doxygen comments.
6291
580b8926
JD
62922006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6293
6294 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6295 later. Reported by Paul Eggert in
6296 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6297 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6298 * src/scan-code.l (translate_action): Don't bother invoking
6299 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6300 (code_scanner_free): Instead of invoking
6301 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6302 which frees more.
6303 * src/scan-gram.l (gram_scanner_free): Likewise.
6304 * src/scan-skel.l (scan_skel): Likewise.
6305
4502eadc
JD
63062006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6307
6308 * src/files.c (tr): Change return type to void.
6309 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6310 has been called previously for the same key.
6311 (muscle_find): Return storage instead of value so that
6312 --enable-gcc-warnings doesn't produce warnings that the return discards
6313 const. aver that the value and storage are the same since storage
6314 could potentially be NULL when value is not.
6315 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6316 same as 0.
6317
7746c8f6
PE
63182006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6319
6320 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6321 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6322 us a slightly cleaner distribution, and also works.
6323 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6324 gnulib changes.
6325
eb095650
PE
63262006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6327 and Paul Eggert <eggert@cs.ucla.edu>
6328
6329 Don't let Bison leak memory except when it complains.
6330 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6331 (spec_defines_file, dir_prefix): Now char *, not const char *,
6332 since they are freed.
6333 * src/files.c: Likewise.
6334 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6335 Likewise.
6336 (tr): Now operates in-place. All uses changed.
6337 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6338 values.
6339 (compute_file_name_parts, compute_output_file_names): Don't store
6340 read-only data in variables that will be freed.
6341 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6342 src_extension, and header_extension.
6343 (output_file_names_free): New public function to free
6344 spec_verbose_file, spec_graph_file, spec_defines_file,
6345 parser_file_name, and dir_prefix.
6346 * src/getargs.c (getargs): Don't store read-only data in variables that
6347 will be freed.
6348 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6349 (which previously existed but was unused), and quotearg_free.
6350 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6351 * src/muscle_tab.c: Likewise.
6352 (muscle_entry): Make the value char const *,
6353 and add a new storage member that is char * and can be freed.
6354 (muscle_entry_free): New private function.
6355 (muscle_init): Use it instead of free.
6356 (muscle_insert, muscle_grow): Update and use new storage member.
6357 (muscle_code_grow): Free the string passed to muscle_grow
6358 since it's not needed anymore.
6359 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6360 add a new `char *code' member.
6361 ("{...}"): Declare semantic type as code.
6362 * src/scan-code.h (translate_rule_action):
6363 (translate_symbol_action, translate_code, translate_action): Return
6364 `char const *' rather than `char *' since external code should not free
6365 these strings.
6366 * src/scan-code.l: Likewise.
6367 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6368 which is "{...}" in the parser.
6369 * tests/Makefile.am (maintainer-check-valgrind): Set
6370 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6371 Valgrind.
6372 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6373 complain.
6374 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6375 expecting a non-zero exit status sets --leak-check=summary and
6376 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6377 this case, and we don't want to hear about it.
6378
ac564be4
PE
63792006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6380
6381 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6382 instead of from the template, to simplify configuration a bit.
6383 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6384 and m4/wint_t.m4, as they are needed with the latest gnulib.
6385
17bd8a73
JD
63862006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6387
6388 Disable unset/unused mid-rule value warnings by default, and recognize
6389 --warnings=midrule-values to enable them. Discussed starting at
6390 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6391 * NEWS (2.3a+): Mention.
6392 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6393 warnings): Add entry for midrule-values subargument.
6394 * src/reader.c (symbol_should_be_used): Don't return true just because
6395 the value is a set/used mid-rule value unless
6396 --warnings=midrule-values was specified.
6397 * tests/input.at (Unused values, Unused values before symbol
6398 declarations): Run tests with and without --warnings=midrule-values.
6399
6400 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6401 than LIST_FREE directly.
6402
89eb3c76
JD
64032006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6404
6405 Finish implementing --warnings=error, which should not be implied by
6406 --warnings=all (or by its synonyms -W and --warnings without
6407 subarguments).
6408 * src/complain.c (set_warning_issued): New function to report that
6409 warnings are being treated as errors and to record an error if so.
6410 Invoke...
6411 (warn_at, warn): ... here.
6412 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6413 "error - warnings are errors" does not appear above "all - all of the
6414 above".
6415 (getargs): For -W and --warnings without subarguments, don't let
6416 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6417 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6418
ba7560e2
JD
64192006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6420
6421 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6422 empty subargument list. For example: `bison --warnings= parser.y'.
6423
31283fc3
JD
64242006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6425
6426 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6427 the parser header file so that gcc doesn't warn.
6428
12e35840
JD
64292006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6430
6431 Split the default %destructor/%printer into two kinds: <*> and <!>.
6432 Discussed starting at
6433 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6434 * NEWS (2.3a+): Mention.
6435 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6436 previous change today related to mid-rules.
148d66d8 6437 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 6438 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
6439 (TYPE_TAG_ANY): Add as <*>.
6440 (TYPE_TAG_NONE): Add as <!>.
6441 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6442 for <*> and <!>.
6443 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6444 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6445 * src/symlist.c (symbol_list_default_new): Split into tagged and
6446 tagless versions.
6447 (symbol_list_destructor_set, symbol_list_printer_set): Split
6448 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6449 SYMLIST_DEFAULT_TAGLESS.
6450 * src/symlist.h: Update symbol_list_default*_new prototypes.
6451 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6452 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6453 * src/symtab.c (default_destructor, default_destructor_location,
6454 default_printer, default_printer_location): Split each into tagged and
6455 tagless versions.
6456 (symbol_destructor_get, symbol_destructor_location_get,
6457 symbol_printer_get, symbol_printer_location_get): Implement tagged
6458 default and tagless default cases.
6459 (default_destructor_set, default_printer_set): Split each into tagged
6460 and tagless versions.
6461 * src/symtab.h: Update prototypes.
6462 * tests/actions.at (Default %printer and %destructor): Rename to...
6463 (Default tagless %printer and %destructor): ... this, and extend.
6464 (Per-type %printer and %destructor): Rename to...
6465 (Default tagged and per-type %printer and %destructor): ... this, and
6466 extend.
6467 (Default %printer and %destructor for user-defined end token): Extend.
6468 (Default %printer and %destructor are not for error or $undefined):
6469 Update.
6470 (Default %printer and %destructor are not for $accept): Update.
6471 (Default %printer and %destructor for mid-rule values): Extend.
6472 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6473 (Unused values with default %destructor): Extend.
6474
f91b1629
JD
64752006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6476
6477 Don't apply the default %destructor/%printer to an unreferenced midrule
6478 value. Mentioned at
6479 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6480 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6481 like $@n instead of just @n so that the default %destructor/%printer
6482 logic doesn't see them as user-defined symbols.
6483 (symbol_is_dummy): Check for both forms of the name.
6484 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6485 name for which the midrule value is referenced in any action.
6486 * tests/actions.at (Default %printer and %destructor for mid-rule
6487 values): New test.
6488 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6489 for change to dummy symbol names.
6490
519d0004
JD
64912006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6492
6493 Warn about unset midrule $$ if the corresponding $n is used.
6494 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6495 $n usage.
6496 (packgram): Before invoking grammar_rule_check on any rule, make sure
6497 all actions have already been scanned in order to set `used' flags.
6498 Otherwise, checking that a midrule's $$ is set will not always work
6499 properly because the midrule check must forward-reference the midrule's
6500 parent rule.
6501 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6502 warning.
6503
a501eca9
JD
65042006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6505
6506 More improvements to the documentation of the prologue alternatives:
6507 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6508 Bison manual.
6509 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6510 some text to clarify the relative importance of the new directives and
6511 to show how these directives may be viewed as code labels.
6512
2cbe6b7f
JD
65132006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6514
6515 Similar to the recently removed %before-header, add %code-top as the
6516 alternative to the pre-prologue. Mentioned at
6517 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6518 Also, let the prologue alternatives appear in the grammar section.
6519 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6520 (prologue_declaration): Move the existing prologue alternatives to...
6521 (grammar_declaration): ... here and add %code-top.
6522 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6523
6524 Clean up and extend documentation for the prologue alternatives.
6525 * NEWS (2.3a+): Describe prologue alternatives.
6526 * doc/bison.texinfo (Prologue): Move discussion of prologue
6527 alternatives to...
6528 (Prologue Alternatives): ... this new section, and extend it to discuss
6529 all 4 directives in detail.
148d66d8
JD
6530 (Table of Symbols): Clean up discussion of prologue alternatives and
6531 add %code-top.
2cbe6b7f 6532
e557d3ea
JMG
65332006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6534
6535 DJGPP specific issues.
6536
6537 * djgpp/config.bat: config.hin has been moved to lib. Adjust
6538 config.bat accordingly.
6539 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
6540 * djgpp/config.site: Likewise.
6541
136a0f76
PB
65422006-10-16 Paolo Bonzini <bonzini@gnu.org>
6543
27bd5d67
PB
6544 Replace %*-header with %provides, %requires, %code. See discussion at
6545 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6546
136a0f76
PB
6547 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
6548 (b4_user_start_header): Remove.
6549 * data/glr.c: Use new macros instead of b4_*start_header
6550 and b4_*end_header.
6551 * data/glr.cc: Likewise.
6552 * data/lalr1.cc: Likewise.
6553 * data/push.c: Likewise.
6554 * data/yacc.c: Likewise.
6555
6556 * doc/bison.texinfo: Remove %before-header, rename
6557 %{start,end,after}-header to %requires, %provides, %code.
6558
6559 * src/parse-gram.y: Likewise (also rename token names accordingly).
6560 * src/scan-gram.l: Likewise.
6561 * tests/actions.at: Likewise.
6562
10f429ef
PE
65632006-10-14 Paul Eggert <eggert@cs.ucla.edu>
6564
6565 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
6566 Problem reported by Joel E. Denny.
6567
65682006-10-14 Jim Meyering <jim@meyering.net>
6569
6570 (Sync from coreutils.)
6571 Work also when the working directory (with e.g. coreutils sources)
6572 is version controlled with git, rather than CVS.
6573 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
6574 rather than CVS.
6575 In messages and comments, say e.g., "checked-out sources",
6576 rather than "CVS sources".
6577 (version_controlled_file): New function. Work for git as well as
6578 for CVS. Don't use grep's -q option.
6579 (slurp): Call it here, in place of CVS-specific code.
6580
c4bd5bf7
JD
65812006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
6582
6583 Fix testsuite for ./configure --enable-gcc-warnings:
6584 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
6585 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
6586 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
6587 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
6588 * test/regression.at (Diagnostic that expects two alternatives):
6589 Likewise.
6590
46356ea4
PE
65912006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6592
231ed89a
PE
6593 * bootstrap.conf (gnulib_modules): Add config-h.
6594 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
6595 worry about HAVE_CONFIG_H.
6596 * lib/abitset.c: Likewise.
6597 * lib/bitset.c: Likewise.
6598 * lib/bitset_stats.c: Likewise.
6599 * lib/bitsetv-print.c: Likewise.
6600 * lib/bitsetv.c: Likewise.
6601 * lib/ebitset.c: Likewise.
6602 * lib/get-errno.c: Likewise.
6603 * lib/lbitset.c: Likewise.
6604 * lib/subpipe.c: Likewise.
6605 * lib/timevar.c: Likewise.
6606 * lib/vbitset.c: Likewise.
6607 * lib/bitset.c: Include "bitset.h" first, to test interface.
6608 * lib/bitset_stats.c: Include "bitset_stats.h" first.
6609 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
6610 * lib/bitsetv.c: Include "bitsetv.h" first.
6611 * lib/get-errno.c: Include "get-errno.h" first.
6612 * m4/.cvsignore: Add config-h.m4.
6613 * tests/actions.at (Default %printer and %destructor for ...):
6614 Adjust expected line numbers in output to reflect removal of #if
6615 HAVE_CONFIG_H lines.
6616 * tests/glr-regression.at (Missed %merge type warnings when ...):
6617 Likewise.
6618 * tests/regression.at (Braced code in declaration in rules section):
6619 Likewise.
6620 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
6621 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
6622 Include <config.h> unconditionally.
6623
46356ea4
PE
6624 * bootstrap: Sync from coreutils, as follows:
6625
6626 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6627
6628 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6629 variable was sometimes used without being initialized. This
6630 messed up the installation of the INSTALL file in some cases.
6631
6632 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6633
6634 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6635 --copy. Inspired by a suggestion from Bruno Haible.
6636
6637 2006-10-03 Jim Meyering <jim@meyering.net>
6638
6639 * bootstrap: Undo last change to this file, since now gnulib-tool
6640 sticks with the automake default in generating dependencies.
6641
dd4bf078
PE
66422006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6643
cf2a5f7c
PE
6644 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6645 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6646
6647 * doc/bison.1: Add copyright notice.
6648
6649 * data/glr.c: Don't include <stdarg.h>; not used.
6650
35fe0834
PE
6651 * NEWS: The -g and --graph options now output graphs in Graphviz
6652 DOT format, not VCG format.
6653 * doc/bison.1: Likewise.
6654 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
6655 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6656 of this change in
6657 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
6658 * TODO: Remove Graphviz entry.
6659 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6660 remove vcg.c, vcg.h, vcg_defaults.h.
6661 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6662 * src/graphviz.c, src/graphviz.h: New files.
6663 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6664 * src/files.h: Make comment more generic.
6665 * src/main.c (main): Likewise.
6666 * src/print_graph.h: Likewise.
6667 * src/getargs.c (usage): Make usage description more generic.
6668 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6669 (static_graph, fgraph): Remove. All uses changed to pass
6670 arguments instead of sharing a static var.
6671 (print_core, print_actions, print_state, print_graph):
6672 Output graphviz format rather than VCG format.
6673 * tests/.cvsignore: Remove *.vcg; add *.dot.
6674 * tests/output.at: Expect *.dot files, not *.vcg files.
6675
dd4bf078
PE
6676 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6677 accommodates the 2006-10-08 change.
6678
efdd7421
PE
66792006-10-11 Bob Rossi <bob@brasko.net>
6680
6681 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6682 (b4_yyssa, b4_yyerror_range): New macros.
6683 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6684 (yypvarsinit): Remove init of removed fields.
6685 (yypushparse): Remove use of removed fields; use new macros instead.
6686
96a1981a
PE
66872006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6688
6689 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6690 in a push parser. Reindent slightly to match yacc.c better.
6691
66922006-10-11 Bob Rossi <bob@brasko.net>
6693
46356ea4
PE
6694 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6695 yymsg_alloc fields.
6696 (yypvarsinit, yypushparse): Remove init of removed fields.
6697 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 6698
c1630a8b
PE
66992006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6700
6701 * THANKS: Add Paolo Bonzini and Bob Rossi.
6702
90b9908d
PB
67032006-10-08 Paolo Bonzini <bonzini@gnu.org>
6704
6705 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6706 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6707 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6708 b4_define_user_cde and uses): Remove.
6709 (b4_comment, b4_prefix, b4_sync_start): New.
6710 * data/bison.m4: New file, with most of the content removed from c.m4.
6711 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6712 * src/output.c (output_skeleton): Pass bison.m4.
6713 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6714 only if specified.
6715
cf806753
PE
67162006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6717
6718 Fix test failure reported by Tom Lane in
6719 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6720 and try to make such failures easier to catch in the future.
6721 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6722 that's now the caller's responsibility.
6723 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6724 Set yychar = YYEOF if it's negative.
6725 * tests/actions.at (yylex): Abort if asked to read past EOF.
6726 * tests/conflicts.at (yylex): Likewise.
6727 * tests/cxx-type.at (yylex): Likewise.
6728 * tests/glr-regression.at (yylex): Likewise.
6729 * tests/input.at (yylex): Likewise.
6730 * tests/regression.at (yylex): Likewise.
6731 * tests/torture.at (yylex): Likewise.
6732
0e2f006a
PE
67332006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6734
6735 Fix problems with translating English-language diagnostics.
6736 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6737 respect to bison-runtime pot generation. The YY_ stuff
6738 wasn't being captured.
6739 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6740 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6741 * runtime-po/POTFILES.in: Add data/push.c.
6742
e3ddc1e3
PE
67432006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6744
6745 Merge bootstrap changes from coreutils.
6746
6747 2006-09-28 Jim Meyering <jim@meyering.net>
6748
6749 Automatically generated dependencies are important even
6750 when all of the sources in a directory come from gnulib.
6751 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6752 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6753
6754 2006-09-23 Jim Meyering <jim@meyering.net>
6755
6756 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6757
6758 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6759
6760 * bootstrap: Add support for --force.
6761 (usage): New function. Describe usage less tersely.
6762 (CVS_only_file): New var.
6763
01e972b3
PE
67642006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6765
6766 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6767 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6768 Adjust white space and comments to match GNU style better.
6769
c63d3e90
PE
67702006-09-20 Bob Rossi <bob@brasko.net>
6771
6772 * data/push.c (yyresult_get): Remove function.
6773 (YYPUSH_MORE): Add #define.
6774 (yypushparse): Modify return value.
6775
e70f46d1
PE
67762006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6777
6778 * stamp-h.in: Remove; no longer needed.
6779 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6780 Remove config.h, config.hin, intl (no longer created).
6781 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6782 stamp-h1.
6783
6784 Sync bootstrap from coreutils, as follows:
6785
6786 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6787
6788 * bootstrap (symlink_to_gnulib): New function.
6789 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6790 to copies-of-gnulib.
6791 (cp_mark_as_generated, slurp, gnulib_files):
6792 Avoid making a copy if it's the same as the old version.
6793 (gnulib_files): Add support for this variable (used by Bison).
6794
a92be413
PE
67952006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6796
6797 * src/getargs.c (usage): Rework to use conventions similar to
6798 coreutils, to make translation a bit easier and the code a bit
6799 smaller. Problem reported by Tim Van Holder.
6800
4f82b42a
PE
68012006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6802
3b2942e6
PE
6803 Use some of gnulib's new modules, taken from coreutils.
6804
6805 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6806 * bootstrap.conf: New file.
6807 (gnulib_modules): Add configmake, inttypes, unistd.
6808 (XGETTEXT_OPTIONS): Add complain, complain_at,
6809 fatal, fatal_at, warn, warn_at, unexpected_end.
6810 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6811 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6812 (gl_EARLY): Add.
6813 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6814 (gl_INIT): Add
6815 (GNULIB_AUTOCONF_SNIPPET): Remove.
6816 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6817 the pickiest.
6818 * lib/.cvsignore: Add inttypes_.h.
6819 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6820 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6821 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6822 no-longer-necessary initializations.
6823 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6824 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6825 use the unistd module.
6826 * src/system.h: Likewise.
6827 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6828 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6829 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6830 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6831 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6832 * src/system.h: Include inttypes.h unconditionally, now that we
6833 use the inttypes module. Don't bother to include stdint.h, since
6834 inttypes.h now does that for us.
6835 (LOCALEDIR): Remove, now that we use the configmake module.
6836 * src/getargs.c: Include configmake.h.
6837 * src/main.c: Likewise.
6838 * src/output.c: Likewise.
6839 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6840 not from $abs_top_builddir, since config.h moved.
6841
6842
4f82b42a
PE
6843 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6844 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6845
6846 * src/parse-gram.y (symbol_declaration): Don't put statements
6847 before declarations; it's not portable to C89.
6848 * src/scan-code.l (handle_action_at): Likewise.
6849
6850 * src/scan-code.l: Always initialize braces_level; the old code
6851 left it uninitialized and therefore had undefined behavior.
6852
6853 Don't attempt to redefine 'assert', since it runs afoul of
6854 systems where standard headers (mistakenly) include <assert.h>.
6855 Instead, define and use our own alternative, called 'aver'.
6856 * src/reader.c: Don't include assert.h, since we no longer
6857 use assert.
6858 * src/scan-code.l: Likewise.
6859 * src/system.h (assert): Remove, replacing with....
6860 (aver): New function, taking a bool arg. All uses changed.
6861 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6862 not merely an integer.
6863
31c10e38
PE
68642006-09-15 Bob Rossi <bob@brasko.net>
6865
6866 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6867 * data/c.m4 (YYPUSH): New.
6868 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
6869 * src/getargs.c (push_parser): New var.
6870 * src/getargs.h (push_parser): New declaration.
6871 * src/output.c (prepare): Add macro insertion of `push_flag'.
6872 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6873 (prologue_declaration): Parse %push-parser.
6874 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6875 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6876 list of removed lines from the traces observed.
6877 (AT_CHECK_CALC_LALR): Added push parser tests.
6878
fa7b79c0
PE
68792006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6880
21fe08ca
PE
6881 * NEWS: Version 2.3a.
6882 * configure.ac (AC_INIT): Likewise.
6883
e8ec4d9b
PE
6884 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6885 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6886 due to header ordering dependencies. I don't know why the #define
6887 was there.
6888
fa7b79c0
PE
6889 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6890 runtime cost when YYDEBUG is not defined, and so that some tests
6891 that used to fail now work. Problem and initial suggestion by
6892 Paolo Bonzini.
6893 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6894 * data/glr.cc (b4_parser_class_name):
6895 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6896 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6897 (yydebug_) [YYDEBUG]: New member.
6898 (yycdebug_): Now defined only if YYDEBUG.
6899 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6900 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6901 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6902 if YYYDEBUG.
6903 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6904 Define only if YYDEBUG.
6905 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6906 set_debug_level.
6907 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6908 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6909 AT_CHECK_CALC_GLR_CC that are working now.
6910
4ec13d60
PE
69112006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6912
6913 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6914 We don't need them in glr.cc, and glr.c defines them.
6915 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6916 assumes that defining it to anything is the same as defining
6917 it to 1. Problem reported by Paolo Bonzini.
6918
8e1687ae
PE
69192006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6920
6921 * data/c.m4 (b4_null, b4_case): Define.
6922 * src/output.c (prepare_symbols): Use b4_null.
6923 (user_actions_output): Use b4_case.
6924
3dc5e96b
PE
69252006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6926
aef3da86
PE
6927 * data/glr.c (b4_shared_declarations): Put start-header first,
6928 before any #includes that we generate, so that feature-test
6929 macros work. Problem reported by Michael Deutschmann in
6930 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6931 * data/lalr1.cc: Likewise.
6932 * doc/bison.texinfo (Prologue): Document that feature-test macros
6933 should be defined before any Bison declarations.
6934 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6935 that depend on location.hh after, not before, Bison decls, since
6936 we now include location.hh after the first user prologue.
6937
3dc5e96b
PE
6938 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6939 Sander Brandenburg in
6940 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6941 Also, fix minor white space and comment issues.
aef3da86
PE
6942 (Prologue): Mention that it's better to define feature-test macros
6943 before Bison declarations. Problem reported by Michael Deutschmann.
6944
6945 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6946 by Jim Meyering.
6947 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6948 This adjusts to recent gnulib changes.
3dc5e96b 6949
b2a0b7ca
JD
69502006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6951
6952 Finish implementation of per-type %destructor/%printer. Discussed
6953 starting at
6954 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6955 and
6956 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6957 * NEWS (2.3+): Add a description of this feature to the default
6958 %destructor/%printer description.
6959 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6960 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6961 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6962 list node contains a semantic type.
6963 * src/symtab.c, src/symtab.h: Extend with a table that associates
6964 semantic types with their %destructor's and %printer's.
6965 (semantic_type_from_uniqstr, semantic_type_get,
6966 semantic_type_destructor_set, semantic_type_printer_set): New functions
6967 composing the public interface of that table.
6968 (symbol_destructor_get, symbol_destructor_location_get,
6969 symbol_printer_get, symbol_printer_location_get): If there's no
6970 per-symbol %destructor/%printer, look up the per-type before trying
6971 the default.
6972 * tests/actions.at (Per-type %printer and %destructor): New test case.
6973 * tests/input.at (Default %printer and %destructor redeclared):
6974 Extend to check that multiple occurrences of %symbol-default in a
6975 single %destructor/%printer declaration is an error.
6976 (Per-type %printer and %destructor redeclared, Unused values with
6977 per-type %destructor): New test cases.
6978
3be03b13
JD
69792006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6980
6981 Require default %destructor/%printer to be declared using
6982 %symbol-default instead of an empty symbol list, and start working on
6983 new per-type %destructor/%printer. Discussed at
6984 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6985 * NEWS (2.3+): Add %symbol-default to example.
6986 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 6987 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
6988 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6989 (generic_symlist, generic_symlist_item): New nonterminals for creating
6990 a list in which each item is a symbol, semantic type, or
6991 %symbol-default.
6992 (grammar_declaration): Use generic_symlist in %destructor and %printer
6993 declarations instead of symbols.1 or an empty list.
6994 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6995 for changes to symbol_list.
6996 * src/reader.c: Update for changes to symbol_list.
6997 * src/scan-code.l: Likewise.
6998 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6999 * src/symlist.c, src/symlist.h: Extend such that a list node may
7000 represent a semantic type or a %symbol-default in addition to just an
7001 ordinary symbol. Add switched functions for setting %destructor's and
7002 %printer's.
7003 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7004 %destructor/%printer declarations.
7005
3508ce36
JD
70062006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7007
7008 Whether the default %destructor/%printer applies to a particular symbol
7009 isn't a question of whether the user *declares* that symbol (in %token,
7010 for example). It's a question of whether the user by any means
7011 *defines* the symbol at all (by simply using a char token, for
7012 example). $end is defined by Bison whereas any other token with token
7013 number 0 is defined by the user. The error token is always defined by
7014 Bison regardless of whether the user declares it with %token, but we
7015 may one day let the user define error as a nonterminal instead.
7016 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
7017 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
7018 the meaning of "user-defined".
7019 * tests/actions.at (Default %printer and %destructor for user-declared
7020 end token): Rename to...
7021 (Default %printer and %destructor for user-defined end token): ...
7022 this.
7023
7024 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
7025 computation of whether to apply the default, don't maintain a list of
7026 every Bison-defined symbol. Instead, just check for a first character
7027 of '$', which a user symbol cannot have, and check for the error token.
7028
9350499c
JD
70292006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
7030
7031 Don't apply the default %destructor or %printer to the error token,
7032 $undefined, or $accept. This change fits the general rule that the
7033 default %destructor and %printer are only for user-declared symbols,
7034 and it solves several difficulties that are described in the new test
7035 cases listed below.
7036 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
7037 * tests/actions.at (Default %printer and %destructor are not for error
7038 or $undefined, Default %printer and %destructor are not for $accept):
7039 New test cases.
7040
4d7370cb
JD
70412006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
7042
7043 Allow %start after the first rule.
7044 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
7045 when parsing the first rule.
7046 (check_and_convert_grammar): Search for it here after all grammar
7047 declarations have been parsed. Skip midrules, which have dummy LHS
7048 nonterminals.
7049 * src/symtab.c (symbol_is_dummy): New function.
7050 * src/symtab.h (symbol_is_dummy): Declare it.
7051 * tests/input.at (%start after first rule): New test.
7052
6d0ef4ec
JD
70532006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7054
7055 Redo some of the previous commit: add back the ability to use
7056 non-aliased/undeclared string literals since it might be useful to
7057 those declaring %token-table.
7058 * src/reader.c (check_and_convert_grammar): Undo changes in previous
7059 commit: don't worry about complaints from symbols_pack.
7060 * src/symtab.c (symbol_new, symbol_class_set,
7061 symbol_check_alias_consistency): Undo changes in previous commit: count
7062 each string literal as a new symbol and token, assign it a symbol
7063 number, and don't complain about non-aliased string literals.
7064 (symbols_pack): Since symbol_make_alias still does not decrement symbol
7065 and token counts but does still set aliased tokens to the same number,
7066 symbol_pack_processor now leaves empty slots in the symbols array.
7067 Remove those slots.
7068 * tests/regression.at (Undeclared string literal): Remove test case
7069 added in previous commit since non-aliased string literals are allowed
7070 again.
7071 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
7072 remove unnecessary string literal declarations.
7073 * tests/sets.at (Firsts): Likewise.
7074
965537bc
JD
70752006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7076
7077 Don't allow an undeclared string literal, but allow a string literal to
7078 be used before its declaration.
7079 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
7080 symbols_pack complained.
7081 * src/symtab.c (symbol_new): Don't count a string literal as a new
7082 symbol.
7083 (symbol_class_set): Don't count a string literal as a new token, and
7084 don't assign it a symbol number since symbol_make_alias does that.
7085 (symbol_make_alias): It's not necessary to decrement the symbol and
7086 token counts anymore. Don't assume that an alias declaration occurs
7087 before any uses of the identifier or string, and thus don't assert that
7088 one of them has the highest symbol number so far.
7089 (symbol_check_alias_consistency): Complain if there's a string literal
7090 that wasn't declared as an alias.
7091 (symbols_pack): Bail if symbol_check_alias_consistency failed since
7092 symbol_pack asserts that every token has been assigned a symbol number
7093 although undeclared string literals have not.
7094 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 7095 string literal): New test cases.
965537bc
JD
7096 (Characters Escapes, Web2c Actions): Declare string literals as
7097 aliases.
7098 * tests/sets.at (Firsts): Likewise.
7099
47aee066
JD
71002006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
7101
7102 In the grammar scanner, STRING_FINISH unclosed constructs and return
7103 them to the parser in order to improve error messages.
7104 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
7105 SC_BRACED_CODE, SC_PROLOGUE): Implement.
7106 * tests/input.at (Unclosed constructs): New test case.
7107 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
7108 seen.
7109
7110 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
7111 unused global.
7112
1f6b3679
JD
71132006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
7114
7115 Handle string aliases for character tokens correctly.
7116 * src/symtab.c (symbol_user_token_number_set): If the token has an
7117 alias, check and set its alias's user token number instead of its own,
7118 which is set to indicate the alias. Previously, every occurrence of
7119 the character token in the grammar overwrote that alias indicator with
7120 the character code.
7121 * tests/input.at (String aliases for character tokens): New test.
7122
219741d8
JD
71232006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
7124
7125 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
7126
11daa4e7
PE
71272006-08-11 Paul Eggert <eggert@cs.ucla.edu>
7128
7129 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
7130 to prevent failures when building on older platforms.
7131 Check for autopoint failure.
7132 Set XGETTEXT_OPTIONS to values that check for C format strings,
7133 so that translators are warned about them (this also helps
7134 prevent core dumps).
7135
7136 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
7137 function, since it simplifies our code a bit.
7138
7139 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
7140 rather than -W, so we don't get bogus warnings about sign comparisons.
7141 Add -Wpointer-arith, since that warning is useful (it reports code
7142 that does not conform to C89 and that some compilers reject).
7143 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
7144 since it's no longer needed.
7145
f9bfc42a
JD
71462006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
7147
7148 Clean up scanners a bit.
7149 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
7150 definitions so gcc won't warn when obstack_for_string is unused.
7151 * src/scan-code.l: config.h and system.h are already #include'd by
7152 scan-code-c.c, so get rid of them here.
7153 * src/scan-gram.l: Likewise.
7154 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
7155 definitions rather than duplicating the rest of it.
7156 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
7157
06e8700a
JD
71582006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
7159
7160 Suppress signed/unsigned comparison warnings for yycheck.
7161 * data/c.m4 (b4_safest_int_type): New macro.
7162 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
7163 a signed int type, cast it to b4_safest_int_type first.
7164 * data/yacc.c: Likewise.
7165 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
7166 also overwritten.
7167
9c437126
PE
71682006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
7169
7170 * doc/bison.texinfo: Fix some typos.
7171
284d8a13
PE
71722006-08-02 Paul Eggert <eggert@cs.ucla.edu>
7173
7174 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
7175 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
7176
7177 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
7178 the latest gnulib does this a different way.
7179 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
7180 translation was patched, so stop omitting it.
7181
ec5479ce
JD
71822006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7183
7184 Enable declaration of default %printer/%destructor. Make the parser
7185 use these for all user-declared grammar symbols for which the user does
7186 not declare a specific %printer/%destructor. Thus, the parser uses it
7187 for token 0 if the user declares it but not if Bison generates it as
7188 $end. Discussed starting at
7189 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
7190 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
7191 and
7192 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
7193 * NEWS (2.3+): Mention.
7194 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
7195 declare a %destructor for a mid-rule's semantic value. It's just
7196 impossible to declare one specific to it.
7197 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
7198 code. Describe default %destructor form.
7199 * src/parse-gram.y (grammar_declaration): Parse default
7200 %printer/%destructor declarations.
7201 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
7202 and symbol_destructor_location_get rather than accessing the destructor
7203 and destructor_location members of struct symbol.
7204 (symbol_printers_output): Likewise but for %printer's.
7205 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
7206 again.
7207 * src/symtab.c (default_destructor, default_destructor_location,
7208 default_printer, default_printer_location): New static global
7209 variables to record the default %destructor and %printer.
7210 (symbol_destructor_get, symbol_destructor_location_get,
7211 symbol_printer_get, symbol_printer_location_get): New functions to
7212 compute the appropriate %destructor and %printer for a symbol.
7213 (default_destructor_set, default_printer_set): New functions to set the
7214 default %destructor and %printer.
7215 * src/symtab.h: Prototype all those new functions.
7216 * tests/actions.at (Default %printer and %destructor): New test to
7217 check that the right %printer and %destructor are called, that they're
7218 not called for $end, and that $$ and @$ work correctly.
7219 (Default %printer and %destructor for user-declared end token): New
7220 test to check that the default %printer and %destructor are called for
7221 a user-declared end token.
7222 * tests/input.at (Default %printer and %destructor redeclared, Unused
7223 values with default %destructor): New tests to check related grammar
7224 warnings and errors.
7225
868d2d96
JD
72262006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7227
7228 Clean up handling of %destructor for the end token (token 0).
7229 Discussed starting at
7230 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7231 and
7232 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7233
7234 Make the skeletons consistent in how they pop the end token and invoke
7235 its %destructor.
7236 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7237 state, which has token number 0, since this would invoke the
7238 %destructor for the end token.
7239 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7240 until after shifting the end token, or else it won't be popped.
7241 * data/yacc.c (yyparse): Likewise.
7242
7243 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7244 it's the end token. Upon termination, destroy an unshifted lookahead
7245 even when it's the end token.
7246 * data/lalr1.cc (yy::parser::parse): Likewise.
7247 * data/yacc.c (yyparse): Likewise.
7248
7249 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7250 value warnings for the end token when the user gives the end token a
7251 %destructor.
7252
7253 * tests/actions.at (Printers and Destructors): Test all the above.
7254
62a9592d
PE
72552006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7256
7257 Update to latest gnulib and gettext versions.
7258 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7259 Add fopen-safer.
7260 (gnulib_files): Add m4/warning.m4. Don't worry about files
7261 overwritten by autopoint.
7262 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7263 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7264 rejects them.
7265 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7266 so that we can remove the intl files at a better time.
7267 (intl_files_to_remove): Remove aclocal.m4, since it gets
7268 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7269 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7270 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7271 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7272 Remove datarootdir hack; no longer needed.
7273 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7274 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7275 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7276 strdup.h.
7277 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7278 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7279
10d6970f
PE
72802006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7281
7282 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7283 it with --assume-autoconf='latest-stable'.
7284
50a33993
JD
72852006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7286
7287 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7288 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7289 YYSTYPE' and `{'.
7290 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7291 those from muscle_tab.c since the old ones are misleading.
7292
2ce4ed68
AD
72932006-07-13 Akim Demaille <akim@epita.fr>
7294
7295 Support %define "KEY" {VALUE}.
7296 * src/scan-code.h, src/scan-code.l (translate_action)
7297 (translate_rule_action, translate_symbol_action, translate_code):
7298 Return char *, not const char *.
7299 * src/parse-gram.y (declaration): Rename as...
7300 (prologue_declaration): this.
7301 (string_content): Remove this nonterminal, use STRING.
7302 (braceless, content, content.opt): New nonterminal.
7303 Use them.
7304 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7305 as value.
7306 * src/scan-gram.l (getargs.h): Don't include it.
7307
db7e5eb5
PE
73082006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7309
7310 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7311 rather than a for-loop that declares a local bool variable. This
7312 should work around a compatibility problem with a Cray x1e C++
7313 compiler reported by Hung Nguyen in
7314 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7315 The for-loop was introduced in the 2004-11-17 change but I don't
7316 know why it was needed.
7317
a5d80ba5
AD
73182006-07-12 Akim Demaille <akim@epita.fr>
7319
7320 * data/c.m4: Comment changes.
7321
23eb2a69
AD
73222006-07-10 Akim Demaille <akim@lrde.epita.fr>
7323
7324 * src/complain.c (error_message, ERROR_MESSAGE): New.
7325 To factor...
7326 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7327 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7328
ddc8ede1
PE
73292006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7330
7331 * NEWS: Instead of %union, you can define and use your own union type
7332 YYSTYPE if your grammar contains at least one <type> tag.
7333 Your YYSTYPE need not be a macro; it can be a typedef.
7334 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7335 (Union Decl, Decl Summary): Document this.
7336 * data/glr.c (YYSTYPE): Implement this.
7337 * data/glr.cc (YYSTYPE): Likewise.
7338 * data/lalr1.cc (YYSTYPE): Likewise.
7339 * data/yacc.c (YYSTYPE): Likewise.
7340 * src/output.c (prepare): Output tag_seen_flag.
7341 * src/parse-gram.y (declaration, grammar_declaration):
7342 Use 'union_seen' rather than 'typed' to determine whether
7343 %union has been seen, since grammars can now be typed without
7344 %union.
7345 (symbol_declaration, type.opt, symbol_def):
7346 Keep track of whether a tag has been seen.
7347 * src/reader.c (union_seen, tag_seen): New vars.
7348 (typed): remove.
7349 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7350 * src/scan-code.l (untyped_var_seen): New variable.
7351 (handle_action_dollar): Adjust to above changes.
7352 (handle_action_dollar, handle_action_at):
7353 Improve overflow checking for outlandish numbers.
7354 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7355 avoid new diagnostics generated by above changes.
7356 * tests/regression.at (YYSTYPE typedef): Add test to check
7357 for type tags without %union.
7358
7359 * src/symlist.c (symbol_list_length): Return int, not unsigned
7360 int, since callers expect int. This may need to get revisited
7361 once we have proper integer overflow checking.
7362
7363 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7364 object is now static.
7365
7366 * src/getargs.c (flags_argmatch): Return void, not int,
7367 to pacify ./configure --enable-gcc-warnings.
7368
7369 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7370 since last_string is already defined to FLEX_PREFIX (last_string).
7371
7b42569e
AD
73722006-07-09 Akim Demaille <akim@lrde.epita.fr>
7373
7374 Implement --warnings/-W.
7375 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7376 replaced by...
7377 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7378 Adjust callers.
7379 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7380 (warnings_args, warnings_types): New.
7381 (getargs, short_options, long_options): Accept -W/--warnings.
7382 Sort the options by alphabetical order, upper case letter right
7383 before its lower case.
7384
3b452f4e
JD
73852006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7386
7387 Change %merge result type clash warnings to errors. Discussed at
7388 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7389 * src/reader.c (record_merge_function_type): Use complain_at.
7390 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7391 declared later): Update test case results.
7392
b8a41559
AD
73932006-07-09 Akim Demaille <akim@lrde.epita.fr>
7394
7395 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7396 to be in alphabetical order.
7397 (trace_args): Spelling fixes.
7398
cd9e1ba2
PE
73992006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7400
7401 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7402 so they don't collide with user-defined macros.
7403 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7404 this was never guaranteed, and now that we're using gnulib stdint,
7405 which defines int_fast16_t to long int, the problem is exposed.
7406
cb48f191
PE
74072006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7408
b8445a15
PE
7409 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7410 need the full POSIX semantics (and weren't implementing them
7411 anyway).
7412
cb48f191
PE
7413 Adjust to Autoconf 2.60 and today's gnulib.
7414 * bootstrap (gnulib_modules): Add stdint.
7415 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7416 no longer copies it.
7417 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7418 since stdint needs the former and wcwidth (which is now required
7419 by mbswidth) needs the latter.
7420 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7421 work around a compatibility glitch between gettext 0.14.6 and
7422 Autoconf 2.60.
7423 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7424 Do not check for uintptr_t, since new stdint module does the right
7425 thing.
7426 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7427 Add stdint.h, stdint_.h, wcwidth.h.
7428 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7429 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7430 stdint.m4, wchar_t.m4, wcwidth.m4.
7431 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7432 usual order for ../lib/*.h files.
7433 (file_name_split): Use last_component, not base_name, to adjust
7434 to gnulib changes.
7435 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7436 for ../lib/*.h files.
7437 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7438 Define unconditionally, since we now assume the stdint module.
7439 * src/scan-skel.l: Include <dirname.h>.
7440 (BASE_QPUTS): Use last_component, not base_name.
7441 * src/system.h: Include <unlocked-io.h> in the usual order
7442 for ../lib/*.h files. Include <stdint.h> unconditionally,
7443 since we now use the stdint module.
7444 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7445 HAVE_UINTPTR_T, since we now use the stdint module.
7446 (base_name): Remove decl, since files now include <dirname.h>
7447 to get the decl.
7448
cd48d21d
AD
74492006-07-08 Akim Demaille <akim@lrde.epita.fr>
7450
7451 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7452 New, default to 1.
7453 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7454 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7455 default.
7456 * tests/calc.at: Adjust.
7457
8ec0a172
AD
74582006-07-08 Akim Demaille <akim@lrde.epita.fr>
7459
b8445a15 7460 * data/c.m4 (b4_basename): New.
8ec0a172
AD
7461 (b4_syncline): Also output the location of its invocation (from
7462 the skeleton).
7463 (b4_user_action, b4_define_user_action, b4_user_actions)
7464 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7465 (b4_user_stype): New.
7466 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7467
4a678af8
JD
74682006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7469
7470 In the grammar file, the first column is 1 not 0 on the first line as
7471 on every other line.
7472 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7473 * tests/input.at (Torturing the Scanner): Update output.
7474
7475 * src/scan-gram.l (scanner_cursor): Declare it static.
7476
dd60572a
JD
74772006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7478
7479 In warnings, say "previous declaration" rather than "first
7480 declaration".
7481 * src/symtab.c (redeclaration): Do that here.
7482 * src/reader.c (record_merge_function_type): In the case of a result
7483 type clash, report the previous declaration rather than the very first
7484 one in the grammar file.
7485 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7486 declared later): Add a third declaration to check this behavior.
7487 * tests/input.at (Incompatible Aliases): Update output.
7488
2073e1b6
AD
74892006-06-27 Akim Demaille <akim@epita.fr>
7490
7491 * doc/Doxyfile.in: New.
7492 * doc/Makefile.am: Use it.
7493 * src/lalr.h, src/symtab.h: Initial doxygenation.
7494
8ee5b538
JD
74952006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7496
7497 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
7498 declared after the %merge. This continues the effort of the previous
7499 patch.
8ee5b538
JD
7500 * src/reader.c (get_merge_function): Don't set the merger type yet.
7501 (record_merge_function_type): New function for setting the merger type
7502 and checking for clashes.
7503 (grammar_current_rule_merge_set): Set the location of the %merge for
7504 the current rule.
7505 (packgram): Invoke record_merge_function_type for each rule now that
7506 all symbol type declarations have been parsed.
7507 * src/reader.h (merger_list.type_declaration_location): New member
7508 storing the location of the first %merge from which the type for this
7509 merging function was derived.
7510 * src/symlist.h (symbol_list.merger_declaration_location): New member
7511 storing the location of a rule's %merge, if any.
7512 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7513 declared later): New test to catch the error fixed by the above patch.
7514
ffa4ba3a
JD
75152006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7516
7517 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
7518 declarations appear after the rules. Discussed at
7519 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7520 and
7521 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7522 Don't mistake the type of $$ in a midrule to be that of its parent
7523 rule's $$.
ffa4ba3a
JD
7524 * src/reader.c (grammar_current_rule_end): Don't invoke
7525 grammar_rule_check yet since not all symbol declarations may have been
7526 parsed yet.
7527 (grammar_midrule_action): Likewise.
7528 Don't record whether the midrule's $$ has been used yet since actions
7529 haven't been translated yet.
7530 Record the midrule's parent rule and its RHS index within the parent
7531 rule.
7532 (grammar_current_rule_action_append): Don't translate the action yet
7533 since not all symbol declarations may have been parsed yet and, thus,
7534 warnings about types for $$, $n, @$, and @n can't be reported yet.
7535 (packgram): Translate the action and invoke grammar_rule_check now that
7536 all symbol declarations have been parsed.
7537 * src/scan-code.l (handle_action_dollar): Now that this is invoked
7538 after parsing the entire grammar file, the symbol list here in the case
7539 of a midrule is actually the midrule's empty RHS, so reference its
7540 parent rule's RHS where necessary.
7541 On the other hand, now that you can already know it's a midrule, you
7542 aren't forced to think $$ has the same type as its parent rule's $$.
7543 (handle_action_at): In the case of a midrule, reference the parent rule
7544 where necessary.
7545 * src/symlist.c (symbol_list_new): Initialize new midrule-related
7546 members.
7547 (symbol_list_length): Now that this is invoked after all rules have
7548 been parsed, a NULL symbol (rather than a NULL symbol list node)
7549 terminates a rule. symbol_list_print already does this correctly.
7550 * src/symlist.h (symbol_list.midrule_parent_rule,
7551 symbol_list.midrule_parent_rhs_index): New members so that midrules can
7552 remember their relationships with their parents.
7553 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
7554 fixed by the above patch.
7555 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
7556 implementing...
7557 (Unused values): ... this old test case and...
7558 (Unused values before symbol declarations): ... this new test case.
7559 This one is the same as `Unused values' except that all symbol
7560 declarations appear after the rules in order to catch the rest of the
7561 errors fixed by the above patch.
7562
e256e17f
JD
75632006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7564
300a1930
JD
7565 More cleanup.
7566 * src/reader.c (current_rule): Declare it static since it's no longer
7567 used outside this file.
7568 (grammar_current_rule_action_append): Remove redundant arguments from
7569 translate_rule_action invocation.
7570 * src/reader.h (current_rule): Remove this unused extern.
7571 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
7572 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 7573
381ecb06
JD
75742006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
7575
7576 Clean up yesterday's patch.
7577 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
7578 to...
7579 * src/reader.c (grammar_current_rule_action_append): ... here for
7580 consistency with grammar_current_rule_symbol_append.
7581 * tests/regression.at (Braced code in declaration in rules section):
7582 Make yyerror and yylex static as usual.
7583
4210cd0b
JD
75842006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
7585
7586 Fix bug that mistakes braced code in a declaration in the rules section
7587 to be a rule action. Mentioned at
7588 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
7589 * src/scan-gram.l: Move midrule action detection from the start of the
7590 scanning of any braced code to...
7591 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
7592 action. For readability, use $2 and @2 rather than the equivalent
7593 global variables.
7594 * tests/regression.at (Braced code in declaration in rules section):
7595 New test to catch the error fixed by the above patch.
7596
7597 Work on code readability some.
7598 * src/scan-code.l (current_rule): Get rid of this misleading and
7599 redundant declaration: it's actually extern'ed in reader.h.
7600 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
7601 translate_action): Add a rule argument and use it instead of the global
7602 current_rule.
7603 (translate_rule_action): This already receives current_rule through an
7604 argument, so pass it on to translate_action instead of assigning
7605 current_rule to current_rule.
7606 (translate_symbol_action, translate_code): Pass rule = NULL to
7607 translate_action.
7608
34f98f46
JD
76092006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
7610
7611 Rename %before-definitions to %start-header and %after-definitions to
7612 %end-header. Don't use these declarations to separate pre-prologue
7613 blocks from post-prologue blocks. Add new order-independent
7614 declarations %before-header and %after-header as alternatives to the
7615 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
7616 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
7617 * NEWS (2.3+): Update for these changes.
7618 * data/glr.c (b4_before_definitions): Update to...
7619 (b4_start_header): ... this.
7620 (b4_after_definitions): Update to...
7621 (b4_end_header): ... this.
7622 * data/glr.cc: Likewise.
7623 * data/lalr1.cc: Likewise.
7624 * data/yacc.c: Likewise.
7625 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7626 prologue blocks with %*-header declarations.
7627 (Calc++ Parser): Likewise.
91661ebb 7628 (Decl Summary): Update names.
148d66d8 7629 (Table of Symbols): Update description.
34f98f46
JD
7630 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7631 (PERCENT_END_HEADER): ... this.
7632 (PERCENT_BEFORE_DEFINITIONS): Update to...
7633 (PERCENT_START_HEADER): ... this.
7634 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7635 (declaration): Update token names and m4 macro names.
7636 When parsing %end-header and %start-header, invoke translate_code
7637 before muscle_code_grow, and no longer set global booleans to remember
7638 whether these declarations have been seen.
7639 Parse new %after-header and %before-header.
7640 * src/reader.c (before_definitions, after_definitions): Remove.
7641 (prologue_augment): Accept a new bool argument to specify whether to
7642 augment the pre-prologue or post-prologue.
7643 * src/reader.h (before_definitions, after_definitions): Remove these
7644 extern's.
7645 (prologue_augment): Add new bool argument.
7646 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7647 (PERCENT_END_HEADER): ... this.
7648 (PERCENT_BEFORE_DEFINITIONS): Update to...
7649 (PERCENT_START_HEADER): ... this.
7650 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7651 * tests/actions.at (Printers and Destructors): Update names.
7652
31b2b07e
JD
76532006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7654
7655 Add comparison operators for C++ location classes. Discussed at
7656 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7657 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7658 declaration indicating whether filename_type has an operator==. If
7659 filename_type is `std::string', it defaults to `1', `0' otherwise.
7660 * data/location.cc: Iff b4_define_location_comparison is `1', add
7661 operator== and operator!= for class position and for class location.
7662
7663 Some minor fixes.
7664 * src/scan-action.l: Remove unused file.
7665 * src/symtab.c (symbol_printer_set): Use printer_location not
7666 destructor_location.
7667 * src/symtab.h (struct symbol): Replace incorrect source comment for
7668 printer members.
7669 * tests/input.at (Incompatible Aliases): Update output with correct
7670 printer location.
7671
9bc0dd67
JD
76722006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7673
7674 Don't put the pre-prologue in the header file. For the yacc.c code
7675 file and the glr.c header and code files, move the pre-prologue before
7676 the token definitions. Add new %before-definitions and
7677 %after-definitions to declare code that will go in both the header file
7678 and code file. Discussed at
7679 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7680 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7681 and
7682 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7683 * NEWS (2.3+): Describe these changes.
7684 * data/glr.c (b4_pre_prologue): Move from within to before...
7685 (b4_shared_declarations): ... this.
7686 Add new b4_before_definitions before b4_token_enums.
7687 Add new b4_after_definitions at the end.
7688 * data/glr.cc (b4_pre_prologue): Replace with...
7689 (b4_before_definitions): ... this in the header file.
7690 (b4_after_definitions): New near the end of the header file.
7691 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7692 code file right before including the header file.
7693 (b4_before_definitions): New in the previous position of
7694 b4_pre_prologue in the header file.
7695 (b4_after_definitions): New near the end of the header file.
7696 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7697 (b4_token_enums_defines): In the code file, move to right before
7698 YYSTYPE for consistency with the header file.
7699 (b4_before_definitions): New right before b4_token_enums_defines in
7700 both the header and code file.
7701 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7702 header and code file.
7703 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7704 of prologues for %union dependencies.
91661ebb
JD
7705 (Decl Summary): In %defines description, mention the effect of
7706 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
7707 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7708 than in the pre-prologue so that make check succeeds.
148d66d8 7709 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
7710 %after-definitions.
7711 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7712 %before-definitions.
7713 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7714 (declaration): Parse those declarations and append to
7715 b4_before_definitions and b4_after_definitions, respectively.
7716 * src/reader.c (before_definitions, after_definitions): New bools to
7717 track whether those declarations have been seen.
7718 (prologue_augment): Add to the post-prologue if %union,
7719 %before-definitions, or %after-definitions has been seen.
7720 * src/reader.h (before_definitions, after_definitions): New extern's.
7721 * src/scan-gram.l: Scan the new declarations.
7722 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7723 prologue block in a %before-definitions or a %after-definitions based
7724 on whether the %union is declared.
7725 * tests/regression.at (Early token definitions with --yacc, Early token
7726 definitions without --yacc): Move tests for token definitions into the
7727 post-prologue since token names are no longer defined in the
7728 pre-prologue.
7729
203b9274
AD
77302006-06-20 Akim Demaille <akim@epita.fr>
7731
7732 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7733 (symbol_get): Use it.
7734 * src/parse-gram.y: Use it.
7735
a7ee59cf
JD
77362006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7737
7738 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7739 build succeeds when configured with --enable-gcc-warnings.
7740
5a2baae7
PE
77412006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7742
33ad1a9c
PE
7743 * src/parse-gram.y (char_name): New function.
7744 (CHAR, STRING, string_content): For %printer, properly escape.
7745 (ID): Prefer fputs to fprintf.
7746 (id): Reindent to be consistent with other rules.
7747 Properly quote char.
7748
5a2baae7
PE
7749 The Translation Project changed its way of publishing translations
7750 to maintainers. I haven't received any responses to my request
7751 for supporting the old way, or for documenting the new way. I
7752 have modified 'bootstrap' to use screen scraping
7753 (in this case, HTML scraping). This is unreliable and inelegant,
7754 but I don't see any better way. Yuck.
7755 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7756 (get_translations): New function, which uses HTML scraping to
7757 deduce locations of latest translations.
7758 Use this function to grab both bison and bison-runtime .po files.
7759 Don't bother priming the pump for the runtime-po domain any more,
7760 as it's now translated better than bison is.
7761
58d7a1a1
AD
77622006-06-19 Akim Demaille <akim@epita.fr>
7763
7764 * src/scan-gram.l: No longer "parse" things after `%union' until
7765 `{'. Rather, return a single "%union" token.
7766 No longer make symbols: return strings, and leave the conversion
7767 to symbols to the parser.
7768 (SC_PRE_CODE, token_type): Remove.
7769 * src/parse-gram.y (%union): New field `character'.
7770 Sort tokens.
7771 (CHAR): New token.
7772 (ID, ID_COLON): Now that the scanner no longer makes them
7773 identifiers, adjust all uses to invoke symbol_get.
7774 (id_colon): New, wraps the conversion from string to symbol.
7775 (%union): Accept a possible union_name.
7776 (symbol): Now can be a char.
7777 * data/c.m4 (b4_union_name): Leave a default value.
7778 * data/glr.c, data/yacc.c: Use it.
7779
b931235e
JD
77802006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7781
7782 For associating token numbers with token names for "yacc.c", don't use
7783 #define statements unless `--yacc' is specified; always use enum
7784 yytokentype. Most important discussions start at:
7785 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7786 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7787 and
7788 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7789 * NEWS (2.3+): Mention.
7790 * data/c.m4 (b4_yacc_if): New.
7791 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7792 token #define's.
7793 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7794 on token name definitions.
7795 * src/getargs.c (usage): Capitalize `Yacc' in English.
7796 * src/output.c (prepare): Define b4_yacc_flag.
7797 * tests/regression.at (Early token definitions): Test that tokens names
7798 are defined before the pre-prologue not just before the post-prologue.
7799 Remove this test case and copy to...
7800 (Early token definitions with --yacc): ... this to test #define's.
7801 (Early token definitions without --yacc): ... and this to test enums.
7802
9e6e7ed2
PE
78032006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7804
7805 * NEWS: Reword the post-2.3 change to not be so optimistic about
7806 removing the old "look-ahead" spelling.
7807 Update previous look-ahead/lookahead change reports.
7808 * REFERENCES: look-ahead -> lookahead (since that's
7809 what he actually wrote).
7810 * doc/refcard.tex: look ahead -> lookahead,
7811 look-ahead -> lookahead
7812
742e4900
JD
78132006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7814
7815 For consistency, use `lookahead' instead of `look-ahead' or
7816 `look_ahead'. Discussed starting at
7817 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7818 and then at
7819 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7820 * NEWS: For the next release, note the change to `--report'.
7821 * TODO, doc/bison.1: Update English.
7822 * doc/bison.texinfo: Update English.
7823 (Understanding Your Parser, Bison Options): Document as
7824 `--report=lookahead' rather than `--report=look-ahead'.
7825 * src/conflicts.c: Update English in comments.
7826 (lookahead_set): Rename from look_ahead_set.
7827 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7828 (resolve_sr_conflict): Rename local look_ahead_tokens to
7829 lookahead_tokens, and update other uses.
7830 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7831 count_rr_conflicts, conflicts_free): Update uses.
7832 * src/getargs.c (report_args): Move "lookahead" before alternate
7833 spellings.
7834 (report_types): Update uses.
7835 (usage): For `--report' usage description, state `lookahead' spelling
7836 rather than `look-ahead'.
7837 * src/getargs.h (report.report_lookahead_tokens): Rename from
7838 report_look_ahead_tokens.
7839 * src/lalr.c: Update English in comments.
7840 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7841 (state_lookahead_tokens_count): Rename from
7842 state_look_ahead_tokens_count.
7843 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7844 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7845 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7846 Update other uses.
7847 Update English in output.
7848 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7849 * src/print.c: Update English in comments.
7850 (lookahead_set): Rename from look_ahead_set.
7851 (print_reduction): Rename argument lookahead_token from
7852 look_ahead_token.
7853 (print_core, state_default_rule, print_reductions, print_results):
7854 Update uses.
7855 * src/print_graph.c: Update English in comments.
7856 (print_core): Update uses.
7857 * src/state.c: Update English in comments.
7858 (reductions_new): Update uses.
7859 (state_rule_lookahead_tokens_print): Rename from
7860 state_rule_look_ahead_tokens_print, and update other uses.
7861 * src/state.h: Update English in comments.
7862 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7863 (state_rule_lookahead_tokens_print): Rename from
7864 state_rule_look_ahead_tokens_print.
7865 * src/tables.c: Update English in comments.
7866 (conflict_row, action_row): Update uses.
7867 * tests/glr-regression.at
7868 (Incorrect lookahead during deterministic GLR,
7869 Incorrect lookahead during nondeterministic GLR): Rename
7870 print_look_ahead to print_lookahead.
7871 * tests/torture.at: Update English in comments.
7872 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7873 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7874 (Many lookahead tokens): Update uses.
7875 * data/glr.c: Update English in comments.
7876 * lalr1.cc: Likewise.
7877 * yacc.c: Likewise.
7878 * src/conflicts.h: Likewise.
7879 * src/lalr.h: Likewise.
7880 * src/main.c: Likewise.
7881 * src/output.c: Likewise.
7882 * src/parse-gram.c: Likewise.
7883 * src/tables.h: Likewise.
7884 * tests/calc.at: Likewise.
7885
3c40d0b5
JD
78862006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7887
7888 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7889
5d278082
PE
78902006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7891
7892 * TODO: Add request from Nelson H. F. Beebe to be able to install
7893 Bison without installing the yacc script.
7894
9e668899
JD
78952006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7896
7897 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7898 and yytext if they're already #define'd.
7899 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7900 * src/scan-code-c.c: ... here.
7901 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7902 <config.h>.
7903
0c8e079f
JD
79042006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7905
7906 Get Bison to build again when configured with --enable-gcc-warnings.
7907 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7908 missing #include's.
7909 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7910 loc argument as it shadows a global.
7911 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7912 invocation.
7913
7914 * src/.cvsignore: Add scan-code.c.
7915
2346344a
AD
79162006-06-07 Akim Demaille <akim@epita.fr>
7917
7918 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7919 to...
7920 * src/scan-code.l: here.
7921 * tests/input.at (Torturing the Scanner): Fix another location
7922 error.
7923
4862bdfd
AD
79242006-06-07 Akim Demaille <akim@epita.fr>
7925
7926 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7927
e9071366
AD
79282006-06-06 Akim Demaille <akim@epita.fr>
7929
7930 Extract the parsing of user actions from the grammar scanner.
7931 As a consequence, the relation between the grammar scanner and
7932 parser is much simpler. We can also split "composite tokens" back
7933 into simple tokens.
7934 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7935 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7936 rename as...
7937 * src/location.h, src/location.c (add_column_width)
7938 (location_compute): these.
7939 Fix the column count: the initial column is 0.
7940 (location_print): Be robust to ending column being 0.
7941 * src/location.h (boundary_set): New.
7942 * src/main.c: Adjust to scanner_free being renamed as
7943 gram_scanner_free.
7944 * src/output.c: Include scan-code.h.
7945 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7946 Use boundary_set.
7947 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7948 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7949 which is now, again, a separate token.
7950 Adjust all dependencies.
7951 Whereever actions with $ and @ are used, use translate_code.
7952 (action): Remove this nonterminal which is now useless.
7953 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7954 (grammar_current_rule_action_append): Use translate_code.
7955 (packgram): Bound check ruleno, itemno, and rule_length.
7956 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7957 (last_string, last_braced_code_loc, max_left_semantic_context)
7958 (scanner_initialize, scanner_free, scanner_last_string_free)
7959 (gram_out, gram_lineno, YY_DECL_): Move to...
7960 * src/scan-gram.h: this new file.
7961 (YY_DECL): Rename as...
7962 (GRAM_DECL): this.
7963 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7964 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7965 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7966 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7967 Move these declarations, and...
7968 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7969 these to...
7970 * src/flex-scanner.h: this new file.
7971 * src/scan-gram.l (rule_length, rule_length_overflow)
7972 (increment_rule_length): Remove.
7973 (last_braced_code_loc): Rename as...
7974 (gram_last_braced_code_loc): this.
7975 Adjust to the changes of the parser.
7976 Move all the handling of $ and @ into...
7977 * src/scan-code.l: here.
7978 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7979 (handle_action_dollar, handle_action_at): Move to...
7980 * src/scan-code.l: here.
7981 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7982 scan-code.h, scan-code-c.c, scan-gram.h.
7983 (EXTRA_bison_SOURCES): Add scan-code.l.
7984 (BUILT_SOURCES): Add scan-code.c.
7985 (yacc): Be robust to white spaces.
7986
7987 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7988 * tests/regression.at: Adjust the column numbers.
7989 * tests/regression.at: Adjust the error message.
7891a7c4 7990
184e42f0
JD
79912006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7992
7993 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7994 Use Akim's wording from
7995 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7996
7891a7c4
JD
79972006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7998
7999 Between Bison releases, manually append `+' to the previous Bison
8000 release number, and use that as a signal to automatically print the
8001 ChangeLog's CVS Id keyword from --version. Discussed starting at
8002 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8003 * ChangeLog: Add Id header.
8004 * configure.ac (AC_INIT): Append `+' to `2.3'.
8005 * src/.cvsignore: Add revision.c.
8006 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8007 (BUILT_SOURCES): Add revision.c.
8008 (revision.c): New target rule. This file defines a new global variable
8009 named revision. It initializes it with either the Id from ChangeLog
8010 or, if VERSION doesn't contain `+', with the empty string.
8011 * src/getargs.c (version): Print the value of revision.
8012 * src/revision.h: Extern revision.
8013
4ad3ed84
PE
80142006-06-05 Paul Eggert <eggert@cs.ucla.edu>
8015
8016 * NEWS: Version 2.3.
8017 * configure.ac (AC_INIT): Likewise.
8018
02103984
PE
80192006-05-30 Paul Eggert <eggert@cs.ucla.edu>
8020
8021 * data/glr.c (YYRECOVERING): Define to be a function-like macro
8022 with no arguments, not as an object-like macro. This is for
8023 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
8024 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
8025 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
8026 Document this.
8027
2c08afa5
JD
80282006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
8029
8030 * src/getargs.c (usage): Back out yesterday's modification of the
8031 --help output so that we don't have to wait for translation before
8032 releasing 2.3.
8033
6077da58
PE
80342006-05-29 Paul Eggert <eggert@cs.ucla.edu>
8035
8036 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
8037 Problem reported by Akim Demaille.
8038
2a26b6c2
JD
80392006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
8040
8041 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8042
aefef0d6
PE
80432006-05-26 Paul Eggert <eggert@cs.ucla.edu>
8044
8045 * data/yacc.c (yy_reduce_print): Omit trailing white space in
8046 generated source code. Problem reported by Frans Englich in
8047 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
8048
fcd8e201
PE
80492006-05-22 Paul Eggert <eggert@cs.ucla.edu>
8050
8051 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
8052 shell, not within 'make', so that 'make' by an ordinary builder
8053 (using GNU make) does not worry about configuring gzip. This also
8054 works around a bug reported independently by Keith Thompson and by
8055 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
8056 stderr rather than stdout, messing up the build logs.
8057
7b5cdcbd
JD
80582006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8059
8060 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
8061 to make sure that YYID will never be unused. This fixes a 'make
8062 maintainer-check' failure caused by the recent changes to the 'Trivial
8063 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
8064 not used.
8065 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
8066
5ad0a449
JD
80672006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8068
8069 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
8070 state before an empty RHS is always resolved here. Only the location
8071 of that state is guaranteed to be resolved, and that's enough. This
8072 fixes the remaining bug reported by Derek M. Jones in
8073 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8074 * tests/glr-regression.at (Uninitialized location when reporting
8075 ambiguity): Test the above case.
8076 Also, the embedded comments in this test case claim it checks the case
8077 of an empty RHS that has inherited the initial location. However, the
8078 corresponding LHS was already resolved, so yyresolveLocations didn't
8079 actually have reason to modify it. Fix this by forcing
8080 nondeterministic operation at the beginning of the parse.
8081
50cce58e
PE
80822006-05-20 Paul Eggert <eggert@cs.ucla.edu>
8083
8084 * data/c.m4 (b4_yy_symbol_print_generate):
8085 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
8086 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
8087 of the bugs reported today by Derek M Jones in
8088 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8089 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
8090 defined to be a type name without parens or brackets.
8091 (Location Type): Similarly for YYLTYPE.
8092 * tests/regression.at (Trivial grammars): Put in a test for this
8093 bug that will be caught by 'make maintainer-check' (though not,
8094 alas, by 'make check' unless your compiler is picky).
8095
ab8d9dc5
PE
80962006-05-19 Paul Eggert <eggert@cs.ucla.edu>
8097
0d2c8934 8098 * NEWS: Version 2.2.
ab8d9dc5
PE
8099 * configure.ac (AC_INIT): Likewise.
8100
9138c575
JD
81012006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
8102
8103 * data/glr.c (yyreportTree): Make room in yystates for the state
8104 preceding the RHS. This fixes the segmentation fault reported by Derek
8105 M. Jones in
8106 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
8107 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
8108 to the user. Reported for yyreportTree by Derek M. Jones later in the
8109 same thread.
8110 * THANKS: Add Derek M. Jones.
8111 Update my email address.
8112 Fix typo in Steve Murphy's name.
8113
276f48df
PE
81142006-05-14 Paul Eggert <eggert@cs.ucla.edu>
8115
d6645148
PE
8116 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
8117 checking against YYLAST that caused the parser to miss a potential
8118 alternative in its diagnostic.
8119 Problem reported by Maria Jose Moron Fernandez in
8120 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
8121 * data/lalr1.cc (yysyntax_error_): Likewise.
8122 * data/yacc.c (yysyntax_error): Likewise.
8123 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
8124 tokens, in case we run into an older C compiler.
8125 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
8126 Use them to check for the off-by-one error fixed above.
8127
276f48df
PE
8128 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
8129 YYSIZE_T, not size_t.
8130 * tests/regression.at (Trivial grammars): New test, to catch
8131 the error fixed by the above patch.
8132
cd8b5791
AD
81332006-05-14 Akim Demaille <akim@lrde.epita.fr>
8134
8135 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
8136 scheme.
8137 Reported by Steve Murphy.
8138
34376418
AD
81392006-05-14 Akim Demaille <akim@lrde.epita.fr>
8140
8141 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
8142 * data/glr.cc: b4_location_flag is now b4_locations_flag.
8143
327afc7c
AD
81442006-05-14 Akim Demaille <akim@lrde.epita.fr>
8145
8146 Implement --trace=m4.
8147 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
8148 * src/output.c (output_skeleton): When set, pass -dV to m4.
8149
8150 Factor the handling of flags in m4.
8151 * src/output.c (prepare): Rename the muscle names debug, defines,
8152 error_verbose to debug_flag, defines_flag, error_verbose_flag.
8153 * data/c.m4: Adjust.
8154 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
8155 Use b4_define_flag_if to define other b4_FLAG_if macros.
8156 (b4_location_if): As a consequence, rename as...
8157 (b4_locations_if): this, for consistency.
8158 Adjust all the skeletons.
8159
ba9ecd19
AD
81602006-05-14 Akim Demaille <akim@lrde.epita.fr>
8161
8162 * etc/bench.pm: Shorten bench names.
8163
4e83ea15
AD
81642006-05-14 Akim Demaille <akim@lrde.epita.fr>
8165
8166 * src/output.h, src/output.c (error_verbose): Move to...
8167 * src/getargs.h, src/getargs.c: here.
8168 Sort the flags.
8169 Adjust dependencies.
8170
6e93d810
PE
81712006-05-13 Paul Eggert <eggert@cs.ucla.edu>
8172
8173 * data/c.m4 (b4_copyright): Put the special exception for Bison
8174 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
8175 uses changed. Suggested by Akim Demaille. Also, wrap the
8176 copyright notice, in case it is longer than 80 columns. Replace
8177 comma by newline after title.
6e93d810 8178
eaea13f5
PE
81792006-05-11 Paul Eggert <eggert@cs.ucla.edu>
8180
8181 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
8182 incompatibility, not a bug. Mention that it wasn't fixed as of
8183 flex 2.5.33.
8184
3cf084ec
AD
81852006-05-11 Akim Demaille <akim@lrde.epita.fr>
8186
8187 * examples/extexi: Enforce the precedence of concatenation over
8188 >>.
0a9f1c7d 8189 Reported by Tommy Nordgren.
3cf084ec 8190
32c96bd7
AD
81912006-05-11 Akim Demaille <akim@lrde.epita.fr>
8192
8193 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
8194 with the member "token".
f94705b2 8195 Reported by Martin Nylin.
32c96bd7 8196
eaea13f5
PE
81972006-05-08 Paul Eggert <eggert@cs.ucla.edu>
8198
8199 * data/glr.c: Switch to Bison 2.2 special-exception language in
8200 the copyright notice. Use more-regular format for titles and
8201 copyright notices.
8202 * data/glr.cc: Likewise.
8203 * data/location.cc: Likewise.
8204 * data/yacc.cc: Likewise.
8205 * doc/bison.texinfo (Conditions): Document this.
8206 * NEWS: likewise. Upgrade version to 2.2.
8207
6e2d1146
AD
82082006-04-27 Akim Demaille <akim@lrde.epita.fr>
8209
8210 * data/glr.cc: Remove dead code.
8211
47671055
PE
82122006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8213
8214 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8215 that variable and the line breaks the bootstrap. Problem reported
8216 by Juan M. Guerrero.
8217
ed2e6384
AD
82182006-04-24 Akim Demaille <akim@lrde.epita.fr>
8219
8220 * doc/bison.texinfo (Multiple start-symbols): New.
8221
3cedc2dc
AD
82222006-04-24 Akim Demaille <akim@lrde.epita.fr>
8223
8224 * etc/README, etc/bench.pl: New.
8225
b2ddc3f3
AD
82262006-04-03 Akim Demaille <akim@lrde.epita.fr>
8227
8228 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8229 rule.
8230 Reported by Mickael Labau.
8231 * tests/input.at (Torturing the Scanner): Test it.
8232
91e3ac9a
PE
82332006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8234
8235 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8236 Problem reported by Bob Rossi.
8237
82382006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8239
8240 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8241 and didn't really work.
8242 For the index, use @ifnotinfo, not @iftex.
8243 Minor cleanups of spacing and terminology.
8244
5cf61e93
AD
82452006-03-12 Akim Demaille <akim@lrde.epita.fr>
8246
8247 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8248 of AT_NAME_PREFIX when %name-prefix is not used.
8249
aa08666d
AD
82502006-03-12 Akim Demaille <akim@lrde.epita.fr>
8251
8252 Apply --prefix to C++ skeletons too: they change the namespace.
8253 The test suite already exercize these cases.
8254 * data/c++.m4 (b4_namespace): New.
8255 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8256 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8257 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8258 * doc/bison.texinfo: Document it.
8259 (Option Cross Key): Use @multitable in all formats. It looks
8260 nicer, even in TeX outputs.
8261 (Rules): Use the same code whatever the output type is.
8262 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8263 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8264 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 8265
45567173
AD
82662006-03-10 Akim Demaille <akim@lrde.epita.fr>
8267
8268 * TODO: Remove dead items.
8269
e9d8f881 82702006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
8271
8272 * doc/FAQ: Remove, merged into...
8273 * doc/bison.texinfo (FAQ): this.
8274 * doc/Makefile.am (EXTRA_DIST): Adjust.
8275
c095d689
AD
82762006-03-10 Akim Demaille <akim@lrde.epita.fr>
8277
8278 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8279 even if empty.
8280 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8281 * doc/bison.texinfo (Calc++ Scanner): Use it.
8282
6e0f8287
PE
82832006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8284
8285 Fix two nits reported by twlevo, plus one more that I discovered.
8286
8287 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8288 this is the usual Bison style.
8289 * src/location.h (location_print): Likewise.
8290
8291 * src/reader.h (token_name): Likewise.
8292
d6b771c3
PE
82932006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8294
8295 Fix some nits reported by twlevo.
8296 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8297 and "POSIX". Use more-modern syntax for URLs. Mention C++
8298 and ask for Java. Don't hardwire OS version numbers. Add
8299 copyright notice.
8300 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8301 * src/conflicts.c (solved_conflicts_obstack): Now static.
8302
1e137b71
JD
83032006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8304
8305 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8306 page. Say "you can use it" not "you may use it" as on the web page;
8307 we're describing capabilities not granting permission.
8308
73f2e47e
PE
83092006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8310
6d05403d
PE
8311 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8312 shadowing warnings. Use usual patter for iterating through RHS.
8313 * tests/glr-regression.at
8314 (Uninitialized location when reporting ambiguity):
8315 Modify yylex so that it uses its argument, rather than trying
8316 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8317 const char -> char const.
8318
73f2e47e
PE
8319 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8320 Don't use tabs inside commands; it messes up 'ps'.
8321 Problem reported by twlevo.
8322
8710fc41
JD
83232006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8324
8325 * tests/glr-regression.at (Uninitialized location when reporting
8326 ambiguity): New test case.
8327 * data/glr.c (yyresolveLocations): New function, which uses
8328 YYLLOC_DEFAULT.
8329 (yyresolveValue): Invoke yyresolveLocations before reporting an
8330 ambiguity.
8331 * doc/bison.texinfo (Default Action for Locations): Note
8332 YYLLOC_DEFAULT's usage for ambiguity locations.
8333 (GLR Semantic Actions): Cross-reference those notes.
8334
ae952af2
JD
83352006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8336
8337 * tests/glr-regression.at (Leaked semantic values when reporting
8338 ambiguity): Remove unnecessary union and type declarations.
8339 (Leaked lookahead after nondeterministic parse syntax error): New test
8340 case.
8341 * data/glr.c (yyparse): Check for zero stacks remaining before
8342 attempting to shift the lookahead so that you don't lose it.
8343
35ee866a
JD
83442006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8345
8346 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8347 * tests/glr-regression.at (Leaked semantic values when reporting
8348 ambiguity): New test case.
8349 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8350 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8351 now unnecessary yystackp parameter.
8352 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8353 destructors can be called.
8354
8355 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8356 in existing testcases.
8357
520181ab
JD
83582006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8359
8360 Don't leak semantic values for parent RHS when a user action cuts the
8361 parser, and clean up related code a bit.
8362 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
8363 cuts parse): Rename to...
8364 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
8365 for leaked parent RHS values.
8366 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8367 between an unresolved state (non-empty chain of semantic options) and
8368 an incomplete one (signaled by an empty chain).
ae952af2 8369 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
8370 successfully or unsuccessfully resolved yyGLRState to...
8371 (yyresolveValue): ... here so that yyresolveValue always leaves a
8372 yyGLRState with consistent data and thus is easier to understand.
8373 Remove the yyvalp and yylocp parameters since they are always just
8374 taken from the yys parameter. When reporting a discarded merged value
8375 in debugging output, note that it is incompletely merged. Document the
8376 interface.
8377 (yyresolveAction): If resolving any of the RHS states fails, destroy
8378 them all rather than leaking them. Thus, as long as user actions are
8379 written to clean up the RHS correctly, yyresolveAction always cleans up
8380 the RHS of a semantic option. Document the interface.
8381
18d9185c
PE
83822006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8383
8384 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8385 led to a segmentation fault in GNU Pascal. Problem reported
8386 by Waldek Hebisch.
8387
841a7737
JD
83882006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8389
8390 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8391 mid-rule action inside a nonterminal symbol in order to declare a
8392 destructor for its semantic value.
8393
fc3f467f
PE
83942006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8395
8396 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8397 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8398 __cplusplus && ! defined _STDLIB_H && !
8399 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8400 defined free))]: Include <stdlib.h> rather than rolling our own
8401 declarations of malloc and free, to avoid problems with
8402 incompatible declarations (using 'throw') C++'s stdlib.h. This
8403 should fix Debian bug 340012
8404 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8405 reported by Guillaume Melquiond.
8406
a3af26dd
PE
84072006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8408
4d7bc38c
PE
8409 * NEWS: Clarify symbols versus types in unused-value warnings.
8410
a3af26dd
PE
8411 * configure.ac (AC_INIT): Bump version number.
8412
4e26c69e
PE
84132006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8414
8415 * NEWS: Version 2.1a.
8416 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8417 since C99 requires this.
8418
498e897c
PE
84192006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8420
8421 * m4/c-working.m4: New file.
8422 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8423
57bb17ca
PE
84242006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8425
8426 * Makefile.maint: Merge from coreutils.
8427
0be105dc
PE
84282006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8429
8430 More portability fixes for problems summarized by Nelson H. F. Beebe.
8431
8432 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8433 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8434 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8435 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8436 messes up because C++ code is compiled in 32-bit mode but linked
8437 in 64-bit mode.
8438
6fc0c024
PE
84392006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8440
8441 More portability fixes for problems summarized by Nelson H. F. Beebe.
8442
7870f699
PE
8443 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8444 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8445
6fc0c024
PE
8446 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8447 nodist_PROGRAMS, since we don't need to actually compile the
8448 example if we're just doing a plain 'make'. This avoids bothering
8449 the installer unnecessarily about problems due to weird C++
8450 compilers.
8451
fe6c2fde
PE
84522006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8453
8454 More portability fixes for problems summarized by Nelson H. F. Beebe.
8455
8456 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8457 than #include "...", and compile with -I'.'. The old method was
8458 not portable, according to Posix and the C standard, and it does
8459 not work with Sun C 5.7, where previous #line directives affect
8460 the working directory used in later #include "..." directives.
8461
927b425b
JMG
84622006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8463
8464 Various DJGGP specific issues in /djgpp
8465
d9735e9e
PE
84662006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8467
8468 More portability fixes for problems summarized by Nelson H. F. Beebe.
8469
8470 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8471 '#include <map>' works and that you can apply ++ to iterators.
8472
5a6755af
PE
84732006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8474
67a0dc4f
PE
8475 Work around portability problems summarized by Nelson H. F. Beebe in
8476 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8477
8c86f0ef
PE
8478 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8479 that '#include <string>' works.
8480
de35dd59
PE
8481 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8482 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8483 "warning: sorry: semantics of inline function static data `const
8484 unsigned char translate_table[262]' are wrong (you'll wind up with
8485 multiple copies)".
8486
67a0dc4f
PE
8487 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8488 or, xor to not_, and_, or_, and xor_, respectively. This works
8489 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8490 random system header somewhere that includes the equivalent of
8491 <iso646.h>.
8492
5a6755af
PE
8493 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8494 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 8495 Suite Version 2.0.
5a6755af 8496
3f001415
JD
84972006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8498
8499 During deterministic GLR operation, user actions should be able to
8500 influence the parse by changing yychar. To make this easier to fix and
8501 to make glr.c easier to evolve in general, don't maintain yytoken in
8502 parallel with yychar; just compute yytoken when needed.
8503 * tests/glr-regression.at (Incorrect lookahead during deterministic
8504 GLR): Check that setting yychar in a user action has the intended
8505 effect.
8506 * data/glr.c (yyGLRStack): Remove yytokenp member.
8507 (yyclearin): Don't set *yytokenp.
8508 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8509 yychar rather than *yytokenp to determine the current lookahead.
8510 Compute yytoken locally when needed.
8511 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8512 point to.
8513
8514 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8515 after `--report' documentation.
8516
e2a8c0f5
PE
85172006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8518
8519 * src/parse-gram.y (grammar_declaration): Location of printer
8520 symbol is @1, not list->location. Bug reported by twlevo.
8521 * tests/input.at (Incompatible Aliases): Adjust to above change.
8522
6b702268
PE
85232006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8524
27622431
PE
8525 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8526 all the test at once. This makes the output easier to read in the
8527 normal case.
8528
6b702268
PE
8529 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
8530 got from <http://bro-ids.org/download.html>. The bug is that
8531 when two actions appeared in succession, the second one was
8532 scanned before the first one was added to the grammar rule
8533 as a midrule action. Bison then output the incorrect warning
8534 "parse.y:905.17-906.36: warning: unused value: $3".
8535 * src/parse-gram.y (BRACED_CODE, action): These are no longer
8536 associated with a value.
8537 (rhs): Don't invoke grammar_current_rule_action_append.
8538 (action): Invoke it here instead.
8539 * src/reader.c (grammar_midrule_action): Now extern.
8540 (grammar_current_rule_action_append): Don't invoke
8541 grammar_midrule_action; that is now the scanner's job.
8542 * src/reader.h (last_string, last_braced_code_loc):
8543 (grammar_midrule_action): New decls.
8544 * src/scan-gram.l (last_string): Now extern, sigh.
8545 (last_braced_code_loc): New extern variable.
8546 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
8547 rule already has an action.
8548 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
8549 * tests/input.at (AT_CHECK_UNUSED_VALUES):
8550 Add some tests to check that the above changes fixed the bug.
8551
d40ba6c2
PE
85522006-01-27 Paul Eggert <eggert@cs.ucla.edu>
8553
8554 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
8555 All used changed. Check whether the symbol has a destructor,
8556 not whether it is typed.
8557 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
8558 that the values are still reported as unused. All line numbers
8559 adjusted.
8560
401aace6
PE
85612006-01-23 Paul Eggert <eggert@cs.ucla.edu>
8562
8563 Work around a bug in bro 0.8, which underparenthesizes its
8564 definition of YYLLOC_DEFAULT.
8565 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
8566 their arguments.
8567 * data/lalr1.cc: Likewise.
8568 * data/yacc.cc: Likewise.
8569
06f01bc4
PE
85702006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8571
401aace6
PE
8572 Work around a bug in Pike 7.0, and give the Pike folks a
8573 better way to override the usual int widths.
8574 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
8575 user can override the types.
8576 (short): #undef, to work around a bug in Pike 7.0.
8577 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
8578 (union yyalloc.yyss): Use yytype_int16 rather than short.
8579 All uses changed.
8580 (yysigned_char): Remove.
8581 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
8582 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
8583 * tests/regression.at (Web2c Actions): Adjust to above changes.
8584
8585 * src/reader.c (check_and_convert_grammar): New function.
8586 (reader): Close the input file even if something went wrong during
8587 parsing. Minor file descriptor leak reported by twlevo.
8588
06f01bc4
PE
8589 * src/assoc.c (assoc_to_string): Use a default: abort (); case
8590 to pacify gcc -Wswitch-default.
8591 * src/scan-gram.l (adjust_location): Use a default: break; case
8592 to pacify gcc -Wswitch-default.
8593 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
8594 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8595 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8596 Move these decls to scan-skel.l, since they don't need to be
8597 visible elsewhere.
8598 * src/scan-skel.l: Accept the above decls.
8599 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
8600 is used.
8601
02650b7f
PE
86022006-01-21 Paul Eggert <eggert@cs.ucla.edu>
8603
8604 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
8605 since we don't want to insist on a version number at the start
8606 of the changelog every time.
8607 * Makefile.maint: Sync from coreutils a bit better.
8608 (sc_trailing_blank): Renamed from sc_trailing_space.
8609 All uses changed.
8610 (sc_no_if_have_config_h, sc_require_config_h):
8611 (sc_prohibit_assert_without_use): New rules.
8612 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
8613 (sc_dd_max_sym_length): Fix leading spaces in rule.
8614 (sc_system_h_headers): Prefix with @.
8615 (sc_useless_cpp_parens, m4-check): Output line numbers.
8616 (changelog-check): Allow version only in head.
8617 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
8618 satisfy new Makefile.maint rule.
8619 * data/glr.c: Likewise.
8620 * data/glr.cc: Likewise.
8621 * data/lalr1.cc: Likewise.
8622 * data/yacc.c: Likewise.
8623 * lib/ebitsetv.c: Likewise.
8624 * lib/lbitset.c: Likewise.
8625 * lib/subpipe.c: Likewise.
8626 * lib/timevar.c: Likewise.
8627 * src/system.h: Likewise.
8628 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8629 * djgpp/Makefile.maint: Add copyright notice.
8630 * djgpp/README.in: Likewise.
8631 * djgpp/config.bat: Likewise.
8632 * djgpp/config.site: Likewise.
8633 * djgpp/config_h.sed: Likewise.
8634 * djgpp/djunpack.bat: Likewise.
8635 * djgpp/config.sed: Fix copyright notice to match standard format.
8636 * djgpp/subpipe.h: Likewise.
8637 * lib/bitsetv-print.c: Likewise.
8638 * lib/bitsetv.c: Likewise.
8639 * lib/subpipe.h: Likewise.
8640 * lib/timevar.c: Likewise.
8641 * lib/timevar.h: Likewise.
8642 * djgpp/subpipe.c: Use standard recipe for config.h.
8643 * lib/abitset.c: Likewise.
8644 * lib/bitset.c: Likewise.
8645 * lib/bitset_stats.c: Likewise.
8646 * lib/bitsetv-print.c: Likewise.
8647 * lib/bitsetv.c: Likewise.
8648 * lib/ebitsetv.c: Likewise.
8649 * lib/get-errno.c: Likewise.
8650 * lib/lbitset.c: Likewise.
8651 * lib/subpipe.c: Likewise.
8652 * lib/timevar.c: Likewise.
8653 * lib/vbitset.c: Likewise.
8654 * tests/local.at: Likewise.
8655 * src/scan-gram.l: Don't include verify.h, since system.h does
8656 that for us.
8657 * .x-sc_require_config_h: New file.
8658 * .x-sc_unmarked_diagnostics: New file.
8659
287c78f6
PE
86602006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8661
287c78f6
PE
8662 Be a bit more systematic about using 'abort'.
8663 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8664 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8665 Put 'default: abort ();' before some other case, to satisfy older
8666 pedantic compilers.
8667 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8668 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8669 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8670 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
8671 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8672 (get_decision_str, get_orientation_str, get_node_alignment_str):
8673 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8674 (get_linestyle_str, get_arrowstyle_str): Likewise.
8675 * src/conflicts.c (resolve_sr_conflict):
8676 Use a default case rather than one for the one remaining enum
8677 value, to catch invalid enum values as well.
8678 * src/lalr.c (set_goto_map, map_goto):
8679 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8680 * src/nullable.c (nullable_compute, token_definitions_output):
8681 Likewise.
8682 * src/reader.c (packgram, reader): Likewise.
8683 * src/state.c (transitions_to, state_new, state_reduction_find):
8684 Likewise.
8685 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8686 (symbol_pack): Likewise.
8687 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
8688 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8689 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
8690 * src/system.h: Don't include <assert.h>.
8691 (assert): New macro.
8692
8693 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8694 (Destructor Decl, Parser Function, Pure Calling):
8695 Describe rules for braces inside C code more carefully.
287c78f6 8696
c66dfadd
PE
86972006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8698
c21493b8
PE
8699 Fix some porting glitches found by Nelson H. F. Beebe.
8700 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8701 compilers that don't understand that abort () does not return.
8702 * src/state.c (transitions_to): Likewise.
8703 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8704 that '#include <cstdlib>' works.
8705 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8706 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8707 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8708 for the benefit of some pre-C99 compilers.
8709
b6e3facf
PE
8710 * bootstrap: Undo changes to gnulib files that autoreconf made.
8711
c66dfadd
PE
8712 Minor fixups to get 'make maintainer-check' to work.
8713 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8714 with the new verify.h implementation.
8715 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8716 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8717 * data/yacc.c (YYUSE): Likewise.
8718 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8719 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8720 * src/parse-gram.y (declaration): Don't pass a string constant
8721 to a function that expects char *, since GCC might complain
8722 about the constant value.
8723 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8724 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8725 before #defining them.
8726 * tests/glr-regression.at
8727 (Incorrectly initialized location for empty right-hand side in GLR):
8728 In yyerror, use the msg arg.
8729 (Corrupted semantic options if user action cuts parse):
8730 (Incorrect lookahead during deterministic GLR):
8731 (Incorrect lookahead during nondeterministic GLR):
8732 Don't name a local var 'index'; it shadows string.h's 'index'.
8733
ed94ef2a
AD
87342006-01-19 Akim Demaille <akim@epita.fr>
8735
8736 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8737 location, not just parts of it.
8738
e9ad4aec
PE
87392006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8740
d6ca7905
PE
8741 * NEWS: Document the fact that multiple %unions are now allowed.
8742 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
8743 * TODO: This feature is now implemented, so remove it from
8744 the wishlist.
d6ca7905 8745
ef1b70e0
PE
8746 * Makefile.maint: Merge with coreutils Makefile.maint.
8747 (CVS_LIST): Use build-aux version if available.
8748 (VERSION_REGEXP): New macro.
8749 (syntax-check-rules): Add sc_no_if_have_config_h,
8750 sc_prohibit_assert_without_use, sc_require_config_h,
8751 sc_useless_cpp_parens.
8752 (sc_obsolete_symbols): Check for O_NDELAY.
8753 (sc_dd_max_sym_length): Track coreutils.
8754 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8755 (sc_useless_cpp_parens): New rule.
8756 (news-date-check): Look for version or today's date.
8757 (changelog-check): Don't require version number near head.
8758 (copyright-check): Use current year instead of hardwiring 2005.
8759 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8760 (announcement): Add --gpg-key-ID.
8761
8762 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8763 with "file system".
8764
2073ce56 8765 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
8766 array. Problem reported by twlevo.
8767 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8768 * src/lalr.c (build_relations): Rely on new sentinel.
8769 * src/gram.c (gram_free): Adjust to new sentinel.
8770
b7691f15
JD
87712006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8772
8773 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8774 yylookaheadNeeds. All uses updated.
8775 (yysplitStack): Rename local yynewLookaheadStatuses to
8776 yynewLookaheadNeeds.
8777 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8778 GLR): In comments, change `lookahead status' to `lookahead need'.
8779
ddee1b06
PH
87802006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8781
8782 * data/glr.c (yysplitStack): A little stylistic rewrite.
8783
12f4614d
PH
87842006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8785
8786 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8787
32c29292
JD
87882006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8789
8790 * doc/bison.texinfo: Fix some typos.
8791 (GLR Semantic Actions): New subsection discussing special
8792 considerations because GLR semantic actions might be deferred.
8793 (Actions): Mention look-ahead usage of yylval.
8794 (Actions and Locations): Mention look-ahead usage of yylloc.
8795 (Special Features for Use in Actions): Add YYEOF entry and mention it
8796 in the yychar entry.
8797 In the yychar entry, remove mention of the local yychar case (pure
8798 parser) since this is irrelevant information when writing semantic
148d66d8 8799 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
8800 yychar is otherwise described as an external variable.
8801 In the yychar entry, don't call it the `current' look-ahead since it
8802 isn't when semantic actions are deferred.
8803 In the yychar and yyclearin entries, add note about deferred semantic
8804 actions.
8805 Add yylloc and yylval entries discussing look-ahead usage.
8806 (Look-Ahead Tokens): When discussing yychar, don't call it the
8807 `current' look-ahead, and do mention yylval and yylloc.
8808 (Error Recovery): Cross-reference `Action Features' when mentioning
8809 yyclearin.
148d66d8 8810 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
8811 look-ahead.
8812 In the yylloc and yylval entries, mention look-ahead usage.
8813
de366a2f 88142006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
8815
8816 * tests/glr-regression.at: Update copyright year to 2006.
8817
bf70fa87
JD
88182006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8819
8820 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8821 use during nondeterministic operation to track which stacks have
8822 actually needed the current lookahead.
8823 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8824 Allocate, deallocate, resize, and otherwise shuffle space for
8825 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8826 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8827 appropriately during nondeterministic operation.
8828 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8829 members to store the current lookahead to be used by the deferred
8830 user action.
8831 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8832 from which the RHS is taken. Set the lookahead members of the new
8833 yySemanticOption according to the lookahead status for stack yyk.
8834 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8835 yyaddDeferredAction.
8836 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8837 members of yySemanticOption before invoking yyuserAction, and then set
8838 them back to their current values afterward.
8839 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8840 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8841 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8842 titles for consistency.
8843 (Leaked merged semantic value if user action cuts parse): In order to
8844 suppress lint warnings, use arguments in merge function, and assign
8845 char value < 128 in main.
8846 (Incorrect lookahead during deterministic GLR): New test case.
8847 (Incorrect lookahead during nondeterministic GLR): New test case.
8848
05449a2c
JD
88492006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8850
de366a2f 8851 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
8852 !yyvaluep as signal that no semantic value is available to print.
8853 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8854 to print a semantic value.
8855
4158e0a1 88562006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 8857
4158e0a1
JD
8858 * tests/glr-regression.at: For consistency with my newer test cases,
8859 don't thank myself.
8860
d659304d
JD
88612006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8862
8863 * data/glr.c (yyresolveValue): When merging semantic options, if at
8864 least one user action succeeds but a later one cuts the parse, then
8865 destroy the semantic value before returning rather than leaking it.
8866 (yyresolveStates): If a user action cuts the parse and thus
8867 yyresolveValue fails, ignore the (unset) semantic value rather than
8868 corrupting the yyGLRState, and empty the semantic options list since
8869 the user actions should have called all necessary destructors.
8870 Simplify code with YYCHK.
8871 * tests/glr-regression.at (Corrupted semantic options if user action
8872 cuts parse): New test case.
8873 (Undesirable destructors if user action cuts parse): New test case.
8874 Before applying any of this patch, this test case never actually failed
8875 for me... but only because the corrupted semantic options usually
8876 masked this bug.
8877 (Leaked merged semantic value if user action cuts parse): New test
8878 case.
8879
6ec2c0f2
AD
88802006-01-05 Akim Demaille <akim@epita.fr>
8881
8882 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8883
1b9c21fb
PE
88842006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8885
8886 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8887 _MSC_VER. Problem reported by Cenzato Marco.
8888 (b4_c_function_def): Use it.
8889 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8890 b4_c_modern.
8891 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8892 than rolling our own.
8893
84866159
AD
88942006-01-04 Akim Demaille <akim@epita.fr>
8895
8896 Also warn about non-used mid-rule values.
8897 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8898 member.
8899 (symbol_list_new): Adjust.
8900 * src/reader.c (symbol_typed_p): New.
8901 (grammar_rule_check): Use it.
8902 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8903 Check its rule.
8904 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8905 Use it.
8906 * tests/actions.at (Exotic Dollars): Adjust.
8907
378f4bd8
AD
89082006-01-04 Akim Demaille <akim@epita.fr>
8909
8910 * src/reader.c (grammar_midrule_action): If $$ is set in a
8911 mid-rule, move the `used' bit to its lhs.
8912 * tests/input.at (Unused values): New.
8913 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8914
e2a21b6f
PE
89152006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8916
54662697
PE
8917 * doc/bison.texinfo (Bison Options): Say more accurately what
8918 --yacc does.
8919 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8920 about declarations in the grammar when in Yacc mode, as POSIX does
8921 not require a diagnostic when the grammar uses extensions.
8922
8923 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8924
073f9288
PE
8925 Warn about dubious constructions like "%token T T".
8926 Reported by twlevo.
8927 * src/symtab.h (struct symbol.declared): New member.
8928 * src/symtab.c (symbol_new): Initialize it to false.
8929 (symbol_class_set): New arg DECLARING, specifying whether
8930 this is a declaration that we want to warn about, if there
8931 is more than one of them. All uses changed.
8932
1221b78a
PE
8933 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8934 Allow multiple %union directives, whose contents concatenate.
8935 * src/parse-gram.y (grammar_declaration): Likewise.
8936 Use muscle_code_grow, so that we don't need stype_line any more.
8937 All uses changed.
8938
8939 * src/muscle_tab.c (muscle_grow): Fix comment.
8940
e2a21b6f
PE
8941 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8942 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8943 Update copyright year to 2006.
8944
8f7e3cf9
AD
89452006-01-03 Akim Demaille <akim@epita.fr>
8946
8947 Have glr.cc pass (some of) the calc.at tests.
8948 * data/glr.cc (b4_parse_param_orig): New.
8949 (b4_parse_param): Improve its definition, and bound it more
8950 clearly in the skeleton.
8951 (b4_epilogue): Append, instead of prepending, in order to keep
8952 #line consistency.
8953 Simplify the generation of auxiliary functions: locations and
8954 purity are mandated.
8955 (b4_global_tokens_and_yystype): Honor it.
8956 * data/location.cc (c++.m4): Don't include it.
8957 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8958 and AT_SKEL_CC_IF.
8959 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8960 AT_LALR1_CC_IF.
8961 Be sure to initialize the first position's filename.
8962 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8963 mandated anyway.
8964 (AT_CHECK_CALC_GLR_CC): New.
8965 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8966
3953ed88
AD
89672006-01-02 Akim Demaille <akim@epita.fr>
8968
8969 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8970 c.m4.
0a96ba81 8971 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
8972 * data/glr.cc: Do not include stack.hh.
8973
9ecafbbf
AD
89742006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8975
8976 * data/glr.c: Reformat whitespace with tabs.
8977 (b4_lpure_formals): Remove this unused m4 macro.
8978 * tests/cxx-type.at: Reformat whitespace with tabs.
8979 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8980 since it's a member. Rename type to isNterm for clarity.
8981
c4d497a0
AD
89822005-12-29 Akim <akim@sulaco.local>
8983
8984 Let glr.cc catch up with symbol_value_print.
8985 * data/glr.cc (b4_yysymprint_generate): Replace by...
8986 (b4_yy_symbol_print_generate): this.
8987 (yy_symbol_print, yy_symbol_value_print): Declare them.
8988
4517da37
PE
89892005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8990
8991 * src/location.h (boundary): Note that a line or column equal
8992 to INT_MAX indicates an overflow.
8993 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8994 (rule_length_overflow, increment_rule_length, add_column_width):
8995 New functions.
8996 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8997 (<SC_BRACED_CODE>"}"):
8998 Use increment_rule_length rather than incrementing it by hand.
8999 (adjust_location, handle_syncline): Diagnose overflow.
9000 (handle_action_dollar, handle_action_at):
9001 Fix bug with monstrosities like $-2147483648.
9002 Remove now-unnecessary checks.
9003 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9004 (convert_ucn_to_byte): Verify assumptions.
9005 (handle_syncline): New arg LOC. All callers changed.
9006 Don't store through a value derived from char const * pointer.
9007
9008 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9009 GCC warnings.
9010
e3233bf6
PE
90112005-12-27 Paul Eggert <eggert@cs.ucla.edu>
9012
9013 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
9014 Remove unnecessary forward static decls.
9015
8f3596a6
AD
90162005-12-27 Akim Demaille <akim@epita.fr>
9017
9018 * src/reader.c (grammar_current_rule_check): Also check that $$
9019 is used.
9020 Take the rule to check as argument, hence rename as...
9021 (grammar_rule_check): this.
9022 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
9023 Rename as...
9024 (grammar_rule_begin, grammar_rule_end): these, for consistency.
9025 (grammar_midrule_action, grammar_symbol_append): Now static.
9026 * tests/torture.at (input): Don't rely on the default action
9027 being always performed.
9028 * tests/calc.at: "Set" $$ even when the action is "cut" with
9029 YYERROR or other.
9030 * tests/actions.at (Exotic Dollars): Instead of using unused
9031 values, check that the warning is issued.
9032
721be13c
PE
90332005-12-22 Paul Eggert <eggert@cs.ucla.edu>
9034
9035 * NEWS: Improve wording for unused-value warnings.
9036
a0af42fc
AD
90372005-12-22 Akim Demaille <akim@epita.fr>
9038
9039 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
9040 (b4_yysymprint_generate): Rename as...
9041 (b4_yy_symbol_print_generate): this.
9042 Generate yy_symbol_print instead of yysymprint.
9043 Generate also yy_symbol_value_print, and use it.
9044
affac613
AD
90452005-12-22 Akim Demaille <akim@epita.fr>
9046
721be13c 9047 * NEWS: Warn about unused values.
affac613
AD
9048 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
9049 a `used' member.
9050 (symbol_list_n_get, symbol_list_n_used_set): New.
9051 (symbol_list_n_type_name_get): Use symbol_list_n_get.
9052 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
9053 * src/reader.c (grammar_current_rule_check): Check that values are
9054 used.
9055 * src/symtab.c (symbol_print): Accept 0.
9056 * tests/existing.at: Remove the type information.
9057 Empty the actions.
9058 Remove useless actions (beware of mid-rule actions: perl -000
9059 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
9060 * tests/actions.at (Exotic Dollars): Use unused values.
9061 * tests/calc.at: Likewise.
9062 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9063 Likewise.
9064
9065 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
9066 rule_useful_p.
9067
9d9b8b70
PE
90682005-12-21 Paul Eggert <eggert@cs.ucla.edu>
9069
8bb4c753
PE
9070 Undo 2005-12-01 tentative license wording change. The wording is
9071 still being reviewed by the lawyers, and we don't want to wait for
9072 them before publishing a test release. For now, revert to the
9073 previous wording.
9074 * NEWS: Undo 2005-12-01 change.
9075 * data/glr.c: Revert to previous license wording.
9076 * data/glr.cc: Likewise.
9077 * data/lalr1.cc: Likewise.
9078 * data/location.cc: Likewise.
9079 * data/yacc.c: Likewise.
9080
9d9b8b70
PE
9081 * NEWS: Reword %destructor vs YYABORT etc.
9082 * data/glr.c: Use American spacing, for consistency.
9083 * data/glr.cc: Likewise.
9084 * data/lalr1.cc: Likewise.
9085 * data/yacc.c: Likewise.
9086 * data/yacc.c: Reformat comments slightly.
9087 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
9088 for consistency. Fix some spelling errors and reword recently-included
9089 text slightly.
9090 * tests/cxx-type.at: Cast results of malloc, for C++.
9091
2c3b392a
AD
90922005-12-21 Joel E. Denny <address@hidden>
9093
9094 * tests/cxx-type.at: Construct a tree, count the parents of shared
9095 nodes, and free each node once and only once. Previously, the memory
9096 for semantic values was leaked instead.
9097
d6cff4dc
AD
90982005-12-21 Joel E. Denny <address@hidden>
9099
9100 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
9101 (yylval, yylloc): If pure, #define to yystackp->yyval and
9102 yystackp->yyloc similar to yychar and yynerrs.
9103 (yyparse): If pure, remove local yylval and yylloc. Add local
9104 yystackp to accommodate pure definitions of yylval and yylloc.
9105 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
9106 yylvalp and yyllocp to &yylval and &yylloc.
9107 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
9108 namespace. Previously, nerrs and char were missing, but lval and lloc
9109 weren't necessary.
9110 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
9111 yylvalp and yyllocp parameters since, if pure, these are now always
9112 accessible through yystackp. If not pure, they are still accessible
9113 globally.
9114 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
9115 `if (YYID (N))' to pacify lint.
9116
a85284cf
AD
91172005-12-21 Akim Demaille <akim@epita.fr>
9118
9119 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
9120 destroy the RHS symbols of a rule.
9121 * data/yacc.c (yylen): Initialize to 0.
9122 Keep its value to the number of items to possibly shift.
9123 In particular, a regular successful parse that ends on YYFINAL by
9124 a (internal) YYACCEPT must not have yylen != 0.
9125 (yyerrorlab, yyreturn): Pop the RHS.
9126 Reorder a bit to emphasize the `shifting' bits of code.
9127 (YYPOPSTACK): Now accept a number of items to pop.
9128 * data/lalr1.cc: Likewise.
9129 * data/glr.c: Formatting changes.
9130 Use goto instead of fall through.
9131 * doc/bison.texinfo (Destructor Decl): Complete.
9132
d508c281
JMG
91332005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9134
9135 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9136 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
9137 * djgpp/config.bat: Replace every occurence of the file name
9138 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9139 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9140 * djgpp/config.sed: Replace every occurence of the file name
9141 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9142 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9143 * djgpp/djunpack.bat: DJGPP specific file.
9144 * djgpp/fnchange.lst: DJGPP specific file.
9145 * djgpp/README.in: Add new information about how to unpack the bison
9146 source on MSDOS and other systems which have 8.3 file name restrictions
9147 using djunpack.bat and fnchange.lst.
9148
3e7a2cd9
PE
91492005-12-12 Paul Eggert <eggert@cs.ucla.edu>
9150
9151 * bootstrap (build_cvs_prefix): Remove; unused.
9152 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
9153 when getting gnulib.
9154
91552005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
9156
9157 * data/glr.c: Reorder typedef declarations for structs to match order
9158 of struct declarations.
9159 Rename yystack everywhere to yystackp except in yyparse where it's not
9160 a pointer.
9161 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
9162 consistency.
9163 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
9164 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
9165 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
9166 lint.
9167
877519f8
PE
91682005-12-09 Paul Eggert <eggert@cs.ucla.edu>
9169
0eca5a39
PE
9170 * tests/sets.at (Accept): Fix typos in regular expression used to
9171 sed out the final state number.
9172
2cec9080
PE
9173 Work around portability problem on Solaris 10: flex-generated
9174 files include <stdio.h> before <config.h>, which messes up
9175 because the latter defines __EXTENSIONS__. Address the problem
9176 by creating two new little files that include <config.h> first,
9177 then include the flex-generated files. Rewrite everyone else
9178 to include <config.h> first, as well.
9179 * lib/timevar.c: Always include "config.h".
9180 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
9181 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
9182 (EXTRA_bison_SOURCES): New macro.
9183 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
9184 * src/system.h: Don't include config.h.
9185 * src/LR0.c: Include <config.h> first.
9186 * src/assoc.c: Likewise.
9187 * src/closure.c: Likewise.
9188 * src/complain.c: Likewise.
9189 * src/conflicts.c: Likewise.
9190 * src/derives.c: Likewise.
9191 * src/files.c: Likewise.
9192 * src/getargs.c: Likewise.
9193 * src/gram.c: Likewise.
9194 * src/lalr.c: Likewise.
9195 * src/location.c: Likewise.
9196 * src/main.c: Likewise.
9197 * src/muscle_tab.c: Likewise.
9198 * src/nullable.c: Likewise.
9199 * src/output.c: Likewise.
9200 * src/parse-gram.y: Likewise.
9201 * src/print.c: Likewise.
9202 * src/print_graph.c: Likewise.
9203 * src/reader.c: Likewise.
9204 * src/reduce.c: Likewise.
9205 * src/relation.c: Likewise.
9206 * src/state.c: Likewise.
9207 * src/symlist.c: Likewise.
9208 * src/symtab.c: Likewise.
9209 * src/tables.c: Likewise.
9210 * src/uniqstr.c: Likewise.
9211 * src/vcg.c: Likewise.
9212
877519f8
PE
9213 * src/parse-gram.y: Fix minor problems uncovered by lint.
9214 (current_lhs, current_lhs_location): Now static.
9215 (current_assoc): Remove unused variable.
9216
9217 Cleanups so that Bison-generated parsers have less lint.
9218 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9219 Prepend /*ARGSUSED*/, for lint's sake.
9220 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9221 definition if 'lint' is defined.
9222 (YYID): New macro (or function, if lint).
9223 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9224 * data/yacc.c: Likewise.
9225 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9226 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9227 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9228 is C++ only.
9229 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9230 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9231 Use YYID(0) rather than 0, for lint.
9232 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9233 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9234
f5228370
PE
92352005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9236
9237 * tests/glr-regression.at
9238 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9239 Close memory leak reported by twlevo.
9240
69ce078b
PE
92412005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9242
6ff99711
PE
9243 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9244 all stacks.
9245 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
9246 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9247 New test case.
9248 (Duplicated user destructor for lookahead): This test now is expected
9249 to succeed.
9250
af3412cd
PE
92512005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9252
32b5b719 9253 * NEWS: Document the following change.
af3412cd
PE
9254 * data/yacc.c: Say "parser skeleton" rather than "file", since
9255 it's no longer just a file.
9256 * data/glr.c: Grant a special exception for C GLR parsers, that
9257 reads like the already-existing exception for C LALR(1) parsers.
9258 * data/glr.cc: Likewise.
9259 * data/lalr1.cc: Likewise.
9260 * data/location.cc: Likewise.
9261 * data/yacc.c: Reword the "written by" statement to clarify that
9262 it was the parser skeleton, not the entire output file.
9263 * data/glr.c: Written by Paul Hilfinger.
9264 * data/glr.cc: Written by Akim Demaille.
9265 * data/lalr1.cc: Likewise.
9266
035aa4a0
PE
92672005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9268
d9963c85
PE
9269 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9270 Fix typos in previous change that broke 'make check'.
9271 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9272 supported in C.
9273 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9274 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9275 We can revert this once things settle down.
9276
035aa4a0
PE
9277 * src/conflicts.c (conflicts_print): Don't print file name twice
9278 when %expect fails because there were no conflicts.
9279 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9280 change.
9281 * tests/conflicts.at (%expect not enough, %expect too much):
9282 (%expect with reduce conflicts): Adjust to new behavior.
9283
92842005-11-18 Akim Demaille <akim@epita.fr>
9285
9286 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9287 errors.
9288 * NEWS: Document this.
9289 * doc/bison.texinfo (Expect Decl): Likewise.
9290
d1ff7a7c
AD
92912005-11-16 Akim Demaille <akim@epita.fr>
9292
9293 Generalize the display of semantic values and locations in traces.
9294 * data/glr.c (yy_reduce_print): Fix indices (again).
9295 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9296 literal integers.
9297 * data/lalr1.cc (yyreduce_print): Rename as...
9298 (yy_reduce_print): this.
9299 Display values and locations.
9300 * data/yacc.c (yy_reduce_print): Likewise.
9301 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9302 (yysymprint): Move higher to be visible from yy_reduce_print).
9303 (yyparse): Adjust.
9304 * tests/calc.at: Adjust the expected length of the traces.
9305
6de5398d
AD
93062005-11-14 Akim Demaille <akim@epita.fr>
9307
9308 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9309 from 1 to N, while values and location start at 0.
9310 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9311
a1373f55
AD
93122005-11-14 Akim Demaille <akim@epita.fr>
9313
9314 * data/glr.c (yy_reduce_print): Fix the $ number.
9315
613d8952
AD
93162005-11-14 Akim Demaille <akim@epita.fr>
9317
9318 "Use" parse parameters.
9319 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9320 * data/glr.c, data/glr.cc: Use them.
9321 * data/glr.c (YYUSE): Have a C++ definition that supports
9322 non-pointer types.
9323
b2741627
AD
93242005-11-14 Akim Demaille <akim@epita.fr>
9325
9326 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9327
5059b5c8
AD
93282005-11-14 Akim Demaille <akim@epita.fr>
9329
42249483
AD
9330 * data/glr.cc: New.
9331 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 9332
4626a15d
AD
93332005-11-12 Akim Demaille <akim@epita.fr>
9334
9335 Let position and location be PODs.
9336 * data/location.cc (position::initialize, location::initialize): New.
9337 (position::position, location::location): Define only if
9338 b4_location_constructors is defined.
9339 * data/lalr1.cc (b4_location_constructors): Define it for backward
9340 compatibility.
9341 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9342
93432005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
9344
9345 * data/lalr1.cc: Move the body of the ctor and dtor into the
9346 parser file (instead of the header).
9347 Wrap the implementations in a "namespace yy".
9348
93492005-11-12 Akim Demaille <akim@epita.fr>
9350
9351 Have glr.c include its header file when created.
9352 * data/glr.c (b4_shared_declarations): New.
9353 Output them verbatim in the parser if !%defines, otherwise
9354 output then in the header file, and include it instead.
9355
1989d947
AD
93562005-11-11 Akim Demaille <akim@epita.fr>
9357
9358 * data/glr.c: Comment changes.
9359
93602005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
9361
9362 When yydebug, report semantic and location values for reductions.
9363 * data/glr.c (yy_reduce_print): Report the semantic values and the
9364 locations.
9365 (YY_REDUCE_PRINT): Adjust.
9366 (yyglrReduce): Use them.
9367 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9368 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9369 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9370 traces.
9371
02998094
AD
93722005-11-10 Akim Demaille <akim@epita.fr>
9373
9374 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9375 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9376 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9377
5210672f
PE
93782005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9379
9380 * m4/cxx.m4, examples/Makefile.am: Don't build
9381 examples/calc++ if no C++ compiler is available. (trivial change)
9382
a8991a1d
AD
93832005-11-09 Akim Demaille <akim@epita.fr>
9384
9385 * src/scan-skel.l: Use a couple of asserts.
9386
36b5e963
AD
93872005-11-03 Akim Demaille <akim@epita.fr>
9388
9389 In some (weird) cases, the final state number is incorrect.
9390 Reported by Alexandre Duret-Lutz.
9391 * src/LR0.c (state_list_append): Remove the computation of
9392 final_state.
9393 (save_reductions): Do it here.
9394 (get_state): Alpha conversion.
9395 (generate_states): Use a for loop.
9396 * src/gram.h (item_number_is_rule_number)
9397 (item_number_is_symbol_number): New.
9398 * src/state.c: Use assert.
9399 * src/system.h: Include assert.h.
9400 * tests/sets.at (Accept): New.
9401
44e7ead1
PH
94022005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9403
9404 * data/glr.c (yyfill): Adjust comment.
36b5e963 9405 (yyresolveAction): Initialize default location properly
44e7ead1
PH
9406 for empty right-hand sides.
9407 (yydoAction): Ditto.
9408 Add comment explaining apparently dead code.
36b5e963
AD
9409 * tests/glr-regression.at
9410 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 9411 New test.
36b5e963 9412
e10a80ee
PE
94132005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9414
9415 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9416 gnulib when interrupted. This fixes some race conditions and
9417 works around some portability problems (one noted by Paul
9418 Hilfinger).
9419
067b32ee
AD
94202005-10-22 Akim <akim@epita.fr>
9421
9422 * Makefile.cfg: Adjust to config -> build-aux.
9423 Reported by twledo.
9424
4b367315
AD
94252005-10-21 Akim Demaille <akim@epita.fr>
9426
9427 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9428 the %parse-params.
9429 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9430 * data/yacc.c (b4_Pure_if): Rename as...
9431 (b4_yacc_pure_if): this.
9432 (YY_SYMBOL_PRINT, yyparse): Adjust.
9433 * doc/bison.texinfo: Formatting changes.
9434
24cc23d9
AD
94352005-10-21 Akim Demaille <akim@epita.fr>
9436
9437 Finish the transition config -> build-aux.
9438 * configure.ac, Makefile.am: Use build-aux.
9439 * config/prev-version, config/announce-gen, config/Makefile.am:
9440 Move to...
9441 * build-aux/prev-version, build-aux/announce-gen,
9442 * build-aux/Makefile.am: here.
9443
d4476375
AD
94442005-10-14 Akim Demaille <akim@epita.fr>
9445
9446 * examples/calc++/test: Use set -x only when VERBOSE.
9447
302c0aee
PE
94482005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9449
9450 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9451 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9452
7625ec2c
AD
94532005-10-13 Akim Demaille <akim@epita.fr>
9454
9455 * src/scan-skel.l: Output the base name parts of the parser and
9456 header file names.
302c0aee 9457 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
9458 additional checks.
9459 Use this to exercise C++ outputs in subdirs.
9460 Reported by Oleg Smolsky.
9461
ba0fe3c7
PE
94622005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9463
9464 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9465 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9466 Problem reported by John P. Hartmann.
9467 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9468 already defined it.
9469
9b8a5ce0
AD
94702005-10-12 Akim Demaille <akim@epita.fr>
9471
9472 * src/parse-gram.y (version_check): Exit 63 to please missing
9473 (stands for "version mismatch).
9474 * tests/input.at, doc/bison.texinfo: Adjust.
9475
4f6e011e
PE
94762005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9477
9478 Work around portability problems with Visual Age C compiler
9479 (xlc and xlC_r) reported by John P. Hartmann.
9480 * data/location.cc (initial_column, initial_line): Remove.
9481 All uses replaced by 0 and 1.
9482 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9483 that xlc complains about.
9484 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 9485 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 9486 as __STDC__.
4d7aa45e
PE
9487 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9488 __STDC_VERSION__. Use it everywhere instead of looking at
9489 __STDC__ and __cplusplus.
4f6e011e 9490
a1b3bf8c
AD
94912005-10-10 Akim Demaille <akim@epita.fr>
9492
9493 * examples/calc++/test: Be quiet unless VERBOSE.
9494
412e44aa
PE
94952005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9496
2a4647a3
PE
9497 * data/c.m4 (yydestruct, yysymprint):
9498 Use YYUSE instead of casting to void.
9499 * data/glr.c (YYUSE): New macro.
9500 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9501 Use it instead of rolling our own.
9502 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9503 (YYCHK1):
9504 Use /*CONSTCOND*/ to suppress lint warnings.
9505 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9506 (YY_STACK_PRINT): Use 'false' not '0'.
9507 (YYUSE): New macro.
9508 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9509 * data/yacc.c (YYUSE): New macro.
9510 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9511 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9512 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9513
9514
412e44aa
PE
9515 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9516 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9517
88c6637f
PE
95182005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9519
2f4f028d
PE
9520 Undo the parts of the unlocked-I/O change that substituted
9521 putc or puts for printf. This might hurt performance a bit,
9522 but some people prefer the printf style.
9523 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9524 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9525 All uses replaced by YYFPRINTF and YYDPRINTF.
9526 * data/yacc.c: Likewise.
9527 * lib/bitset.c (bitset_print): Likewise.
9528 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
9529 putc and puts.
9530 * lib/lbitset.c (debug_lbitset): Likewise.
9531 * src/closure.c (print_firsts, print_fderives): Likewise.
9532 * src/gram.c (grammar_dump): Likewise.
9533 * src/lalr.c (look_ahead_tokens_print): Likewise.
9534 * src/output.c (escaped_output): Likewise.
9535 (user_actions_output): Break apart two printfs.
9536 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
9537 * src/reduce.c (reduce_print): Likewise.
9538 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9539 * src/system.h: Include unlocked-io.h rathe than stdio.h.
9540
88c6637f
PE
9541 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9542 Use assignments rather than casts-to-void to suppress
9543 unused-variable warnings. This pacifies 'lint'.
9544 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
9545 unused-variable warnings.
9546
fb32e373
JMG
95472005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9548
9549 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9550
edb8f44f
PE
95512005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9552
fb9c0b33
PE
9553 Use unlocked I/O for a minor performance improvement on hosts like
9554 GNU/Linux and Solaris that support unlocked I/O. The basic idea
9555 is to use the gnlib unlocked-io module, and to prefer putc and
9556 puts to printf when either will work (since the latter doesn't
9557 come in an unlocked flavor).
9558 * bootstrap (gnulib_modules): Add unlocked-io.
9559 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
9560 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
9561 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
9562 and similarly for puts and putc and printf.
9563 * data/yacc.c: Likewise.
9564 * lib/bitset.c (bitset_print): Likewise.
9565 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
9566 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
9567 to printf.
9568 * lib/lbitset.c (debug_lbitset): Likewise.
9569 * src/closure.c (print_firsts, print_fderives): Likewise.
9570 * src/gram.c (grammar_dump): Likewise.
9571 * src/lalr.c (look_ahead_tokens_print): Likewise.
9572 * src/output.c (escaped_output): Likewise.
9573 (user_actions_output): Coalesce two printfs.
2f4f028d 9574 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
9575 * src/reduce.c (reduce_print): Likewise.
9576 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 9577 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 9578
edb8f44f
PE
9579 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9580 this confuses xgettext.
9581
b50d2359
AD
95822005-10-02 Akim Demaille <akim@epita.fr>
9583
9584 * bootstrap (gnulib_modules): Add strverscmp.
9585 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
9586 * m4/.cvsignore: Add strverscmp.m4.
9587 * src/parse-gram.y (%require): New token, new rule.
9588 (version_check): New.
9589 * src/scan-gram.l (%require): Adjust.
9590 * tests/input.at (AT_REQUIRE): New.
9591 Use it.
9592 * doc/bison.texinfo (Require Decl): New.
9593 (Calc++ Parser): Use %require.
9594
21667f64
AD
95952005-10-02 Akim Demaille <akim@epita.fr>
9596
9597 * data/location.cc: New.
9598
2b81e969
AD
95992005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
9600 Akim Demaille <akim@epita.fr>
9601
9602 Make sure -odir/foo.cc creates dir/location.hh etc.
9603 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
9604 (spec_file_prefix, spec_verbose_file, spec_graph_file)
9605 (spec_defines_file): Now const.
9606 (dir_prefix): New.
9607 (short_base_name): Remove.
9608 * src/files.c: Adjust.
9609 (dirname.h): Include.
9610 (base_name): Don't prototype it.
9611 (finput): Remove, duplicates gram_in.
9612 (full_base_name, short_base_name): Replace by...
9613 (all_but_ext, all_but_tab_ext): these.
9614 (compute_base_names): Rename as...
9615 (compute_file_name_parts): this.
9616 Update to compute the new variables, including dir_prefix.
9617 Adjust dependencies.
9618 * src/output.c (prepare): Output them.
9619 * src/reader.c: Adjust to use gram_in, not finput.
9620 * src/scan-skel.l (@dir_prefix@): New.
9621
ad6a9b97
JMG
96222005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9623
9624 * lib/subpipe.c: New function end_of_output_subpipe() added
9625 to allow support for non-posix systems. This is a no-op function
9626 for posix systems.
9627
9628 * lib/subpipe.h: New function end_of_output_subpipe() added
9629 to allow support for non-posix systems. This is a no-op function
9630 for posix systems.
9631
9632 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9633 handle the lack of pipe/fork functionality on non-posix systems.
9634
9635 * djgpp/Makefile.maint: DJGPP specific file.
9636
9637 * djgpp/README.in: DJGPP specific file.
9638
9639 * djgpp/config.bat: DJGPP specific configuration file.
9640
9641 * djgpp/config.sed: DJGPP specific configuration file.
9642
9643 * djgpp/config.site: DJGPP specific configuration file.
9644
9645 * djgpp/config_h.sed: DJGPP specific configuration file.
9646
9647 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9648
9649 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9650
fc695704
AD
96512005-10-02 Akim Demaille <akim@epita.fr>
9652
9653 * data/location.cc: New, extract from...
9654 * data/lalr1.cc: here.
9655 (location.hh): Include it after the user prologue, in case the
9656 filename type is defined by the user.
9657 Forward declation location and position before the pre-prologue.
9658 (yyresult_): Rename as...
9659 (yyresult): this, it's a local variable, not an attribute.
9660 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9661
96622005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
9663
9664 * examples/extexi: Restore the #line generation.
9665
fb9712a9
AD
96662005-09-30 Akim Demaille <akim@epita.fr>,
9667 Alexandre Duret-Lutz <adl@gnu.org>
9668
9669 Move the token type and YYSTYPE in the parser class.
9670 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9671 (parser::token): New, from the moved free definition of tokens.
9672 (parser::semantic_value): Now a full definition instead of an
9673 indirection to YYSTYPE.
9674 (b4_post_prologue): No longer included in the header file, but
9675 in the implementation file.
9676 * doc/bison.texi (C+ Language Interface): Update.
9677 * src/parse-gram.y: Support unary %define.
9678 * tests/actions.at: Define global_tokens_and_yystype for backward
9679 compatibility until we update the tests.
9680 * tests/calc.at: Idem.
9681 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9682 to simplify the code.
9683
55f0c7b1
PE
96842005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9685
9686 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9687 Ah, the good old days! Problem reported by Peter Klein.
9688 * bootstrap (gnulib_modules): Add strerror, strtoul.
9689 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9690 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9691
fb9712a9 96922005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
9693
9694 * data/c.m4 (b4_error_verbose_if): New.
9695 * data/lalr1.cc: Use it.
9696 (YYERROR_VERBOSE_IF): Remove.
9697 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9698 parser members, replaced by...
9699 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9700 local variables.
9701 (yysyntax_error_): Takes the state number as argument.
9702 (yyreduce_print_): Use the argument yyrule, not the former
9703 attribute yyn_.
9704
8a6f72f3
PE
97052005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9706
9707 * bootstrap (gnulib_modules): Add verify.
9708 * lib/.cvsignore: Add verify.h.
9709 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9710 * src/system.h (verify): Remove.
9711 Include verify.h instead.
9712 * src/tables.c (tables_generate): Use new API for 'verify'.
9713
0d50976f
PE
97142005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9715
ebc3737e
PE
9716 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9717 local variables whose names begin with 'yy'.
9718 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9719 Trivial changes from Joel E. Denny.
9720
0d50976f
PE
9721 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9722 it itself.
9723 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9724 don't use alloca any more.
9725
9726 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9727 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 9728 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
9729 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9730 to match yacc.c, to test more hosts.
9731
a05b79df
PE
97322005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9733
55289366
PE
9734 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9735 doesn't affect behavior.
9736 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9737 Solaris, AIX, MSC.
9738 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9739 This works a bit better with glibc, if user code has already included
9740 stdlib.h.
9741 * doc/bison.texinfo (Bison Parser): Document that users can't
9742 arbitrarily use malloc and free for other purposes. Document
9743 that <alloca.h> and <malloc.h> might be included.
9744 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9745 user must declare alloca.
9746
a05b79df
PE
9747 * HACKING (release): Forwarn the Translation Project about
9748 stable releses.
9749
3ab2ca22
AD
97502005-09-20 Akim Demaille <akim@epita.fr>
9751
9752 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9753
a9739e7c
PE
97542005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9755
a702593e
PE
9756 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9757 (YYSTACK_ALLOC_MAXIMUM): Use it.
9758 (yysyntax_error): New function.
9759 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9760 multiple syntax errors are reported, and alloca is being used.
9761 Instead, reallocate buffers twice as big each time, so that
9762 we waste at most half the allocated memory. Start with a small
9763 (128-byte) buffer that will suffice in most cases anyway.
9764 Use yysyntax_error to do most of the work.
9765
9766 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9767 yynerrs is the number of errors reported, not the number of
9768 errors encountered.
9769
a9739e7c
PE
9770 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9771 Mark it as expected to fail.
9772 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9773 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9774 Don't start user-code symbols with "yy", to avoid name space problems.
9775
f479c6c6
AD
97762005-09-19 Akim Demaille <akim@epita.fr>
9777
9778 Remove the traits, failed experiment.
9779 It never proved useful, and anyway because of the current
9780 definition, it was not possible to have several specialization of
9781 this traits, making it useless.
9782 * data/lalr1.cc (yy:traits): Remove.
9783 Inline its definitions in the parser class.
9784
e2586f82
AD
97852005-09-19 Akim Demaille <akim@epita.fr>
9786
9787 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9788 least Mac OSX with a /usr/local install of gettext.
9789
2e8cf949
AD
97902005-09-19 Akim Demaille <akim@epita.fr>
9791
9792 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9793 and yytoken for similarity with the other skeletons.
9794
c7fb0b90
AD
97952005-09-19 Akim Demaille <akim@epita.fr>
9796
4e26c69e 9797 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 9798
1bd0deda
PE
97992005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9800
9801 * NEWS: Version 2.1.
9802
9803 * NEWS: Remove notice of yytname change, since it was never in an
9804 official release.
9805 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9806 diagnostic.
9807 * src/output.c (prepare): Likewise.
9808 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9809 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9810 is not defined. This is an awful hack, but it's enough for now.
9811 All callers changed.
9812 * tests/glr-regression-at (make_value): Args are const pointers now,
9813 to avoid GCC warning.
9814 (Duplicated user destructor for lookahead): New test. Currently
9815 skipped. It fails on my host but I'm not sure it'll always fail.
9816
98172005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
9818
9819 * src/symtab.h (struct symbol): Declare the printer and destructor
9820 as const, to avoid accidental calls to free.
9821 (symbol_destructor_set, symbol_printer_set): Adjust.
9822 * src/symtab.c: Adjust.
9823
1bd0deda 98242005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
9825
9826 * data/c.m4 (b4_token_enums): New.
9827 (b4_token_defines): Rename as...
9828 (b4_token_enums_defines): this.
9829 (b4_token_defines): New, output only the #defines.
9830 * data/yacc.c, data/glr.c: Adjust.
9831 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9832 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9833 as default values.
9834
dbcdae2d
AD
98352005-09-16 Akim Demaille <akim@epita.fr>
9836
9837 * data/lalr1.cc (yylex_): Remove, inline its code.
9838 (yyreport_syntax_error_): Remove, replaced by...
9839 (yysyntax_error_): this which returns a string and leaves to the
9840 caller the call to the users' error function.
9841 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9842 Move from members of the parser object...
9843 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9844 to local variables of the parse function.
9845
70d8f291
AD
98462005-09-16 Akim Demaille <akim@epita.fr>
9847
9848 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9849 since it's in Bison's name space.
9850
b47dbebe
PE
98512005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9852
ae199bf1
PE
9853 * data/glr.c (yyresolveValue): Add default case to pacify
9854 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9855
b47dbebe
PE
9856 * NEWS: Document when yyparse started to return 2.
9857 * doc/bison.texinfo (Parser Function): Document when yyparse
9858 returns 2.
9859
9860 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9861 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9862 changed.
9863 (class position): file_name -> filename (reverting). All uses changed.
9864
98652005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9866
9867 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9868 do anything if $@ exists. This reverts part of the 2005-07-07
9869 patch.
9870
00292f66
PE
98712005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9872
9873 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9874 contains obsolete information and isn't worth distributing as a
9875 separate file anyway.
9876 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9877 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9878 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9879 (yyparse): Abort if user code uses longjmp to throw an unexpected
9880 value.
9881
a420f962
PE
98822005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9883
00292f66
PE
9884 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9885 Suggested by twlevo@xs4all.nl.
9886
127287e9
PE
9887 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9888 This avoids a diagnostic from gcc -Wswitch-enum.
9889 Problem reported by twlevo@xs4all.nl.
9890
a420f962
PE
9891 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9892 standards. Use "file name" or "file" or "name", depending on
9893 the context.
9894 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9895 not to hack/foo.tab.c.
9896 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
9897 * data/glr.c: b4_filename -> b4_file_name.
9898 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9899 All uses changed.
9900 (class position): filename -> file_name. All uses changed.
9901 * data/yacc.c: b4_filename -> b4_file_name.
9902 * lib/bitset.h: filename -> file_name in local vars.
9903 * lib/bitset_stats.c: Likewise.
9904 * src/files.c: Likewise.
9905 * src/scan-skel.l ("@output ".*\n): Likewise.
9906 * src/files.c (file_name_split): Renamed from filename_split.
9907 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
9908
99092005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9910
9911 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9912 to accommodate latest gnulib.
9913
9914 * tests/glr-regression.at (Duplicate representation of merged trees):
9915 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9916
9917 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9918 needed.
9919
42a6501d
PE
99202005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9921
9922 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9923 All uses changed. Invoke user destructor after an error during a
9924 split parse (trivial change from Joel E. Denny).
9925
9926 * tests/glr-regression.at
9927 (User destructor after an error during a split parse): New test case.
9928 Problem reported by Joel E. Denny in:
9929 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9930
ef9a1faf
PE
99312005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9932
5b4aaf78
PE
9933 * README-cvs: Give URLs for recommended tools.
9934 Mention Gzip version problem, and bootstrapping issues.
9935 Remove troubleshooting section, as it's somewhat obsolete.
9936
b5240ba5
PE
9937 * bootstrap (no_cache): New var, to accommodate different wget
9938 variants. Use it instead of '-C off'. Problem reported by
9939 twlevo@xs4all.nl.
9940
ef9a1faf
PE
9941 * data/glr.c (yydestroyStackItem): New function.
9942 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9943 debugging information. Problem reported by Joel E. Denny.
9944
e6efa9da
AD
99452005-08-25 Akim Demaille <akim@epita.fr>
9946
9947 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9948
adc90f13
PE
99492005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9950
9951 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9952 Don't invoke destructor on unresolved entries.
9953 * tests/glr-regression.at
9954 (User destructor for unresolved GLR semantic value): New test case.
9955 Problem reported by Joel E. Denny in:
9956 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9957
f9315de5
PE
99582005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9959
15d29c1f
PE
9960 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9961 Add strnlen.c.
9962 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9963 lib-prefix.m4, po.m4.
9964
dd5f2af2
PE
9965 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9966 in yydestruct diagnostic, since it might not be an error.
9967 Problem reported by Joel Denny near end of
9968 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 9969 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
9970 * data/yacc.c (yyreturn): Likewise.
9971 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9972
9973 * src/files.c: Remove obsolete FIXME comment.
9974
9975 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9976 with the other templates, and to fix bogus run-on messages such
9977 as the one reported at the end of
9978 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9979 All callers changed to avoid the newline.
9980 (yyprocessOneStack): Output two lines rather than one, to accommodate
9981 the above change. This changes the debug output format slightly.
9982
f9315de5
PE
9983 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9984 reported by Joel E. Denny in
9985 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9986 (trivial change).
9987 * tests/glr-regression.at (Duplicate representation of merged trees):
9988 New test, from Joel E. Denny in:
9989 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9990 * THANKS: Add Joel E. Denny.
9991
9992 * configure.ac (AC_INIT): Bump to 2.0c.
9993
04098407
PE
99942005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9995
9996 * NEWS: Version 2.0b.
9997
ca5d2013
PE
9998 * Makefile.am (SUBDIRS): Put examples before tests, so that
9999 "make check" doesn't finish with "All 1 tests passed".
10000
3d54b576
PE
10001 * tests/regression.at (Token definitions): Don't rely on
10002 AT_PARSER_CHECK for data that contains backslashes. It currently
10003 uses 'echo', and 'echo' isn't portable if its argument contains
10004 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10005 that the byte '\0xff' is not printable in the C locale; it is,
10006 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10007 not printable, so use '\0x81' to test.
10008
d53ae497
PE
10009 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10010 version of GCC, since the macro is used with non-GCC compilers.
10011
fc01665e
PE
10012 Fix core dump reported by Pablo De Napoli in
10013 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
10014 * tests/regression.at (Invalid inputs with {}): New test.
10015 * src/parse-gram.y (token_name): Translate type before using
10016 it as an index.
10017
04098407
PE
10018 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
10019 the user's name space. All uses changed to __attribute__
10020 ((__unused__)).
10021 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
10022 Add __attribute__ ((__noreturn__)).
10023
10024 * etc/clcommit: Remove. We weren't using it, and it failed
10025 "make maintainer-distcheck".
10026 * Makefile.maint: Merge from coreutils.
10027 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
10028 (syntax-check-rules): Change list of rules as described below.
10029 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
10030 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
10031 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
10032 (sc_trailing_space): New rules.
10033 (sc_xalloc_h_in_src): Remove.
10034 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
10035 (sc_space_tab, sc_error_exit_success, sc_changelog):
10036 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
10037 (makefile-check, po-check, author_mark_check):
10038 (makefile_path_separator_check, copyright-check):
10039 Use grep -n, to make it easier to find violations.
10040 Use CVS_LIST and CVS_LIST_EXCEPT.
10041 (header_regexp, h_re): Remove.
10042 (dd_c): New macro.
10043 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
10044 (my-distcheck): Use more-modern GCC flags.
10045 (signatures, %.asc): Remove.
10046 (rel-files, announcement): Remove signatures.
10047 Restore old updating code, even though we don't use it, so
10048 that we're the same as coreutils.
10049 (alpha, beta, major): Depend on news-date-check.
10050 Make the upload commands.
10051
10052 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
10053 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
10054 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
10055 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
10056 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
10057 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
10058 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
10059 * tests/sets.at: Likewise.
10060
10061 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
10062 we comment out the Autoconf version number.
10063 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
10064 it's error-prone and "make maintainer-distcheck" rejects it.
10065
10066 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
10067 Indent calls to "error" to pacify "make maintainer-distcheck",
10068 when the calls are not intended to be translated.
10069 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
10070
10071 * src/Makefile.am (DEFS): Use +=, to pacify
10072 "make maintainer-distcheck".
10073 (bison_SOURCES): Add scan-skel.h.
10074 (sc_tight_scope): New rule, from coreutils.
10075
10076 * src/files.c (src_extension, header_extension):
10077 Now static, not extern.
10078 * src/getargs.c (short_options): Likewise.
10079 * src/muscle_tab.c (muscle_table): Likewise.
10080 * src/parse-gram.y (current_class, current_type, current_prec):
10081 Likewise.
10082 * src/reader.c (grammar_end, previous_rule_end): Likewise.
10083 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
10084 * src/main.c (main): Cast bindtextdomain and textdomain calls to
10085 void, to avoid warning when NLS is disabled.
10086 * src/output.c: Include scan-skel.h.
10087 (scan_skel): Remove decl, since scan-skel.h does this.
10088 (output_skeleton):
10089 Indent calls to "error" to pacify "make maintainer-distcheck".
10090 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
10091 * src/reader.h (gram_end, gram_lineno): New decls to pacify
10092 "make maintainer-distcheck".
10093 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
10094 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
10095 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
10096 (skel_lex_destroy, scan_skel): Move these decls to...
10097 * src/scan-skel.h: New file.
10098 * src/uniqstr.c (uniqstr_assert):
10099 Indent calls to "error" to pacify "make maintainer-distcheck".
10100
10101 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
10102 not @VAR@.
10103
10104 * tests/torture.at: Revamp to avoid misuse of atoi that
10105 "make maintainer-distcheck" complained about.
10106
10107 * examples/extexi (message): Don't print a message more than once,
10108 and omit line-number decoration that makes Emacs compile think
10109 that informative messages are worth worrying about.
10110
101112005-07-22 Paul Eggert <eggert@cs.ucla.edu>
10112
10113 * configure.ac: Update version number.
10114
10115 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
10116 accidentally.
10117 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
10118 autogenerated by the maintainer.
10119 * examples/calc++/.cvsignore: Add *.yy.
10120
10121 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
10122 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10123 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10124
10125 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
10126
10127 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
10128 from maintainer-distcheck about casting the argument of 'free'.
10129
10130 * NEWS: Mention recent yytname changes.
10131 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
10132
10133 * bootstrap: For translations that have not yet been upgraded to
10134 the new runtime-po domain, prime the pump by extracting the
10135 relevant strings from the obsolete translations. This code can be
10136 removed once the bison-runtime domain has been translated by each
10137 team.
10138
10139 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
10140 now that token names are already quoted.
10141
10142 Fix problem reported by Anthony Heading.
10143 * data/glr.c (YYTOKEN_TABLE): New macro.
10144 (yytname): Define if YYTOKEN_TABLE.
10145 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
10146 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
10147 (YYERROR_VERBOSE): Define the same way the other skeletons do.
10148 * src/output.c (prepare_symbols): Output token_table_flag.
10149
0ffda363
PE
101502005-07-21 Paul Eggert <eggert@cs.ucla.edu>
10151
10152 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
10153 again if the first call fails.
10154
10155 * data/glr.c (yytnamerr): New function.
10156 (yyreportSyntaxError): Use it to dequote most string literals.
10157 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
10158 with other skeletons. All uses changed.
10159 (yytnameerr_): New function.
10160 (yyreport_syntax_error): Use it to dequote most string literals.
10161 * data/yacc.c (yytnamerr): New function.
10162 (yyerrlab): Use it to decode most string literals.
10163 * doc/bison.texinfo (Decl Summary, Calling Convention):
10164 Clarify quoting convention of yytname.
10165 * src/output.c (prepare_symbols): Quote all names. This undoes
10166 the 2005-04-17 change, which is now accomplished (mostly) via
10167 changes in the parsers as described above.
10168 * tests/regression.at (Token definitions, Web2c Actions):
10169 Undo most 2005-04-17 change here, too.
10170
101712005-07-20 Paul Eggert <eggert@cs.ucla.edu>
10172
10173 Fix more problems reported by twlevo@xs4all.nl.
10174 * tests/cxx-type.at: Don't pipe output of ./types through sed to
10175 remove trailing spaces. This loses the exit status of ./types,
10176 and isn't needed since ./types shouldn't be emitting trailing
10177 spaces.
10178 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
10179 as the stack isn't valid in that case.
10180
10181 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10182 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10183 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10184 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
10185 is used.
10186 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
10187 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10188 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10189 Likewise.
10190
10191 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
10192 overly-picky compilers that reject 'char *foo = "bar";'.
10193
10194 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
10195 to FILE * parameter, not to stderr. This fixes a typo introduced
10196 in the 2005-07-12 change.
10197
10198 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
10199 warnings from GCC 4.
10200
10201 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
10202 (yyglrShiftDefer, yysplitStack):
10203 Remove unused parameters b4_pure_formals. All uses changed.
10204 (yyglrShift): Remove unused parameters b4_user_formals.
10205 All uses changed.
10206 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10207
6100a9aa
PE
102082005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10209
258b75ca
PE
10210 Destructor cleanups and regularization among the three skeletons.
10211 * NEWS: Document the behavior changes.
10212 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10213 stack before failing, as the cleanup code will do it for us now.
10214 * data/lalr1.cc (yyerrlab): Likewise.
10215 * data/glr.c (yyparse): Pop everything off the stack before
10216 freeing it, so that destructors get called properly.
10217 * data/lalr1.cc (yyreturn): Likewise.
10218 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10219 This is more consistent.
10220 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10221 why destructors might be called. 1.875 -> 2.1.
10222 (Destructor Decl, Decl Summary, Table of Symbols):
10223 Some English-language cleanups for %destructor.
10224 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10225 Add output line for destructor of start symbol.
10226 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10227 because of that same extra output line.
10228
1a059451
PE
10229 * NEWS: Document minor wording changes in diagnostics of
10230 Bison-generated parsers.
10231 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10232 Remove unused formals. All uses changed.
10233 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10234 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10235 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10236 Rename yyoverflowab to yyexhaustedlab.
10237 When memory exhaustion occurs during syntax-error reporting,
10238 report it separately rather than in a single diagnostic; this
10239 eases translation.
10240 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10241 (Memory Exhausted): Renamed from Parser Stack Overflow.
10242 Revamp wording slightly to prefer "memory exhaustion".
10243 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10244
97460c78
PE
10245 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10246
30757c8c
PE
10247 Add i18n support to the GLR skeleton. Partially fix the C++
10248 skeleton; a C++ expert needs to finish this. Remove debugging
10249 msgids; there's little point to having them translated, since they
10250 can be understood only by someone who can read the
10251 (English-language) source code.
10252
10253 Generate runtime-po/bison-runtime.pot automatically, so that we
10254 don't have to worry about garbage getting in that file. We'll
10255 make sure after the next official release that old msgids don't
10256 get lost. See
10257 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10258
10259 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10260 Now auto-generated.
10261 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10262 Fix typos in explanations of the runtime file.
10263 * bootstrap: Change gettext keyword from YYI18N to YY_.
10264 Use standard Makefile.in.in in runtime-po, since we'll arrange
10265 for backward-compatible bison-runtime.po files in a different way.
10266 * data/glr.c (YY_): New macro, from yacc.c.
10267 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10268 Translate messages intended for users.
10269 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10270 the wording in the other skeletons. We don't know that the memory
10271 is virtual.
10272 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10273 Use same method that yacc.c uses.
10274 Don't translate debugging messages.
10275 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10276 it doesn't work (yet), and requires C++ expertise to fix.
10277 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10278 Move defn to a more logical place, to be consistent with other
10279 skeletons.
10280 Don't translate debugging messages.
10281 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10282 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10283 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10284 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10285
ac8c5689
PE
10286 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10287 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10288 void, not int.
10289 * tests/glr-regression.at (Badly Collapsed GLR States):
10290 Likewise.
10291 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10292 yylex should return 0 at EOF rather than aborting.
10293
6100a9aa
PE
10294 Improve tests for stack overflow in GLR parser.
10295 Problem reported by twlevo@xs4all.nl.
10296 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10297 All uses removed.
10298 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10299 can handle the problem.
10300 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10301 (yyparse): New local variable yyresult to record the result.
10302 Use result of setjmp to set it, rather than storing itinto
10303 struct.
10304 (yyDone): Remove label.
10305 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10306 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10307 if YYABORT is used).
10308 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10309 yyparse status; put status > 1 into diagnostic.
10310 Check that status==2 works.
10311 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10312 Use exit status 3 for failure to open (which shouldn't happen).
10313
15f40952
PE
103142005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10315
67fd79c4
PE
10316 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10317 1 on syntax error; just let yyparse do its thing.
10318 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10319 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10320 (Exploding the Stack Size with Alloca):
10321 (Exploding the Stack Size with Malloc):
10322 Expect exit status 2, not 1, since the parser is supposed to blow
10323 its stack. Problem reported by twlevo@xs4all.nl.
10324
15f40952
PE
10325 * data/glr.c (yyparse): Don't assume that the initial calls
10326 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10327 Print a stack-overflow message and fail instead.
10328 Initialize the line-number information before creating the stack,
10329 so that the stack-overflow message can report line zero safely.
10330
f32c66b5
PE
103312005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10332
a22ff96f 10333 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
10334 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10335 (yyuserMerge): Provide a default case if b4_mergers is empty.
10336 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10337 * tests/glr-regression.at
10338 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 10339 Add casts to pacify C++ compilers.
1beb0b24
PE
10340 * tests/glr-regression.at (Improper merging of GLR delayed action
10341 sets): Declare yylex before using it.
f32c66b5 10342 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
10343 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10344 test for valgrind; valgrind is independent of g++.
10345 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10346 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10347 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10348 Use a destructor, so that we can expand the stack. Change
10349 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 10350
d741bd1b
PE
103512005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10352
10353 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10354 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10355
0410a6e0
PE
103562005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10357
10358 * PACKAGING: New file, suggested by Bruno Haible and taken from
10359 similar wording in gettext's PACKAGING file.
10360 * NEWS: Mention PACKAGING.
10361 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10362
f7ab6a50
PE
103632005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10364
baf785db 10365 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
10366 * bootstrap: Get runtime translations into runtime-po.
10367 Create runtime-po files automatically, if possible.
10368 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10369 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10370 does not infringe on the user's name space.
10371 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10372 * doc/bison.texinfo (Internationalization): Revamp the English
10373 and Texinfo syntax a bit, to try to make it clearer.
10374 (Bison Options, Option Cross Key): Mention --print-localedir.
10375 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10376 YYENABLE_NLS. Quote a bit more.
10377 * runtime-po/.cvsignore: New file.
10378 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10379 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10380 * runtime-po/quot.sed: Likewise.
10381 * runtime-po/boldquot.sed: Likewise.
10382 * runtime-po/en@quot.header: Likewise.
10383 * runtime-po/en@boldquot.header: Likewise.
10384 * runtime-po/insert-header.sin: Likewise.
10385 * runtime-po/remove-potcdate.sin: Likewise.
10386 * runtime-po/Makevars: Likewise.
10387 * runtime-po/LINGUAS: Likewise.
10388 * runtime-po/de.po: Likewise; we will rely on the translation project
10389 to maintain this, so "bootstrap" should get it.
0410a6e0 10390 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
10391 its value.
10392 * src/main.c (main): Bind the bison-runtime domain, too.
10393
103942005-07-12 Bruno Haible <bruno@clisp.org>
10395
10396 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10397 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10398 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10399 * runtime-po: New directory.
10400 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10401 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10402 * runtime-po/Rules-quot: New file, copied from po/.
10403 * runtime-po/quot.sed: Likewise.
10404 * runtime-po/boldquot.sed: Likewise.
10405 * runtime-po/en@quot.header: Likewise.
10406 * runtime-po/en@boldquot.header: Likewise.
10407 * runtime-po/insert-header.sin: Likewise.
10408 * runtime-po/remove-potcdate.sin: Likewise.
10409 * runtime-po/Makevars: New file.
10410 * runtime-po/POTFILES.in: New file.
10411 * runtime-po/LINGUAS: New file.
10412 * runtime-po/bison-runtime.pot: New file.
10413 * runtime-po/de.po: New file.
10414 * m4/bison.m4: New file.
10415 * Makefile.am (SUBDIRS): Add runtime-po.
10416 (aclocaldir, aclocal_DATA): New variables.
10417 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10418 Define aclocaldir.
10419 * src/getargs.c (usage): Document --print-localedir option.
10420 (PRINT_LOCALEDIR_OPTION): New enum item.
10421 (long_options): Add --print-localedir option.
10422 (getargs): Handle --print-localedir option.
10423 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10424 (Internationalization): New section.
10425
22dda0f0
AD
104262005-07-12 Akim Demaille <akim@epita.fr>
10427
10428 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10429 for consistency with the rest of the code.
10430 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10431 Add separators.
10432
82b248ad
AD
104332005-07-12 Akim Demaille <akim@epita.fr>
10434
10435 * src/parse-gram.y: Use %printer instead of YYPRINT.
10436
fa0e9314
AD
104372005-07-12 Akim Demaille <akim@epita.fr>
10438
867a3e00
AD
10439 * src/symtab.h, src/symtab.c (symbol_print): New.
10440 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10441 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10442
104432005-07-12 Akim Demaille <akim@epita.fr>
10444
10445 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
10446 b4_at_dollar and b4_dollar_dollar.
10447
e054b190
PE
104482005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10449
10450 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10451 and Pennello's paper.
10452
34160ec4
PE
104532005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10454
407d4a75
PE
10455 * data/yacc.c (yyparse): Undo previous patch. Instead,
10456 set yylsp[0] and yyvsp[0] only if the initial action
10457 sets yylloc and yylval, respectively.
10458
34160ec4
PE
10459 * data/yacc.c (yyparse): In the initial action, set
10460 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10461 This avoids the use of undefined variables if the initial
10462 action does not set yylloc and/or yylval.
10463
c3d5a4a7
PE
104642005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10465
b34d96c1
PE
10466 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10467 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10468 Remove from CVS. These files are automatically generated.
10469 * examples/extexi: Clarify that this file is now part of Bison,
10470 not GNU M4, and that it works with any POSIX-compatible Awk.
10471 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10472 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10473 so that we also get calc++-parser.yy. Geneate it.
10474 Use $(AWK), not gawk, since any conforming Awk will do.
10475 Put comment before action, since older 'make' can't handle comment
10476 in action.
10477 $(BUILT_SOURCES): List all built sources, not just some of them.
10478 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10479 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10480 $($(calc_sources_generated)): Remove unnecessary test for existence
10481 of target. (This had a shell syntax error anyway; a stray "x".)
10482 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10483 calc++-parser.yy.
10484 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10485
c3d5a4a7
PE
10486 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10487 implied by the other modules.
10488
828c373b
AD
104892005-07-06 Akim Demaille <akim@epita.fr>
10490
10491 Bind examples/calc++ to the package.
10492 * examples/calc++/Makefile: Remove, replaced by...
10493 * examples/calc++/Makefile.am: ... this new file.
10494 * examples/calc++/test: Remove input.
10495 * examples/calc++/compile: Remove.
10496 * examples/Makefile.am: New.
10497 * configure.ac, Makefile.am: Adjust.
10498 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10499
63cb01d6
PE
105002005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10501
fd2df2ed
PE
10502 * data/glr.c (yyFail): Drastically simplify; since the format argument
10503 never had any % directives, we can simply pass it to yyerror.
10504 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10505 be modified later, as that is the usual style in glr.c.
10506 Problems reported by Paul Hilfinger.
10507
63cb01d6
PE
10508 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10509 and size overflow errors.
10510 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10511 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10512 (YYSIZEMAX): New macro.
10513 (yystpcpy): New function, taken from yacc.c.
10514 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10515 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10516 so that we don't have to maintain their signatures.
10517 (yyFail): Check for buffer overflow, by using vsnprintf rather
10518 than vsprintf. Allocate a bigger buffer if possible.
10519 Report an error if buffer allocation fails.
10520 (yyStackOverflow): New function.
10521 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10522 the initialization was successful. It might fail if storage was
10523 exhausted.
10524 (yyexpandGLRStack): Add more checks for storage allocation failure.
10525 Use yyStackOverflow to report failures.
10526 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
10527 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
10528 Don't assume stack number fits in int.
10529 (yysplitStack): Check for storage allocation failure.
10530 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
10531 can print diagnostics on storage allocation failure. All callers
10532 changed.
10533 (yyresolveValue): Use yybool for boolean.
10534 (yyreportSyntaxError): Check for size-calculation overflow.
10535 This code is taken from yacc.c.
10536 (yyparse): Check for storage allocation errors when allocating
10537 the initial stack.
10538
1c59e0a1
AD
105392005-07-05 Akim Demaille <akim@epita.fr>
10540
10541 Extract calc++ from the documentation.
10542 * doc/bison.texinfo (Calc++): Add the extraction marks.
10543 * examples/extexi: New, from the aborted GNU Programming 2E.
10544 Separate the different paragraph of a file with empty lines.
10545 * examples/Makefile: Use it to extract the whole calc++ example.
10546
8a0adb01
AD
105472005-06-24 Akim Demaille <akim@epita.fr>
10548
10549 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10550 class typedefs.
10551
12545799
AD
105522005-06-22 Akim Demaille <akim@epita.fr>
10553
10554 * doc/bison.texinfo (C++ Language Interface): First stab.
10555 (C++ Parsers): Remove.
10556
99be0235
AD
105572005-06-22 Akim Demaille <akim@epita.fr>
10558
10559 * data/lalr1.cc (yylex_): Honor %lex-param.
10560
0ffd4fd1
AD
105612005-06-22 Akim Demaille <akim@epita.fr>
10562
10563 Start a set of simple examples.
10564 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
10565 * examples/calc++/calc++-driver.hh,
10566 * examples/calc++/calc++-parser.yy,
10567 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
10568 * examples/calc++/compile, examples/calc++/test: New.
10569
0925ebb4
PE
105702005-06-09 Paul Eggert <eggert@cs.ucla.edu>
10571
10572 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
10573 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
10574 which stems from the 2005-05-27 patch.
10575
43d3b664
PH
105762005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10577
10578 * data/glr.c: Modify treatment of unused parameters to permit use
10579 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
10580
3062864d
PE
105812005-05-30 Paul Eggert <eggert@cs.ucla.edu>
10582
10583 Fix infringement on user name space reported by Janos Zoltan Szabo.
10584 * data/yacc.c (yyparse): strlen -> yystrlen.
10585
989b5b8e
AD
105862005-05-30 Akim Demaille <akim@epita.fr>
10587
10588 * data/lalr1.cc (_): New.
10589 Translate the various messages.
10590
bedf57f5
PE
105912005-05-27 Paul Eggert <eggert@cs.ucla.edu>
10592
10593 Fix infringement on user name space reported by Bruno Haible.
10594 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
10595 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
10596 the user's name space.
10597 (alloca): Include <stdlib.h> to get it, if it's not built in.
10598 (YYMALLOC, YYFREE): Define only if needed.
10599 (malloc, free): Declare, but only if needed, as this infringes on
10600 the user name space.
10601
4d1801f1
PE
106022005-05-25 Paul Eggert <eggert@cs.ucla.edu>
10603
10604 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
10605 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
10606 with %d format.
10607 * lib/ebitset.c (min, max): Undef before defining.
10608 * lib/vbitset.c (min, max): Likewise.
10609 * lib/subpipe.c (create_subpipe): Save local variables in case
10610 vfork clobbers them.
10611
106122005-05-24 Bruno Haible <bruno@clisp.org>
10613
10614 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
10615 error message syntax used by gcc-4.0.
10616
b94a9e1e
PE
106172005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10618
85ac3861
PE
10619 * README: Mention m4 1.4.3. Remove obsolete advice about
10620 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10621
b94a9e1e
PE
10622 * bootstrap: Remove workaround for problem I encountered with
10623 gettext 0.14.1; it seems to be fixed now.
10624
51c30d21
PE
106252005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10626
009ce67d
PE
10627 * NEWS: Version 2.0a.
10628
f2a97c62
PE
10629 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10630 the previous change.
10631
c8775f93
PE
10632 Various maintainer cleanups.
10633 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10634 conftest*, for benefit of CVS commands run at the same time as
10635 "configure". Add build-aux, since "bootstrap" now creates it and
10636 its subfiles.
10637 * Makefile.cfg (move_if_change): Remove.
10638 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10639 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10640 (po_repo, do-po-update, po-update, wget_files, get-targets):
10641 (config.guess-url_prefix, config.sub-url_prefix):
10642 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10643 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10644 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10645 Remove.
10646 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10647 this is now the recommended name.
10648 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10649 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10650 ylwrap. These files now go into build-aux.
10651 * config/move-if-change: Remove.
10652 * config/prev-version.txt: Bump from 1.75 to 2.0.
10653
3ea5f0ec
PE
10654 * bootstrap: Add stdio-safer, unistd-safer modules.
10655 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10656 we don't need it).
10657 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10658 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10659 * lib/subpipe.c: Include "unistd-safer.h".
10660 (create_subpipe): Make sure all the newly-created
10661 file descriptors are > 2, so that diagnostics don't
10662 get sent down them (which might cause Bison to hang, in theory).
10663 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10664 * src/files.c (xfopen): Use fopen_safer, not fopen.
10665
51c30d21
PE
10666 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10667 yesterday's yacc.c fix.
10668
cea1469d
PE
106692005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10670
3ea5f0ec
PE
10671 * data/glr.c, data/lalr1.cc: Update copyright date.
10672
cea1469d
PE
10673 Fix a destructor bug reported by Wolfgang Spraul in
10674 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10675 * data/yacc.c (yyabortlab): Don't call destructor, and
10676 don't set yychar to EMPTY.
10677 (yyoverflowlab): Don't call destructor.
10678 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10679 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10680 since we no longer output the message "discarding lookahead token
10681 end of input ()".
10682
5e6f62f2
PH
106832005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10684
10685 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10686 fix a small glitch in debugging output.
10687 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10688 after YY_SYMBOL_PRINT where needed.
10689
10690 (struct yyGLRState): Add some comments.
10691 (struct yySemanticOption): Add some comments.
10692 (union yyGLRStackItem): Add comment.
10693
10694 (yymergeOptionSets): Correct this to properly perform the union,
10695 avoiding infinite reported by Michael Rosien.
10696 Update comment.
10697
10698 * tests/glr-regression.at: Add test for GLR merging error reported
10699 by M. Rosien.
cea1469d 10700
0fb669f9
PE
107012005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10702
10703 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10704 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10705 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10706 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10707 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10708 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10709 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10710 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10711 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10712 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10713 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10714 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10715 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10716 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10717 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10718 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10719 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10720 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10721 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10722 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10723 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10724 src/output.h, src/parse-gram.c, src/parse-gram.h,
10725 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10726 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10727 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10728 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10729 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10730 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10731 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10732 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10733 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10734 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10735 tests/reduce.at, tests/regression.at, tests/sets.at,
10736 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10737 Update FSF postal mail address.
10738
51f4735e
PE
107392005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10740
10741 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10742 Problem reported by Ralf Menzel.
10743
80ce3401
PE
107442005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10745
10746 * tests/actions.at: Test that stack overflow invokes destructors.
10747 From Marcus Holland-Moritz.
10748 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10749 from here....
10750 (yyreturn): to here. That way, destructors are called properly
10751 even if the stack overflows, or the user calls YYACCEPT or
10752 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10753 (yyoverflowlab): Destroy the lookahead.
10754
107552005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10756
10757 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10758
72f000b0
PE
107592005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10760
10761 * NEWS: Bison-generated C parsers no longer quote literal strings
10762 associated with tokens.
10763 * src/output.c (prepare_symbols): Don't escape strings,
10764 since users don't want to see C escapes.
10765 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10766 in diagnostics.
c19683bb 10767 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
10768 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10769
1094323f
PE
107702005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10771
10772 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10773 the data size is known to be too small and we can't increase it.
10774 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10775
ca407bdf
PE
107762005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10777
10778 * src/parse-gram.y: Include quotearg.h.
10779 (string_as_id): Quote $1 before using it as a key, since the
10780 lexer no longer quotes it for us.
10781 (string_content): Don't strip quotes, since lexer no longer
10782 quotes it for us.
10783 * src/scan-gram.l: Include quotearg.h.
10784 ("\""): Omit quote.
10785 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10786 a key, since the rest of the lexer doesn't quote it.
10787 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10788 * tests/regression.at (Token definitions): Check for backslashes
10789 in token strings.
10790
10791 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10792 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10793 (yyparse): Revamp code to generate long syntax error message, to
10794 make it easier to translate, and to avoid problems with arithmetic
10795 overflow. Change "virtual memory" to "memory" in diagnostic, since
10796 we don't know whether the memory is virtual.
10797
1ce59070
PE
107982005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10799
10800 * NEWS: Bison-generated C parsers now use the _ macro to
10801 translate strings.
10802 * data/yacc.c (_) [!defined _]: New macro.
10803 All English strings wrapped inside this macro.
10804 * doc/bison.texinfo (Bison Parser): Document _.
10805 * po/POTFILES.in: Include src/parse-gram.c, since it now
10806 includes translateable strings that parse-gram.y doesn't.
10807
a749a695
PE
108082005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10809
10810 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10811 reverting the 2004-10-11 change to this function.
10812 (symbol_check_alias_consistency): Don't call symbol_type_set
10813 if the type name is already correct.
10814 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10815
8fb1053b
PE
108162005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10817
10818 * tests/regression.at (Token definitions): Don't use a token named
10819 c, as that generates a "#define c ..." that runs afoul of buggy
10820 stdlib.h that uses the identifier c as a member of struct
10821 drand48_data. Problem reported by Horst Wente.
10822
ff498c4a
PE
108232005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10824
10825 * bootstrap: Change translation URL from
10826 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10827 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10828 redirection glitches. Problem reported by twlevo@xs4all.nl.
10829
65211d70
PE
108302005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10831
10832 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10833 after operands; POSIX says this isn't portable for the c99 command.
10834
9577fb1f
PE
108352005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10836
10837 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10838 immediately if a data overrun has occurred; this may help us track
10839 down what may be a spurious failure on MacOS.
10840
78b178f7
PE
108412005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10842
a2599d0f
PE
10843 Respond to problems reported by twlevo@xs4all.nl.
10844
10845 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10846
78b178f7
PE
10847 * src/vcg.h: Comment fix.
10848 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10849 (G_CMAX): Change to -1 instead of INT_MAX.
10850
10851 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 10852
7296e729
PE
108532005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10854
10855 * src/tables.c (state_number_to_vector_number): Put it inside an
10856 "#if 0", since it's not currently used. Problem reported by
10857 Roland McGrath.
10858
05ac60f3
PE
108592005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10860
10861 * src/output.c (escaped_output): Renamed from
10862 escaped_file_name_output, since we now use it for symbol tags as
10863 well. All uses changed.
10864 (symbol_destructors_output, symbol_printers_output):
10865 Escape symbol tags too.
10866 Problem reported by Matyas Forstner in
10867 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10868
10869 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10870 not needed.
10871 * src/output.c (user_actions_output, token_definitions_output,
10872 symbol_destructors_output, symbol_printers_output): Likewise.
10873 * src/reader.c (prologue_augment): Likewise.
10874 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10875
10876 * src/vcg.c (output_edge): Don't quote linestyle arg.
10877 Problem reported by twlevo@xs4all.nl.
10878
7eb453ac
PE
108792005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10880
10881 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10882 example, reported by Derek M Jones. Also, make the example even
10883 more outrageous, to better illustrate how bad the problem is.
10884
4c04c52a
PE
108852005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10886
10887 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10888 putsym. Typo reported by Sebastian Piping.
10889
a61e1620
PE
108902005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10891
10892 * doc/bison.texinfo (Language and Grammar): some -> same
10893 (Epilogue): int he -> in the
10894 Typos reported by Sebastian Piping via Justin Pence.
10895
9ec93868
PE
108962005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10897
10898 * tests/glr-regression.at (Improper handling of embedded actions
10899 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10900 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10901 with dollar signs in test names.
10902 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10903 for a similar reason.
10904
73ce7e7e
PE
109052005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10906
10907 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10908 wants to redefine G_VIEW.
10909
2e72b98e
PE
109102005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10911
10912 * src/vcg.c (get_view_str): Remove case for normal_view.
10913 Problem reported by twlevo@xs4all.nl.
10914
e0d634e5
PE
109152005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10916
ccf830a4
PE
10917 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10918 Problem reported by twlevo@xs4all.nl.
10919
e0d634e5
PE
10920 * doc/bison.texinfo: Change @dircategory from "GNU programming
10921 tools" to "Software development". Requested by Richard Stallman
10922 via Karl Berry.
10923
7bbc8cb0
PE
109242005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10925
10926 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10927 Problem reported by twlevo@xs4all.nl.
10928
08b770bc
PE
109292005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10930
10931 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10932 keyword; it's not needed with modern compilers, and it doesn't
10933 affect correctness with older compilers. Suggested by
10934 twlevo@xs4all.nl.
10935
95f22ad2
PE
109362005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10937
10938 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10939 gcc -Wswitch-default.
10940 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10941 * data/yacc.c (yyparse): Likewise.
10942
d229d15c
PE
109432005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10944
10945 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10946 already. Let config.h define any nonstandard values.
10947
ecadd90f
PE
109482005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10949
10950 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10951 for the benefit of slower hosts. Problem reported by
10952 Nelson H. F. Beebe.
10953
213744b5
PE
109542005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10955
10956 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10957 being defined and not used.
10958 * data/lalr1.cc (yyparse): Likewise.
10959 Use "if (false)" rather than "if (0)".
10960
249d3236
PE
109612005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10962
10963 * TODO: Mention that we should allow NUL bytes in tokens.
10964
987cc1fb
PE
109652005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10966
10967 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10968 Problem reported by Hans Aberg.
10969
08fe02d9
PE
109702005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10971
10972 * src/getargs.c (version): Happy new year; update overall
10973 program copyright date from 2004 to 2005.
10974
10975 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10976 Problem reported by Hans Aberg.
10977 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10978 (Output file names.): Add a test for the case when standard output
10979 is closed.
10980
010c0266
PE
109812004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10982
10983 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10984 to fix an oversight in the Bison 2.0 manual.
10985
da12206a
PE
109862004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10987
10988 * NEWS: Version 2.0. Reformat the existing news items since
10989 1.875, so that related items are grouped together.
3a4734aa 10990 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
10991 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10992
c935d934
PE
10993 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10994 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10995 otherwise, we're not testing alloca. Unfortunately there's no
10996 simple way to consult HAVE_ALLOCA here.
10997
da12206a
PE
10998 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10999 for yymsg, too.
11000
11001 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11002 hand. This avoids a warning about comparing int to size_t when
11003 GCC warnings are enabled.
11004
0a2c5137
PE
110052004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11006
d7e14fc0
PE
11007 * NEWS: Bison-generated parsers no longer default to using the
11008 alloca function (when available) to extend the parser stack, due
11009 to widespread problems in unchecked stack-overflow detection.
11010 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11011 responsibility to set it to a positive value. This lets the user
11012 specify a value that is not a preprocessor constant.
11013 * data/yacc.c (YYMAXDEPTH): Likewise.
11014 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
11015 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
11016 to be a compile-time constant. However, explain the constraints on it.
11017 Also, explain the constraints on YYINITDEPTH.
11018 (Table of Symbols): Explain that alloca is no longer the default.
11019 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
11020 to 1.
11021
0a2c5137
PE
11022 * doc/bison.texinfo (Location Default Action): Mention that n must
11023 be zero when k is zero. Suggested by Frank Heckenbach.
11024
e019c247
AD
110252004-12-22 Akim Demaille <akim@epita.fr>
11026
11027 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
11028 (parser::state_type, parser::semantic_type, parser::location_type):
11029 Private, not public.
11030 (parser::parse): Return ints, not bool.
11031 Returning a bool introduces a problem: 0 corresponds to false, and
11032 it seems weird to return false on success. Returning true changes
11033 the conventions for yyparse.
11034 Alternatively we could return void and send an exception.
11035 There is no clear consensus (yet?).
11036 (state_stack, semantic_stack, location_stack): Rename as...
11037 (state_stack_type, semantic_stack_type, location_stack_type): these.
11038 Private, not public.
11039 * tests/c++.at: New.
11040 * tests/testsuite.at, tests/Makefile.am: Adjust.
11041
72731bb7
AD
110422004-12-21 Akim Demaille <akim@epita.fr>
11043
11044 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
11045
9a0d8bec
AD
110462004-12-21 Akim Demaille <akim@epita.fr>
11047
11048 Don't impose std::string for filenames.
11049
11050 * data/lalr1.cc (b4_filename_type): New.
11051 (position::filename): Use it.
11052 (parser.hh): Move the inclusion of stack.hh and location.hh below
11053 the user code, so that needed headers for the filename type can be
11054 included first.
72731bb7
AD
11055 Forward declare them before the user code.
11056 * tests/Makefile.am (check-local, installcheck-local): Pass
11057 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 11058
99880de5
AD
110592004-12-20 Akim Demaille <akim@epita.fr>
11060
11061 Use more STL like names: my_class instead of MyClass.
11062
11063 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
11064 (SemanticStack, SemanticType, StateStack, StateType)
11065 (TokenNumberType, Stack, Slice, Traits, Parser::location)
11066 (Parser::value): Rename as...
11067 (location_stack, location_type, rhs_number_type, semantic_stack)
11068 (semantic_type, state_stack, state_type, token_number_type, stack)
11069 (slice, traits, parser::yylloc, parser::yylval): these.
11070
11071 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
11072
9bec482e
PE
110732004-12-19 Paul Eggert <eggert@cs.ucla.edu>
11074
11075 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
11076 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11077
f6fbd3da
PE
110782004-12-17 Paul Eggert <eggert@cs.ucla.edu>
11079
11080 Remove uses of 'short int' and 'unsigned short int'. This raises
11081 some arbitrary limits. It uses more memory but nowadays that's
11082 not much of an issue.
11083
11084 This change does not affect the generated parsers; that's a different
11085 task, as some users will want to conserve memory there.
11086
11087 Ideally we should use size_t to represent all object counts, and
11088 something like ptrdiff_t to represent signed differences of object
11089 counts; but that will require more code-cleanup than I have the
11090 time to do right now.
11091
11092 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
11093 Use size_t, not int or short int, to count objects.
11094 * src/closure.c (nritemset, closure): Likewise.
11095 * src/closure.h (nritemset, closure): Likewise.
11096 * src/nullable.c (nullable_compute): Likewise.
11097 * src/print.c (print_core): Likewise.
11098 * src/print_graph.c (print_core): Likewise.
11099 * src/state.c (state_compare, state_hash): Likewise.
11100 * src/state.h (struct state): Likewise.
11101 * src/tables.c (default_goto, goto_actions): Likewise.
11102
11103 * src/gram.h (rule_number, rule): Use int, not short int.
11104 * src/output.c (prepare_rules): Likewise.
11105 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
11106 errs, reductions): Likewise.
11107 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
11108 Likewise.
11109 * src/tables.c (vector_number, tally, action_number,
11110 ACTION_NUMBER_MINIMUM): Likewise.
11111 * src/output.c (muscle_insert_short_int_table): Remove.
11112
efeed023
AD
111132004-12-17 Akim Demaille <akim@epita.fr>
11114
11115 * data/lalr1.cc: Extensive Doxygenation.
11116 (error_): Rename as...
11117 (error): this, since it is visible to the user.
11118 Adjust callers.
11119 (Parser::message): Now an automatic variable from...
11120 (Parser::yyreport_syntax_error_): here.
11121 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
11122 Parser::error.
11123 * tests/input.at: Escape $.
11124
bc82c5a5
PE
111252004-12-16 Paul Eggert <eggert@cs.ucla.edu>
11126
11127 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
11128 Parenthesize rhs to avoid obscure problems with mistakes like
11129 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
11130 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11131 b4_rhs_location): Likewise.
11132 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11133 b4_rhs_location): Likewise.
11134
fd19f271
AD
111352004-12-16 Akim Demaille <akim@epita.fr>
11136
11137 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
11138 yacc.c: be sure to stay within yycheck_.
11139 * tests/actions.at: Re-enable C++ tests.
11140
10454ea4
AD
111412004-12-16 Akim Demaille <akim@epita.fr>
11142
11143 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
11144 real.
11145
c5b95ccf
AD
111462004-12-16 Akim Demaille <akim@epita.fr>
11147
11148 Use #define to handle the %name-prefix.
11149
11150 * data/glr.c, data/yacc.c: Comment changes.
11151 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
11152 so that one can refer to yylex in the parser file, and have it
11153 renamed, as is the case with other skeletons.
11154
617a8f12
AD
111552004-12-16 Akim Demaille <akim@epita.fr>
11156
11157 Move lalr1.cc internals into yy*.
11158
11159 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
11160 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
11161 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
11162 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
11163 (empty_, final_, terror_, errcode_, ntokens_)
11164 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
11165 (looka_, ilooka_, error_range_, nerrs_):
11166 Rename as...
11167 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
11168 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
11169 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
11170 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
11171 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
11172 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
11173 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
11174 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
11175 these.
11176
1e547e6e
PE
111772004-12-15 Paul Eggert <eggert@cs.ucla.edu>
11178
11179 Fix some problems reported by twlevo at xs4all.
11180 * src/symtab.c (symbol_new): Report an error if the input grammar
11181 contains too many symbols. This is better than calling abort() later.
11182 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
11183 (struct node, struct graph):
11184 Rename member expand to stretch. All uses changed.
11185 (struct graph): Remove member layoutalgorithm. All uses removed.
11186 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
11187 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
11188 All uses changed.
11189 (N_STRETCH): Rename from N_EXPAND. All uses changed.
11190
735d6bd4
AD
111912004-12-15 Akim Demaille <akim@epita.fr>
11192
11193 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
11194 Add more Doxygen comments.
11195 (symprint_, stack_print_, reduce_print_, destruct_, pop)
11196 (report_syntax_error_, translate_): Rename as...
11197 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
11198 (yypop_, yyreport_syntax_error_, yytranslate_): this.
11199
2e1f5829
AD
112002004-12-15 Akim Demaille <akim@epita.fr>
11201
11202 * data/lalr1.cc (lex_): Rename as...
11203 (yylex_): this.
11204 Move the trace here.
11205 Take the %name-prefix into account.
11206 Reported by Alexandre Duret-Lutz.
11207
a3cb6248
AD
112082004-12-15 Akim Demaille <akim@epita.fr>
11209
11210 Simplify the C++ parser constructor.
11211
11212 * data/lalr1.cc (debug_): Rename as...
11213 (yydebug_): so that the parser's internals are always in the yy*
11214 pseudo namespace.
11215 Adjust uses.
11216 (b4_parse_param_decl): Remove the leading comma as it is now only
11217 called as unique argument list.
11218 (Parser::Parser): Remove the constructor accepting a location and
11219 an initial debugging level.
11220 Remove from the other ctor the argument for the debugging level.
11221 (debug_level_type, debug_level, set_debug_level): New.
11222
11223 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11224 constructor calls.
11225
07fed891
AD
112262004-12-15 Akim Demaille <akim@epita.fr>
11227
11228 Remove b4_root related material: failure experiment
a3cb6248 11229 (which goal was to allow to derive from a class).
07fed891
AD
11230
11231 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11232 definitions and uses.
11233
e603eaa5
PE
112342004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11235
11236 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11237 not 2, since it's not portable to subtract 1 from the start of an
11238 array. The new item 0 is never set or used. All uses changed.
11239
11240 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11241 the default definition of YYLLOC_DEFAULT. Problem reported
11242 by Frank Heckenbach.
11243
fafb007d
PE
112442004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11245
11246 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11247 the normal case and one for the error case. Just use the
11248 first one uniformly. Problem reported by Frank Heckenbach.
11249 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11250 use exactly the same macro in both places.
11251 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11252 so that the normal-case YYRHSLOC works for the error case too.
11253 All uses changed.
11254 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11255 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11256 * doc/bison.texinfo (Location Default Action): Don't claim that
11257 we have an array of locations. Use the same macro for both glr
11258 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11259 the index is 0.
11260
48814dcd
PE
112612004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11262
a4e1a53b
PE
11263 * HACKING: Update email addresses to send announcements to.
11264
48814dcd
PE
11265 * configure.ac (AC_INIT): Bump version to 1.875f.
11266
337116ba
PE
112672004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11268
11269 * NEWS: Version 1.875e.
11270 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11271
11272 * src/scan-skel.l: Include "complain.h", for "fatal".
11273
11274 * src/relation.h (relation_print, relation_digraph):
11275 Relation sizes are of type relation_node, not size_t (this is
11276 merely a doc fix, since the two types are equivalent).
11277 (relation_transpose): Relation sizes are of type relation_node,
11278 not int.
11279 * src/relation.c: Likewise.
11280 (top, infinity): Now of type relation_node, not int.
11281 (traverse, relation_transpose): Use relation_node, not int.
11282
11283 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11284 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11285 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11286
11287 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 11288 specifying whether the test should be skipped. Use it tp
337116ba 11289 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 11290 fail on some hosts, and should be skipped.
337116ba 11291
da2a7671
PE
112922004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11293
11294 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11295 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11296 unless otherwise specified below.
11297
11298 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11299 to allocate kernel_base, kernel_items, kernel_size, since
11300 they needn't be initialized to 0.
11301 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11302 * src/closure.c (new_closure): Likewise, for itemset.
11303 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11304 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11305 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11306 (build_relations): Likewise for edge, states1, includes.
11307 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11308 * src/reader.c (packgram): Likewise, for ritem, rules.
11309 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11310 * src/relation.c (relation_digraph): Likewise for VERTICES.
11311 (relation_transpose): Likewise for new_R, end_R.
11312 * src/symtab.c (symbols_token_translations_init): Likewise for
11313 token_translations.
11314 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11315 (token_actions): Likewise for yydefact, actrow, conflrow,
11316 conflict_list.
11317 (save_column): Likewise for froms[symno], tos[symno].
11318 (goto_actions): Likewise for state_count.
11319 (pack_table): Likewise for base, pos, check.
11320 (tables_generate): Likewise for width.
11321
11322 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11323 for initial core. Just have a separate core, so we needn't worry
11324 about whether kernel_size and kernel_base are initialized.
11325
11326 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11327 kernel_size, kernel_items): Remove unnecessary initialization.
11328 * src/conflicts.c (conflicts): Likewise.
11329 * src/derives.c (derives): Likewise.
11330 * src/muscle_tablc (muscle_insert): Likewise.
11331 * src/relation.c (relation_digraph): Likewise.
11332 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11333 conflrow, conflict_table, conflict_list, table, check):
11334 Likewise.
11335
11336 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11337 This is because all callers pass unsigned int.
11338 * src/closure.h (new_closure): Likewise.
11339
11340 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11341 (build_relations): Initialize includes[i] in all cases.
11342 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11343 and rules[ruleno].precsym. Initialize members in order.
11344 * src/relation.c (relation_transpose): Always initialize new_R[i]
11345 and end_R[i].
11346 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11347
11348 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11349 conflict_list[0] was always 0, but now it isn't initialized.
11350
11351 * src/table.c (table_grow): When conflict_table grew, the grown
11352 area wasn't cleared. Fix this.
11353
11354 * lib/.cvsignore: Add strdup.c, strdup.h.
11355 * m4/.cvsignore: Add strdup.m4.
11356
00baeeac
PE
113572004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11358
11359 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11360 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11361 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11362 ngotos + 1 without checking for overflow.
11363 (build_relations): Use END_NODE, not -1, to denote end of edges.
11364 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11365 build_relations): Use goto_number, not int, for goto numbers.
11366 * src/tables.c (save_column, default_goto): Likewise.
11367
be3d9d42
AD
113682004-11-23 Akim Demaille <akim@epita.fr>
11369
11370 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11371 of #defining from yystype.
11372 Don't typedef yystype, C++ does not need it.
11373 This lets it possible to forward declare it as union.
11374
78e526d5
PE
113752004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11376
11377 * bootstrap (gnulib_modules): Add extensions.
11378 Problem reported by Jim Meyering.
11379
afbb696d
PE
113802004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11381
11382 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11383 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11384 src/system.h, src/tables.c: XFREE -> free, to accommodate
11385 recent change to gnulib xalloc.h.
78e526d5 11386 Problem reported by Jim Meyering.
afbb696d 11387
c1f8f16a
AD
113882004-11-17 Akim Demaille <akim@epita.fr>
11389
11390 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11391
db7e5eb5 113922004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
11393 Alexandre Duret-Lutz <adl@gnu.org>
11394
11395 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11396 changes.
11397 (YYCDEBUG): Adjust.
11398 Use it instead of cdebug_.
11399 (Parser::debug_stream, Parser::set_debug_stream): New.
11400 (Parser::symprint_): Define cdebug_ for temporary backward
11401 compatibility.
11402 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11403 debug_stream ().
11404
68e11668
AD
114052004-11-17 Akim Demaille <akim@epita.fr>
11406
11407 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11408 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11409 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11410 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11411
97cbc73e
PE
114122004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11413
11414 * data/glr.c (yyloc_default): Remove; not used.
11415 Problem reported by Frank Heckenbach.
11416
e342c3be
AD
114172004-10-25 Akim Demaille <akim@epita.fr>
11418
11419 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11420 Introduce another definition to address simple location arrays.
11421 (yyGLRStack): New member: yyerror_range.
11422 (yyrecoverSyntaxError, yyparse): Update it.
11423 (yyrecoverSyntaxError): Use it when shifting the error token to
11424 have an accurate range, equivalent to the one computed by both
11425 yacc.c and lalr1.cc.
11426 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11427 that column numbers start at column 0, as per GNU Coding
11428 Standards, the others tests, and the doc.
11429 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11430 Adjust to the above change (first column is 0).
11431 And adjust the location of the "<error>", now covering the whole
11432 line.
11433
93602feb 114342004-10-22 Akim Demaille <akim@epita.fr>
04098407 11435 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
11436
11437 Remove some arbitrary limits on goto numbers and relations.
11438 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11439 initial values, since they're never used.
11440 (set_goto_map): ngotos is now unsigned, so test for overflow
11441 by seeing whether it wraps around to zero.
11442 * src/lalr.h (goto_number): Now size_t, not short int.
11443 (GOTO_NUMBER_MAXIMUM): Remove.
11444 * src/relation.c (relation_print, traverse, relation_transpose):
11445 Check for END_NODE rather than looking at sign.
11446 * src/relation.h (END_NODE): New macro.
11447 (relation_node): Now size_t, not short int.
11448
dba08b04
PE
114492004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11450
11451 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11452 keyword, not an identifier. Problem reported by Baron Schwartz in
11453 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11454
df09ef2e
AD
114552004-10-11 Akim Demaille <akim@epita.fr>
11456
11457 * src/symtab.c (symbol_check_alias_consistency): Also check
11458 type names, destructors, and printers.
11459 Reported by Alexandre Duret-Lutz.
11460 Recode the handling of associativity and precedence in terms
11461 of symbol_precedence_set.
11462 Accept no redeclaration at all, not even equal to the previous
11463 value.
11464 (redeclaration): New.
11465 Use it to factor redeclaration complaints.
11466 (symbol_make_alias): Don't set the type of the alias, let
11467 symbol_check_alias_consistency do it as for other features.
11468 * src/symtab.h (symbol): Add new member prec_location, and
11469 type_location.
11470 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11471 * tests/input.at (Incompatible Aliases): New.
11472
146bc99d
PE
114732004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11474
11475 .cvsignore fixes to accommodate gnulib changes,
11476 and the practice of naming build directories "_build".
11477 * .cvsignore: Add "_*". Sort.
11478 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11479 * m4/.cvsignore: Add "*_gl.m4".
11480
e503aa60
AD
114812004-10-06 Akim Demaille <akim@epita.fr>
11482
11483 * src/parse-gram.y (add_param): Fix the truncation of trailing
11484 spaces.
11485
b4a20338
AD
114862004-10-05 Akim Demaille <akim@epita.fr>
11487
11488 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11489 whether the reducion was empty or not. This leaves room to
11490 improve the use of YYLLOC_DEFAULT in such a case.
11491 lalr1.cc is still experimental, so changing this is acceptable.
11492 And finally, there are probably not many users who changed the
11493 handling of locations in GLR, so changing is admissible too.
11494
11495 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11496 empty reduction, set @$ to an empty location ending the previously
11497 stacked symbol.
11498 Adjust uses to make sure the code is triggered on empty
11499 reductions.
11500 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11501 expected output: empty reductions have empty locations.
11502
f85a5e6f
AD
115032004-09-29 Akim Demaille <akim@epita.fr>
11504
11505 * data/lalr1.cc: Move towards a more standard C++ coding style
11506 for templates: Class < T > -> Class<T>.
11507
b203fc2c
AD
115082004-09-29 Akim Demaille <akim@epita.fr>
11509
11510 * data/lalr1.cc: Reinstall the former ctor, for sake of
11511 compatibility, but warn it will be removed.
11512 Move towards a more standard C++ coding style (i.e., type *var ->
11513 type* var).
11514
5b7e1e73
PE
115152004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11516
3fee967f
PE
11517 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11518 since it's less likely to work if NULs are involved in the future.
5b7e1e73 11519
0dcca5c2
AD
115202004-09-27 Akim Demaille <akim@epita.fr>
11521
11522 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11523
6dde1c82
AD
115242004-09-27 Akim Demaille <akim@epita.fr>
11525
11526 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 11527 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
11528 and argument names.
11529 (b4_cc_constructor_call): Likewise.
11530
b233d555
AD
115312004-09-24 Akim Demaille <akim@epita.fr>
11532
11533 * src/parse-gram.y (add_param): Strip the leading and trailing
11534 blanks from a formal argument declaration.
11535 (YY_LOCATION_PRINT): New.
11536
619404e3
AD
115372004-09-24 Akim Demaille <akim@epita.fr>
11538
11539 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11540 after the location.
11541
dd8d9022
AD
115422004-09-24 Akim Demaille <akim@epita.fr>
11543
11544 * doc/bison.texinfo (Table of Symbols): Sort.
11545
0092f063
AD
115462004-09-21 Akim Demaille <akim@epita.fr>
11547
11548 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
11549 the useless parentheses.
11550 Suggested by Paul Eggert.
11551
451364ed
AD
115522004-09-20 Akim Demaille <akim@epita.fr>
11553
11554 Let the initial-action act on the look-ahead, and use it for the
11555 "initial push" (corresponding to an hypothetical beginning-of-file).
11556 And let lalr1.cc honor %initial-action.
11557
11558 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
11559 example.
11560 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
11561 (Parser::Parser): Remove the ctor that used to initialize it.
11562 (Parser::parse): Like in the other skeletons, issue the "starting
11563 parse" message before any action.
11564 Honor %initial-action.
11565 Initialize the stacks with the lookahead.
11566 * data/yacc.c: Let $$ and @$ in %initial-action designate the
11567 look-ahead.
11568 Push them in the stacks.
11569 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
11570
18d192f0
AD
115712004-09-20 Akim Demaille <akim@epita.fr>
11572
11573 * doc/bison.texinfo (Initial Action Decl): New.
11574
b8458aa5
AD
115752004-09-20 Akim Demaille <akim@epita.fr>
11576
11577 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
11578 clearer criterion to define it.
11579 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
11580 When reducing on an empty RHS, use the latest stacked location as
11581 location.
11582 yylloc is not always available.
11583 * data/glr.c: Likewise.
11584 Also, honor initial-actions.
11585
3fc16193
AD
115862004-09-20 Akim Demaille <akim@epita.fr>
11587
11588 * data/yacc.c (YY_LOCATION_PRINT): New.
11589 Define when we know YYLTYPE's structure, i.e., when the default
11590 YYLLOC_DEFAULT is used.
11591 * data/c.m4 (b4_yysymprint_generate): Use it.
11592 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
11593 value of the result.
11594 (error_start_): Replace with...
11595 (error_range_): this location array.
11596 This allows to replace code relying on the implementation of
11597 locations by portable code.
11598 * data/yacc.c (yylerrsp): Replace with...
11599 (yyerror_range): this.
11600 Every time a token is popped, update yyerror_range[0], to have an
11601 accurate location for the error token.
11602 * data/glr.c (YY_LOCATION_PRINT): New.
11603 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
11604 deference a pointer.
11605 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
11606 report the location in %printers.
11607
11608 * src/scan-skel.l: Instead of abort, report error messages to ease
11609 understanding skeleton scanning failures.
11610
ecfe33e7
AD
116112004-09-16 Akim Demaille <akim@epita.fr>
11612
11613 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
11614 (iterator, const_iterator): these, to be more in the C++ spirit.
11615 Also, return reverse iterators so that when displaying the stack
11616 we display its bottom first.
11617 (Parser::stack_print_, Parser::reduce_print_): Match the messages
11618 from yacc.c.
11619 We should probably use vector here though.
11620
1576d44d
AD
116212004-09-16 Akim Demaille <akim@epita.fr>
11622
11623 Have more complete shift traces.
11624
11625 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11626 to report Shifts instead of ad hoc YYDPRINTF invocations,
11627 including for the error token.
11628 * data/lalr1.cc (symprint_): Output the location.
11629 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11630 output the location within the %printer.
11631 Activate GLR tests, at least to make sure they compile properly.
11632 They still don't pass though.
11633 * tests/calc.at: Adjust expect verbose output, since now "Entering
11634 state..." is on a different line than the "Shifting" message.
11635
9c66f418
AD
116362004-09-08 Akim Demaille <akim@epita.fr>
11637
11638 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11639 Bison directive from the Bison file to the invocation of this
11640 macro, so that these directives are passed to
11641 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11642 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11643 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11644 the extra Bison directives instead of the whole series.
11645 Change the grammar so that there are recoverable errors, and
11646 unrecoverable errors. Now we can have the parser give up before
11647 consuming the whole input. As a result we now can observe that
11648 the lookahead is freed when needed.
11649 Change the parser source to parse argv[1] instead of a hard coded
11650 string.
11651 Simplify yylex, and give a value and location to EOF.
11652 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11653 passed directives already coded in the file.
11654 Add some tests to check the location of "error".
11655 For some tests, the C++ parser is correct, and not yacc.c.
11656 For other tests, they provide different, but unsatisfying, values,
11657 so keep the C++ value so that at least one parser is "correct"
11658 according to the test suite.
11659 (Actions after errors): Remove, this is subsumed by the
11660 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11661
52d5733f
AD
116622004-09-06 Akim Demaille <akim@epita.fr>
11663
11664 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 11665 (Parser::pop): New.
52d5733f
AD
11666 Use it.
11667
a0e68930
AD
116682004-09-06 Akim Demaille <akim@epita.fr>
11669
11670 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11671 argument, an informative message.
11672 Call YY_SYMBOL_PRINT.
11673 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11674 * data/lalr1.cc (destruct_): Likewise.
11675 In addition, no longer depend on b4_yysymprint_generate and
11676 b4_yydestruct_generate to generate these functions, do it "by
11677 hand".
11678
e757bb10
AD
116792004-09-03 Akim Demaille <akim@epita.fr>
11680
11681 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11682 invoked, yydestruct the lookahead.
11683 * tests/calc.at (Calculator $1): Update the expected lengths of
11684 traces: there is an added line for the discarded lookahead.
11685 * doc/bison.texinfo (Destructor Decl): Some rewording.
11686 Define "discarded" symbols.
11687
0fe1f06d
AD
116882004-09-02 Akim Demaille <akim@epita.fr>
11689
11690 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11691
284acc8b
AD
116922004-09-02 Akim Demaille <akim@epita.fr>
11693
11694 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11695 (YYDSYMPRINTF): Rename as...
11696 (YY_SYMBOL_PRINT): this.
11697 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11698 two.
11699 Use it instead of direct symprint_ calls.
11700 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11701 one.
11702
a5eb1ed2
AD
117032004-09-02 Akim Demaille <akim@epita.fr>
11704
b7c72fe1
AD
11705 * data/lalr1.cc (b4_yysymprint_generate): New.
11706 (symprint_): New member function, defined when YYDEBUG.
11707 Use it consistently instead of token/nterm debugging output by
11708 hand.
a5eb1ed2
AD
11709 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11710 %printer calls to use cdebug_ when using lalr1.cc.
11711
417141dd
AD
117122004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11713
11714 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11715 with #ifdef YYDEBUG.
11716
2fa09258
AD
117172004-08-26 Akim Demaille <akim@epita.fr>
11718
11719 * doc/bison.texinfo (Implementing Loops): Rename as...
11720 (Implementing Gotos/Loops): this.
11721
9378b508
PE
117222004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11723
11724 Adjust to latest gnulib.
11725 * bootstrap (gnulib_modules): Add xalloc-die.
11726 Set LC_ALL=C so that file names sort consistently.
11727 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11728 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11729 uintmax_t.m4, ulonglong.m4.
11730 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11731 po.m4 since we are now using _gl.m4 instead.
11732
87a8ad5c
PE
117332004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11734
11735 * src/scan-action.l: Remove. Scanning of semantic actions is
11736 handled in scan-gram.l.
11737
dca81a78
PE
117382004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11739
11740 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11741
11742 * src/location.h (struct): The file member is a uniqstr.
11743 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11744
c9cbf7c5
PE
117452004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11746
11747 Fix bug with non-%union parsers that have printers or destructors,
11748 which led to a Bison core dump. Reported by Peter Fales in
11749 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 11750
c9cbf7c5
PE
11751 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11752 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11753 not to our own type.
11754 * src/output.c (symbol_destructors_output, symbol_printers_output):
11755 Don't assume %union.
11756 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11757 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11758 UNION-FLAG. All callers changed.
11759 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11760 Use type char, not unsigned int, when declaring an array of char;
11761 this lets us remove a cast.
11762 (Printers and Destructors): Add non-%union test cases.
11763
fa7e68c3
PE
117642004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11765
11766 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11767 GLR writeups. E.g., avoid frenchspacing and the future tense,
11768 change "lookahead" to "look-ahead", and change "wrt" to "with
11769 respect to".
2fa09258 11770
fa7e68c3
PE
117712004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11772
11773 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11774 New sections, split off from the GLR Parsers section. Put the new
11775 Simple GLR Parser near the start of the GLR section, for clarity.
11776 Rewrite connective text.
11777
99a9344e
PE
117782004-06-21 Frank Heckenbach <frank@g-n-u.de>
11779
11780 * doc/bison.texinfo (Simple GLR Parsers): New section.
11781
8dd162d3
PE
117822004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11783
11784 * NEWS, TODO, doc/bison.texinfo:
11785 Use "look-ahead" instead of "lookahead", to be consistent.
11786 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11787 while we're fixing "look-ahead".
11788 * src/conflicts.c (shift_set): Renamed from shiftset.
11789 (look_ahead_set): Renamed from lookaheadset.
11790 * src/print.c: Likewise.
11791 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11792 name for "lookahead".
11793 (report_types, usage): Likewise.
11794 * src/getargs.h (report_look_ahead_tokens): Renamed from
11795 report_lookaheads.
11796 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11797 compute_lookaheads.
11798 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11799 (look_ahead_tokens_print): Renamed from lookaheads_print.
11800 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11801 state_rule_lookaheads_print.
11802 * src/state.h: Likewise.
11803 (reductions.look_ahead_tokens): Renamed from lookaheads.
11804 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11805 AT_DATA_LOOKAHEADS_GRAMMAR.
11806
57a90331
PE
118072004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11808
11809 * README: Update location of patched M4 distribution.
11810
8ed3234a
PE
118112004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11812
11813 Don't assume the C++ compiler takes the same arguments as the C compiler
11814 (trivial change).
11815 * configure.ac (O0CXXFLAGS): New var.
11816 * tests/atlocal.in (CXXFLAGS): Use it.
11817
07971983
PE
118182004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11819
11820 Fix some "make check" problems with C++ reported by
11821 Albert Chin-A-Young for Tru64 C++ in this thread:
11822 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11823
11824 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11825 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11826 Output to a .cc file for C++, not to a .c file.
11827 * tests/calc.at (AT_CHECK_CALC): Likewise.
11828 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11829 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11830
29058652
PE
118312004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11832
11833 * tests/calc.at, tests/actions.at: Workaround for SGI
11834 C++ compiler. (trivial change)
11835
62cb8a99
PE
118362004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11837
fd418816
PE
11838 Spent a few hours checking out which prerequisite versions the
11839 current sources actually require. I went all the way back to
11840 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11841 a seemingly endless set of combinations of versions more recent
11842 than that. The bottom line is that the current sources require
11843 fairly recent versions of the build tools, and it'll be some work
11844 to change this.
11845 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11846 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11847 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11848 Add comments explaining why those particular versions are
11849 currently needed.
2fa09258 11850
62cb8a99
PE
11851 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11852 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 11853 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
11854
11855 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11856 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11857
caa52c10
PE
118582004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11859
11860 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11861 0.11.5. Suggested by Bruno Haible.
11862 * bootstrap: Remove gettext version checking.
11863
11864 * doc/bison.texinfo (Decl Summary): Also mention that %union
11865 can depend on prerequisite types. Problem reported by Tim
11866 Van Holder.
11867
4bfd5e4e
PE
118682004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11869
2cef3017
PE
11870 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11871 * README-alpha: Don't tell people not to package this.
11872
b9c85d5c
PE
11873 * bootstrap: Don't assume $(...) works; use `...` instead.
11874 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11875 gettext better.
11876
4bfd5e4e
PE
11877 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11878 put into the -d output file, and mention what to do if YYSTYPE is
11879 defined as a macro.
11880
6a36ff94
PE
118812004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11882
6712933e
PE
11883 Undo change made earlier today: it caused autopoint to not bring
11884 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11885 autopoint's.
11886
11887 * bootstrap: Check that gettext version matches what's in
11888 configure.ac. Warn users to ignore robots.txt ERROR 404.
11889 * bootstrap: Undo today's earlier change (logged below).
11890 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 11891
6a36ff94
PE
11892 The gettext version checking is causing more trouble than it's
11893 curing; remove it. Problem reported by Paul Hilfinger.
11894
11895 * bootstrap: Issue a warning that one can expect a message
11896 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11897 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11898
209ea708
PE
118992004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11900
11901 Ensure that the C++ compiler used for testing actually works on a
11902 simple test program; if not, skip the C++-related tests. Problem
11903 reported by Vin Shelton in:
161a71f3 11904 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
11905
11906 * m4/cxx.m4: New file.
11907 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11908 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11909 * tests/local.at (AT_COMPILE_CXX): Use it.
11910
41ca2549
PE
119112004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11912
383e69dc
PE
11913 * data/glr.c (yylloc): Output this macro even if locations are not
11914 being generated, as the GLR parser needs it even in that case.
11915 Problem reported by Troy A. Johnson
11916 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11917
41ca2549
PE
11918 * configure.ac (AC_INIT): Update to 1.875e.
11919
e476c87d
PE
119202004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11921
11922 * NEWS: Version 1.875d.
11923 * configure.ac (AC_INIT): Likewise.
11924 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11925
11926 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11927 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11928 lalr1.cc runs afoul of the first, and the last two are no longer
11929 supported by GCC 3.4.0.
11930 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11931 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11932
233a88ad
PE
119332004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11934
11935 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11936 unsigned int, for compatibility with latest gnulib hash module.
11937 * src/state.c (state_hash, state_hasher): Likewise.
11938 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11939 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 11940
12ffdd28
PE
119412004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11942
11943 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11944
11945 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11946 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11947 character and string literals.
11948 (unexpected_end): New function.
11949 (unexpected_eof): Use it.
11950 (unexpected_newline): New function.
11951 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11952 actions.
e476c87d 11953
12ffdd28
PE
11954 * NEWS: Document %expect-rr.
11955
11956 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11957 Fix typo by replacing $1 with $option.
11958 Remove more 'intl'-related files.
9668e2be 11959 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
11960
11961 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11962 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11963 strtoul.c.
11964 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11965 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11966 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11967 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11968 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11969 * src/.cvsignore: Add *.output.
11970
11971 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11972 gets copied to the output file.
e476c87d 11973
1f65350a
PE
119742004-04-28 Paul Eggert <eggert@twinsun.com>
11975
11976 Get files from the gnulib and po repositories, instead of relying
11977 on them being in our CVS. Upgrade to latest versions of gnulib
11978 and Automake.
11979
11980 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11981 * bootstrap: Bootstrap from gnulib and po repositories.
11982 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11983 * README-cvs: Document these changes. Remove version numbers from
11984 mentions of build tools, since they change so often. Mention Flex.
11985
11986 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11987 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
11988 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11989 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 11990 does this for us.
12ffdd28
PE
11991 (AC_ISC_POSIX): Remove; we no longer support this
11992 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
11993 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11994 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11995 Do not check for C89 headers, except for locale.h which is used
11996 by the Yacc library and must port to K&R hosts.
11997 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11998 Do not check for C89 functions, except for setlocale which is
11999 used by the Yacc library.
12000 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12001 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12002 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12003 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12004 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12005 AM_GNU_GETTEXT): Remove; now done by:
12006 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12007 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12008 for us.
12009
12010 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12011 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
12012 Define to empty, as gnulib.mk will do the rest for us.
12013 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
12014 for us.
12015 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
12016 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
12017
12018 * src/files.c: Include gnulib's xstrndup.h.
12019
12020 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
12021 (REALLOC): Use xnrealloc, for likewise.
12022 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
12023 (strnlen, memrchr): Remove decls; functions no longer used.
12024 Include <stpcpy.h>.
12025
12026 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
12027 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12028 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
12029 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
12030 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
12031 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
12032 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
12033 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
12034 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
12035 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
12036 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
12037 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12038 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
12039 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
12040 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
12041 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
12042 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
12043 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
12044 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
12045 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
12046 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
12047 Remove, as these files are now generated automatically
12048 by bootstrap or automake.
12049
12050 * po/ChangeLog: Remove: all but one entry was a duplicate
12051 of this file, and I moved that 2000-11-02 entry here.
12052
12053 * config/.cvsignore: Add Makefile, depcomp, install-sh.
12054 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
12055 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
12056 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
12057 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
12058 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
12059 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
12060 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
12061 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
12062 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
12063 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
12064 xstrndup.h.
12065 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
12066 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
12067 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
12068 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
12069 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
12070 * src/.cvsignore: Remove *_.c.
12071
12072
12073 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
12074 support it. (The latest stable gzip doesn't.)
12075
120762004-04-27 Paul Eggert <eggert@twinsun.com>
12077
12078 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
12079 case, as stos_ is now used by destructors due to the 2004-02-09
12080 change.
12081
12082 Remove more K&R C support.
12083 * lib/libiberty.y (PARAMS): Remove. All uses removed.
12084 * lib/subpipe.c (errno): Remove decl.
12085 Include <stdlib.h> unconditionally.
12086 (EXIT_FAILURE): Remove macro.
12087 * src/complain.c (vfprintf, strerror): Remove.
12088 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
12089 unconditionally.
12090 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
12091 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
12092 (strchr, strspn, memchr): Remove decls.
12093 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
12094 unconditionally. Do not declare perror.
12095 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
12096 unconditionally.
12097
12098 * src/complain.c (_): Remove useless defn, as system.h defines this.
12099
12100 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
12101 with latest obstack.h.
12102 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
12103 to procedure types, as obstack.h now does that for us.
12104 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
12105
12106 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
12107 so that this include file can stand alone.
12108 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
12109 does this now. Include subpipe.h first after config.h, to
12110 test whether it can stand alone.
12111
12112 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
12113 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
12114 unused declaration.
12115
12116 * tests/synclines.at (%union synch line): Put a dummy member in
12117 the union, because empty unions aren't allowed in C. Caught
12118 by GCC 3.4.0.
12119
4f16766c
PE
121202004-04-13 Jim Meyering <jim@meyering.net>
12121
12122 * src/conflicts.c (conflicts_print): Correct format string typo:
12123 use `%%' to produce literal `%'. (trivial change)
12124
779e7ceb
PE
121252004-03-30 Paul Eggert <eggert@twinsun.com>
12126
12127 * src/getargs.c (version): Update copyright year to 2004.
12128
12129 * data/c.m4 (b4_int_type): Use 'short int' rather than
12130 'short', and similarly for 'long', 'unsigned', etc.
12131 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
12132 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
12133 yy_yypstack, yydumpstack): Likewise.
12134 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
12135 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
12136 Likewise.
12137 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
12138 yy_stack_print, yyparse): Likewise.
12139 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
12140 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
12141 * lib/bitset.c (bitset_print): Likewise.
12142 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
12143 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12144 * lib/bitsetv.c (bitsetv_dump): Likewise.
12145 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
12146 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
12147 Likewise.
12148 * src/LR0.c (allocate_itemsets): Likewise.
12149 * src/gram.h (rule_number, rule): Likewise.
12150 * src/lalr.h (goto_number): Likewise.
12151 * src/nullable.c (nullable_compute): Likewise.
12152 * src/output.c (prepare_rules): Likewise.
12153 * src/relation.c (relation_print, relation_digraph): Likewise.
12154 * src/relation.h (relation_node): Likewise.
12155 * src/state.h (state_number, transitions, errs, reductions,
12156 struct state): Likewise.
12157 * src/symtab.h (symbol_number, struct symbol): Likewise.
12158 * src/tables.c (vector_number, tally, action_number,
12159 default_goto, goto_actions): Likewise.
12160 * tests/existing.at (GNU Cim Grammar): Likewise.
12161 * tests/regression.at (Web2c Actions): Likewise.
12162
12163 * src/output.c (muscle_insert_short_int_table): Renamed from
12164 muscle_insert_short_table. All uses changed.
12165
d6328241
PH
121662004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12167
12168 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
12169 (declaration): Replace expected_conflicts with expected_sr_conflicts.
12170 Add %expect-rr rule.
4f16766c 12171
d6328241
PH
12172 * src/scan-gram.l: Recognize %expect-rr.
12173
4f16766c 12174 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 12175 expected_conflicts.
4f16766c 12176 (expected_rr_conflicts): Declare.
d6328241
PH
12177
12178 * src/conflicts.c (expected_sr_conflicts): Rename from
12179 expected_conflicts.
12180 (expected_rr_conflicts): Define.
12181 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
12182 for GLR parsers.
12183 Use expected_sr_conflicts in place of expected_conflicts.
12184 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 12185
d6328241 12186 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 12187
1452af69
PE
121882004-03-08 Paul Eggert <eggert@gnu.org>
12189
12190 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 12191 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
12192
12193 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
12194 in lalr1.cc.
12195 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
12196 * src/scan-gram.l (scan_integer): New function.
12197 ({int}): Use it.
12198 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
12199 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
12200 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
12201 Say "long int", not "long", for uniformity with GNU style.
12202
006d217d
PE
122032004-02-25 Paul Eggert <eggert@twinsun.com>
12204
12205 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
12206 compilers. This fixes a problem with Intel's C++ compiler being
12207 chatty, reported by Guido Trentalancia in
161a71f3 12208 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 12209
c2729758
ADL
122102004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12211
12212 Support %destructor and merge error locations in lalr1.cc.
12213
12214 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12215 (Parser::stos_): Define unconditionally.
12216 (Parser::destruct_): New method. Generate its body with
12217 b4_yydestruct_generate.
12218 (Parser::error_start_): New attribute.
12219 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12220 token which are discarded.
12221 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12222 error_start_ when erroneous token are discarded.
12223 (Parser::parse) <yyerrlab1>: Compute the location of the error
12224 token so that it covers all the discarded tokens.
12225 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12226 it can be called with `%skeleton "lalr1.cc"', and do that.
12227
dd0e0635
PE
122282004-02-02 Paul Eggert <eggert@twinsun.com>
12229
12230 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12231 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12232 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12233 There's no need to mention top_builddir since Automake does that
12234 for us.
12235 (INCLUDES): Remove, as Automake says it's obsolescent.
12236 Contents migrated into AM_CPPFLAGS as described above.
12237 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12238
122392004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12240
12241 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12242 (yyreportSyntaxError): Handle case where lookahead token is
12243 YYEMPTY.
12244
be16239b
PH
122452004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12246
12247 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12248 resulting parsers are compilable with C++.
12249
5fa90832
PE
122502003-12-23 Paul Eggert <eggert@twinsun.com>
12251
12252 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12253 * src/output.c (output_skeleton): Rename local var.
12254 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12255 Bison tokens, as this runs afoul of the 2003-10-07 change that
12256 disallowed NUL bytes in character constants or string literals.
12257
12258 * tests/local.at: Require Autoconf 2.59's Autotest.
12259 * tests/testsuite.at: Don't include local.at, since we now assume
12260 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12261 including it.
12262 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12263 multiple inclusion warnings.
dd0e0635 12264
b165c324
AD
122652003-12-02 Akim Demaille <akim@epita.fr>
12266
12267 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12268 conditions.
12269 From Bruno Haible.
12270
26e06a21
ADL
122712003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12272
12273 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12274
92ac3705
PE
122752003-10-07 Paul Eggert <eggert@twinsun.com>
12276
6a5ecb38
PE
12277 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12278 if testsuite doesn't exist.
12279
92ac3705
PE
12280 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12281 literals, unfortunately.
12282 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12283 Complain about NUL bytes in character constants or string literals.
12284
91d2c560
PE
122852003-10-05 Paul Eggert <eggert@twinsun.com>
12286
12287 * NEWS: Don't document %no-default-prec, as it's still
12288 too experimental.
12289 * doc/bison.texinfo: Document %no-default-prec only if
12290 the defaultprec flag is set. Normally it's not.
12291
0cc3da3a
PE
122922003-10-04 Paul Eggert <eggert@twinsun.com>
12293
12294 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12295 non-modifiable lvalue, instead of a modifiable one.
12296 * doc/bison.texinfo (Actions): Document that $$ can
12297 be assigned to. Do not claim that $$ and $N are
12298 array element references: user code should not rely on this.
12299
22fccf95
PE
123002003-10-01 Paul Eggert <eggert@twinsun.com>
12301
12302 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12303 (grammar_declaration): Use it.
12304 * src/scan-gram.l: New token %no-default-prec.
12305 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12306 * NEWS, doc/bison.texinfo: Document the above.
12307
fc8f2965
AD
123082003-10-01 Akim Demaille <akim@epita.fr>
12309
12310 VCG no longer supports long_straight_phase.
12311
12312 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12313 * src/print_graph.c (print_graph): Adjust.
12314
39a06c25
PE
123152003-09-30 Frank Heckenbach <frank@g-n-u.de>
12316 and Paul Eggert <eggert@twinsun.com>
12317
12318 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12319 Table of Symbols): Document %default-prec.
12320 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12321 (grammar_declaration): Set default_prec on %default-prec.
12322 * src/scan-gram.l (%default-prec): New token.
12323 * src/reader.h (default_prec): New flag.
12324 * src/reader.c: Likewise.
12325 (packgram): Handle it.
12326 * tests/conflicts.at (%default-prec without %prec,
12327 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 12328
39a06c25
PE
123292003-09-30 Paul Eggert <eggert@twinsun.com>
12330
12331 * tests/testsuite.at: Include local.at, not input.at, fixing
12332 a typo in the 2003-08-25 patch.
12333
62b6aef9
AD
123342003-08-27 Akim Demaille <akim@epita.fr>
12335
12336 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12337 GCC warnings.
12338
89e1cc61
AD
123392003-08-26 Akim Demaille <akim@epita.fr>
12340
12341 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12342 "<\#" to avoid magic from Gnus when posting parts of this script.
12343
a08460b0
AD
123442003-08-26 Akim Demaille <akim@epita.fr>
12345
12346 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12347 (Parser::parse): here.
12348 Adjust: nerrs and errstatus is now replaced by...
12349 (Parser::nerrs_, Parser::errstatus_): New.
12350
603f1cfd
AD
123512003-08-25 Akim Demaille <akim@epita.fr>
12352
12353 * config/announce-gen, Makefile.cfg: New.
12354 * Makefile.am: Adjust.
12355 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12356 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12357
cd3684cf
AD
123582003-08-25 Akim Demaille <akim@epita.fr>
12359
12360 When reducing initial empty rules, Bison parser read an initial
12361 location that is not defined. This results in garbage, and that
12362 affects Bison's own parser. Therefore we need (i) to extend Bison
12363 to support a means to initialize this location, and (ii) to use
12364 this CVS Bison to fix CVS Bison's parser.
12365
12366 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12367 with...
12368 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12369 * src/parse-gram.y: Adjust.
12370 (%initial-action): New.
12371 (%error-verbose): Since we require CVS Bison, there is no reason
12372 not to use it.
12373 * src/scan-gram.l: Adjust.
12374 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12375 * data/yacc.c (yyparse): Use b4_initial_action.
12376
4e03e201
AD
123772003-08-25 Akim Demaille <akim@epita.fr>
12378
12379 * doc/bison.texinfo: Don't promote stdout for error messages.
12380
8c182d05
AD
123812003-08-25 Akim Demaille <akim@epita.fr>
12382
12383 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12384 From Alexandre Duret-Lutz.
12385
6a60c4cf
PE
123862003-08-25 Akim Demaille <akim@epita.fr>
12387
12388 Version 1.875c.
12389
25f66e1a
AD
123902003-08-25 Akim Demaille <akim@epita.fr>
12391
12392 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12393 Use them.
12394
5348bfbe
AD
123952003-08-25 Akim Demaille <akim@epita.fr>
12396
12397 * data/lalr1.cc (Parser::reduce_print_): New.
12398 Use it.
12399
47301314
AD
124002003-08-25 Akim Demaille <akim@epita.fr>
12401
12402 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12403 error recovery loops. This patch is based on
161a71f3 12404 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
12405 Also, augment the similarity between lalr1.cc and yacc.c.
12406 Note: the locations of error recovery rules are not correct yet.
12407
12408 * data/lalr1.cc: Comment changes to augment the similarity between
12409 lalr1.cc and yacc.c.
12410 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12411 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12412 yyerrlab), when hitting EOF, pop the whole stack here instead of
12413 merely falling thru the default error handling mechanism.
12414 (yyerrorlab): New label, with the old contents of YYERROR,
12415 plus the following change: pop the stack of rhs corresponding
12416 to the production that invoked YYERROR. That is how Yacc
12417 behaves (required by POSIX).
12418 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12419 fail.
12420
1f7a61ff
AD
124212003-08-25 Akim Demaille <akim@epita.fr>
12422
12423 Tune local.at so that people can "autom4te -l autotest calc.at -o
12424 calc" for instance, to extract a sub test suite.
12425
12426 * tests/testsuite.at: Move the initialization, Autotest version
12427 requirement, and AT_TESTED invocation into...
12428 * tests/local.at: here.
12429 * tests/testsuite.at: Include it for compatibility with Autoconf
12430 2.57.
12431 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12432 be ignore.
12433
327b5b56
PE
124342003-08-04 Paul Eggert <eggert@twinsun.com>
12435
12436 Rework code slightly to avoid gcc -Wtraditional warnings.
12437 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12438 The returned value is now stored in *YY0. All callers changed.
12439 * src/output.c (merge_output): Adjust to the above change.
12440
0051e3ed
PE
124412003-07-26 Paul Eggert <eggert@twinsun.com>
12442
12443 * data/glr.c (YYASSERT): New macro.
12444 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12445 yyresolveStates, yyprocessOneStack):
12446 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12447 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 12448
137437c6
PE
124492003-07-25 Paul Eggert <eggert@twinsun.com>
12450
5b620e06
PE
12451 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12452 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 12453 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
12454 by Frank Heckenbach, though I have omitted the structure-initialization
12455 part of his glr-knr.diff patch since I recall that the Portable
12456 C Compiler didn't require that change.
12457
137437c6
PE
12458 Let the user specify how to allocate and free memory.
12459 Derived from a suggestion by Frank Heckenbach in
161a71f3 12460 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
12461 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12462 All uses of free, malloc, realloc changed to use these macros,
12463 and unnecessary casts removed.
12464 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12465
ddb85ca5
PE
124662003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12467
12468 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12469 use s.empty() rather than s == "" to test for empty string; see
161a71f3 12470 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
12471 (trivial change)
12472
39910e09
AD
124732003-06-25 Akim Demaille <akim@epita.fr>
12474
12475 * config/depcomp, config/install-sh: Update from masters.
12476
0ae99356
PE
124772003-06-20 Paul Eggert <eggert@twinsun.com>
12478
12479 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12480 and return properly parenthesized result.
12481 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12482 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12483 Remove unnecessary parentheses from uses.
12484 * doc/bison.texinfo (Location Default Action): Describe the
12485 conventions for parentheses.
12486
cd05d13c
PE
124872003-06-19 Paul Eggert <eggert@twinsun.com>
12488
81fd08ca
PE
12489 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12490 yyreportTree): Do not assume that size_t is the same width as int,
12491 when printing sizes. Print sizes using an unsigned format.
12492 Problem reported by Frank Heckenbach in
161a71f3 12493 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 12494
cd05d13c
PE
12495 Port to Forte Developer 7 C compiler.
12496 * data/glr.c (struct YYLTYPE): If locations are not being used,
12497 declare a single dummy member, as empty structs do not conform
12498 to the C standard.
12499 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12500 the Forte Developer 7 C compiler complains that end-of-loop
12501 code is not reached.
12502
4dcf140b
PE
125032003-06-17 Paul Eggert <eggert@twinsun.com>
12504
12505 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12506 avoid warnings from picky compilers about redefinition of PARAMS.
12507
8dd76bee
PE
125082003-06-17 Paul Eggert <eggert@twinsun.com>
12509
12510 Version 1.875b.
12511
12512 * NEWS: Document 1.875b.
12513
12514 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12515 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12516 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12517 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12518 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12519 per recent gettext manual's suggestion.
12520 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12521 Use prototypes, not old-style definitions.
12522 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12523 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12524 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12525 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12526 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
12527 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
12528 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
12529 vbitset_or_and_cmp, vbitset_copy): Likewise.
12530
12531 * lib/libiberty.h: Do not include config.h; that's the includer's job.
12532 Do not include <stdlib.h>.
12533 (PARAMS): Define unconditionally for C89.
12534 (ATTRIBUTE_NORETURN): Remove.
12535 (ATTRIBUTE_UNUSED): Define unconditionally.
12536
12537 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 12538 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
12539 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
12540 * lib/vbitset.c, lib/vbitset.h: New files.
12541 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12542 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
12543 from libbitset.
12544
12545 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
12546 `How Can I Reset @code{yyparse}', since texinfo does not allow
12547 arbitrary @ in node names.
12548
12549 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
12550 shouldn't be needed according to the gettext 0.12.1 documentation
12551 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 12552 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 12553 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 12554 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 12555
8dd76bee
PE
12556 * lib/.cvsignore: Add stdbool.h.
12557 * m4/.cvsignore: Add nls.m4, po.m4.
12558
12559 Upgrade to CVS gnulib.
12560 * stdbool_.h: File renamed from stdbool.h.in.
12561 * configure.ac (AM_STDBOOL_H): Invoke this instead of
12562 AC_HEADER_STDBOOL.
12563 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
12564 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
12565 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
12566 (MOSTLYCLEANFILES): New var.
12567 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
12568 (stdbool.h): New rule.
12569 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
12570 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
12571 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
12572 m4/quote.m4: Upgrade to today's gnulib.
12573
12574 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
12575 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
12576 the tests right now.
12577 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
12578 yyerror are declared before use; C99 requires this.
12579
25005f6a
PH
125802003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12581
12582 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
12583 first.
12584 (yyrecoverSyntaxError): Correct the logic for setting and testing
12585 yyerrState.
12586 Correct comment on handling EOF.
12587 Allow states with only a default reduction, rather than failing
8dd76bee 12588 (I can't quite reconstruct why these were not allowed before).
25005f6a 12589
137437c6 12590 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 12591 buffer overruns, corrupting state.
8dd76bee
PE
12592
12593 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
12594 definition.
12595 * src/reader.h (max_left_semantic_context): New variable declaration.
12596 * src/scan-gram.l (max_left_semantic_context): Define.
12597 (handle_action_dollar): Update max_left_semantic_context.
12598 * data/glr.c (YYMAXLEFT): New definition.
12599 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
12600 (yyresolveAction): Ditto.
12601
12602 Fixes to problems with location handling in GLR parsers reported by
12603 Frank Heckenbach (2003/06/05).
12604
12605 * data/glr.c (YYLTYPE): Make trivial if locations not used.
12606 (YYRHSLOC): Add parentheses, and define only if locations used.
12607 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
12608 locations not used.
12609 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
12610 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 12611
25005f6a
PH
12612 * tests/cxx-type.at: Exercise location information; update tests
12613 to differentiate output with and without locations.
8dd76bee 12614 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
12615 because default YYLTYPE not yet defined.
12616 Change semantic actions to compute strings, rather than printing
12617 them directly (to test proper passing of semantics values). Change
12618 output to prefix notation and update test data and expected results.
12619 (yylex): Track locations.
12620 (stmtMerge): Return value rather than printing, and include arguments
12621 in value.
8dd76bee 12622
711f40b7
PE
126232003-06-03 Paul Eggert <eggert@twinsun.com>
12624
12625 Avoid warnings generated by GCC 2.95.4 when Bison is
12626 configured with --enable-gcc-warnings.
12627 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12628 yy::]b4_parser_class_name[::translate_,
12629 yy::Stack::operator[] (unsigned),
12630 yy::Stack::operator[] (unsigned) const,
12631 yy::Slice::operator[] (unsigned),
12632 yy::Slice::operator[] (unsigned) const):
12633 Rename local vars to avoid warnings.
12634 * tests/glr-regression.at (Improper handling of embedded actions
12635 and $-N in GLR parsers): Remove unused local variable from yylex.
12636 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12637 (void) as arg when not pure, since we now assume C89 when building
12638 Bison. Pacify GCC by using parameter.
12639
ac695f7d
PE
126402003-06-02 Paul Eggert <eggert@twinsun.com>
12641
12642 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12643 yy::Location::lines, yy::Location::columns): Rename arguments
12644 to avoid shadowing; this removes a warning generated by GCC 3.3.
12645
26ec81e0
PE
126462003-06-01 Paul Eggert <eggert@twinsun.com>
12647
12648 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12649 to g++, as GCC 3.3 complains if you do it.
12650 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12651 everything that WARNING_CFLAGS has, except omit warnings
12652 not suitable for C++.
12653 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12654 * tests/atlocal.in (CXXFLAGS): New var.
12655 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12656
12657 Fix a GLR parser bug I reported in February; see
161a71f3 12658 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
12659 The problem was that GLR parsers did not conform to the C standard,
12660 because actions like { $1 = $2 + $3; } expanded to expressions
12661 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12662 to a local variable. The C standard says that expressions
12663 like (var = f ()) + (var = f ()) have undefined behavior.
12664 Another problem was that GCC sometimes issues warnings that
12665 yyfill and its parameters are unused.
12666
12667 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12668 as possibly unused.
12669 (yyfill): New function.
12670 (YYFILL): Use it.
12671 (yyuserAction): Change type of yynormal to bool, so that it matches
12672 the new yyfill signature. Mark it as possibly unused.
12673
12674
12675 Follow up on a bug I reported in February, where a Bison-generated
12676 parser can loop. Provide a test case and a fix for yacc.c. I
12677 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12678 The original bug report is in:
161a71f3 12679 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
12680
12681 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12682 macro's size was becoming unwieldy.
12683 (yyerrlab): Do not discard an empty lookahead symbol, as this
12684 might destroy garbage.
12685 (yyerrorlab): New label, with the old contents of YYERROR,
12686 plus the following change: pop the stack of rhs corresponding
12687 to the production that invoked YYERROR. That is how Yacc
12688 behaves, and POSIX requires this behavior.
12689 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12690 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12691 Define 'alarm' to do nothing if unistd.h is not available.
12692 Add a new rule "exp: '-' error;" to test the above change to
12693 data/yacc.c. Use 'alarm' to abort any test taking longer than
12694 10 seconds, as it's probably looping.
12695 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12696 Also, the new yacc.c generates two fewer diagnostics for an
12697 existing test.
12698
d0829076
PE
126992003-05-24 Paul Eggert <eggert@twinsun.com>
12700
c6ae27df
PE
12701 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12702 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12703 This fixes a problem reported by John Bowman when the Compaq/HP
12704 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12705 -ansi -Wall -gall).
12706 * data/yacc.c (union yyalloc): Likewise.
12707 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 12708
d0829076
PE
12709 Switch from 'int' to 'bool' where that makes sense.
12710
12711 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12712 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12713 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12714 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12715 Return or accept bool, not int. All callers changed.
12716 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12717 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12718 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12719 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12720 bitset_or_and_cmp_): Likewise.
12721 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12722 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12723 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12724 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12725 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12726 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12727 bitset_stats_or_and_cmp): Likewise.
12728 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12729 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12730 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12731 ebitset_xor_cmp): Likewise.
12732 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12733 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12734 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12735 lbitset_xor_cmp): Likewise.
12736 * lib/bbitset.h: Include <stdbool.h>.
12737 (struct bitset_vtable): The following members now return bool, not
12738 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12739 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12740 or_and_cmp).
12741 * src/conflicts.c (count_rr_conflicts): Likewise.
12742 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12743 All uses changed.
12744 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12745 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12746 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12747 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12748 graph_flag): Likewise.
12749 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12750 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12751 graph_flag): Likewise.
12752 * src/output.c (error_verbose): Likewise.
12753 * src/output.h (error_verbose): Likewise.
12754 * src/reader.c (start_flag, typed): Likewise.
12755 * src/reader.h (typed): Likewise.
12756 * src/getargs.c (LOCATIONS_OPTION): New constant.
12757 (long_options, getargs): Use it.
12758 * src/lalr.c (build_relations): Use bool, not int.
12759 * src/nullable.c (nullable_compute): Likewise.
12760 * src/print.c (print_reductions): Likewise.
12761 * src/tables.c (action_row, pack_vector): Likewise.
12762 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12763 * src/output.c (prepare): Use it.
12764 * src/output.c (token_definitions_output,
12765 symbol_destructors_output, symbol_destructors_output): Use string,
12766 not boolean integer, to keep track of whether to output separator.
12767 * src/print_graph.c (print_core): Likewise.
12768 * src/state.c (state_rule_lookaheads_print): Likewise.
12769
12770 * config/install-sh: Sync from automake 1.7.5.
12771
6b2584b7
PE
127722003-05-14 Paul Eggert <eggert@twinsun.com>
12773
12774 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12775 semicolon after a grammar declaration, in the interest of possible
12776 future changes to the Bison input language.
12777 Do not allow a stray semicolon at the start of the grammar.
12778 (rhses.1): Allow one or more semicolons after any rule, including
12779 just before "|" as required by POSIX.
12780 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12781 grammar.
12782
caf37a36
ADL
127832003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12784
12785 %parse-param support for lalr1.cc.
12786
12787 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12788 b4_cc_constructor_calls, b4_cc_constructor_call,
12789 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12790 definitions.
12791 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12792 parse-param arguments.
12793 (yy::b4_parser_class_name): Declare instance variables to
12794 hold parse-param arguments.
12795 * tests/calc.at: s/value/semantic_value/ because value clashes
12796 with a member of yy::b4_parser_class_name. Adjust C++ code
12797 to handle %parse-param. Enable %parse-param test in C++.
12798
3ab37077
PE
127992003-05-12 Paul Eggert <eggert@twinsun.com>
12800
12801 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12802 English a bit. Fix fclose typo. Change "const char" to "char
12803 const", and use ANSI C rather than K&R for "main". Suggest
12804 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12805 and suggest yy_switch_to_buffer.
12806
128072003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
12808
12809 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12810 C89. This avoids a diagnostic on compilers that define __STDC__
12811 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 12812 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 12813
e743727f
PE
128142003-05-03 Paul Eggert <eggert@twinsun.com>
12815
12816 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12817 Do not overrun array bounds.
12818 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 12819 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 12820
916708d5
AD
128212003-04-29 Akim Demaille <akim@epita.fr>
12822
12823 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12824 * src/getargs.c, src/getargs.h: here, as bool, not int.
12825 (nondeterministic_parser): New.
12826 * src/parse-gram.y, src/scan-gram.l: Support
12827 %nondeterministic-parser.
12828 * src/output.c (prepare): Use nondeterministic_parser instead
12829 of glr_parser where appropriate.
12830 * src/tables.c (conflict_row, action_row, save_row)
12831 (token_actions, token_actions, pack_vector): Ditto.
12832
a06ea4aa
AD
128332003-04-29 Akim Demaille <akim@epita.fr>
12834
12835 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12836
211074ca
AD
128372003-04-29 Akim Demaille <akim@epita.fr>
12838
12839 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12840 with %pure-parser and %locations to exercise the patch from Yakov
12841 Markovitch below.
12842
6175ffe3
PE
128432003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12844
12845 * data/yacc.c: (b4_lex_param): Corrected for the case where
12846 %lex-param is provided and %pure-parser isn't.
12847
b1e95857
PE
128482003-04-27 Paul Eggert <eggert@twinsun.com>
12849
12850 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 12851 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
12852 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12853 if it is not defined.
12854 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12855
acda9df6
PE
128562003-04-26 Paul Eggert <eggert@twinsun.com>
12857
3470c57b
PE
12858 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12859 Declare to be of type suitable for the ninf value itself, not of
12860 type suitable for the corresponding table, since the latter might
12861 be unsigned but the ninf value might be negative. This fixes a
12862 bug reported by Alexandre Duret-Lutz in
161a71f3 12863 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 12864
acda9df6
PE
12865 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12866 invokes it. We shouldn't invoke it twice because it will attempt
12867 to put error.o in the archive twice. This fixes a glitch reported
12868 by Martin Mokrejs in
161a71f3 12869 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 12870
b5250f26
PE
128712003-04-21 Paul Eggert <eggert@twinsun.com>
12872
12873 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12874 to gnulib.
12875
089ac0f1
PE
128762003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12877
12878 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12879 Fix obvious typo that results in uncompilable GLR parsers
12880 when both %pure-parser and %locations are used. (trivial change)
12881
5ededac6
PE
128822003-04-17 Paul Eggert <eggert@twinsun.com>
12883
1b8f2fff
PE
12884 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12885 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12886 Do not insert the expected token via unput, as this runs afoul
12887 of a POSIX-compatibility bug in flex 2.5.31.
12888 All uses changed to BEGIN the parent state,
12889 since we no longer insert the expected token via unput.
12890 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12891 that is no longer emitted after the above change.
12892
5ededac6
PE
12893 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12894 the first one. This change is from Paul Hilfinger, and it fixes
12895 regression reported by Werner Lemberg in
161a71f3 12896 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
12897
12898 (resolve_sr_conflict): Don't invoke state_errs_set
12899 unless one or more tokens have been explicitly made errors.
12900 Otherwise, the above change causes Bison to abort.
12901
12902 * tests/existing.at (GNU pic Grammar): New test case, taken from
12903 Lemberg's email.
12904
b8be9132
AD
129052003-03-31 Akim Demaille <akim@epita.fr>
12906
12907 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12908
d423d460
AD
129092003-03-31 Akim Demaille <akim@epita.fr>
12910
12911 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12912 output.
12913
c7e441b4
AD
129142003-03-31 Akim Demaille <akim@epita.fr>
12915
12916 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12917 From Paul Hilfinger.
12918
231897ad
AD
129192003-03-29 Akim Demaille <akim@epita.fr>
12920
12921 * m4/error.m4: Do not put under dynamic conditions some code which
12922 expansion is under static control.
12923
5b066063
AD
129242003-03-29 Akim Demaille <akim@epita.fr>
12925
12926 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12927
22a74fec
AD
129282003-03-29 Akim Demaille <akim@epita.fr>
12929
12930 * doc/bison.texinfo (Strings are Destroyed): New.
12931
0eee27e7
PE
129322003-03-13 Paul Eggert <eggert@twinsun.com>
12933
12934 * .cvsignore: Add configure.lineno.
12935 * src/.cvsignore: Add yacc.
12936 * tests/.cvsignore: Add testsuite.log.
12937 * doc/fdl.texi: Sync with latest FSF version.
12938
f61aad93
PE
129392003-03-12 Paul Eggert <eggert@twinsun.com>
12940
537636c7
PE
12941 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12942 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12943 cursor, instead of leaving it undefined. This fixes a bug
12944 reported by Tim Van Holder in
161a71f3 12945 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
12946 * tests/input.at (Torturing the Scanner): Test the scanner on
12947 an empty input file, which was Tim Van Holder's test case.
12948
12949 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12950 <sys/resource.h> can be included, include sys/time.h and
12951 sys/times.h first, if available. This works around the SunOS
12952 4.1.4 porting bug reported by Bruce Becker in
161a71f3 12953 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
12954
12955 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12956 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12957 AC_HEADER_SYS_WAIT.
12958
f61aad93
PE
12959 Merge changes from gnulib. This was prompted because the CVS
12960 snapshot didn't build on Solaris 7 due to strnlen problems.
12961
12962 These changes need to be merged back into gnulib:
12963 * lib/hash.c: Include <stdbool.h> unconditionally.
12964 * m4/onceonly.m4 (m4_quote): New macro.
12965 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12966 Quote AC_FOREACH variable-expansions properly.
12967 The 2003-01-03 obstack.h change also needs merging.
12968 {end of changes requiring merging}
5b066063 12969
f61aad93
PE
12970 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12971 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12972 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12973 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12974 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12975 New files, imported from gnulib.
12976 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12977 above.
12978
12979 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12980 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12981 gnulib sources.
12982
12983 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12984 Add.
12985 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12986 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12987 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12988 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12989 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12990 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12991 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12992 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12993 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12994 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12995 (jm_PREREQ_ARGMATCH): Remove.
12996 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12997 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12998
12999 * src/system.h: Include <stdbool.h> unconditionally.
13000
13001 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13002 assuming at least C89 in the bitset code for some time now.
13003
d2ffe116
AD
130042003-03-03 Akim Demaille <akim@epita.fr>
13005
13006 * ro.po: New.
13007
052826fd
AD
130082003-03-02 Akim Demaille <akim@epita.fr>
13009
13010 * doc/bison.texinfo (Table of Symbols): Reactivate the
13011 documentation for %lex-param, and %parse-param.
13012
c4749565
AD
130132003-03-02 Akim Demaille <akim@epita.fr>
13014
13015 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
13016 generate verbose error messages.
13017 Use the number of tokens as an upper bound in yytname, as it
13018 cannot be a non terminal.
13019
d5286af1
AD
130202003-03-02 Akim Demaille <akim@epita.fr>
13021
13022 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
13023 message.
13024
22e304a6
AD
130252003-03-02 Akim Demaille <akim@epita.fr>
13026
22e304a6
AD
13027 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
13028 Use them to exercise yycheck overrun.
13029 Based on Andrew Suffield's grammar.
13030
67a25fed
AD
130312003-03-02 Akim Demaille <akim@epita.fr>
13032
13033 Create tests/local.at for Bison generic testing macros.
13034
13035 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
13036 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
13037 This new file.
13038 * tests/calc.at (AT_CHECK_CALC): Adjust.
13039 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
13040 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
13041 * tests/local.at: here.
13042 (AT_COMPILE_CXX): Tags the tests using it as c++.
13043 Ignore the test if CXX is not functional.
13044
9c2b381f
PE
130452003-03-01 Paul Eggert <eggert@twinsun.com>
13046
13047 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
13048 not loc->end, since loc->end might contain garbage and this leads
13049 to undefined behavior on some platforms.
13050 (id_loc, token_start): Use (IF_LINTed) initial values that do not
13051 depend on *loc, so that the reader doesn't give the the false
13052 impression that *loc is initialized.
13053 (<INITIAL>"%%"): Do not bother setting code_start, since its value
13054 does not survive the return.
13055
0433ba88
AD
130562003-03-01 Akim Demaille <akim@epita.fr>
13057
13058 * src/scan-gram.l (code_start): Always initialize it when entering
13059 into yylex, as SC_EPILOGUE is activated *before* the corresponding
13060 yylex invocation. An alternative would be making it static, but
13061 then it starts with the second %%'s beginning, instead of its end.
13062
b305ea69
PE
130632003-02-28 Paul Eggert <eggert@twinsun.com>
13064
13065 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
13066 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 13067 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 13068
c3d25e01
PE
130692003-02-26 Paul Eggert <eggert@twinsun.com>
13070
13071 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
13072 Remove Sequent/Pyramid discussion (nobody uses them any more).
13073 Merge VMS and MS-DOS discussion; these ports may well be dead
13074 but let's keep mentioning them for now. Put <> around email
13075 addresses. Add copyright notice.
13076
c267ffbc
PE
130772003-02-24 Paul Eggert <eggert@twinsun.com>
13078
13079 * data/glr.c (yy_reduce_print): yylineno -> yylno,
13080 to avoid collision with flex use of yylineno.
13081 Problem reported by Bruce Lilly in
161a71f3 13082 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
13083 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13084 * data/yacc.c (yy_reduce_print): Likewise.
13085
13086 * config/depcomp: Sync with Automake 1.7.3.
13087
f939fc12
AD
130882003-02-21 Akim Demaille <akim@epita.fr>
13089
13090 * data/lalr1.cc: Use temporary variables instead of casts to
13091 change integer types.
13092 Suggested by Paul Eggert.
13093
95923bd6
AD
130942003-02-21 Akim Demaille <akim@epita.fr>
13095
13096 * doc/bison.texinfo: Use "location" consistently to refer to @n,
13097 to avoid confusions with lalr1.cc's notion of Position.
13098 Suggested by Paul Eggert.
13099
2cdc240e
AD
131002003-02-20 Akim Demaille <akim@epita.fr>
13101
13102 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
13103 before initial_columns.
13104 (location.hh): Use consistent variable names when defining the
13105 operator<<.
13106 Use "last" so that we subtract from Positions, not from unsigned.
13107
5d003116
AD
131082003-02-20 Akim Demaille <akim@epita.fr>
13109
13110 * data/lalr1.cc (position.hh): New subfile, including the extended
13111 and Doxygen'ed documentation of class Position.
13112 (location.hh): Use it.
13113 Document a` la Doxygen.
ba1ecc07 13114 With the help of Benoit Perrot.
5d003116 13115
d02b25f9
AD
131162003-02-20 Akim Demaille <akim@epita.fr>
13117
13118 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
13119 AT_YACC_IF.
13120 Redefine AT_YYERROR_SEES_LOC_IF using it.
13121 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
13122 not defined.
13123 Don't use the location in yy::Parser::error_ and
13124 yy::Parser::print_ when not %locations.
13125 Activate more lalr1.cc tests.
13126
0d1c3a04
AD
131272003-02-19 Akim Demaille <akim@epita.fr>
13128
13129 * data/lalr1.cc: When displaying a line number, be sure to make it
13130 an int.
13131
60a777aa
AD
131322003-02-19 Akim Demaille <akim@epita.fr>
13133
13134 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
13135 Remove, useless.
13136 (YYABORT, YYACCEPT, YYERROR): New.
13137 * tests/calc.at: Renable the lalr1.cc test.
13138
0b86fc41
AD
131392003-02-19 Akim Demaille <akim@epita.fr>
13140
13141 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
13142 error recovery, mixing with/without pops and discarding of the
13143 lookahead.
13144 Exercise YYERROR.
13145 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
13146
da99a5dc
PE
131472003-02-17 Paul Eggert <eggert@twinsun.com>
13148
13149 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
13150 * tests/testsuite.at (AT_COMPILE): Use them.
13151 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 13152 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 13153
93b8c255
PE
131542003-02-12 Paul Eggert <eggert@twinsun.com>
13155
13156 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
13157 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 13158 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
13159 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
13160 Check for malloc failure, for consistency with yacc.c.
13161 (yytname_size): Remove, for consistency with yacc.c.
13162
13163 The bug still remains in data/lalr1.cc, as I didn't have time
13164 to fix it there.
13165
7548fed2
AD
131662003-02-06 Akim Demaille <akim@epita.fr>
13167
13168 * configure.ac (GXX): Rename as...
13169 (CXX): this, to keep the original Autoconf semantics.
13170 Require 2.57.
13171 * data/lalr1.cc: Fix b4_copyright invocations.
13172 If YYDEBUG is not defined, don't depend upon name_ being defined.
13173 (location.hh): Include string and iostream.
13174 (Position::filename): New member.
13175 (Position::Position ()): New.
13176 (operator<< (Position)): New.
13177 (operator- (Position, int)): New.
13178 (Location::first, Location::last): Rename as...
13179 (Location::begin, Location::end): these, to mock the conventional
13180 iterator names.
13181 (operator<< (Location)): New.
13182 * tests/atlocal.in (CXX): New.
13183 * tests/testsuite.at (AT_COMPILE_CXX): New.
13184 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
13185 locations in a more synthetic way.
13186 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
13187 lalr1.cc is used.
13188 Adjust the C locations to match those from Emacs: first column is
13189 column 0.
13190 Change all the expected results.
13191 Conform to the GCS: simplify the locations when applicable.
13192 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
13193 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
13194 these CPP macros with the m4 macros new defined by...
13195 (AT_CHECK_PUSHDEFS): this, i.e.:
13196 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 13197 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
13198 New macros.
13199 (AT_CHECK_POPDEFS): Undefine them.
13200 (AT_CHECK_CALC_LALR1_CC): New.
13201 Use it for the first lalr1.cc test.
13202
43a176ef
AD
132032003-02-04 Akim Demaille <akim@epita.fr>
13204
13205 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
13206 Location as is defined.
13207
fc049e9c
AD
132082003-02-04 Akim Demaille <akim@epita.fr>
13209
13210 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13211 name_ being defined.
13212
a737b216
PE
132132003-02-03 Paul Eggert <eggert@twinsun.com>
13214
13215 * src/gram.h (start_symbol): Remove unused decl.
13216
13217 Use more-consistent naming conventions for local vars.
13218
13219 * src/derives.c (derives_compute): Change type of local var from
13220 int to rule_number.
13221 * src/gram.c (grammar_rules_partial_print): Likewise.
13222 * src/print.c (print_core): Likewise.
13223 * src/reduce.c (reduce_grammar_tables): Likewise.
13224
13225 * src/gram.c (grammar_dump): Change name of item_number *
13226 local var from r to rp.
13227 * src/nullable.c (nullable_compute): Likewise.
13228
13229 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13230
13231 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13232 for symbol or symbol_number var.
13233 * src/reader.c (grammar_start_symbol_set): Likewise.
13234 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13235 Likewise.
13236 * src/state.c (transitions_to): Likewise.
13237 * src/state.h: Likewise.
13238 * src/tables.c (symbol_number_to_vector_number): Likewise.
13239
13240 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13241 char * var.
13242
13243 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13244 var.
13245
13246 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13247 var.
13248
13249 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13250 Use str, not s, for char * var. Use ch, not c, for character var.
13251 Use size for size var.
13252
13253 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13254 char * var.
13255 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13256 uniqstr var.
13257 * src/uniqstr.h: Likewise.
13258
13259 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13260 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13261 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13262 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13263 param to have same name as that of enum, so that we don't use
13264 "s" to stand for a non-state.
13265
68e93ad5
AD
132662003-02-02 Akim Demaille <akim@epita.fr>
13267
13268 * src/scan-skel.l: Scan more than one inert character per yylex
13269 invocation.
13270
92898986
PE
132712003-02-01 Paul Eggert <eggert@twinsun.com>
13272
13273 Version 1.875a.
13274
1d9d5d71
PE
13275 * po/LINGUAS: Add ms.
13276
0435d061
AD
132772003-01-30 Akim Demaille <akim@epita.fr>
13278
13279 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13280
6029a57f
PH
132812003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13282
13283 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13284 of $1.
0435d061
AD
13285
13286 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 13287 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 13288 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 13289
6029a57f
PH
13290 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13291 (b4_rhs_location): Ditto.
0435d061 13292 (yyfill): New function to copy from stack tree into array
6029a57f 13293 incrementally.
0435d061
AD
13294 (yyuserAction): Modify to allow incremental move of semantic values
13295 to rhs array when in GLR mode.
13296 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
13297 as needed.
13298 Remove dummy use of yystack, as there is now a guaranteed use.
13299 (yydoAction): Modify to allow incremental move of semantic values
13300 to rhs array when in GLR mode.
13301 (yyresolveAction): Ditto.
13302 (yyglrShiftDefer): Update comment.
0435d061 13303 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
13304 (yyglrReduce): Ditto.
13305 (yydoAction): Ditto
0435d061 13306
6029a57f
PH
13307 * tests/glr-regr1.at: Rename to ...
13308 * tests/glr-regression.at: Add new regression test for the problems
13309 described above (adapted from S. Eken).
13310 Update copyright notice.
13311 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13312 * tests/Makefile.am: Ditto.
13313
6cee6297
PE
133142003-01-28 Paul Eggert <eggert@twinsun.com>
13315
13316 * data/lalr1.cc: Do not use @output_header_name@ unless
13317 b4_defines_flag is set. This fixes two bugs reported by
13318 Tim Van Holder in
161a71f3
PE
13319 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13320 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 13321
b2a836b5
PE
133222003-01-21 Paul Eggert <eggert@twinsun.com>
13323
13324 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13325 we don't need to worry about yyerrlab1 being reported as an
13326 "unused label" by non-GCC C compilers. The downside is that if
13327 locations are used then a couple of statements are duplicated each
13328 time YYERROR is invoked, but the upside is that the warnings
13329 should vanish.
13330 (yyerrlab1): Move code to YERROR.
13331 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13332 This reverts some of the 2002-12-27 change.
13333
4196b931
PE
133342003-01-17 Paul Eggert <eggert@twinsun.com>
13335
13336 * src/output.c (symbol_printers_output): Fix typo that led
13337 to core dump. Problem reported by Antonio Rus in
161a71f3 13338 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 13339
3ae831b4
AD
133402003-01-13 Akim Demaille <akim@epita.fr>,
13341 Quoc Peyrot <chojin@lrde.epita.fr>,
13342 Robert Anisko <anisko_r@lrde.epita.fr>
13343
13344 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13345 when the stacks contain one element, as the loop would otherwise
13346 free the last state, and then use the top state (the one we just
13347 popped). This means that the initial elements will not be freed
13348 explicitly, as is the case in yacc.c; it is not a problem, as
13349 these elements have fake values.
13350
e3aa65c5
PE
133512003-01-11 Paul Eggert <eggert@twinsun.com>
13352
13353 * NEWS: %expect-violations are now just warnings, reverting
13354 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13355 bootstrapping problem reported by Matthias Klose; see
161a71f3 13356 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
13357 * src/conflicts.c (conflicts_print): Likewise.
13358 * tests/conflicts.at (%expect not enough, %expect too much,
13359 %expect with reduce conflicts): Likewise.
13360 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13361 that the warning is enabled if the number of conflicts changes
13362 (not necessarily increases).
13363
13364 * src/getargs.c (version): Update copyright year.
13365
f0057011
AD
133662003-01-09 Akim Demaille <akim@epita.fr>
13367
13368 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13369
1ee6d2a0
PE
133702003-01-08 Paul Eggert <eggert@twinsun.com>
13371
13372 * Makefile.maint (WGETFLAGS):
13373 New macro, containing "-C off" to disable proxy caches.
13374 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13375 (rel-check): Use $(WGET) instead of wget.
13376
d4fd77c4
PE
133772003-01-06 Paul Eggert <eggert@twinsun.com>
13378
13379 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13380 the GLR paper of Scott, Johnstone and Hussain.
13381
464c6927
PE
133822003-01-04 Paul Eggert <eggert@twinsun.com>
13383
d600ee67
PE
13384 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13385 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13386 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13387 (EXTRA_LIBRARIES): New var, for liby.a.
13388 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13389 (EXTRA_SCRIPTS): New var, for yacc.
13390
464c6927
PE
13391 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13392 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13393 Problem reported by Nelson H. F. Beebe.
13394
133952003-01-03 Paul Eggert <eggert@twinsun.com>
13396
13397 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13398 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13399 when compiling Bison 1.875's `bitset bset = obstack_alloc
13400 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13401
13402 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13403 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13404 grow to a huge size with typical invocation.
d600ee67 13405
464c6927
PE
13406 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13407 Use the pattern recommended by Autoconf 2.57, except also protect
13408 against double-definition.
13409 * src/system.h: Likewise.
13410 Portability issues reported by Nelson H. F. Beebe.
d600ee67 13411
464c6927
PE
13412 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13413 All uses changed. Provide a definition in both C and C++.
13414 (yytrue, yyfalse): Define even if defined (__cplusplus).
13415
13416 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13417 Reported by Nelson H. F. Beebe.
d600ee67 13418
464c6927
PE
13419 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13420
0f42c7d5
PE
134212003-01-02 Paul Eggert <eggert@twinsun.com>
13422
13423 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13424 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13425 Bug reported by Nelson H. F. Beebe.
13426
dc546b0f
PE
134272003-01-01 Paul Eggert <eggert@twinsun.com>
13428
13429 * Version 1.875.
13430
2c09b6a7
PE
134312002-12-30 Paul Eggert <eggert@twinsun.com>
13432
13433 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13434 Moved here from...
13435 (<INITIAL>","): Here. This causes stray "," to be treated
13436 more uniformly.
13437
dc546b0f 13438 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
13439 last brace in braced code when not in Yacc mode, for compatibility
13440 with Bison 1.35. This resurrects the 2001-12-15 patch to
13441 src/reader.c.
13442
13443 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13444 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13445
535c0f63
PE
134462002-12-28 Paul Eggert <eggert@twinsun.com>
13447
13448 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13449 that of SYM's type. This fixes Debian bug 168069, reported by
13450 Thomas Olsson.
d600ee67 13451
963fcc17
PE
134522002-12-28 Paul Eggert <eggert@twinsun.com>
13453
13454 Version 1.75f.
13455
13456 Switch back to the Yacc style of conflict reports, undoing some
13457 of the 2002-07-30 change.
13458 * doc/bison.texinfo (Understanding): Use Yacc style for
13459 conflict reports. Also, use new way of locating rules.
13460 * src/conflicts.c (conflict_report):
13461 Renamed from conflict_report_yacc, removing the old
13462 'conflict_report'. Translate the entire conflict report at once,
13463 so that we don't assume that "," has the same interpretation in
13464 all languages.
13465 (conflicts_output): Use Yacc-style conflict report for each state,
13466 instead of our more-complicated style.
13467 (conflicts_print): Use Yacc-style conflict report, except print
13468 the input file name when not emulating Yacc.
13469 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13470 Conflicted Reduction, %expect not enough, %expect too much,
13471 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13472 * tests/existing.at (GNU Cim Grammar): Likewise.
13473 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13474
13475 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13476 fatal): Don't invoke fflush; it's not needed and it might even be
13477 harmful for stdout, as stdout might not be open.
13478 * src/reduce.c (reduce_print): Likewise.
13479
b1efe548
PE
134802002-12-27 Paul Eggert <eggert@twinsun.com>
13481
13482 Fix a bug where error locations were not being recorded correctly.
13483 This problem was originally reported by Paul Hilfinger in
161a71f3 13484 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
13485
13486 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13487 top of the location stack's error locations.
13488 (yyerrlab): Set it. When discarding a token, push its location
13489 onto yylerrsp so that we don't lose track of the error's end.
13490 (yyerrlab1): Now is only the target of YYERROR, so that we can
13491 properly record the location of the action that failed. For GCC
13492 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13493 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13494 (yyerrlab2): New label, which yyerrlab now falls through to.
13495 Compute the error's location by applying YYLLOC_DEFAULT to
13496 the locations of all the symbols that went into the error.
13497 * doc/bison.texinfo (Location Default Action): Mention that
13498 YYLLOC_DEFAULT is also invoked for syntax errors.
13499 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13500 Error locations include the locations of all the tokens that were
13501 discarded, not just the last token.
d600ee67 13502
983c5c2c
PE
135032002-12-26 Paul Eggert <eggert@twinsun.com>
13504
b1efe548
PE
13505 * src/files.c: Include quote.h.
13506 (compute_output_file_names): Warn if we detect conflicting
13507 outputs to the same file. This should catch the misunderstanding
13508 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13509
13510 * src/conflicts.c (conflicts_print): If the user specifies
13511 "%expect N", report an error if there are any reduce/reduce
13512 conflicts. This is what the manual says should happen.
13513 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13514 * tests/conflicts.at (%expect with reduce conflicts): New test.
13515
983c5c2c
PE
13516 Don't use m4_include on relative file names, as it doesn't work as
13517 desired if there happens to be a file with that name under ".".
d600ee67 13518
983c5c2c
PE
13519 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13520 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13521 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13522 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13523 * src/output.c (output_skeleton): Use full path names when
13524 specifying a file to include; don't rely on include path, as
13525 it's unreliable when the working file contains a file with
13526 that name.
d600ee67 13527
983c5c2c
PE
135282002-12-25 Paul Eggert <eggert@twinsun.com>
13529
13530 Remove obsolete references to bison.simple and bison.hairy.
13531 Problem mentioned by Aubin Mahe in
161a71f3 13532 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
13533 * data/glr.c: Comment fix.
13534 * doc/bison.1: Remove references. Also, mention "yacc".
13535
13536 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
13537 with -g option.
13538
13539 * src/parse-gram.y (declaration): Use enum "report_states" rather
13540 than its numeric value 1.
13541
13542 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
13543 opening a new one. This fixes Debian bug 165349, reported by
13544 Bruce Stephens.
13545
23f2d9dc
PE
135462002-12-24 Paul Eggert <eggert@twinsun.com>
13547
13548 Version 1.75e.
13549
13550 * Makefile.maint (cvs-update): Don't assume that the shell
13551 supports $(...), as Solaris sh doesn't.
13552
13553 * src/parse-gram.y (lloc_default): Remove test for empty
13554 nonterminals at the end, since it didn't change the result.
13555
135562002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
13557
13558 If the user does not define YYSTYPE as a macro, Bison now declares it
13559 using typedef instead of defining it as a macro. POSIX requires this.
13560 For consistency, YYLTYPE is also declared instead of defined.
13561
13562 %union directives can now have a tag before the `{', e.g., the
13563 directive `%union foo {...}' now generates the C code
13564 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
13565 The default union tag is `YYSTYPE', for compatibility with Solaris 9
13566 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
13567 instead of `yyltype'.
13568
13569 `yystype' and `yyltype' are now obsolescent macros instead of being
13570 typedefs or tags; they are no longer documented and will be
13571 withdrawn in a future release.
13572
13573 * data/glr.c (b4_location_type): Remove.
13574 (YYSTYPE): Renamed from yystype.
13575 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
13576 (struct YYLTYPE): Renamed from struct yyltype.
13577 (YYLTYPE): Renamed from yyltype.
13578 (yyltype, yystype): New (and obsolescent) macros,
13579 for backward compatibility.
13580 * data/yacc.c: Likewise.
13581
13582 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
13583 does not specify a union tag. This is for compatibility with
13584 Solaris 9 yacc.
13585
13586 * src/parse-gram.y (add_param): 2nd arg is now char * not char
13587 const *, since it is now modified by stripping surrounding { }.
13588 (current_braced_code): Remove.
13589 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
13590 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
13591 trailing " {...}". Now of type <chars>.
13592 (grammar_declaration): Adjust to bundled tokens.
13593 (code_content): Remove; stripping is now done by add_param.
13594 (print_token_value): Print contents of bundled tokens.
13595 (token_name): New function.
13596
13597 * src/reader.h (braced_code, current_braced_code): Remove.
13598 (token_name): New decl.
13599
13600 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
13601 token_type, not braced_code code_kind. All uses changed.
13602 (SC_PRE_CODE): New state, for scanning after a keyword that
13603 has (or usually has) an immediately-following braced code.
13604 (token_type): New local var, to keep track of which token type
13605 to return when scanning braced code.
13606 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 13607 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
13608 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
13609 instead of returning a token type immediately.
13610 (<INITIAL>"{"): Set token type.
13611 (<SC_BRACED_CODE>"}"): Use it.
13612 (handle_action_dollar, handle_action_at): Now returns bool
13613 indicating success. Fail if ! current_rule; this prevents a core dump.
13614 (handle_symbol_code_dollar, handle_symbol_code_at):
13615 Remove; merge body into caller.
13616 (handle_dollar, handle_at): Complain in invalid contexts.
13617
13618 * NEWS, doc/bison.texinfo: Document the above.
13619 * NEWS: Fix years and program names in copyright notice.
13620
879ca4f8
PE
136212002-12-17 Paul Eggert <eggert@twinsun.com>
13622
13623 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
13624 Reporting, Table of Symbols): Omit mentions of %lex-param and
13625 %parse-param from the documentation for now.
13626
1c5fe69d
PE
136272002-12-15 Paul Eggert <eggert@twinsun.com>
13628
13629 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13630 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13631 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
13632 disagreed with the Bison documentation. Bug
13633 reported by Andrew Walrond.
d600ee67 13634
1c5fe69d
PE
13635 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13636 as the caller now does that.
13637 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13638 (YYEMPTY): Parenthesize right hand side, since others use it.
13639 (yyparse): Don't assume that our generated code is the only code
13640 that sets yychar.
13641
d1de5372
PE
136422002-12-13 Paul Eggert <eggert@twinsun.com>
13643
13644 Version 1.75d.
13645
13646 POSIX requires a "yacc" command.
13647 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13648 (MOSTLYCLEANFILES): Add yacc.
13649 (yacc): New rule.
1c5fe69d 13650 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
13651 as an alias for bison y.
13652
13653 * po/LINGUAS: Add da.
d600ee67 13654
d1de5372
PE
13655 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13656 problem with latest <getopt.h>.
13657 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13658
13659 * doc/fdl.texi: Upgrade to 1.2.
13660 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13661 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13662 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13663 gnulib.
13664 * config/install-sh: Sync with autotools.
13665
13666 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 13667 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
13668 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13669 locations are requested.
13670 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13671 locations are requested.
13672
d0f3fe23
PE
136732002-12-12 Paul Eggert <eggert@twinsun.com>
13674
13675 Remove unportable casts and storage allocation tricks.
13676 While we're at it, remove almost all casts, since they
13677 usually aren't needed and are a sign of trouble.
13678
13679 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13680
13681 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13682 the pointer DSET returned by malloc; this isn't portable.
13683 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13684 Similarly for DERIVES.
13685 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13686 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13687 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13688
13689 * src/derives.c (derives_compute): Do not bother invoking
13690 int_of_rule_number, since rule numbers are integers.
13691
13692 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13693 rather than XMALLOC (char, N).
13694
13695 * src/files.c (filename_split): Rewrite to avoid cast.
13696
13697 * src/gram.h (symbol_number_as_item_number,
13698 item_number_as_symbol_number, rule_number_as_item_number,
13699 item_number_as_rule_number):
13700 Now inline functions rather than macros, to avoid casts.
13701 * src/state.h (state_number_as_int): Likewise.
13702 * src/tables.c (state_number_to_vector_number,
13703 symbol_number_to_vector_number): Likewise.
13704
13705 * src/gram.h (int_of_rule_number): Remove; no longer used.
13706
13707 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13708 since the resulting storage is always stored into.
13709
13710 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13711 where it's needed.
13712
13713 * src/muscle_tab.c (muscle_m4_output):
13714 Now inline. Return bool, not int.
13715 * src/state.c (state_compare): Likewise.
13716 * src/symtab.c (symbol_check_defined,
13717 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13718 hash_compare_symbol, hash_symbol):
13719 Likewise.
13720 * src/uniqstr.c (uniqstr_print): Likewise.
13721 * src/muscle_tab.c (muscle_m4_output_processor):
13722 New function, to avoid casts.
13723 * src/state.c (state_comparator, stage_hasher): Likewise.
13724 * src/symtab.c (symbol_check_defined_processor,
13725 symbol_check_alias_consistency_processor, symbol_pack_processor,
13726 symbol_translation_processor, hash_symbol_comparator,
13727 hash_symbol_hasher): Likewise.
13728 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13729 * src/muscle_tab.c (muscles_m4_output):
13730 Use new functions instead of casting old functions unportably.
13731 * src/state.c (state_hash_new): Likewise.
13732 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13733 symbols_token_translations_init):
13734 Likewise.
13735 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13736
13737 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13738 var instead of casting to long, to avoid casts.
13739 (prepare_states): Use MALLOC rather than alloca, so that we don't
13740 have to worry about alloca.
13741 * src/state.c (state_hash_lookup): Likewise.
13742
13743 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13744 local var instead of casting to unsigned char, to avoid casts.
13745
13746 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13747 STATE_ALLOC): Remove.
13748 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13749 rather than calloc, and use offsetof to avoid allocating slightly
13750 too much storage.
13751 (state_new): Initialize all members.
13752
13753 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13754
13755 * src/symtab.c (symbol_free): Remove; unused.
13756 (symbol_get): Remove cast in lhs of assignment.
13757 (symbols_do): Now static. Accept generic arguments, not
13758 hashing-related ones.
13759
13760 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13761 (symbol_processor): Remove.
13762 (symbols_do): Remove decl; now static.
13763
13764 * src/system.h (alloca): Remove; decl no longer needed.
13765 (<stddef.h>): Include, for offsetof.
13766 (<inttypes.>, <stdint.h>): Include if available.
13767 (uintptr_t): New type, if system lacks it.
13768 (CALLOC, MALLOC, REALLOC): New macros.
13769 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13770 new macros.
13771
13772 * src/tables.c (table_size): Now int, to pacify GCC.
13773 (table_grow, table_ninf_remap): Use signed table size.
13774 (save_row): Don't bother initializing locals when not needed.
13775 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13776 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13777
13778 * src/vcg.h: Correct misspellings.
13779
13780 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13781
13782
13783 * src/getargs.c (getargs): Don't assume EOF == -1.
13784
26b4a969
PE
137852002-12-09 Paul Eggert <eggert@twinsun.com>
13786
13787 Change identifier spellings to avoid collisions with names
13788 that are reserved by POSIX.
13789
13790 Don't use names ending in _t, since POSIX reserves them.
13791 For consistency, remove _e and _s endings -- they're weren't
13792 needed to remove ambiguity. All uses changed.
13793 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13794 turn was just renamed from struniq_t.
13795 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13796 which in turn was just renamed from struniq_processor_t.
13797 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13798 in turn was renamed from hash_compare_struniq_t.
13799 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13800 (state_list): Renamed from state_list_t.
13801 * src/assoc.h (assoc): Renamed from assoc_t.
13802 * src/conflicts.c (enum conflict_resolution): Renamed from
13803 enum conflict_resolution_e.
13804 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13805 (rule_list): Renamed from rule_list_t.
13806 * src/getargs.h (enum trace): Renamed from enum trace_e.
13807 (enum report): Renamed from enum report_e.
13808 * src/gram.h (item_number): Renamed from item_number_t.
13809 (rule_number): Renamed from rule_number_t.
13810 (struct rule_s): Remove the "rule_s" part; not used.
13811 (rule): Renamed from rule_t.
13812 (rule_filter): Renamed from rule_filter_t.
13813 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13814 (goto_list): Renamed from goto_list_t.
13815 * src/lalr.h (goto_number): Renamed from goto_number_t.
13816 * src/location.h (location): Renamed from location_t.
13817 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13818 and moved here from:
13819 * src/muscle_tab.h (muscle_entry_t): here.
13820 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13821 (rule_list): Renamed from rule_list_t.
13822 * src/print_graph.c (static_graph): Renamed from graph.
13823 * src/reader.h (braced_code): Renamed from braced_code_t.
13824 Remove brace_code_e tag.
13825 * src/relation.h (relation_node): Renamed from relation_node_t.
13826 (relation_nodes): Renamed from relation_nodes_t.
13827 (relation): Renamed from relation_t.
13828 * src/state.h (state_number): Renamed from state_number_t.
13829 (struct state): Renamed from struct state_s.
13830 (state): Renamed from state_t.
13831 (transitions): Renamed from transitions_t. Unused (and
13832 misspelled) transtion_s tag removed.
13833 (errs): Renamed from errs_t. Unused errs_s tag removed.
13834 (reductions): Renamed from reductions_t. Unused tag
13835 reductions_s removed.
13836 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13837 (struct symbol_list): Renamed from struct symbol_list_s.
13838 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13839 (struct symbol): Renamed from struct symbol_s.
13840 (symbol): Renamed from symbol_t.
13841 * src/tables.c (vector_number): Renamed from vector_number_t.
13842 (action_number): Renamed from action_t.
13843 * src/tables.h (base_number): Renamed from base_t.
13844 * src/vcg.h (enum color): Renamed from enum color_e.
13845 (enum textmode): Renamed from enum textmode_e.
13846 (enum shape): Renamed from enum shape_e.
13847 (struct colorentry): Renamed from struct colorentry_s.
13848 (struct classname): Renamed from struct classname_s.
13849 (struct infoname): Renamed from struct infoname_s.
13850 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13851 (enum decision): Renamed from enum decision_e.
13852 (enum orientation): Renamed from enum orientation_e.
13853 (enum alignment): Renamed from enum alignment_e.
13854 (enum arrow_mode): Renamed from enum arrow_mode_e.
13855 (enum crossing_type): Renamed from enum crossing_type_e.
13856 (enum view): Renamed from enum view_e.
13857 (struct node): Renamed from struct node_s.
13858 (node): Renamed from node_t.
13859 (enum linestyle): Renamed from enum linestyle_e.
13860 (enum arrowstyle): Renamed from enum arrowstyle_e.
13861 (struct edge): Renamed from struct edge.
13862 (edge): Renamed from edge_t.
13863 (struct graph): Renamed from struct graph_s.
13864 (graph): Renamed from graph_t.
13865 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13866 Rename value_t -> value.
13867 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13868 value_t_as_yystype -> value_as_yystype.
13869
13870 Don't include <errno.h> in the mainstream code, since it
13871 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13872 * lib/get-errno.c, lib/get-errno.h: New files.
13873 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13874 get-errno.c.
13875 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13876 * src/output.c (output_skeleton): Likewise.
13877 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13878 instead of errno.
13879 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13880 Likewise.
13881 (handle_action_dollar, handle_action_at): Likewise.
13882 * src/system.h: Do not include <errno.h>.
13883 (TAB_EXT): Renamed from EXT_TAB.
13884 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13885
13886 Avoid str[a-z]*, since <string.h> reserves that name space.
13887 Change all instances of "struniq" in names to "uniqstr", and
13888 likewise for "STRUNIQ" and "UNIQSTR".
13889 * src/uniqstr.c: Renamed from src/struniq.c.
13890 * src/uniqstr.h: Renamed from src/struniq.h.
13891 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13892 * src/files.c (strsuffix): Remove; unused.
13893 (concat2): Renamed from stringappend. Now static.
13894 * src/files.h (strsuffix, stringappend): Remove; unused.
13895 * src/parse-gram.y (<chars>): Renamed from <string>.
13896 (<uniqstr>): Renamed from <struniq>.
13897 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13898 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13899 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13900 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13901 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13902 (N_EXPAND): Renamed from N_STRETCH.
13903
13904 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13905 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13906 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13907 Remove; unused.
13908 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13909 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13910 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13911 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13912 (BASE_MAXIMUM): Renamed from BASE_MAX.
13913 (BASE_MINIMUM): Renamed from BASE_MIN.
13914 (ACTION_MAX): Remove; unused.
13915 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13916 Unnecessary casts removed from above defines.
13917
13918
13919 Fix misspelling in names.
13920 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13921 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13922 G_NODE_ALIGNEMENT.
13923
13924
13925 * lib/timevar.c (timevar_report): Renamed from time_report,
13926 for consistency with other names.
13927 * lib/timevar.h (timevar_report): New decl.
13928 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13929
13930
13931 Sort include-file uses.
13932
13933 Reorder all include files under src to be in the order "system.h".
13934 then the ../lib include files in angle brackets (alphabetized),
13935 then the . include files in double-quotes (alphabetized). Fix
13936 dependency breakages encountered in this process, as follows:
13937 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13938 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13939 * src/state.h: Include "symtab.h".
13940
996b1c7e
PE
139412002-12-08 Paul Eggert <eggert@twinsun.com>
13942
13943 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13944 since this causes problems when __file__ contains character
13945 sequences like "@" that are treated specially by src/scan-skel.l.
13946 Instead, just use the file's basename. This fixes the bug
13947 reported by Martin Mokrejs in
161a71f3 13948 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 13949
e19c4e5d
PE
139502002-12-06 Paul Eggert <eggert@twinsun.com>
13951
13952 Add support for rules that do not have trailing semicolons, as
13953 POSIX requires. Improve the quality of locations in Bison
13954 diagnostics.
26b4a969 13955
e19c4e5d
PE
13956 * src/location.c: Include <quotearg.h>.
13957 (empty_location): Now const.
13958 (location_print): New function. Follow the recommendation of the
13959 GNU Coding Standards for locations that span file boundaries.
13960 * src/location.h: Do not include <quotearg.h>; no longer needed.
13961 (boundary): New type.
13962 (location_t): Use it. This allows locations to span file boundaries.
13963 All member uses changed: file -> start.file or end.file (as needed),
13964 first_line -> start.line, first_column -> start.column,
13965 last_line -> end.line, last_column -> end.column.
13966 (equal_boundaries): New function.
13967 (LOCATION_RESET, LOCATION_STEP): Remove.
13968 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13969 (empty_location): Now const.
13970 (location_print): New decl.
13971 * src/parse-gram.y (lloc_default): New function, which handles
13972 empty locations more accurately.
13973 (YYLLOC_DEFAULT): Use it.
13974 (%token COLON): Remove.
13975 (%token ID_COLON): New token.
26b4a969 13976 (rules): Use it.
e19c4e5d
PE
13977 (declarations, rules): Remove trailing semicolon.
13978 (declaration, rules_or_grammar_declaration):
13979 Allow empty (";") declaration.
13980 (symbol_def): Remove empty actions; no longer needed.
13981 (rules_or_grammar_declaration): Remove trailing semicolon.
13982 (semi_colon.opt): Remove.
13983 * src/reader.h: Include location.h.
13984 (scanner_cursor): New decl.
13985 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13986 rolling our own.
13987 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13988 of *loc.
13989 (STEP): Remove. No longer needed, now that adjust_location does
13990 the work. All uses removed.
13991 (scanner_cursor): New var.
13992 (adjust_location): Renamed from extend_location. It now sets
13993 *loc and adjusts the scanner cursor. All uses changed.
13994 Don't bother testing for CR.
13995 (handle_syncline): Remove location arg; now updates scanner cursor.
13996 All callers changed.
13997 (unexpected_end_of_file): Now accepts start boundary of token or
13998 comment, not location. All callers changed. Update scanner cursor,
13999 not the location.
14000 (SC_AFTER_IDENTIFIER): New state.
14001 (context_state): Renamed from c_context. All uses changed.
14002 (id_loc, code_start, token_start): New local vars.
14003 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14004 processing of Yacc white space and equivalents here.
14005 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14006 instead of returning ID immediately, since we need to search for
14007 a subsequent colon.
14008 (<INITIAL>"'", "\""): Save token_start.
14009 (<INITIAL>"%{", "{", "%%"): Save code_start.
14010 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14011 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
14012 BEGIN context_state at end, not INITIAL.
14013 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
14014 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
14015 Return correct token start.
14016 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
14017 the start of a character, string or multiline comment is found.
14018 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
14019 Reduction): Adjust reported locations to match the more-precise
14020 results now expected.
14021 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
14022 * tests/reduce.at (Useless Rules, Reduced Automaton,
14023 Underivable Rules): Likewise.
14024 * tests/regression.at (Invalid inputs): No longer `expecting ";"
14025 or "|"' now that so many other tokens are allowed by the new grammar.
14026
14027 * src/complain.h (current_file): Remove duplicate decl;
14028 current_file is now owned by files.h.
14029 * src/complain.c, src/scan-gram.l: Include files.h.
14030
140312002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 14032
e19c4e5d
PE
14033 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
14034 promotes to int; it might be unsigned int.
14035 * data/yacc.c (yy_reduce_print): Likewise.
14036
14037 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
14038 be #defined in the prologue, not in the Bison declarations.
14039 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 14040
b64755e3
PE
140412002-12-02 Paul Eggert <eggert@twinsun.com>
14042
14043 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
14044 * lib/strtoul.c: New file, from gnulib.
14045 This fixes a porting bug reported by Peter Klein in
161a71f3 14046 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 14047
6e746484
PE
140482002-11-30 Paul Eggert <eggert@twinsun.com>
14049
b64755e3
PE
14050 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
14051 and put only a forward declaration in the prologue. This is for
14052 consistency with the other scanner helper functions.
14053
6ba55592
PE
14054 Type clashes now generate warnings, not errors, since it
14055 appears that POSIX may allow some grammars with type clashes.
14056 * src/reader.c (grammar_current_rule_check): Warn about
14057 type clashes instead of complaining.
14058 * tests/input.at (Type Clashes): Expect warnings, not complaints.
14059
6e746484
PE
14060 Add Yacc library, since POSIX requires it.
14061 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
14062 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
14063 * lib/main.c, lib/yyerror.c: New files.
14064
14065 gram_error can be static; it need not be extern.
14066 * src/reader.h (gram_error): Remove decl.
14067 * src/parse-gram.y (gram_error): Now static. Add static decl.
14068 (print_token_value): Omit parameter names from forward decl,
14069 for consistency.
14070
88510f9c
PE
140712002-11-29 Paul Eggert <eggert@twinsun.com>
14072
6e746484
PE
14073 * doc/bison.texinfo: Emphasize that yylex and yyerror must
14074 be declared before being used. E.g., one should typically
14075 declare them in the prologue. Use GNU coding style in examples.
14076 Put "const" consistently after the type it modifies. Mention
14077 that C99 supports "inline". Mention that yyerror traditionally
14078 returns "int".
14079
88510f9c
PE
14080 %parse-param and %lex-param now take just one argument, the
14081 declaration; the argument name is deduced from the declaration.
14082
14083 * doc/bison.texinfo (Parser Function, Pure Calling, Error
14084 Reporting, Table of Symbols): Document this.
14085 * src/parse-gram.y (add_param): New function.
14086 (COMMA): Remove.
14087 (declaration): Implement new rule for %parse-param and %lex-param.
14088 * src/scan-gram.l: "," now elicits a warning, rather than being
14089 a token; this is more compatible with byacc.
14090 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
14091
bb92250c
PE
140922002-11-27 Paul Eggert <eggert@twinsun.com>
14093
14094 Rename identifiers to avoid real and potential collisions.
14095
14096 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
14097 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 14098 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
14099 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
14100 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
14101 * src/parse-gram.y (print_token_value): Renamed from yyprint.
14102 All uses changed.
14103 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
14104 The name "yycontrol" violates the name space rules, and this stuff
14105 wasn't being used anyway.
14106 (input): Remove action; this stuff wasn't being used.
14107 (gram_error): Rename local variable yylloc -> loc.
14108 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
14109 (YY_DECL): Don't use "yy" at start of local variables.
14110 All uses changed, e.g., yylloc -> loc.
14111 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
14112 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
14113 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
14114 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
14115
14116 * src/parse-gram.y (gram_error): loc is now const *.
14117 * src/reader.h (gram_error): Likewise.
14118
3af4feb2
PE
141192002-11-24 Paul Eggert <eggert@twinsun.com>
14120
14121 Version 1.75c.
14122
14123 * tests/actions.at (Actions after errors): Use an output format
14124 more similar to that of the Printers and Destructors test.
14125 Test the position of the ';' token too.
14126 (Printers and Destructors): Likewise.
14127 (Printers and Destructors: %glr-parser): Remove for now, to avoid
14128 unnecessarily alarming people when the test fails.
14129
14130 * data/yacc.c (yyerrlab1): Move this label down, so that the
14131 parser does not discard the lookahead token if the user code
14132 invokes YYERROR. This change is required for POSIX conformance.
14133
14134 * lib/error.c: Sync with gnulib.
14135
141362002-11-22 Paul Eggert <eggert@twinsun.com>
14137
14138 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
14139 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
14140 * lib/xmalloc.c: Likewise.
26b4a969 14141
58004308
PE
141422002-11-20 Paul Eggert <eggert@twinsun.com>
14143
14144 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
14145
141462002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 14147
58004308
PE
14148 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
14149 should use `if (! x) abort ();' rather than `assert (x);', and
14150 anyway it's one less thing to worry about configuring.
14151
14152 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
14153 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
14154 and replace all instances of assert with abort.
14155 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
14156 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
14157
14158 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
14159 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
14160 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
14161 hash_find_entry, hash_rehash, hash_insert): Likewise.
14162 * src/conflicts.c (resolve_sr_conflict): Likewise.
14163 * src/lalr.c (set_goto_map, map_goto): Likewise.
14164 * src/nullable.c (nullable_compute): Likewise.
14165 * src/output.c (prepare_rules, token_definitions_output): Likewise.
14166 * src/reader.c (packgram, reader): Likewise.
14167 * src/state.c (state_new, state_free, state_transitions_set,
14168 state_reduction_find): Likewise.
14169 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
14170 symbol_pack): Likewise.
14171 * src/tables.c (conflict_row, pack_vector): Likewise.
14172 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14173 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14174 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
14175 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
14176
14177 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
14178 (ARGMATCH_CONSTRAINT): New macro.
14179 (ARGMATCH_ASSERT): Use it.
14180
14181 * src/system.h (verify): New macro.
14182 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
14183 rather than assert.
14184 * src/tables.c (tables_generate): Likewise.
14185
14186 * src/struniq.c (struniq_assert): Now returns void, and aborts
14187 if the assertion is false.
14188 (struniq_assert_p): Remove.
14189 * src/struniq.h: Likewise.
14190
76ae8198
PE
141912002-11-18 Paul Eggert <eggert@twinsun.com>
14192
14193 * data/glr.c (yygetLRActions): Replace `yyindex' with
14194 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
14195 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 14196 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 14197
d3c4e709
AD
141982002-11-18 Akim Demaille <akim@epita.fr>
14199
14200 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
14201 space.
14202 From Tim Van Holder.
14203
8d8a7238
PE
142042002-11-17 Paul Eggert <eggert@twinsun.com>
14205
14206 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14207 to "SyntaxError" for consistency with my 2002-11-15 change.
14208
14209 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14210 not define to {}, since this breaks the common use of `YYDPRINTF
14211 ((...));' if a single statement is desired (e.g. before `else').
14212 Work around GCC warnings by surrounding corresponding calls with
14213 {} if needed.
14214 (yyhasResolvedValue): Remove unused function.
14215 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14216 loop body.
14217 (yyreportSyntaxError): Renamed from yyreportParseError.
14218 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14219 All uses changed.
14220 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14221 extern when possible. Remove unused initializations.
14222
b0937b22
AD
142232002-11-16 Akim Demaille <akim@epita.fr>
14224
14225 Augment the similarity between GLR and LALR traces.
14226
14227 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14228 (YY_REDUCE_PRINT): New.
14229 (yyparse): Use them.
14230 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14231 YYDPRINT here.
14232 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14233 state reached after the reduction/recovery, since...
14234 (yyparse, yyprocessOneStack): Report the state we are entering in.
14235
c5e3e510
AD
142362002-11-16 Akim Demaille <akim@epita.fr>
14237
14238 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14239 Add support for --trace=skeleton.
14240 * src/scan-skel.l: %option debug.
14241 Scan strings of non-@ or \n instead of character by character.
14242 (scan_skel): Handle trace_skeleton.
14243 (QPUTS): New.
14244 (@output_parser_name@, @output_header_name@): ``Restore'' their
14245 support (used to be M4 macros).
14246 * data/yacc.c: Quote larger chunks, a la glr.c.
14247 * data/lalr1.cc: Likewise.
14248 The header guards are no longer available, so use some other
14249 string than `YYLSP_NEEDED'.
14250
4c6cc1db
AD
142512002-11-16 Akim Demaille <akim@epita.fr>
14252
14253 Make the ``Printers and Destructors'' test more verbose, taking
14254 `yacc.c''s behavior as (possibly wrong) reference.
14255
14256 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14257 instead of fprint on stdout.
14258 Set and report the last_line of the symbols.
14259 Consistently display values and locations.
14260
6d9e8019
PE
142612002-11-16 Paul Eggert <eggert@twinsun.com>
14262
14263 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14264
6e649e65
PE
142652002-11-15 Paul Eggert <eggert@twinsun.com>
14266
b25d88f6
PE
14267 * tests/actions.at (Actions after errors): New test case.
14268
6e649e65
PE
14269 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14270 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14271 tests/action.at, tests/calc.at, tests/conflicts.at,
14272 tests/cxx-type.at, tests/regression.at:
14273 "parse error" -> "syntax error" for POSIX compatibility.
14274 "parsing stack overflow..." -> "parser stack overflow" so
14275 that code matches Bison documentation.
14276
0f39aab9
AD
142772002-11-15 Akim Demaille <akim@epita.fr>
14278
14279 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14280 take two BRACED_CODE, not two string_content.
14281 Free the scanner's obstack when we are done.
14282 (code_content): New.
14283 * tests/calc.at: Adjust.
14284 * doc/bison.texinfo: Adjust.
14285 Also, make sure to include the `,' for these declarations.
14286
761c1926
AD
142872002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14288
14289 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14290 definition; avoids potential autoreconf problems.
14291
b0f98b10
AD
142922002-11-15 Akim Demaille <akim@epita.fr>
14293
14294 Always check the value returned by yyparse.
14295
14296 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14297 returned by yyparse.
14298 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14299 Adjust calls.
14300 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14301 returned by yyparse.
14302
970785f1
PH
143032002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14304
14305 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14306 on input.at test.
14307
8fcc7db1
PE
143082002-11-14 Paul Eggert <eggert@twinsun.com>
14309
7ec1b48e
PE
14310 * src/output.c (output_skeleton): Call xfopen instead of
14311 duplicating xfopen's body.
14312
cfff7583 14313 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 14314 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 14315
8fcc7db1
PE
14316 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14317 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14318 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14319 file twice in the grammar, as an extra check.
14320
14321 * tests/input.at (Torturing the Scanner): Surround the
14322 backslash-newline tests with "#if 0", to make it less likely that
14323 we'll run into compiler bugs. Bring back solitary \ inside
14324 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 14325 test backslash-newline in C character constant.
8fcc7db1 14326
4e8d992c
AD
143272002-11-14 Akim Demaille <akim@epita.fr>
14328
14329 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14330 status of the compiler.
f32b346d 14331 Calling `exit 1' is no longer needed.
4e8d992c
AD
14332 Reported by Nelson H. F. Beebe.
14333
9501dc6e
AD
143342002-11-14 Akim Demaille <akim@epita.fr>
14335
14336 * tests/atlocal.in (CPPFLAGS): We have config.h.
14337 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14338 New.
14339 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14340 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14341 * tests/regression.at, tests/torture.at: Use them for all the
14342 grammars that are to be compiled.
14343 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14344 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14345 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14346
18b519c0
AD
143472002-11-14 Akim Demaille <akim@epita.fr>
14348
14349 * doc/bison.texinfo: Various formatting changes (alignments in
14350 samples, additional @group/@end group, GCS in samples.
14351 Use @deffn instead of simple @table to define the directives,
14352 macros, variables etc.
14353
9a86cdb9
PE
143542002-11-13 Paul Eggert <eggert@twinsun.com>
14355
daa33def 14356 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 14357 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 14358
daa33def 14359 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 14360 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
14361 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14362 * tests/headers.at (export YYLTYPE): Likewise.
14363
14364 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 14365 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 14366
9a86cdb9
PE
14367 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14368 comments, since they're not portable. Use GNU coding style.
14369
9c1e26bd
AD
143702002-11-13 Akim Demaille <akim@epita.fr>
14371
14372 * data/yacc.c: Leave bigger chunks of quoted text.
14373 (YYDSYMPRINTF): New.
14374 Use it to report symbol activities.
14375 * data/glr.c (YYDSYMPRINTF): New.
14376 Use it.
14377
87f721cc
PE
143782002-11-12 Paul Eggert <eggert@twinsun.com>
14379
14380 Version 1.75b.
14381
14382 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14383 (yyglrReduce): Return yyok, not 0.
14384 This should avoid the enumerated-type warnings reported
464c6927 14385 by Nelson H. F. Beebe in
161a71f3 14386 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
14387
14388 * lib/bbitset.h (BITSET_INLINE): Remove.
14389 * lib/bitset.h [! BITSET_INLINE]: Remove.
14390 (bitset_set, bitset_reset, bitset_test): Rename local vars
14391 to avoid shadowing warnings by GCC.
14392
14393 * data/glr.c (inline): Remove #define. It's the user's
14394 responsibility to #define it away, just like 'const'.
464c6927 14395 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 14396 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 14397
87f721cc
PE
14398 * Makefile.maint (po-check): Scan .l and .y files instead of the
14399 .c and the .h files that they generate. This fixes the bug
14400 reported by Tim Van Holder in:
161a71f3 14401 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
14402 Look for N_ as well as for _. Try to avoid matching #define for
14403 N_ and _.
14404 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14405 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14406 * src/scan-gram.l: Revamp regular expressions so that " and '
14407 do not confuse xgettext.
14408
14409 * src/struniq.h (struniq_new): Do not declare the return type
14410 to be 'const'; this violates the C standard.
14411 * src/struniq.c (struniq_new): Likewise.
14412
be14ade5
AD
144132002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14414
14415 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14416 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14417 linker.
14418
05291fbc
AD
144192002-11-12 Akim Demaille <akim@epita.fr>
14420
14421 * Makefile.maint: Sync with Autoconf:
14422 (local_updates): New.
14423
1f5fd52e
AD
144242002-11-12 Akim Demaille <akim@epita.fr>
14425
14426 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14427
283f1e64
AD
144282002-11-12 Akim Demaille <akim@epita.fr>
14429
14430 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14431 locations.
14432
886b69d1
AD
144332002-11-12 Akim Demaille <akim@epita.fr>
14434
14435 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14436 not yyvalue.
14437
3df37415
AD
144382002-11-12 Akim Demaille <akim@epita.fr>
14439
14440 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14441 Use it to test the GLR parser.
14442
7bd6c77e
AD
144432002-11-12 Akim Demaille <akim@epita.fr>
14444
14445 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14446 defines it.
14447 * data/glr.c (yystos): New.
14448 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14449 (YYDSYMPRINT): New.
14450 (yyval): Don't define it, it is handled via M4.
14451 (yyrecoverParseError): Free verbosely the discarded symbols.
14452 * data/yacc.c (yysymprint): Remove, rather...
14453 (b4_yysymprint_generate): invoke.
14454 * data/c.m4 (b4_yysymprint_generate): New.
14455 Accept pointers as arguments, as opposed to the version from
14456 yacc.c.
14457 (b4_yydestruct_generate): Likewise.
14458 * tests/cations.at (Printers and Destructors): Use Bison directives
14459 instead of CPP macros.
14460 Don't rely on internal details.
14461
b0400cc6
AD
144622002-11-12 Akim Demaille <akim@epita.fr>
14463
14464 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14465 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14466 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14467 it against YYEMPTY and so forth), work on yytoken (i.e., set
14468 it to YYEMPTY etc.).
14469 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14470 (b4_symbol_actions): Remove.
14471 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14472 for 0, end-of-input.
14473
72f889cc
AD
144742002-11-12 Akim Demaille <akim@epita.fr>
14475
14476 * doc/bison.texinfo (Destructor Decl): New.
14477
b1ae9233
AD
144782002-11-12 Akim Demaille <akim@epita.fr>
14479
14480 * src/tables.c (tables_generate): Use free for pointers that
14481 cannot be NULL, not XFREE.
14482 (pack_vector): Use assert, not fatal, for bound violations.
14483 * src/state.c (state_new): Likewise.
14484 * src/reader.c (reader): Likewise.
14485 * src/lalr.c (set_goto_map): Likewise.
72f889cc 14486 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
14487 the file name.
14488
7ec2d4cd
AD
144892002-11-12 Akim Demaille <akim@epita.fr>
14490
14491 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14492 Restore.
14493 * src/scan-gram.l (last_string): Is global to the file, not to
14494 yylex.
14495 * src/parse-gram.y (input): Don't append the epilogue here,
14496 (epilogue.opt): do it here, and free the scanner's obstack.
14497 * src/reader.c (epilogue_set): Rename as...
14498 (epilogue_augment): this.
14499 * data/c.m4 (b4_epilogue): Defaults to empty.
14500
573a6cd3
AD
145012002-11-12 Akim Demaille <akim@epita.fr>
14502
14503 * src/getargs.c (long_options): Remove duplicates.
14504 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14505 Remove.
14506 * doc/bison.rnh: Remove.
14507 * doc/bison.texinfo (VMS Invocation): Remove.
14508
95612cfa
AD
145092002-11-12 Akim Demaille <akim@epita.fr>
14510
14511 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14512 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14513
14514 Use struniq for symbols.
14515
14516 * src/symtab.h (symbol_t): The tag member is a struniq.
14517 (symbol_type_set): Adjust.
14518 * src/symtab.c (symbol_new): Takes a struniq.
14519 (symbol_free): Don't free the tag member.
14520 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14521 (hash_compare_symbol, hash_symbol): these.
14522 Use the fact that tags as struniqs.
14523 (symbol_get): Use struniq_new.
14524 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14525 Returns a strniq.
14526 * src/reader.h (merger_list, grammar_currentmerge_set): The name
14527 and type members are struniqs.
14528 * src/reader.c (get_merge_function)
14529 (grammar_current_rule_merge_set): Adjust.
14530 (TYPE, current_type): Are struniq.
14531
14532 Use struniq for file names.
14533
14534 * src/files.h, src/files.c (infile): Split into...
14535 (grammar_file, current_file): these.
14536 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
14537 * src/reduce.c (reduce_print): Likewise.
14538 * src/getargs.c (getargs): Likewise.
14539 * src/complain.h, src/complain.c: Likewise.
14540 * src/main.c (main): Call struniqs_new early enough to use it for
14541 file names.
14542 Don't free the input file name.
14543
3e6656f9
AD
145442002-11-12 Akim Demaille <akim@epita.fr>
14545
14546 * src/symtab.c (symbol_free): Remove dead deactivated code:
14547 type_name are properly removed.
14548 Don't use XFREE to free items that cannot be NULL.
14549 * src/struniq.h, src/struniq.c: New.
14550 * src/main.c (main): Initialize/free struniqs.
14551 * src/parse-gram.y (%union): Add astruniq member.
14552 (yyprint): Adjust.
14553 * src/scan-gram.l (<{tag}>): Return a struniq.
14554 Free the obstack bit that used to store it.
14555 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
14556
7672019c
PE
145572002-11-11 Paul Eggert <eggert@twinsun.com>
14558
14559 Revamp to fix many (but not all) of the C- and M4-related quoting
14560 problems. Among other things, this fixes the Bison bug reported
14561 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 14562 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
14563
14564 Use new @ escapes consistently. Represent brackets with @{ and @}
14565 rather than @<:@ and @:>@, since this works a bit better with dumb
14566 editors like vi. Represent @ with @@, since @ is now consistently
14567 an escape. Use @oline@ and @ofile@ rather than __oline__ and
14568 __ofile__, to avoid unexpected expansions. Similarly, use @output
14569 rather than #output.
14570
14571 * data/c.m4 (b4_copyright): Omit file name from comment, since
14572 the file name could contain "*/".
14573 (b4_synclines_flag): Don't quote the 2nd argument; it should already
14574 be quoted. All uses changed.
14575
14576 * data/glr.c: Use new @ escapes consistently.
14577 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
14578 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
14579 Remove, since they couldn't handle arbitrary characters in file
14580 names.
14581 * data/lalr1.cc: Likewise.
14582 * data/yacc.c: Likewise.
14583
14584 * src/files.c (output_infix): Remove; all uses removed.
14585 * src/files.h: Likewise.
14586
14587 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
14588 mishandled funny characters in file names, and anyway it isn't
14589 needed any more.
14590 * data/yacc.c: Likewise.
14591 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
14592
14593 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
14594 * data/yacc.c: Likewise.
14595
14596 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
14597 strings now.
14598 (muscle_init): Quote filename as a C string.
14599 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
14600 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
14601 * src/output.c (escaped_file_name_output): New function.
14602 (prepare_symbols): Quote tokens for M4.
14603 (prepare): Don't insert output_infix, output_prefix,
14604 output_parser_name, output_header_name; this is now down by scan-skel.
14605 Insert skeleton as a C string.
14606
14607 * src/output.c (user_actions_output, symbol_destructors_output,
14608 symbol_printers_output): Quote filenames for C and M4.
14609 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14610
14611 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
14612 escapes other than \\ and \'; this simplifies the code.
14613 (<SC_STRING>): Likewise, for \\ and \".
14614 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
14615 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
14616 Use new escapes @{ and @} for [ and ].
14617
14618 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
14619 them with auto vars.
14620 Switch to new escape scheme, where @ is the escape character uniformly.
14621 Abort if a stray escape character is found. Avoid unbounded input
14622 buffer when parsing non-escaped text.
14623
14624 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14625 __oline__, #output, $@, and @{ do not have unintended meanings.
14626
acea4f3b
PE
146272002-11-09 Paul Eggert <eggert@twinsun.com>
14628
14629 Fix the test failure due to GCC warnings described in
161a71f3 14630 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
14631 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14632 evaluate to 0 if it's impossible for NINF to be in the respective
14633 table.
14634 (yygetLRActions, yyrecoverParseError): Use them.
14635
14636 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14637 counted in the token inserted at end of file. Now takes
14638 location_t *, not location_t, so that the location can be
14639 adjusted. All uses changed.
14640
14641 * tests/regression.at (Invalid inputs): Adjust wording in
14642 diagnostic to match the new behavior.
14643
14644 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14645 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14646 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14647 abort ();'. This reduces the runtime of the "Many lookaheads"
14648 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14649 GCC 3.2.
14650
20ef1ad5
PE
146512002-11-07 Paul Eggert <eggert@twinsun.com>
14652
14653 * src/parse-gram.y (CHARACTER): Remove unused token.
14654 All uses removed.
14655
14656 * src/scan-gram.l: Remove stack option. We no longer use the
14657 stack, since the stack was never deeper than 1; instead, use the
14658 new auto var c_context to record the stacked value.
14659
14660 Remove nounput option. At an unexpected end of file, we now unput
14661 the minimal input necessary to end cleanly; this simplifies the
14662 code.
14663
14664 Avoid unbounded token sizes where this is easy.
14665
14666 (unexpected_end_of_file): New function.
14667 Use it to systematize the error message on unexpected EOF.
14668 (last-string): Now auto, not static.
14669 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14670 (scanner_last_string_free): Remove; not used.
14671 (percent_percent_count): Move decl to just before use.
14672 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14673 not the (never otherwised-used) CHARACTER.
14674
93724f13
AD
146752002-11-07 Akim Demaille <akim@epita.fr>
14676
14677 Let yyerror always receive the msg as last argument, so that
14678 yyerror can be variadic.
14679
14680 * data/yacc.c (b4_yyerror_args): New.
14681 Use it when calling yyerror.
14682 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14683 Use it when calling yyerror.
14684 * doc/bison.texinfo (Error Reporting): Adjust.
14685 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14686 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14687
6e40b4eb
AD
146882002-11-06 Akim Demaille <akim@epita.fr>
14689
14690 #line should have quoted strings.
14691 Ideally, this should be done by m4_quotearg.
14692
14693 * src/scan-skel.l: Include quotearg.h.
14694 Quote __ofile__.
14695 * src/output.c (symbol_printers_output)
14696 (symbol_destructors_output): Quote the file name.
14697
2dfbfc12
AD
146982002-11-06 Akim Demaille <akim@epita.fr>
14699
14700 * tests/regression.at (Invalid inputs): Adjust to the recent
14701 messages.
14702
437c2d80
AD
147032002-11-06 Akim Demaille <akim@epita.fr>
14704
14705 Restore --no-lines.
14706 Reported by Jim Kent.
14707
14708 * data/c.m4 (b4_syncline): New.
14709 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14710 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14711 * src/output.c (user_actions_output): Likewise.
14712 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 14713 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 14714
900c5db5
AD
147152002-11-06 Akim Demaille <akim@epita.fr>
14716
14717 * src/main.c (main): Free `infile'.
14718 * src/scan-gram.l (handle_syncline): New.
14719 Recognize `#line'.
14720 * src/output.c (user_actions_output, symbol_destructors_output)
14721 (symbol_printers_output): Use the location's file name, not
14722 infile.
14723 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14724
e183b123 147252002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 14726
e183b123 14727 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 14728 either has GLR conflict entries.
e183b123 14729
193eb6b7
PE
147302002-11-05 Paul Eggert <eggert@twinsun.com>
14731
e183b123
PE
14732 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14733 "integer out of range" rather than "invalid value".
14734 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14735 accordingly.
14736
193eb6b7
PE
14737 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14738 Also, remove one static variable in the scanner.
14739
14740 * src/scan-gram.l (braces_level): Now auto, not static.
14741 Initialize to zero if the compiler is being picky.
14742 (INITIAL): Clear braces_level instead of incrementing it.
14743 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14744 as POSIX 1003.1-2001 requires.
14745 * src/system.h (IF_LINT): New macro, taken from coreutils.
14746 * configure.ac: Define "lint" if --enable-gcc-warnings.
14747
29c01725
AD
147482002-11-05 Akim Demaille <akim@epita.fr>
14749
14750 * src/scan-gram.l: When it starts with `%', complain about the
14751 whole directive, not just that `invalid character: %'.
14752
8aeac3ca
AD
147532002-11-04 Akim Demaille <akim@epita.fr>
14754
14755 * Makefile.maint: Update from Autoconf.
14756 (update, cvs-update, po-update, do-po-update): New.
14757
793a58bb
AD
147582002-11-04 Akim Demaille <akim@epita.fr>
14759
14760 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14761 and yyerror.
14762 Have yyerror `use' its arguments.
14763 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14764 returns true when location & yacc & pure & parse-param.
14765 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14766
c4d720cd
AD
147672002-11-04 Akim Demaille <akim@epita.fr>
14768
14769 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14770 clashes.
14771 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14772 font-lock-mode.
14773 Use complain_at.
14774 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14775 slot 0.
14776
613a0dc5
PE
147772002-11-03 Paul Eggert <eggert@twinsun.com>
14778
14779 * src/reader.c (get_merge_function, grammar_current_rule_check):
14780 Use consistent diagnostics for reporting type name clashes.
14781 Quote the types with <>, for consistency with Yacc.
14782 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14783
2a8d363a
AD
147842002-11-03 Akim Demaille <akim@epita.fr>
14785
14786 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14787 New.
14788 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14789 (b4_parse_param): Remove.
14790 Use b4_identification.
14791 Propagate b4_pure_args where needed to pass them to yyerror.
14792 * data/glr.m4 (b4_parse_param): Remove.
14793 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14794 (b4_lpure_formals): New.
14795 Use b4_identification.
14796 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14797 b4_user_formals and b4_user_args.
14798 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14799 (yyreportAmbiguity): When using a pure parser, also need
14800 the location, and the parse-params.
14801 Adjust callers.
14802 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14803 When using a pure parser, also need the parse-params.
14804 Adjust callers.
14805 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14806 (%pure-parser + %parse-param) LALR and GLR parsers.
14807 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14808 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14809 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14810 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14811 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14812 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14813 * doc/bison.texinfo: Untabify the whole file.
14814 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14815 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14816 (Error Reporting): Adjust to these new directives.
14817 Document %error-verbose, deprecate YYERROR_VERBOSE.
14818
9e32add8
AD
148192002-11-03 Akim Demaille <akim@epita.fr>
14820
14821 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14822 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14823 command line options.
14824 * tests/cxx-type.at: Formatting changes.
14825
b02d90a5
PE
148262002-11-03 Paul Eggert <eggert@twinsun.com>
14827
14828 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14829 to count columns correctly, and to check for invalid inputs.
9e32add8 14830
b02d90a5
PE
14831 Use mbsnwidth to count columns correctly. Account for tabs, too.
14832 Include mbswidth.h.
14833 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14834 (extend_location): New function.
14835 (YY_LINES): Remove.
14836
14837 Handle CRLF in C code rather than in Lex code.
14838 (YY_INPUT): New macro.
14839 (no_cr_read): New function.
14840
14841 Scan UCNs, even though we don't fully handle them yet.
14842 (convert_ucn_to_byte): New function.
14843
14844 Handle backslash-newline correctly in C code.
14845 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14846 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14847 all uses changed.
14848 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14849 Use {splice} wherever C allows backslash-newline.
14850 YY_STEP after space, newline, vertical-tab.
14851 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 14852
b02d90a5
PE
14853 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14854
14855 ({int}, handle_action_dollar, handle_action_at): Check for integer
14856 overflow.
9e32add8 14857
b02d90a5
PE
14858 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14859
14860 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14861 as well as \000. Check for UCHAR_MAX, not 255.
14862 Allow \x with an arbitrary positive number of digits, as in C.
14863 Check for overflow here.
14864 Allow \? and UCNs, for compatibility with C.
14865
14866 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14867 with quote slot used by complain_at.
14868
14869 * tests/input.at: Add tests for backslash-newline, m4 quotes
14870 in symbols, long literals, and funny escapes in strings.
14871
14872 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14873 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14874 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14875 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14876 * m4/mbswidth.m4: New file, from GNU coreutils.
14877
14878 * doc/bison.texinfo (Grammar Outline): Document // comments.
14879 (Symbols): Document that trigraphs have no special meaning in Bison,
14880 nor is backslash-newline allowed.
14881 (Actions): Document that trigraphs have no special meaning.
14882
14883 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14884 no longer used.
14885
148862002-11-02 Paul Eggert <eggert@twinsun.com>
14887
14888 * src/reader.c: Don't include quote.h; not needed.
14889 (get_merge_function): Reword warning to be consistent with
14890 type clash diagnostic in grammar_current_rule_check.
14891
14892 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14893 bug in trigraph handling.
14894
14895 * src/output.c (prepare_symbols): When printing token names,
14896 escape "[" as "@<:@" and likewise for "]".
14897
14898 * src/system.h (errno): Remove declaration, as we are now
14899 assuming C89 or better, and C89 guarantees errno.
14900
762b212b
PE
149012002-10-30 Paul Eggert <eggert@twinsun.com>
14902
14903 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14904 Check for close failures.
14905 * src/files.h (xfclose): Return void, not int, since it always
14906 returned zero.
14907 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14908 indicates one.
14909 * src/output.c (output_skeleton): Use xfclose rather than fclose
14910 and ferror. xfclose now checks ferror.
14911
14912 * data/glr.c (YYLEFTMOST_STATE): Remove.
14913 (yyreportTree): Use a stack-based leftmost state. This avoids
14914 our continuing battles with bogus warnings about initializers.
14915
56100c60
AD
149162002-10-30 Akim Demaille <akim@epita.fr>
14917
14918 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14919 #if.
14920
51b4a04c
PH
149212002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14922
14923 * tests/glr-regr1.at: New test for reported regressions.
14924 * tests/testsuite.at: Add glr-regr1.at test.
14925 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 14926
bf1ebda2
PE
149272002-10-24 Paul Eggert <eggert@twinsun.com>
14928
5c16c6b1
PE
14929 Version 1.75a.
14930
bf1ebda2
PE
14931 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14932 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14933 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14934 Don't assume strdup exists; POSIX says its an XSI extension.
14935 Check for buffer overflow on input.
14936
b526ee61
AD
149372002-10-24 Akim Demaille <akim@epita.fr>
14938
14939 * src/output.c (output_skeleton): Don't disable M4sugar comments
14940 too soon: it results in comments being expanded.
14941 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14942 first output.
14943
f1886bb2
AD
149442002-10-24 Akim Demaille <akim@epita.fr>
14945
14946 * data/yacc.c (m4_int_type): New.
14947 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14948 char' as only yacc.c wants K&R portability.
14949 * data/glr.c (yysigned_char): Remove.
14950 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14951 Reported by Quoc Peyrot.
14952
c5576256
PE
149532002-10-23 Paul Eggert <eggert@twinsun.com>
14954
14955 * src/main.c (main): With --trace=time, report times even if a
14956 non-fatal error occurs. Formerly, the times were reported in some
14957 such cases but not in others.
14958 * src/reader.c (reader): Just return if a complaint has been issued,
14959 instead of exiting, so that 'main' can report times.
14960
27b0ffea
AD
149612002-10-22 Akim Demaille <akim@epita.fr>
14962
14963 * src/system.h: Include sys/types.
14964 Reported by Bert Deknuydt.
14965
223a7883
PE
149662002-10-23 Paul Eggert <eggert@twinsun.com>
14967
14968 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14969 Suggested by Art Haas.
14970
149712002-10-22 Paul Eggert <eggert@twinsun.com>
14972
14973 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14974 decl; not needed any more.
14975 * src/main.c (main): Use return to exit, undoing yesterday's change.
14976 The last OS that we could find where this wouldn't work is
14977 SunOS 3.5, and that's too old to worry about now.
14978
14979 * data/glr.c (struct yyltype): Define members even when not
14980 doing locations. This is more consistent with yacc.c, and it
14981 works around the following bug reports:
161a71f3
PE
14982 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14983 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 14984
223a7883
PE
14985 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14986 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14987 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14988
8b76775a
AD
149892002-10-22 Akim Demaille <akim@epita.fr>
14990
14991 * data/README: New.
14992
6db10d14
PE
149932002-10-21 Paul Eggert <eggert@twinsun.com>
14994
14995 Be consistent about 'bool'; the old code used an enum in one
14996 module and an int in another, and this violates the C standard.
14997 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14998 * configure.ac (AC_HEADER_STDBOOL): Add.
14999 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15000 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15001 * src/symtab.c (hash_compare_symbol_t): Likewise.
15002 * src/system.h (bool, false, true): Use a definition consistent
15003 with ../lib/hash.c. All uses changed.
15004
15005 * src/complain.c (warning_issued): Renamed from warn_message_count,
15006 so that we needn't worry about integer overflow (!).
15007 Now of type bool. All uses changed.
15008 (complaint_issued): Renamed from complain_message_count; likewise.
15009
15010 * src/main.c (main): Use exit to exit with failure.
27b0ffea 15011
6db10d14
PE
15012 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
15013 rather than 1 and 0.
15014 * src/main.c (main): Likewise.
15015 * src/getargs.c (getargs): Likewise.
15016 * src/reader.c (reader): Likewise.
15017
15018 * src/getarg.c (getargs): Remove duplicate code for
15019 "Try `bison --help'".
15020
15021 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
15022 What was that "2" for?
15023
15024 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
15025 * src/getargs.c (usage): Likewise.
15026
15027 * src/getargs.c (getargs): When there are too few operands, report
15028 the last one. When there are too many, report the first extra
15029 one. This is how diffutils does it.
15030
92a060fd
PE
150312002-10-20 Paul Eggert <eggert@twinsun.com>
15032
15033 Remove K&R vestiges.
15034 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
15035 * src/complain.c (VA_START): Remove. Assume prototypes.
15036 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
15037 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
15038 fatal): Assume prototypes.
15039 * src/complain.h: Assume prototypes.
15040 * src/system.h (PARAMS): Remove.
15041 Include <limits.h> unconditionally, since it's guaranteeed even
15042 for a freestanding C89 compiler.
15043 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
15044 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 15045
e7cb57c0
AD
150462002-10-20 Akim Demaille <akim@epita.fr>
15047
15048 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
15049 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
15050 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
15051 (yyresolveStates, yyresolveAction, yyresolveStack)
15052 (yyprocessOneStack): Use them.
15053 (yy_reduce_print): New.
15054 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
15055
0245f82d
AD
150562002-10-20 Akim Demaille <akim@epita.fr>
15057
15058 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
15059 arguments and output `void'.
15060 (b4_c_function): Rename as...
15061 (b4_c_function_def): this.
15062 (b4_c_function_decl, b4_c_ansi_function_def)
15063 (b4_c_ansi_function_decl): New.
15064 Change the interpretation of the arguments: before `int, foo', now
15065 `int foo, foo'.
15066 * data/yacc.c (yyparse): Prototype and define thanks to these.
15067 Adjust b4_c_function_def uses.
15068 * data/glr.c (yyparse): Likewise, but ANSI only.
15069
39912f52
AD
150702002-10-20 Akim Demaille <akim@epita.fr>
15071
15072 * src/output.c (prepare): Move the definition of `tokens_number',
15073 `nterms_number', `undef_token_number', `user_token_number_max'
15074 to...
15075 (prepare_tokens): Here.
15076 (prepare_tokens): Rename as...
15077 (prepare_symbols): this.
15078 (prepare): Move the definition of `rules_number' to...
15079 (prepare_rules): here.
15080 (prepare): Move the definition of `last', `final_state_number',
15081 `states_number' to...
15082 (prepare_states): here.
15083 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
15084
20c1e2ad
AD
150852002-10-20 Akim Demaille <akim@epita.fr>
15086
15087 * src/tables.h, src/tables.c, src/output.c: Comment changes.
15088
21964f43
AD
150892002-10-20 Akim Demaille <akim@epita.fr>
15090
15091 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
15092 * data/c.m4: here.
15093
66d30cd4
AD
150942002-10-20 Akim Demaille <akim@epita.fr>
15095
15096 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
15097 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
15098 `pair'.
15099 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
15100 `name' to...
15101 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
15102 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
15103 These.
15104
95f2c9fe
PE
151052002-10-19 Paul Eggert <eggert@twinsun.com>
15106
15107 Do not create a temporary file, as that involves security and
15108 cleanup headaches. Instead, use a pair of pipes.
15109 Derived from a suggestion by Florian Krohm.
15110 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
15111 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
15112 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
15113 (BISON_PREREQ_SUBPIPE): Add.
15114 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
15115 Add subpipe.h, subpipe.c.
15116 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
15117 * po/POTFILES.in: Add lib/subpipe.c.
15118 * src/output.c: Include "subpipe.h".
15119 (m4_invoke): Remove decl.
15120 (scan_skel): New decl.
15121 (output_skeleton): Use pipe rather than temporary file for m4 input.
15122 Check that m4sugar.m4 is readable, to avoid deadlock.
15123 Check for pipe I/O error.
15124 * src/scan-skel.l (readpipe): Remove decl.
15125 (scan_skel): New function, to be used in place of m4_invoke.
15126 Read from stream rather than file.
66d30cd4 15127
95f2c9fe
PE
15128 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
15129 float, as this generates a warning on Solaris 8 + GCC 3.2 with
15130 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
15131 this generates a more-accurate value anyway.
15132
15133 * lib/timevar.c (timervar_accumulate): Rename locals to
15134 avoid confusion with similarly-named more-global.
15135 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
15136
15137 * src/output.c (prepare): Use xstrdup to convert char const *
15138 to char *, to avoid GCC warning.
15139
c19988b7
AD
151402002-10-19 Akim Demaille <akim@epita.fr>
15141
15142 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
15143 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
15144 Use them to have `calc.y' ready for %pure-parser.
15145 * data/yacc.c (YYLEX): Pass a yylex return type to
15146 b4_c_function_call.
15147
ae7453f2
AD
151482002-10-19 Akim Demaille <akim@epita.fr>
15149
15150 Prototype support of %lex-param and %parse-param.
15151
15152 * src/parse-gram.y: Add the definition of the %lex-param and
15153 %parse-param tokens, plus their rules.
15154 Drop the `_' version of %glr-parser.
15155 Add the "," token.
15156 * src/scan-gram.l (INITIAL): Scan them.
15157 * src/muscle_tab.c: Comment changes.
15158 (muscle_insert, muscle_find): Rename `pair' as `probe'.
15159 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
15160 (muscle_entry_s): The `value' member is no longer const.
15161 Adjust all dependencies.
15162 * src/muscle_tab.c (muscle_init): Adjust: use
15163 MUSCLE_INSERT_STRING.
15164 Initialize the obstack earlier.
15165 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
15166 (muscle_pair_list_grow): New.
15167 * data/c.m4 (b4_c_function_call, b4_c_args): New.
15168 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
15169 * tests/calc.at: Use %locations, not --locations.
15170 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
15171
0e575721
AD
151722002-10-19 Akim Demaille <akim@epita.fr>
15173
15174 * src/getargs.c (usage): Take status as argument and exit
15175 accordingly.
15176 Report the traditional `Try ... --help' message when status != 0.
15177 (usage, version): Don't take a FILE * as arg, it is pointless.
15178 (getargs): When there is an incorrect number of arguments, make it
15179 an error, and report it GNUlically thanks to `usage ()'.
15180
724ce7f5
PE
151812002-10-18 Paul Eggert <eggert@twinsun.com>
15182
3a781eb2
PE
15183 * data/glr.c (yyreportParseError): Don't assume that sprintf
15184 yields the length of the printed string, as this is not true
15185 on SunOS 4.1.4. Reported by Peter Klein.
15186
724ce7f5
PE
15187 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
15188 * tests/conflicts.at (%nonassoc and eof): Likewise.
15189 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
15190
473d0a75
AD
151912002-10-17 Akim Demaille <akim@epita.fr>
15192
15193 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
15194 * src/getargs.c (trace_types, trace_args): Adjust.
15195 * src/reader.c (grammar_current_rule_prec_set)
15196 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
15197 Standardize error messages.
15198 And s/@prec/%prec/!
15199 (reader): Use trace_flag to enable scanner/parser debugging,
15200 instead of an adhoc scheme.
15201 * src/scan-gram.l: Remove trailing debugging code.
15202
e76d2469
PE
152032002-10-16 Paul Eggert <eggert@twinsun.com>
15204
93e2236a
PE
15205 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
15206 MUSCLE_TAB_H.
15207
e76d2469
PE
15208 * NEWS: Officially drop support for building Bison with K&R C,
15209 since it didn't work anyway and it's not worth worrying about.
15210 * Makefile.maint (wget_files): Remove ansi2knr.c.
15211 (ansi2knr.c-url_prefix): Remove.
15212 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15213 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15214 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15215
5bd1c419
PE
152162002-10-15 Paul Eggert <eggert@twinsun.com>
15217
15218 Stop using the "enum_" trick for K&R-style function definitions;
15219 it confused me, and I was the author! Instead, assume that people
15220 who want to use K&R C compilers (when using these modules in GCC,
15221 perhaps?) will run ansi2knr.
15222
15223 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15224 All uses of "enum_" changed to "enum ".
15225 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15226 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 15227
5bd1c419
PE
15228 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15229 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15230 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15231 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15232 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15233 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15234 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15235 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15236 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15237 Use function prototypes; this removes the need for declaring
15238 static functions simply to provide their prototypes.
15239 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15240 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15241 bitset_count_, bitset_create, bitset_dump, bitset_first,
15242 bitset_free, bitset_init, bitset_last, bitset_next,
15243 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15244 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15245 bitset_print, bitset_release_memory, bitset_toggle_,
15246 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15247 debug_bitset): Likewise.
15248 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15249 * lib/bitset_stats.c (bitset_log_histogram_print,
15250 bitset_percent_histogram_print, bitset_stats_and,
15251 bitset_stats_and_cmp, bitset_stats_and_or,
15252 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15253 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15254 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15255 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15256 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15257 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15258 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15259 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15260 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15261 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15262 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15263 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15264 bitset_stats_zero): Likewise.
15265 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15266 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15267 bitsetv_dump, debug_bitsetv): Likewise.
15268 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15269 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15270 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15271 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15272 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15273 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15274 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15275 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15276 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15277 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15278 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15279 Likewise.
15280 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15281 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15282 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15283 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15284 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15285 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15286 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15287 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15288 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15289 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15290 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 15291
ae26e1f0
AD
152922002-10-14 Akim Demaille <akim@epita.fr>
15293
15294 Version 1.75.
15295
d43baf71
AD
152962002-10-14 Akim Demaille <akim@epita.fr>
15297
15298 * tests/Makefile.am (maintainer-check-posix): New.
15299
7ebc83e3
AD
153002002-10-14 Akim Demaille <akim@epita.fr>
15301
15302 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15303 member.
15304
05846dae
AD
153052002-10-14 Akim Demaille <akim@epita.fr>
15306
15307 * src/tables.c (table_ninf_remap): base -> tab.
15308 Reported by Matt Rosing.
15309
1318e37d
PE
153102002-10-14 Paul Eggert <eggert@twinsun.com>
15311
447fbb17
PE
15312 * tests/action.at, tests/calc.at, tests/conflicts.at,
15313 tests/cxx-type.at, tests/headers.at, tests/input.at,
15314 tests/regression.at, tests/synclines.at, tests/torture.at:
15315 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15316 so that the tests still work even if POSIXLY_CORRECT is set.
15317 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 15318
1318e37d
PE
15319 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15320 for portability to K&R hosts. Fix typo: signed char is guaranteed
15321 only to 127, not to 128.
15322 * data/glr.c (yysigned_char): New type.
15323 * data/yacc.c (yysigned_char): Likewise.
15324 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15325
cc0f0794
PE
153262002-10-13 Paul Eggert <eggert@twinsun.com>
15327
5038f418
PE
15328 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15329 true due to limited range of data type" warning from GCC.
15330
cc0f0794
PE
15331 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15332 by wrapping enum yytokentype's definition inside #ifndef
15333 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15334
6fed0802
AD
153352002-10-13 Akim Demaille <akim@epita.fr>
15336
15337 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15338 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15339
32f0598d
AD
153402002-10-13 Akim Demaille <akim@epita.fr>
15341
15342 * Makefile.maint: Update from Autoconf 2.54.
15343 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15344
7ea9a33f
AD
153452002-10-13 Akim Demaille <akim@epita.fr>
15346
15347 * src/print.c (print_state): Separate the list of solved conflicts
15348 from the other items.
15349 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15350
ea99527d
AD
153512002-10-13 Akim Demaille <akim@epita.fr>
15352
15353 Let nondeterministic skeletons be usable with deterministic
15354 tables.
15355
15356 With the patch, GAWK compiled by GCC without -O2 passes its test
15357 suite using a GLR parser driven by LALR tables. It fails with -O2
15358 because `struct stat' gives two different answers on my machine:
15359 88 (definition of an auto var) and later 96 (memset on this var).
15360 Hence the stack is badly corrumpted. The headers inclusion is to
15361 blame: if I move the awk.h inclusion before GLR's system header
15362 inclusion, the two struct stat have the same size.
15363
15364 * src/tables.c (pack_table): Always create conflict_table.
15365 (token_actions): Always create conflict_list.
15366 * data/glr.c (YYFLAG): Remove, unused.
15367
f377f69f
AD
153682002-10-13 Akim Demaille <akim@epita.fr>
15369
15370 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15371 (O0FLAGS): New.
15372 (VALGRIND, GXX): New.
15373 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15374 * tests/bison.in: Run $PREBISON a pre-command.
15375 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15376 (maintainer-check-g++): New.
15377 * Makefile.am (maintainer-check): New.
15378
2a1fe6ed
AD
153792002-10-13 Akim Demaille <akim@epita.fr>
15380
15381 * data/glr.c: Formatting changes.
15382 Tweak some trace messages to match yacc.c's.
15383
f50adbbd
AD
153842002-10-13 Akim Demaille <akim@epita.fr>
15385
15386 GLR parsers sometimes raise parse errors instead of performing the
15387 default reduction.
15388 Reported by Charles-Henry de Boysson.
15389
15390 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 15391 check the length of the traces when %glr.
f50adbbd
AD
15392 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15393 GLR's traces.
15394 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15395 Test GLR parsers.
15396 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15397 (yyltype): Remove the yy prefix from the member names.
15398 (yytable): Complete its comment.
15399 (yygetLRActions): Map error action number from YYTABLE from
15400 YYTABLE_NINF to 0.
15401 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15402 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15403 not satisfying as we could compare an YYACTION computed from
15404 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15405 only value for error actions.
15406 (yyreportParseError): In verbose parse error messages, don't issue
15407 `error' in the list of expected tokens.
15408 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15409 next action to perform to match glr.c's decoding.
15410 (yytable): Complete its comment.
15411
bcbad5b9
PE
154122002-10-13 Paul Eggert <eggert@twinsun.com>
15413
15414 Fix problem reported by Henrik Grubbstroem in
161a71f3 15415 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
15416 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15417 because the Bison parser reads the second action before reducing
15418 the first one.
15419 * src/scan-gram.l (rule_length): New static var.
15420 Use it to keep track of the rule length in the scanner, since
15421 we can't expect the parser to be in lock-step sync with the scanner.
15422 (handle_action_dollar, handle_action_at): Use this var.
15423 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 15424
14904b89
PE
154252002-10-12 Paul Eggert <eggert@twinsun.com>
15426
1fe611e5
PE
15427 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15428 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15429 Include <sys/time.h> when checking for clock_t and struct tms.
15430 Use same include order as source.
15431 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 15432 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 15433
1fe611e5
PE
15434 * lib/timevar.c: Update copyright date and clarify comments.
15435 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 15436
1fe611e5
PE
15437 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15438 GCC version as of today, then merge Bison's changes.
15439 Change "GCC" to "Bison" in copyright notice. timevar.def's
15440 author is Akim, so change that too.
15441
98194095
PE
15442 * src/reader.c (grammar_current_rule_check):
15443 Don't worry about the default action if $$ is untyped.
15444 Prevents bogus warnings reported by Jim Gifford in
161a71f3 15445 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 15446
14904b89
PE
15447 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15448 * data/glr.c, data/lalr1.cc, data/yacc.c:
15449 Output token definitions before the first part of user declarations.
15450 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 15451 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 15452
ff6dca18
PE
154532002-10-11 Paul Eggert <eggert@twinsun.com>
15454
15455 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15456 (yyparse): here. This undoes some of the 2002-07-25 change.
15457 Compatibility problem reported by Ralf S. Engelschall with
15458 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15459
eb714592
AD
154602002-10-11 Akim Demaille <akim@epita.fr>
15461
15462 * tests/regression.at Characters Escapes): New.
15463 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15464 characters.
15465 Reported by Jan Nieuwenhuizen.
15466
b7195100
AD
154672002-10-11 Akim Demaille <akim@epita.fr>
15468
15469 * po/id.po: New.
15470
f28a0f2d
PE
154712002-10-10 Paul Eggert <eggert@twinsun.com>
15472
15473 Portability fixes for bitsets; this also avoids several GCC
15474 warnings.
15475
15476 * lib/abitset.c: Include <stddef.h>, for offsetof.
15477 * lib/lbitset.c: Likewise.
15478
15479 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15480 properly for vectors of objects. Do not assume that adding a
15481 header size to a multiple of a word size yields a value that is
15482 properly aligned for the whole union.
15483 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15484
15485 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15486 unique names for structures.
15487 * lib/ebitset.c (ebitset_bytes): Likewise.
15488 * lib/lbitset.c (lbitset_bytes): Likewise.
15489
15490 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15491 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15492 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15493 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15494 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15495 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15496 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15497 to improve the type-checking that GCC can do.
15498 * lib/bitset.c (bitset_op4_cmp): Likewise.
15499 * lib/bitset_stats.c (bitset_stats_count,
15500 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15501 bitset_stats_copy, bitset_stats_disjoint_p,
15502 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15503 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15504 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15505 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15506 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15507 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15508 bitset_stats_or_and_cmp): Likewise.
15509 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15510 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15511 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15512 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15513
15514 * lib/abitset.h: Include bitset.h, not bbitset.h.
15515 * lib/ebitset.h: Likewise.
15516 * lib/lbitset.h: Likewise.
15517
15518 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15519 All instances of parameters of type enum bitset_opts are now of
15520 type enum_bitset_opts, to conform to the C Standard, and similarly
15521 for enum_bitset_type.
15522 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15523 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15524
15525 Do not use "struct bitset_struct" to mean different things in
15526 different modules. Not only is this confusing, it violates
15527 the C Standard, which requires that structure types in different
15528 modules must be compatible if one is to be passed to the other.
15529 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
15530 All instances of "struct bitset_struct *" replaced with "bitset".
15531 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
15532 (union bitset_union, struct abitset_struct, struct ebitset_struct,
15533 struct lbitset_struct, struct bitset_stats_struct): New types.
15534 All uses of struct bitset_struct changed to union bitset_union,
15535 etc.
ba0fe3c7 15536 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
15537 struct bitset_struct): Remove.
15538 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
15539 struct bitset_struct): Remove.
15540 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
15541 bitset_struct): Remove.
15542 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
15543 Likewise.
15544
15545 Do not call a function of type T using a call that assumes the
15546 function is of a different type U. Standard C requires that a
15547 function must be called with a type that is compatible with its
15548 definition.
15549 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15550 New decls.
15551 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15552 New functions.
15553 * lib/ebitset.c (PFV): Remove.
15554 * lib/lbitset.c (PFV): Likewise.
15555 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
15556 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
15557 decls.
15558 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
15559 (ebitset_vtable): Use them.
15560 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
15561 lbitset_xor): New functions.
15562 (lbitset_vtable): Use them.
15563
15564 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
15565 Declare.
15566
15567 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
15568 GCC warning.
15569 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
15570 Use offsetof, for simplicity.
15571
6fbe4984
PE
155722002-10-06 Paul Eggert <eggert@twinsun.com>
15573
15574 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
15575 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 15576 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
15577 which was inadvertently undone by the 2002-09-30 patch.
15578 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
15579 the same width as int.
15580
420f93c8
PE
155812002-10-04 Paul Eggert <eggert@twinsun.com>
15582
15583 Version 1.50.
15584
15585 * configure.ac (AC_INIT), NEWS: Increment version number.
15586
15587 * doc/bison.texinfo: Minor spelling, grammar, and white space
15588 fixes.
15589 (Symbols): Mention that any negative value returned from yylex
15590 signifies end-of-input. Warn about negative chars. Mention
15591 the portable Standard C character set.
15592
15593 The GNU coding standard says CFLAGS and YFLAGS are reserved
15594 for the installer to set.
15595 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
15596 * src/Makefile.am (AM_CFLAGS): Likewise.
15597 (AM_YFLAGS): Renamed from YFLAGS.
15598
15599 Fix some MAX and MIN problems.
15600 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
15601 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
15602 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
15603 * src/reader.c (reader): Use it.
15604
15605 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
15606 POSIX 1003.1-2001 has removed fgrep.
15607
156082002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
15609
15610 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
15611 interpreted as signed.
15612 * lib/ebitset.c (ebitset_list): Fix bug.
15613
ff68026d
PE
156142002-10-01 Paul Eggert <eggert@twinsun.com>
15615
15616 More fixes for 64-bit hosts and large bitsets.
15617
15618 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
15619 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
15620 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
15621 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
15622 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
15623 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
15624 bitset_count_): Likewise.
15625 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15626 bitset_first, bitset_last): Likewise.
15627 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15628 bitset_stats_list_reverse, bitset_stats_size,
15629 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15630 Likewise.
15631 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15632 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15633 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15634 bitsetv_reflexive_transitive_closure): Likewise.
15635 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15636 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15637 Likewise.
15638 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15639 Likewise.
420f93c8 15640
ff68026d
PE
15641 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15642 Use size_t, not unsigned int, to count bytes.
15643 * lib/abitset.h (abitset_bytes): Likewise.
15644 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15645 Likewise.
15646 * lib/bitset.h (bitset_bytes): Likewise.
15647 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15648 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15649 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15650 * lib/ebitset.c (ebitset_bytes): Likewise.
15651 * lib/ebitset.h (ebitset_bytes): Likewise.
15652 * lib/lbitset.c (lbitset_bytes): Likewise.
15653 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 15654
ff68026d
PE
15655 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15656 abitset_subset_p, abitset_disjoint_p, abitset_and,
15657 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15658 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15659 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15660 abitset_or_and, abitset_or_and_cmp):
15661 Use bitset_windex instead of unsigned int.
15662 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15663 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15664 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15665 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15666 Likewise.
15667 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 15668
ff68026d
PE
15669 * lib/bitset.c (bitset_print):
15670 Use proper printf formats for widths of integer types.
15671 * lib/bitset_stats.c (bitset_percent_histogram_print,
15672 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15673 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15674 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15675 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 15676
ff68026d
PE
15677 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15678 BITSET_SIZE_MAX): New macros.
15679 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15680 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15681 to BITSET_WINDEX_MAX.
15682
15683 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15684 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15685 since we now return the bitset_bindex type (not int).
15686
15687 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15688 when computing sizes.
15689 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15690
15691 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15692 and avoid cast to unsigned.
15693
6aa452a6
AD
156942002-09-30 Akim Demaille <akim@epita.fr>
15695
15696 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15697 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15698 Updates from Michael Hayes.
15699
927f7817
AD
157002002-09-30 Art Haas <ahaas@neosoft.com>
15701
15702 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15703 invocations.
15704 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15705 defined.
15706
9738f41e
AD
157072002-09-27 Akim Demaille <akim@epita.fr>
15708
15709 Version 1.49c.
15710
a5c75d7f
AD
157112002-09-27 Akim Demaille <akim@epita.fr>
15712
15713 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15714 (Because of AC_LIBSOURCE).
15715
8280e179
AD
157162002-09-27 Akim Demaille <akim@epita.fr>
15717
15718 Playing with Autoscan.
15719
15720 * configure.ac: Remove the old LIBOBJ tweaks.
15721 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15722 * lib/strrchr.c: New.
15723 * lib/strtol.c: New, from the Coreutils 4.5.1.
15724
ae64af35
AD
157252002-09-27 Akim Demaille <akim@epita.fr>
15726
15727 Playing with Autoscan.
15728
15729 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15730 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15731 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15732 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15733 Coreutils 4.5.1.
15734
d1a1114f
AD
157352002-09-24 Akim Demaille <akim@epita.fr>
15736
15737 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15738 (Frequently Asked Questions, Parser Stack Overflow): New.
15739
b906441c
AD
157402002-09-13 Akim Demaille <akim@epita.fr>
15741
15742 Playing with autoscan.
15743
15744 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15745 * src/files.c (skeleton_find): Remove, unused.
15746 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15747 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15748
bd701811
AD
157492002-09-13 Akim Demaille <akim@epita.fr>
15750
15751 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15752 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15753
e0a13e7b
AD
157542002-09-13 Akim Demaille <akim@epita.fr>
15755
15756 * configure.ac: Require 2.54.
15757 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15758 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15759 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15760 Remove, provided by Autoconf macros.
15761
c97011bf
AD
157622002-09-12 Akim Demaille <akim@epita.fr>
15763
15764 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15765
d862b1be
AD
157662002-09-12 Akim Demaille <akim@epita.fr>
15767
15768 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15769 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15770 Reported by Martin Mokrejs.
15771
3d38c03a
AD
157722002-09-10 Akim Demaille <akim@epita.fr>
15773
15774 * src/parse-gram.y: Associate a human readable string to each
15775 token type.
15776 * tests/regression.at (Invalid inputs): Adjust.
15777
b6347355
AD
157782002-09-10 Gary V. Vaughan <gary@gnu.org>
15779
15780 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15781 with an Autoconf-2.5x style configure.ac.
15782
09ba4ab2
PE
157832002-09-06 Paul Eggert <eggert@twinsun.com>
15784
15785 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15786 exception applies only to yacc.c. This is a modification of a
15787 patch originally suggested by Akim Demaille.
15788
21846f69
AD
157892002-09-06 Akim Demaille <akim@epita.fr>
15790
09ba4ab2
PE
15791 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15792 here to...
15793 * data/yacc.c: here.
15794
21846f69
AD
15795 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15796 LocationType.
15797 (b4_ltype): Default to yy::Location from location.hh.
15798
c0ad8bf3
AD
157992002-09-04 Jim Meyering <jim@meyering.net>
15800
15801 * data/yacc.c: Guard the declaration of yytoknum also with
15802 `#ifdef YYPRINT', so it is declared only when used.
15803
3a93251e
AD
158042002-09-04 Akim Demaille <akim@epita.fr>
15805
15806 * configure.in: Rename as...
15807 * configure.ac: this.
15808 Bump to 1.49c.
15809
427c0dda
AD
158102002-09-04 Akim Demaille <akim@epita.fr>
15811
15812 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15813 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15814 translate maintainer only messages.
15815
6a254321
PE
158162002-08-12 Paul Eggert <eggert@twinsun.com>
15817
645e30d1
PE
15818 Version 1.49b.
15819
6a254321
PE
15820 * Makefile.am (SUBDIRS): Remove intl.
15821 (DISTCLEANFILES): Remove.
15822 * NEWS: Mention that GNU M4 is now required. Clarify what is
15823 meant by "larger grammars". Mention the pt_BR translation.
15824 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15825 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15826 Bump version from 0.11.2 to 0.11.5.
15827 (BISON_PREREQ_STAGE): Remove.
15828 (AM_GNU_GETTEXT): Use external gettext.
15829 (AC_OUTPUT): Remove intl/Makefile.
15830
15831 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15832
15833 * data/glr.c: Include string.h, for strlen.
15834 (yyreportParseError): Use size_t for yysize.
15835 (yy_yypstack): No longer nested inside yypstates, as nested
15836 functions are not portable. Do not assume size_t is the
15837 same width as int.
15838 (yypstates): Do not assume that ptrdiff_t is the same width
15839 as int, and similarly for yyposn and YYINDEX.
15840
15841 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15842
15843 * lib/Makefile.am (INCLUDES): Do not include from the intl
15844 directory, which has been removed.
15845 * src/Makefile.am (INCLUDES): Likewise.
15846
15847 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15848 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15849 New vars.
15850
15851 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15852 * tests/Makefile.am (EXTRA_DIST): Likewise.
15853
15854 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15855 Do not assume that bitset_windex is the same width as unsigned.
15856
15857 * lib/abitset.c (abitset_unused_clear): Do not assume that
15858 bitset_word is the same width as int.
15859 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15860 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15861 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15862 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15863 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15864
15865 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15866 portability to one's complement hosts!).
15867 * lib/ebitset.c (ebitset_op1): Likewise.
15868 * lib/lbitset.c (lbitset_op1): Likewise.
15869
15870 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15871 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15872 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15873 Sync with fileutils.
15874 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15875 lib/gettext.h: Sync with diffutils.
15876
15877 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15878 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15879
15880 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15881 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15882 check for void *.
15883
15884 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15885 size_t; the old version tried to do this but casted improperly.
15886 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15887 (bitset_test): Now returns int, not unsigned long.
15888
15889 * lib/bitset_stats.c: Include "gettext.h".
15890 (_): New macro.
15891 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15892 name locals "index", as it generates unnecessary warnings on some
15893 hosts that have an "index" function.
15894
15895 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15896 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15897 they need translation.
15898 * src/LR0.c (state_list_append, new_itemsets, get_state,
15899 append_states, generate_states): Likewise.
15900 * src/assoc.c (assoc_to_string): Likewise.
15901 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15902 * src/gram.c (grammar_dump): Likewise.
15903 * src/injections.c (injections_compute): Likewise.
15904 * src/lalr.c (lookaheads_print): Likewise.
15905 * src/relation.c (relation_transpose): Likewise.
15906 * src/scan-gram.l: Likewise.
15907 * src/tables.c (table_grow, pack_vector): Likewise.
15908
15909 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15910 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15911 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15912 * m4/mbstate_t.m4: Sync with fileutils.
15913 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15914
15915 * po/LINGUAS: Add pt_BR.
15916 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15917 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15918 lib/timevar.c.
15919 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15920 manual recommends.
15921 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15922
15923 * src/complain.c (strerror_r): Remove decl; not needed.
15924 (strerror): Use same pattern as ../lib/error.c.
15925
15926 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15927
15928 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15929
15930 * src/main.c (main): Cast result of bindtextdomain and textdomain
15931 to void, to avoid a GCC warning when --disable-nls is in effect.
15932
15933 * src/scan-gram.l: Use strings rather than escapes when possible,
15934 to minimize the number of warnings from xgettext.
15935 (handle_action_dollar, handle_action_at): Don't use isdigit,
15936 as it mishandles negative chars and it may not work as expected
15937 outside the C locale.
15938
15939 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15940 this is a GCC extension and is not portable to other compilers.
15941
15942 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15943 Do not include <ctype.h>; no longer needed.
15944 Do not include <malloc.h>; no longer needed (and generates
15945 warnings on OpenBSD 3.0).
15946
15947 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15948 it's not portable.
15949
15950 * tests/regression.at: Do not use 'cc -c input.c -o input';
15951 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15952
15953 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15954 exit status as failure, not just exit status 1. Sun C exits
15955 with status 2 sometimes.
15956
15957 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15958 Use it for the two large tests.
15959
c8f002c7
AD
159602002-08-02 Akim Demaille <akim@epita.fr>
15961
15962 * src/conflicts.c (conflicts_output): Don't output rules never
15963 reduced here, since anyway that computation doesn't work.
15964 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15965 (rule_useless_p, rule_never_reduced_p): New.
15966 (grammar_rules_partial_print): Use a filter instead of a range.
15967 Display the title only if needed.
15968 (grammar_rules_print): Adjust.
15969 (grammar_rules_never_reduced_report): New.
15970 * src/tables.c (action_row): Move the computation of rules never
15971 reduced to...
15972 (token_actions): here.
15973 * src/main.c (main): Make the parser before making the report, so
15974 that rules never reduced are computed.
15975 Call grammar_rules_never_reduced_report.
15976 * src/print.c (print_results): Report rules never reduced.
15977 * tests/conflicts.at, tests/reduce.at: Adjust.
15978
cd08e51e
AD
159792002-08-01 Akim Demaille <akim@epita.fr>
15980
15981 Instead of attaching lookaheads and duplicating the rules being
15982 reduced by a state, attach the lookaheads to the reductions.
15983
15984 * src/state.h (state_t): Remove the `lookaheads',
15985 `lookaheads_rule' member.
15986 (reductions_t): Add a `lookaheads' member.
15987 Use a regular array for the `rules'.
15988 * src/state.c (reductions_new): Initialize the lookaheads member
15989 to 0.
15990 (state_rule_lookaheads_print): Adjust.
15991 * src/state.h, src/state.c (state_reductions_find): New.
15992 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15993 (count_rr_conflicts): Adjust.
15994 * src/lalr.c (LArule): Remove.
15995 (add_lookback_edge): Adjust.
15996 (state_lookaheads_count): New.
15997 (states_lookaheads_initialize): Merge into...
15998 (initialize_LA): this.
15999 (lalr_free): Adjust.
16000 * src/main.c (main): Don't free nullable and derives too early: it
16001 is used by --verbose.
16002 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16003
bb0027a9
AD
160042002-08-01 Akim Demaille <akim@epita.fr>
16005
16006 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16007 `rule_number_t**'.
16008 (set_derives, free_derives): Rename as...
16009 (derives_compute, derives_free): this.
16010 Adjust all dependencies.
16011 * src/nullable.c (set_nullable, free_nullable): Rename as...
16012 (nullable_compute, nullable_free): these.
16013 (rule_list_t): Store rule_t *, not rule_number_t.
16014 * src/state.c (state_rule_lookaheads_print): Directly compare rule
16015 pointers, instead of their numbers.
16016 * src/main.c (main): Call nullable_free, and derives_free earlier,
16017 as they were lo longer used.
16018
3325ddc4
AD
160192002-08-01 Akim Demaille <akim@epita.fr>
16020
16021 * lib/timevar.c (get_time): Include children time.
16022 * src/lalr.h (LA, LArule): Don't export them: used with the
16023 state_t.
16024 * src/lalr.c (LA, LArule): Static.
16025 * src/lalr.h, src/lalr.c (lalr_free): New.
16026 * src/main.c (main): Call it.
16027 * src/tables.c (pack_vector): Check whether loc is >= to the
16028 table_size, not >.
16029 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
16030 (tables_generate): do it, since that's also it which allocates
16031 them.
16032 Don't free LA and LArule, main does.
16033
c6f1a33c
AD
160342002-07-31 Akim Demaille <akim@epita.fr>
16035
16036 Separate parser tables computation and output.
16037
16038 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
16039 (conflict_list, conflict_list_cnt, table, check, table_ninf)
16040 (yydefgoto, yydefact, high): Move to...
16041 * src/tables.h, src/tables.c: here.
16042 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16043 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16044 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
16045 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
16046 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
16047 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
16048 (action_row, save_row, token_actions, save_column, default_goto)
16049 (goto_actions, sort_actions, matching_state, pack_vector)
16050 (table_ninf_remap, pack_table, prepare_actions): Move to...
16051 * src/tables.c: here.
16052 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
16053 * src/output.c (token_actions, output_base, output_conflicts)
16054 (output_check): Merge into...
16055 (prepare_actions): this.
16056 (actions_output): Rename as...
16057 (user_actions_output): this.
16058 * src/main.c (main): Call tables_generate and tables_free.
16059
1509d42f
AD
160602002-07-31 Akim Demaille <akim@epita.fr>
16061
16062 Steal GCC's --time-report support.
16063
16064 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
16065 stolen/adjusted from GCC.
16066 * m4/stage.m4: Remove time related checks.
16067 * m4/timevar.m4: New.
16068 * configure.in: Adjust.
16069 * src/system.h: Adjust to using timevar.h.
16070 * src/getargs.h, src/getargs.c: Support trace_time for
16071 --trace=time.
16072 * src/main.c (stage): Remove.
16073 (main): Replace `stage' invocations with timevar calls.
16074 * src/output.c: Insert pertinent timevar calls.
16075
273a74fa
AD
160762002-07-31 Akim Demaille <akim@epita.fr>
16077
16078 Let --trace have arguments.
16079
16080 * src/getargs.h (enum trace_e): New.
16081 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
16082 (long_options, short_options): --trace/-T takes an optional
16083 argument.
16084 Change all the uses of trace_flag to reflect the new flags.
16085 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
16086
16087 Strengthen `stage' portability.
16088
16089 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
16090 * configure.in: Use it.
16091 Don't check for malloc.h and sys/times.h.
16092 * src/system.h: Include them when appropriate.
16093 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
16094 times and struct tms are available.
16095
217598da
AD
160962002-07-30 Akim Demaille <akim@epita.fr>
16097
16098 In verbose parse error message, don't report `error' as an
16099 expected token.
16100 * tests/actions.at (Printers and Destructors): Adjust.
16101 * tests/calc.at (Calculator $1): Adjust.
16102 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
16103 error message, do not report the parser accepts the error token in
16104 that state.
16105
52489d44
AD
161062002-07-30 Akim Demaille <akim@epita.fr>
16107
16108 Normalize conflict related messages.
16109
16110 * src/complain.h, src/complain.c (warn, complain): New.
16111 * src/conflicts.c (conflicts_print): Use them.
16112 (conflict_report_yacc): New, extracted from...
16113 (conflicts_print): here.
16114 * tests/conflicts.at, tests/existing.at: Adjust.
16115
e8832397
AD
161162002-07-30 Akim Demaille <akim@epita.fr>
16117
16118 Report rules which are never reduced by the parser: those hidden
16119 by conflicts.
16120
16121 * src/LR0.c (save_reductions): Don't make the final state too
16122 different: save its reduction (accept) instead of having a state
16123 without any action (no shift or goto, no reduce).
16124 Note: the final state is now a ``regular'' state, i.e., the
16125 parsers now contain `reduce 0' as default reduction.
16126 Nevertheless, since they decide to `accept' when yystate =
16127 final_state, they still will not reduce rule 0.
16128 * src/print.c (print_actions, print_reduction): Adjust.
16129 * src/output.c (action_row): Track reduced rules.
16130 (token_actions): Report rules never reduced.
16131 * tests/conflicts.at, tests/regression.at: Adjust.
16132
caf23d24
AD
161332002-07-30 Akim Demaille <akim@epita.fr>
16134
16135 `stage' was accidently included in a previous patch.
16136 Initiate its autoconfiscation.
16137
16138 * configure.in: Look for malloc.h and sys/times.h.
16139 * src/main.c (stage): Adjust.
16140 Report only when trace_flag.
16141
640748ee
AD
161422002-07-29 Akim Demaille <akim@epita.fr>
16143
16144 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
16145 state_number_t.
16146 (errs_t): symbol_t*, not symbol_number_t.
16147 (reductions_t): rule_t*, not rule_number_t.
16148 (FOR_EACH_SHIFT): New.
16149 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
16150 * src/print.c, src/print_graph.c: Adjust.
16151
88bce5a2
AD
161522002-07-29 Akim Demaille <akim@epita.fr>
16153
16154 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
16155
16156 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
16157 (endtoken, accept): these.
16158 * src/reader.c (reader): Set endtoken's default tag to "$end".
16159 Set undeftoken's tag to "$undefined" instead of "$undefined.".
16160 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
16161 Adjust.
16162
1bfb97db
AD
161632002-07-29 Akim Demaille <akim@epita.fr>
16164
16165 * src/reduce.c (reduce_grammar): When the language is empty,
16166 complain about the start symbol, not the axiom.
16167 Use its location.
16168 * tests/reduce.at (Empty Language): New.
16169
fc5734fe
AD
161702002-07-26 Akim Demaille <akim@epita.fr>
16171
16172 * src/reader.h, src/reader.c (gram_error): ... can't get
16173 yycontrol without making too strong assumptions on the parser
16174 itself.
16175 * src/output.c (prepare_tokens): Use the real 0th value of
16176 token_translations instead of `0'.
16177 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
16178 visible here.
16179 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
16180 for the time being: %locations ought to provide it to yyerror.
16181
3650b4b8
AD
161822002-07-25 Akim Demaille <akim@epita.fr>
16183
16184 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
16185 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
16186 * tests/regression.at (Web2c Actions): Adjust.
16187
4b3d3a8e
AD
161882002-07-25 Akim Demaille <akim@epita.fr>
16189
16190 Stop storing rules from 1 to nrules + 1.
16191
16192 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
16193 * src/nullable.c, src/output.c, src/print.c, src/reader.c
16194 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
16195 Iterate from 0 to nrules.
16196 Use rule_number_as_item_number and item_number_as_rule_number.
16197 Adjust to `derive' now containing possibly 0.
16198 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
16199 Handle the `- 1' part in rule numbers from/to item numbers.
16200 * src/conflicts.c (log_resolution): Fix the message which reversed
16201 shift and reduce.
16202 * src/output.c (action_row): Initialize default_rule to -1.
16203 (token_actions): Adjust.
16204 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
16205 expected output.
16206 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16207
4a2a22f4
AD
162082002-07-25 Akim Demaille <akim@epita.fr>
16209
16210 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16211 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16212 (b4_c_knr_arg_decl): New.
16213 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16214 yyreport_parse_error.
16215
b8df3223
AD
162162002-07-25 Akim Demaille <akim@epita.fr>
16217
16218 * data/yacc.c (yyreport_parse_error): New, extracted from...
16219 (yyparse): here.
16220 (yydestruct, yysymprint): Move above yyparse.
16221 Be K&R compliant.
16222
a762e609
AD
162232002-07-25 Akim Demaille <akim@epita.fr>
16224
16225 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16226 replace...
16227 (b4_sint_type, b4_uint_type): these.
16228 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16229 * tests/regression.at (Web2c Actions): Adjust.
16230
12b0043a
AD
162312002-07-25 Akim Demaille <akim@epita.fr>
16232
16233 * src/gram.h (TIEM_NUMBER_MAX): New.
16234 (item_number_of_rule_number, rule_number_of_item_number): Rename
16235 as...
16236 (rule_number_as_item_number, item_number_as_rule_number): these.
16237 Adjust dependencies.
16238 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16239 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16240 (symbol_number_to_vector_number): New.
16241 (order): Of vector_number_t* type.
16242 (base_t, BASE_MAX, BASE_MIN): New.
16243 (froms, tos, width, pos, check): Of base_t type.
16244 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16245 (actrow): Of action_number_t type.
16246 (conflrow): Of unsigned int type.
16247 (table_ninf, base_ninf): New.
16248 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16249 (muscle_insert_int_table, muscle_insert_base_table)
16250 (muscle_insert_rule_number_table): New.
16251 (prepare_tokens): Output `toknum' as int_table.
16252 (action_row): Returns a rule_number_t.
16253 Use ACTION_MIN, not SHRT_MIN.
16254 (token_actions): yydefact is rule_number_t*.
16255 (table_ninf_remap): New.
16256 (pack_table): Use it for `base' and `table'.
16257 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16258 replaced with...
16259 (YYPACT_NINF, YYTABLE_NINF): these.
16260 (yypact, yytable): Compute their types instead of hard-coded
16261 `short'.
16262 * tests/regression.at (Web2c Actions): Adjust.
16263
5dde258a
AD
162642002-07-19 Akim Demaille <akim@epita.fr>
16265
16266 * src/scan-gram.l (id): Can start with an underscore.
16267
a945ec39
AD
162682002-07-16 Akim Demaille <akim@epita.fr>
16269
16270 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16271 Adjust all former `associativity' dependencies.
16272 * src/symtab.c (symbol_new): Default associativity is `undef', not
16273 `right'.
16274 (symbol_check_alias_consistence): Adjust.
16275
fae437e8
AD
162762002-07-09 Akim Demaille <akim@epita.fr>
16277
16278 * doc/bison.texinfo: Properly set the ``header'' part.
16279 Use @dircategory ``GNU programming tools'' as per Texinfo's
16280 documentation.
16281 Use @copying.
16282
1a715ef2
AD
162832002-07-09 Akim Demaille <akim@epita.fr>
16284
16285 * lib/quotearg.h: Protect against multiple inclusions.
16286 * src/location.h (location_t): Add a `file' member.
16287 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16288 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16289 `error_one_per_line' support.
16290
a5d50994
AD
162912002-07-09 Akim Demaille <akim@epita.fr>
16292
16293 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16294 * src/reader.c (lineno): Remove.
16295 Adjust all dependencies.
16296 (get_merge_function): Take a location and use complain_at.
16297 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16298 * tests/regression.at (Invalid inputs, Mixing %token styles):
16299 Adjust.
16300
b275314e
AD
163012002-07-09 Akim Demaille <akim@epita.fr>
16302
16303 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16304 recovery rule, and forbid extensions when --yacc.
16305 (gram_error): Use complain_at.
16306 * src/reader.c (reader): Exit if there were parse errors.
16307
865b9df1
AD
163082002-07-09 Akim Demaille <akim@epita.fr>
16309
16310 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16311 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16312 Reported by R Blake <blakers@mac.com>.
16313
c76e14da
AD
163142002-07-09 Akim Demaille <akim@epita.fr>
16315
16316 * data/yacc.c: Output the copyright notive in the header.
16317
7db2ed2d
AD
163182002-07-03 Akim Demaille <akim@epita.fr>
16319
16320 * src/output.c (froms, tos): Are state_number_t.
16321 (save_column): sp, sp1, and sp2 are state_number_t.
16322 (prepare): Rename `final' as `final_state_number', `nnts' as
16323 `nterms_number', `nrules' as `rules_number', `nstates' as
16324 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16325 unused.
16326 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16327 * data/lalr1.cc (nsym_): Remove, unused.
16328
e68e0410
AD
163292002-07-03 Akim Demaille <akim@epita.fr>
16330
16331 * src/lalr.h, src/lalr.c (goto_number_t): New.
16332 * src/lalr.c (goto_list_t): New.
16333 Propagate them.
16334 * src/nullable.c (rule_list_t): New.
16335 Propagate.
16336 * src/types.h: Remove.
16337
e1a4f3a4
AD
163382002-07-03 Akim Demaille <akim@epita.fr>
16339
16340 * src/closure.c (print_fderives): Use rule_rhs_print.
16341 * src/derives.c (print_derives): Use rule_rhs_print.
16342 (rule_list_t): New, replaces `shorts'.
16343 (set_derives): Add comments.
16344 * tests/sets.at (Nullable, Firsts): Adjust.
16345
536545f3
AD
163462002-07-03 Akim Demaille <akim@epita.fr>
16347
16348 * src/output.c (prepare_actions): Free `tally' and `width'.
16349 (prepare_actions): Allocate and free `order'.
16350 * src/symtab.c (symbols_free): Free `symbols'.
16351 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16352 * src/output.c (m4_invoke): Move to...
16353 * src/scan-skel.l: here.
16354 (<<EOF>>): Close yyout, and free its name.
16355
8b752b00
AD
163562002-07-03 Akim Demaille <akim@epita.fr>
16357
16358 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16359
16360 * src/LR0.c (new_state): Merge into...
16361 (state_list_append): this.
16362 (new_states): Merge into...
16363 (generate_states): here.
16364 (set_states): Don't ensure a proper `errs' state member here, do it...
16365 * src/conflicts.c (conflicts_solve): here.
16366 * src/state.h, src/state.c: Comment changes.
16367 (state_t): Rename member `shifts' as `transitions'.
16368 Adjust all dependencies.
16369 (errs_new): For consistency, also take the values as argument.
16370 (errs_dup): Remove.
16371 (state_errs_set): New.
16372 (state_reductions_set, state_transitions_set): Assert that no
16373 previous value was assigned.
16374 (state_free): New.
16375 (states_free): Use it.
16376 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16377 temporary storage: use `errs' and `nerrs' as elsewhere.
16378 (set_conflicts): Allocate and free this `errs'.
16379
613f5e1a
AD
163802002-07-02 Akim Demaille <akim@epita.fr>
16381
16382 * lib/libiberty.h: New.
16383 * lib: Update the bitset implementation from upstream.
16384 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16385 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16386 * src/main.c: Adjust bitset stats calls.
16387
26e0cadc
PE
163882002-07-01 Paul Eggert <eggert@twinsun.com>
16389
16390 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16391 char, so that negative chars don't collide with $.
16392
1154cced
AD
163932002-06-30 Akim Demaille <akim@epita.fr>
16394
16395 Have the GLR tests be `warning' checked, and fix the warnings.
16396
16397 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16398 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16399 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16400 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16401 (yyaddDeferredAction): static.
16402 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16403 (yyreportParseError): yyprefix is const.
16404 yytokenp is used only when verbose.
16405 (yy__GNUC__): Replace with __GNUC__.
16406 (yypdumpstack): yyi is size_t.
16407 (yypreference): Un-yy local variables and arguments, to avoid
16408 clashes with `yyr1'. Anyway, we are not in the user name space.
16409 (yytname_size): be an int, as is compared with ints.
16410 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16411 Use them.
16412 * tests/cxx-gram.at: Use quotation to protect $1.
16413 Use AT_COMPILE to enable warnings hunts.
16414 Prototype yylex and yyerror.
16415 `Use' argc.
16416 Include `string.h', not `strings.h'.
16417 Produce and prototype stmtMerge only when used.
16418 yylex takes a location.
16419
97650f4e
AD
164202002-06-30 Akim Demaille <akim@epita.fr>
16421
16422 We spend a lot of time in quotearg, in particular when --verbose.
16423
16424 * src/symtab.c (symbol_get): Store a quoted version of the key.
16425 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16426 Adjust all callers.
16427
d2576365
AD
164282002-06-30 Akim Demaille <akim@epita.fr>
16429
16430 * src/state.h (reductions_t): Rename member `nreds' as num.
16431 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16432 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16433
ccaf65bc
AD
164342002-06-30 Akim Demaille <akim@epita.fr>
16435
16436 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16437 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16438 (shifts_to): Rename as...
16439 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16440 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16441 (TRANSITION_IS_DISABLED, transitions_to): these.
16442
87675353
AD
164432002-06-30 Akim Demaille <akim@epita.fr>
16444
16445 * src/print.c (print_shifts, print_gotos): Merge into...
16446 (print_transitions): this.
16447 (print_transitions, print_errs, print_reductions): Align the
16448 lookaheads columns.
16449 (print_core, print_transitions, print_errs, print_state,
16450 print_grammar): Output empty lines separator before, not after.
16451 (state_default_rule_compute): Rename as...
16452 (state_default_rule): this.
16453 * tests/conflicts.at (Defaulted Conflicted Reduction),
16454 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16455 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16456
ce4ccb4b
AD
164572002-06-30 Akim Demaille <akim@epita.fr>
16458
16459 Display items as we display rules.
16460
16461 * src/gram.h, src/gram.c (rule_lhs_print): New.
16462 * src/gram.c (grammar_rules_partial_print): Use it.
16463 * src/print.c (print_core): Likewise.
16464 * tests/conflicts.at (Defaulted Conflicted Reduction),
16465 (Unresolved SR Conflicts): Adjust.
16466 (Unresolved SR Conflicts): Adjust and rename as...
16467 (Resolved SR Conflicts): this, as was meant.
16468 * tests/regression.at (Web2c Report): Adjust.
16469
bc933ef1
AD
164702002-06-30 Akim Demaille <akim@epita.fr>
16471
16472 * src/print.c (state_default_rule_compute): New, extracted from...
16473 (print_reductions): here.
16474 Pessimize, but clarify the code.
16475 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16476
53d4308d
AD
164772002-06-30 Akim Demaille <akim@epita.fr>
16478
16479 * src/output.c (action_row): Let default_rule be always a rule
16480 number.
16481
574fb2d5
AD
164822002-06-30 Akim Demaille <akim@epita.fr>
16483
16484 * src/closure.c (print_firsts, print_fderives, closure):
16485 Use BITSET_EXECUTE.
16486 * src/lalr.c (lookaheads_print): Likewise.
16487 * src/state.c (state_rule_lookaheads_print): Likewise.
16488 * src/print_graph.c (print_core): Likewise.
16489 * src/print.c (print_reductions): Likewise.
16490 * src/output.c (action_row): Likewise.
16491 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16492
05811fd7
AD
164932002-06-30 Akim Demaille <akim@epita.fr>
16494
16495 * src/print_graph.c: Use report_flag.
16496
0e4d5753
AD
164972002-06-30 Akim Demaille <akim@epita.fr>
16498
16499 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16500 to...
16501 * src/relation.h, src/relation.c (traverse, relation_digraph)
16502 (relation_print, relation_transpose): New.
16503
24c7d800
AD
165042002-06-30 Akim Demaille <akim@epita.fr>
16505
16506 * src/state.h, src/state.c (shifts_to): New.
16507 * src/lalr.c (build_relations): Use it.
16508
9222837b
AD
165092002-06-30 Akim Demaille <akim@epita.fr>
16510
16511 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16512 (item_number_of_rule_number, rule_number_of_item_number): New.
16513 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16514 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16515 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16516 Propagate their use.
16517 Much remains to be done, in particular wrt `shorts' from types.h.
16518
260008e5
AD
165192002-06-30 Akim Demaille <akim@epita.fr>
16520
16521 * src/symtab.c (symbol_new): Initialize the `printer' member.
16522
8a731ca8
AD
165232002-06-30 Akim Demaille <akim@epita.fr>
16524
16525 * src/LR0.c (save_reductions): Remove, replaced by...
16526 * src/state.h, src/state.c (state_reductions_set): New.
16527 (reductions, errs): Rename as...
16528 (reductions_t, errs_t): these.
16529 Adjust all dependencies.
16530
32e1e0a4
AD
165312002-06-30 Akim Demaille <akim@epita.fr>
16532
16533 * src/LR0.c (state_list_t, state_list_append): New.
16534 (first_state, last_state): Now symbol_list_t.
16535 (this_state): Remove.
16536 (new_itemsets, append_states, save_reductions): Take a state_t as
16537 argument.
16538 (set_states, generate_states): Adjust.
16539 (save_shifts): Remove, replaced by...
16540 * src/state.h, src/state.c (state_shifts_set): New.
16541 (shifts): Rename as...
16542 (shifts_t): this.
16543 Adjust all dependencies.
16544 * src/state.h (state_t): Remove the `next' member.
16545
e5fb6710
AD
165462002-06-30 Akim Demaille <akim@epita.fr>
16547
16548 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
16549 escaped in slot 0.
16550
c7ca99d4
AD
165512002-06-30 Akim Demaille <akim@epita.fr>
16552
16553 Use hash.h for the state hash table.
16554
16555 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
16556 (allocate_storage): Use state_hash_new.
16557 (free_storage): Use state_hash_free.
16558 (new_state, get_state): Adjust.
16559 * src/lalr.h, src/lalr.c (states): Move to...
16560 * src/states.h (state_t): Remove the `link' member, no longer
16561 used.
16562 * src/states.h, src/states.c: here.
16563 (state_hash_new, state_hash_free, state_hash_lookup)
16564 (state_hash_insert, states_free): New.
16565 * src/states.c (state_table, state_compare, state_hash): New.
16566 * src/output.c (output_actions): Do not free states now, since we
16567 still need to know the final_state number in `prepare', called
16568 afterwards. Do it...
16569 * src/main.c (main): here: call states_free after `output'.
16570
df0e7316
AD
165712002-06-30 Akim Demaille <akim@epita.fr>
16572
16573 * src/state.h, src/state.c (state_new): New, extracted from...
16574 * src/LR0.c (new_state): here.
16575 * src/state.h (STATE_ALLOC): Move to...
16576 * src/state.c: here.
16577 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
16578 * src/state.h, src/state.c: here.
16579
39f41916
AD
165802002-06-30 Akim Demaille <akim@epita.fr>
16581
16582 * src/reader.c (gensym): Rename as...
16583 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
16584 (getsym): Rename as...
16585 (symbol_get): this.
16586
d57650a5
AD
165872002-06-30 Akim Demaille <akim@epita.fr>
16588
16589 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
16590 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
16591 * src/output.c, src/print.c, src/print_graph.c: Propagate.
16592 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
16593
5a08f1ce
AD
165942002-06-30 Akim Demaille <akim@epita.fr>
16595
16596 Make the test suite pass with warnings checked.
16597
16598 * tests/actions.at (Printers and Destructors): Improve.
16599 Avoid unsigned vs. signed issues.
16600 * tests/calc.at: Don't exercise the scanner here, do it...
16601 * tests/input.at (Torturing the Scanner): here.
16602
720623af
PH
166032002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16604
88e7e941 16605 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
16606 reorganize first lines parallel to yacc.c.
16607
fb8135fa
AD
166082002-06-28 Akim Demaille <akim@epita.fr>
16609
16610 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
16611 (b4_token_enum, b4_token_defines): New, factored from...
16612 * data/lalr1.cc, data/yacc.c, glr.c: here.
16613
41442480
AD
166142002-06-28 Akim Demaille <akim@epita.fr>
16615
16616 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
16617 unused variables.
16618 * src/output.c (merger_output): static.
16619
e0e5bf84
AD
166202002-06-28 Akim Demaille <akim@epita.fr>
16621
ba0fe3c7 16622 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
16623 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
16624 pacify GCC.
16625 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 16626
676385e2
PH
166272002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16628
16629 Accumulated changelog for new GLR parsing features.
16630
6a254321 16631 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
16632 conflicts_total_count.
16633 * src/conflicts.h: Ditto.
16634 * src/output.c (token_actions): Use the new name.
16635 (output_conflicts): Change conflp => conflict_list_heads, and
16636 confl => conflict_list for better readability.
16637 * data/glr.c: Use the new names.
16638 * NEWS: Add self to GLR announcement.
e0e5bf84 16639
676385e2
PH
16640 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16641
16642 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16643 Akim Demaille.
16644
16645 * data/bison.glr: Change name to glr.c
16646 * data/glr.c: Renamed from bison.glr.
16647 * data/Makefile.am: Add glr.c
e0e5bf84
AD
16648
16649 * src/getargs.c:
16650
676385e2 16651 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 16652 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 16653
676385e2
PH
16654 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16655
16656 * data/bison.glr: Be sure to restore the
16657 current #line when returning to the skeleton contents after having
16658 exposed the input file's #line.
16659
16660 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16661
16662 * data/bison.glr: Bring up to date with changes to bison.simple.
16663
16664 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16665
16666 * data/bison.glr: Correct definitions that use b4_prefix.
16667 Various reformatting.
16668 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16669 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16670 yytokenp argument; now part of stack.
16671 (yychar): Define to behave as documented.
16672 (yyclearin): Ditto.
e0e5bf84 16673
676385e2
PH
16674 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16675
16676 * src/reader.h: Add declaration for free_merger_functions.
16677
16678 * src/reader.c (merge_functions): New variable.
16679 (get_merge_function): New function.
16680 (free_merger_functions): New function.
16681 (readgram): Check for %prec that is not followed by a symbol.
16682 Handle %dprec and %merge declarations.
16683 (packgram): Initialize dprec and merger fields in rules array.
16684
16685 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16686 conflict_list_cnt, conflict_list_free): New variables.
16687 (table_grow): Also grow conflict_table.
e0e5bf84 16688 (prepare_rules): Output dprec and merger tables.
676385e2 16689 (conflict_row): New function.
e0e5bf84 16690 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
16691 default reduction in conflicted states for GLR parser so that there
16692 are spaces for the conflict lists.
16693 (save_row): Also save conflict information.
16694 (token_actions): Allocate conflict list.
16695 (merger_output): New function.
16696 (pack_vector): Pack conflict table, too.
16697 (output_conflicts): New function to output yyconflp and yyconfl.
16698 (output_check): Allocate conflict_tos.
16699 (output_actions): Output conflict tables, also.
16700 (output_skeleton): Output b4_mergers definition.
16701 (prepare): Output b4_max_rhs_length definition.
16702 Use 'bison.glr' as default skeleton for GLR parsers.
16703
16704 * src/gram.c (glr_parser): New flag.
16705 (grammar_free): Call free_merger_functions.
16706
16707 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16708 all pairs of conflicting reductions, rather than just all tokens
16709 causing conflicts. Needed to size conflict tables.
e0e5bf84 16710 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
16711 interface.
16712 (conflicts_print): Ditto.
16713 (count_total_conflicts): New function.
16714
16715 * src/reader.h (merger_list): New type.
16716 (merge_functions): New variable.
16717
16718 * src/lex.h (tok_dprec, tok_merge): New token types.
16719
16720 * src/gram.h (rule_s): Add dprec and merger fields.
16721 (glr_parser): New flag.
16722
16723 * src/conflicts.h (count_total_conflicts): New function.
16724
16725 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16726
16727 * doc/bison.texinfo (Generalized LR Parsing): New section.
16728 (GLR Parsers): New section.
16729 (Language and Grammar): Mention GLR parsing.
16730 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16731 Correct typo ("tge" -> "the").
16732
16733 * data/bison.glr: New skeleton for GLR parsing.
16734
16735 * tests/cxx-gram.at: New tests for GLR parsing.
16736
16737 * tests/testsuite.at: Include cxx-gram.at.
16738
16739 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 16740
676385e2
PH
16741 * src/parse-gram.y:
16742
16743 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16744
16745 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 16746
b5480d74 167472002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
16748
16749 * src/options.h, src/options.c: Remove.
16750 * src/getargs.c (short_options, long_options): New.
16751
60491a94
AD
167522002-06-27 Akim Demaille <akim@epita.fr>
16753
16754 * data/bison.simple, data/bison.c++: Rename as...
16755 * data/yacc.c, data/lalr1.cc: these.
16756 * doc/bison.texinfo (Environment Variables): Remove.
16757
9be0c25b
AD
167582002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16759
16760 * src/getargs.c (report_argmatch): Initialize strtok().
16761
1ae72863
AD
167622002-06-20 Akim Demaille <akim@epita.fr>
16763
16764 * data/bison.simple (b4_symbol_actions): New, replaces...
16765 (b4_symbol_destructor, b4_symbol_printer): these.
16766 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16767 user token numbers.
16768
87542d29
AD
167692002-06-20 Akim Demaille <akim@epita.fr>
16770
16771 * data/bison.simple (yydestructor): Rename as...
16772 (yydestruct): this.
16773
1a31ed21
AD
167742002-06-20 Akim Demaille <akim@epita.fr>
16775
16776 * src/symtab.h, src/symtab.c (symbol_type_set)
16777 (symbol_destructor_set, symbol_precedence_set): The location is
16778 the last argument.
16779 Adjust all callers.
16780
e776192e
AD
167812002-06-20 Akim Demaille <akim@epita.fr>
16782
16783 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16784 internals.
16785 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16786 Takes a location.
16787 * src/symtab.h, src/symtab.c (symbol_class_set)
16788 (symbol_user_token_number_set): Likewise.
16789 Adjust all callers.
16790 Promote complain_at.
16791 * tests/input.at (Type Clashes): Adjust.
16792
5c1180b3
AD
167932002-06-20 Akim Demaille <akim@epita.fr>
16794
16795 * data/bison.simple (YYLEX): Fix the declaration when
16796 %pure-parser.
16797
e3170060
AD
167982002-06-20 Akim Demaille <akim@epita.fr>
16799
16800 * data/bison.simple (yysymprint): Don't print the token number,
16801 just its name.
16802 * tests/actions.at (Destructors): Rename as...
16803 (Printers and Destructors): this.
16804 Also exercise %printer.
16805
253862fd
AD
168062002-06-20 Akim Demaille <akim@epita.fr>
16807
16808 * data/bison.simple (YYDSYMPRINT): New.
16809 Use it to remove many of the #if YYDEBUG/if (yydebug).
16810
366eea36
AD
168112002-06-20 Akim Demaille <akim@epita.fr>
16812
16813 * src/symtab.h, src/symtab.c (symbol_t): printer and
16814 printer_location are new members.
16815 (symbol_printer_set): New.
16816 * src/parse-gram.y (PERCENT_PRINTER): New token.
16817 Handle its associated rule.
16818 * src/scan-gram.l: Adjust.
16819 (handle_destructor_at, handle_destructor_dollar): Rename as...
16820 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16821 * src/output.c (symbol_printers_output): New.
16822 (output_skeleton): Call it.
16823 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16824 since there are already many grammar files with a user `yyprint'.
16825 Replace the calls to YYPRINT to calls to yysymprint.
16826 * tests/calc.at: Adjust.
16827 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16828 taking advantage of parser very internal details (stack size!).
16829
4f25ebb0
AD
168302002-06-20 Akim Demaille <akim@epita.fr>
16831
16832 * src/scan-gram.l: Complete the scanner with the missing patterns
16833 to pacify Flex.
16834 Use `quote' and `symbol_tag_get' where appropriate.
16835
93b68a0e
AD
168362002-06-19 Akim Demaille <akim@epita.fr>
16837
16838 * tests/actions.at (Destructors): Augment to test locations.
16839 * data/bison.simple (yydestructor): Pass it the current location
16840 if locations are enabled.
16841 Prototype only when __STDC__ or C++.
16842 Change the argument names to move into the yy name space: there is
16843 user code here.
16844
58612f1d
AD
168452002-06-19 Akim Demaille <akim@epita.fr>
16846
74310291
AD
16847 * data/bison.simple (b4_pure_if): New.
16848 Use it instead of #ifdef YYPURE.
16849
168502002-06-19 Akim Demaille <akim@epita.fr>
16851
16852 * data/bison.simple (b4_location_if): New.
58612f1d
AD
16853 Use it instead of #ifdef YYLSP_NEEDED.
16854
f25bfb75
AD
168552002-06-19 Akim Demaille <akim@epita.fr>
16856
16857 Prepare @$ in %destructor, but currently don't bind it in the
16858 skeleton, as %location use is not cleaned up yet.
16859
16860 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16861 (handle_action_at): New.
16862 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16863 a braced_code_t and a location as additional arguments.
16864 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16865 unquote one when outputting `b4_dollar_dollar'.
16866 Adjust callers.
16867 * data/bison.simple (b4_eval): Remove.
16868 (b4_symbol_destructor): Adjust.
16869 * tests/input.at (Invalid @n): Adjust.
16870
c732d2c6
AD
168712002-06-19 Zack Weinberg <zack@codesourcery.com>
16872
16873 * doc/bison.texinfo: Document ability to have multiple
16874 prologue sections.
16875
8c165d89
AD
168762002-06-18 Akim Demaille <akim@epita.fr>
16877
16878 * src/files.c (compute_base_names): When computing the output file
16879 names from the input file name, strip the directory part.
16880
ca98bf57
AD
168812002-06-18 Akim Demaille <akim@epita.fr>
16882
16883 * data/bison.simple.new: Comment changes.
16884 Reported by Andreas Schwab.
16885
0bfb02ff
AD
168862002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16887
16888 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16889 there are no `label `yyoverflowlab' defined but not used' warnings
16890 when yyoverflow is defined.
16891
24c0aad7
AD
168922002-06-18 Akim Demaille <akim@epita.fr>
16893
16894 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16895 new member.
16896 (symbol_destructor_set): Adjust.
16897 * src/output.c (symbol_destructors_output): Output the destructor
16898 locations.
16899 Output the symbol name.
16900 * data/bison.simple (b4_symbol_destructor): Adjust.
16901
5719c109
AD
169022002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16903 and Akim Demaille <akim@epita.fr>
16904
16905 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16906 what's left on the stack when the error recovery hits EOF.
16907 * tests/actions.at (Destructors): Complete to exercise this case.
16908
9280d3ef
AD
169092002-06-17 Akim Demaille <akim@epita.fr>
16910
16911 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16912 arguments is really empty, not only equal to `[]'.
16913 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16914 member.
16915 (symbol_destructor_set): New.
16916 * src/output.c (symbol_destructors_output): New.
16917 * src/reader.h (brace_code_t, current_braced_code): New.
16918 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16919 (handle_dollar): Rename as...
16920 (handle_action_dollar): this.
16921 (handle_destructor_dollar): New.
16922 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16923 (grammar_declaration): Use it.
16924 * data/bison.simple (yystos): Is always defined.
16925 (yydestructor): New.
16926 * tests/actions.at (Destructors): New.
16927 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16928
dafdc66f
AD
169292002-06-17 Akim Demaille <akim@epita.fr>
16930
16931 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16932 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16933 rule_length only when needed.
16934 * src/output.c (actions_output, token_definitions_output): Output
16935 the full M4 block.
16936 * src/symtab.c: Don't access directly to the symbol tag, use
16937 symbol_tag_get.
16938 * src/parse-gram.y: Use symbol_list_free.
16939
56c47203
AD
169402002-06-17 Akim Demaille <akim@epita.fr>
16941
16942 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16943 (symbol_list_prepend, get_type_name): Move to...
16944 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16945 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16946 Adjust all callers.
16947 (symbol_list_free): New.
16948 * src/scan-gram.l (handle_dollar): Takes a location.
16949 * tests/input.at (Invalid $n): Adjust.
16950
1e0bab92
AD
169512002-06-17 Akim Demaille <akim@epita.fr>
16952
16953 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16954 (symbol_list_prepend): New.
16955 * src/parse-gram.y (%union): `list' is a new member.
16956 (symbols.1): New, replaces...
16957 (terms_to_prec.1, nterms_to_type.1): these.
16958 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16959 Take a location as additional argument.
16960 Adjust all callers.
16961
04e60654
AD
169622002-06-15 Akim Demaille <akim@epita.fr>
16963
16964 * src/parse-gram.y: Move %token in the declaration section so that
16965 we don't depend upon CVS Bison.
16966
10e5b8bd
AD
169672002-06-15 Akim Demaille <akim@epita.fr>
16968
16969 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16970 * src/print.c (print_core): Use it.
16971
9801d40c
AD
169722002-06-15 Akim Demaille <akim@epita.fr>
16973
16974 * src/conflicts.c (log_resolution): Accept the rule involved in
16975 the sr conflicts instead of the lookahead number that points to
16976 that rule.
16977 (flush_reduce): Accept the current lookahead vector as argument,
16978 instead of the index in LA.
16979 (resolve_sr_conflict): Accept the current number of lookahead
16980 bitset to consider for the STATE, instead of the index in LA.
16981 (set_conflicts): Adjust.
16982 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16983
c0263492
AD
169842002-06-15 Akim Demaille <akim@epita.fr>
16985
16986 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16987 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16988 Adjust all dependencies.
16989 * src/lalr.c (initialize_lookaheads): Split into...
16990 (states_lookaheads_count, states_lookaheads_initialize): these.
16991 (lalr): Adjust.
16992
9757c359
AD
169932002-06-15 Akim Demaille <akim@epita.fr>
16994
16995 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16996 out of...
16997 (grammar_rules_print): here.
16998 * src/reduce.c (reduce_output): Use it.
16999 * tests/reduce.at (Useless Rules, Reduced Automaton)
17000 (Underivable Rules): Adjust.
17001
6b98e4b5
AD
170022002-06-15 Akim Demaille <akim@epita.fr>
17003
17004 Copy BYacc's nice way to report the grammar.
17005
17006 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17007 New.
17008 Don't print the rules' location, it is confusing and useless.
17009 (rule_print): Use grammar_rhs_print.
17010 * src/print.c (print_grammar): Use grammar_rules_print.
17011
6b98e4b5
AD
170122002-06-15 Akim Demaille <akim@epita.fr>
17013
17014 Complete and rationalize `useless thing' warnings.
17015
17016 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
17017 (symbol_tag_print): New.
17018 Use them everywhere in place of accessing directly the tag member.
17019 * src/gram.h, src/gram.c (rule_print): New.
17020 Use it where a rule used to be printed `by hand'.
17021 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
17022 (reduce_grammar_tables): Report the useless rules.
17023 (reduce_print): Useless things are a warning, not an error.
17024 Report it as such.
17025 * tests/reduce.at (Useless Nonterminals, Useless Rules):
17026 (Reduced Automaton, Underivable Rules): Adjust.
17027 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
17028 * tests/conflicts.at (Unresolved SR Conflicts)
17029 (Solved SR Conflicts): Adjust.
17030
ee000ba4
AD
170312002-06-15 Akim Demaille <akim@epita.fr>
17032
17033 Let symbols have a location.
17034
17035 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
17036 (getsym): Adjust.
17037 Adjust all callers.
17038 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
17039 Use location_t, not int.
17040 * src/symtab.c (symbol_check_defined): Take advantage of the
17041 location.
17042 * tests/regression.at (Invalid inputs): Adjust.
17043
8efe435c
AD
170442002-06-15 Akim Demaille <akim@epita.fr>
17045
17046 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
17047 (input): Don't try to initialize yylloc here, do it in the
17048 scanner.
17049 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
17050 * src/gram.h (rule_t): Change line and action_line into location
17051 and action_location, of location_t type.
17052 Adjust all dependencies.
17053 * src/location.h, src/location.c (empty_location): New.
17054 * src/reader.h, src/reader.c (grammar_start_symbol_set)
17055 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
17056 (grammar_current_rule_symbol_append)
17057 (grammar_current_rule_action_append): Expect a location as argument.
17058 * src/reader.c (grammar_midrule_action): Adjust to attach an
17059 action's location as dummy symbol location.
17060 * src/symtab.h, src/symtab.c (startsymbol_location): New.
17061 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
17062 the line numbers.
17063
1921f1d7
AD
170642002-06-14 Akim Demaille <akim@epita.fr>
17065
17066 Grammar declarations may be found in the grammar section.
17067
17068 * src/parse-gram.y (rules_or_grammar_declaration): New.
17069 (declarations): Each declaration may end with a semicolon, not
17070 just...
17071 (grammar_declaration): `"%union"'.
17072 (grammar): Branch to rules_or_grammar_declaration.
17073
4515534c
AD
170742002-06-14 Akim Demaille <akim@epita.fr>
17075
17076 * src/main.c (main): Invoke scanner_free.
17077
f958596b
AD
170782002-06-14 Akim Demaille <akim@epita.fr>
17079
17080 * src/output.c (m4_invoke): Extracted from...
17081 (output_skeleton): here.
17082 Free tempfile.
17083
2c569025
AD
170842002-06-14 Akim Demaille <akim@epita.fr>
17085
17086 * src/parse-gram.y (directives, directive, gram)
17087 (grammar_directives, precedence_directives, precedence_directive):
17088 Rename as...
17089 (declarations, declaration, grammar, grammar_declaration)
17090 (precedence_declaration, precedence_declarator): these.
17091 (symbol_declaration): New.
17092
592e8d4d
AD
170932002-06-14 Akim Demaille <akim@epita.fr>
17094
17095 * src/files.c (action_obstack): Remove, unused.
17096 (output_obstack): Remove it, and all its dependencies, as it is no
17097 longer needed.
17098 * src/reader.c (epilogue_set): Build the epilogue in the
17099 muscle_obstack.
17100 * src/output.h, src/output.c (muscle_obstack): Move to...
17101 * src/muscle_tab.h, src/muscle_tab.h: here.
17102 (muscle_init): Initialize muscle_obstack.
17103 (muscle_free): New.
17104 * src/main.c (main): Call it.
17105
0c15323d
AD
171062002-06-14 Akim Demaille <akim@epita.fr>
17107
17108 * src/location.h: New, extracted from...
17109 * src/reader.h: here.
17110 * src/Makefile.am (noinst_HEADERS): Merge into
17111 (bison_SOURCES): this.
17112 Add location.h.
17113 * src/parse-gram.y: Use location_t instead of Bison's.
17114 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
17115 Use location_t instead of ints.
17116
e96c9728
AD
171172002-06-14 Akim Demaille <akim@epita.fr>
17118
17119 * data/bison.simple, data/bison.c++: Be sure to restore the
17120 current #line when returning to the skeleton contents after having
17121 exposed the input file's #line.
17122
75d1fe16
AD
171232002-06-12 Akim Demaille <akim@epita.fr>
17124
17125 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
17126 eager.
17127 * tests/actions.at (Exotic Dollars): New.
17128
6c35d22c
AD
171292002-06-12 Akim Demaille <akim@epita.fr>
17130
17131 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
17132 ['"/] too eagerly.
17133 * tests/input.at (Torturing the Scanner): New.
17134
1d6412ad
AD
171352002-06-11 Akim Demaille <akim@epita.fr>
17136
17137 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
17138 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
17139 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
17140 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
17141 * src/reader.c (reader): Use it.
17142
4cdb01db
AD
171432002-06-11 Akim Demaille <akim@epita.fr>
17144
17145 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
17146 Adjust all callers.
17147 (scanner_last_string_free): New.
17148
44995b2e
AD
171492002-06-11 Akim Demaille <akim@epita.fr>
17150
17151 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
17152 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
17153 (last_string, YY_OBS_FREE): New.
17154 Use them when returning an ID.
17155
e9955c83
AD
171562002-06-11 Akim Demaille <akim@epita.fr>
17157
17158 Have Bison grammars parsed by a Bison grammar.
17159
17160 * src/reader.c, src/reader.h (prologue_augment): New.
17161 * src/reader.c (copy_definition): Remove.
17162
17163 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
17164 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
17165 (grammar_current_rule_prec_set, grammar_current_rule_check)
17166 (grammar_current_rule_symbol_append)
17167 (grammar_current_rule_action_append): Export.
17168 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
17169 (symbol_list_action_append): Remove.
17170 Hook the routines from reader.
17171 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
17172 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
17173
17174 * src/reader.c (read_declarations): Remove, unused.
17175
17176 * src/parse-gram.y: Handle the epilogue.
17177 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
17178 (grammar_start_symbol_set): this.
17179 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
17180 * src/reader.c (readgram): Remove, unused.
17181 (reader): Adjust to insert eoftoken and axiom where appropriate.
17182
17183 * src/reader.c (copy_dollar): Replace with...
17184 * src/scan-gram.h (handle_dollar): this.
17185 * src/parse-gram.y: Remove `%thong'.
17186
17187 * src/reader.c (copy_at): Replace with...
17188 * src/scan-gram.h (handle_at): this.
17189
17190 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
17191 New.
17192
17193 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
17194 time being.
17195
17196 * src/reader.h, src/reader.c (grammar_rule_end): New.
17197
17198 * src/parse.y (current_type, current_class): New.
17199 Implement `%nterm', `%token' support.
17200 Merge `%term' into `%token'.
17201 (string_as_id): New.
17202 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
17203 type name.
17204
17205 * src/parse-gram.y: Be sure to handle properly the beginning of
17206 rules.
17207
17208 * src/parse-gram.y: Handle %type.
17209 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17210
17211 * src/parse-gram.y: More directives support.
17212 * src/options.c: No longer handle source directives.
17213
17214 * src/parse-gram.y: Fix %output.
17215
17216 * src/parse-gram.y: Handle %union.
17217 Use the prologue locations.
17218 * src/reader.c (parse_union_decl): Remove.
17219
17220 * src/reader.h, src/reader.c (epilogue_set): New.
17221 * src/parse-gram.y: Use it.
17222
17223 * data/bison.simple, data/bison.c++: b4_stype is now either not
17224 defined, then default to int, or to the contents of %union,
17225 without `union' itself.
17226 Adjust.
17227 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17228
17229 * src/output.c (actions_output): Don't output braces, as they are
17230 already handled by the scanner.
17231
17232 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17233 characters to themselves.
17234
17235 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17236 that the epilogue has a proper #line.
17237
17238 * src/parse-gram.y: Handle precedence/associativity.
17239
17240 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17241 a terminal.
17242 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17243 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17244 at all to define terminals that cannot be emitted.
17245
17246 * src/scan-gram.l: Escape M4 characters.
17247
17248 * src/scan-gram.l: Working properly with escapes in user
17249 strings/characters.
17250
17251 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17252 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17253 grammar.
17254 Use more modest sizes, as for the time being the parser does not
17255 release memory, and therefore the process swallows a huge amount
17256 of memory.
17257
17258 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17259 stricter %token grammar.
17260
17261 * src/symtab.h (associativity): Add `undef_assoc'.
17262 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17263 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17264
17265 * tests/regression.at (Invalid %directive): Remove, as it is now
17266 meaningless.
17267 (Invalid inputs): Adjust to the new error messages.
17268 (Token definitions): The new grammar doesn't allow too many
17269 eccentricities.
17270
17271 * src/lex.h, src/lex.c: Remove.
17272 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17273 (copy_character, copy_string2, copy_string, copy_identifier)
17274 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17275 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17276 (parse_action): Remove.
17277 * po/POTFILES.in: Adjust.
17278
2e047461
AD
172792002-06-11 Akim Demaille <akim@epita.fr>
17280
cd05d13c 17281 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
17282 rule's action member: return the action as a string.
17283 Don't require `rule_length' as an argument: compute it.
17284 (grammar_current_rule_symbol_append)
17285 (grammar_current_rule_action_append): New, eved out from
17286 (readgram): here.
17287 Remove `action_flag', `rulelength', unused now.
17288
9af3fbce
AD
172892002-06-11 Akim Demaille <akim@epita.fr>
17290
17291 * src/reader.c (grammar_current_rule_prec_set).
17292 (grammar_current_rule_check): New, eved out from...
17293 (readgram): here.
17294 Remove `xaction', `first_rhs': useless.
17295 * tests/input.at (Type clashes): New.
17296 * tests/existing.at (GNU Cim Grammar): Adjust.
17297
1485e106
AD
172982002-06-11 Akim Demaille <akim@epita.fr>
17299
17300 * src/reader.c (grammar_midrule_action): New, Eved out from
17301 (readgram): here.
17302
da4160c3
AD
173032002-06-11 Akim Demaille <akim@epita.fr>
17304
17305 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17306 New.
17307 (readgram): Use them as replacement of inlined code, crule and
17308 crule1.
17309
f6d0f937
AD
173102002-06-11 Akim Demaille <akim@epita.fr>
17311
17312 * src/reader.c (grammar_end, grammar_symbol_append): New.
17313 (readgram): Use them.
17314 Make the use of `p' as local as possible.
17315
69078d4b
AD
173162002-06-10 Akim Demaille <akim@epita.fr>
17317
17318 GCJ's parser requires the tokens to be defined before the prologue.
17319
17320 * data/bison.simple: Output the token definition before the user's
17321 prologue.
17322 * tests/regression.at (Braces parsing, Duplicate string)
17323 (Mixing %token styles): Check the output from bison.
17324 (Early token definitions): New.
17325
5e424082
AD
173262002-06-10 Akim Demaille <akim@epita.fr>
17327
17328 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17329 assigning twice the same user number to a token, so that we can
17330 use it in...
17331 * src/lex.c (lex): here.
17332 Also use `symbol_class_set' instead of hand written code.
17333 * src/reader.c (parse_assoc_decl): Likewise.
17334
44536b35
AD
173352002-06-10 Akim Demaille <akim@epita.fr>
17336
17337 * src/symtab.c, src/symtab.c (symbol_class_set)
17338 (symbol_user_token_number_set): New.
17339 * src/reader.c (parse_token_decl): Use them.
17340 Use a switch instead of ifs.
17341 Use a single argument.
17342
8b9f2372
AD
173432002-06-10 Akim Demaille <akim@epita.fr>
17344
17345 Remove `%thong' support as it is undocumented, unused, duplicates
17346 `%token's job, and creates useless e-mail traffic with people who
17347 want to know what it is, why it is undocumented, unused, and
17348 duplicates `%token's job.
17349
17350 * src/reader.c (parse_thong_decl): Remove.
17351 * src/options.c (option_table): Remove "thong".
17352 * src/lex.h (tok_thong): Remove.
17353
3ae2b51f
AD
173542002-06-10 Akim Demaille <akim@epita.fr>
17355
17356 * src/symtab.c, src/symtab.c (symbol_type_set)
17357 (symbol_precedence_set): New.
17358 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17359 (value_components_used): Remove, unused.
17360
2f1afb73
AD
173612002-06-09 Akim Demaille <akim@epita.fr>
17362
17363 Move symbols handling code out of the reader.
17364
17365 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17366 (axiom): Move to...
17367 * src/symtab.h, src/symtab.c: here.
17368
17369 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17370 * src/reader.c (startval): Rename as...
17371 * src/symtab.h, src/symtab.c (startsymbol): this.
17372 * src/reader.c: Adjust.
17373
17374 * src/reader.c (symbol_check_defined, symbol_make_alias)
17375 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17376 (token_translations_init)
17377 Move to...
17378 * src/symtab.c: here.
17379 * src/reader.c (packsymbols): Move to...
17380 * src/symtab.h, src/symtab.c (symbols_pack): here.
17381 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17382 argument.
17383
e9bca3ad
AD
173842002-06-03 Akim Demaille <akim@epita.fr>
17385
17386 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17387 then statements.
17388
86eff183
AD
173892002-06-03 Akim Demaille <akim@epita.fr>
17390
17391 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17392 structs with non literals.
17393 * src/scan-skel.l: never-interactive.
17394 * src/conflicts.c (enum conflict_resolution_e): No trailing
17395 comma.
17396 * src/getargs.c (usage): Split long literal strings.
17397 Reported by Hans Aberg.
17398
717be197
AD
173992002-05-28 Akim Demaille <akim@epita.fr>
17400
17401 * data/bison.c++: Use C++ ostreams.
17402 (cdebug_): New member.
17403
670ddffd
AD
174042002-05-28 Akim Demaille <akim@epita.fr>
17405
17406 * src/output.c (output_skeleton): Be sure to allocate enough room
17407 for `/' _and_ for `\0' in full_skeleton.
17408
769b430f
AD
174092002-05-28 Akim Demaille <akim@epita.fr>
17410
17411 * data/bison.c++: Catch up with bison.simple:
17412 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17413 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17414 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17415 and popping traces.
17416
7067cb36
PH
174172002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17418
17419 * src/output.c (output_skeleton): Put an explicit path in front of
17420 the skeleton file name, rather than relying on the -I directory,
17421 to partially alleviate effects of having a skeleton file lying around
17422 in the current directory.
769b430f 17423
4a713ec2
PH
174242002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17425
769b430f 17426 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
17427 obstack_printf should be obstack_fgrow1.
17428
b408954b
AD
174292002-05-26 Akim Demaille <akim@epita.fr>
17430
17431 * src/state.h (state_t): `solved_conflicts' is a new member.
17432 * src/LR0.c (new_state): Set it to 0.
17433 * src/conflicts.h, src/conflicts.c (print_conflicts)
17434 (free_conflicts, solve_conflicts): Rename as...
17435 (conflicts_print, conflicts_free, conflicts_solve): these.
17436 Adjust callers.
17437 * src/conflicts.c (enum conflict_resolution_e)
17438 (solved_conflicts_obstack): New, used by...
17439 (log_resolution): this.
17440 Adjust to attach the conflict resolution to each state.
17441 Complete the description with the precedence/associativity
17442 information.
17443 (resolve_sr_conflict): Adjust.
17444 * src/print.c (print_state): Output its solved_conflicts.
17445 * tests/conflicts.at (Unresolved SR Conflicts)
17446 (Solved SR Conflicts): Exercise --report=all.
17447
a49aecd5
AD
174482002-05-26 Akim Demaille <akim@epita.fr>
17449
17450 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17451 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17452 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17453 (token_number_t, item_number_as_token_number)
17454 (token_number_as_item_number, muscle_insert_token_number_table):
17455 Rename as...
17456 (symbol_number_t, item_number_as_symbol_number)
17457 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17458 these, since it is more appropriate.
17459
5504898e
AD
174602002-05-26 Akim Demaille <akim@epita.fr>
17461
17462 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17463 `Error:' lines.
17464 * data/bison.simple (yystos) [YYDEBUG]: New.
17465 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17466 error recovery.
17467 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17468
ec3bc396
AD
174692002-05-25 Akim Demaille <akim@epita.fr>
17470
17471 * doc/bison.texinfo (Debugging): Split into...
17472 (Tracing): this new section, its former contents, and...
17473 (Understanding): this new section.
17474 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17475 by...
17476 (report_flag): this.
17477 Adjust all dependencies.
17478 (report_args, report_types, report_argmatch): New.
17479 (usage, getargs): Report/support -r, --report.
17480 * src/options.h
17481 (struct option_table_struct): Rename as..,
17482 (struct option_table_s): this.
17483 Rename the `set_flag' member to `flag' to match with getopt_long's
17484 struct.
17485 * src/options.c (option_table): Split verbose into an entry for
17486 %verbose, and another for --verbose.
17487 Support --report/-r, so remove -r from the obsolete --raw.
17488 * src/print.c: Attach full item sets and lookaheads reports to
17489 report_flag instead of trace_flag.
17490 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17491
78df8250
PE
174922002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17493 and Paul Eggert <eggert@twinsun.com>
769b430f 17494
78df8250
PE
17495 * data/bison.simple (yyparse): Correct error handling to conform to
17496 POSIX and yacc. Specifically, after syntax error is discovered,
17497 do not reduce further before shifting the error token.
17498 Clean up the code a bit by removing the labels yyerrdefault,
17499 yyerrhandle, yyerrpop.
17500 * NEWS: Document the above.
17501
c0c9ea05
PH
175022002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17503
17504 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17505 type; it isn't always big enough, since it doesn't necessarily
17506 include non-terminals.
769b430f 17507 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
17508 the latter can be removed.
17509 (yy_token_number_type): Remove, only one use.
17510 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17511 don't use TokenNumberType as element type.
769b430f 17512
c0c9ea05
PH
17513 * tests/regression.at: Modify expected output to agree with change
17514 to yyr1 and yytranslate.
769b430f 17515
6390a83f
FK
175162002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17517
17518 * src/reader.c (parse_action): Use copy_character instead of
17519 obstack_1grow.
17520
db7c8e9a
AD
175212002-05-13 Akim Demaille <akim@epita.fr>
17522
17523 * tests/regression.at (Token definitions): Prototype yylex and
17524 yyerror.
17525
fcc61800
PH
175262002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17527
158c687b 17528 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
17529 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
17530 32-bit arithmetic.
17531 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
17532
5683e9b2
AD
175332002-05-07 Akim Demaille <akim@epita.fr>
17534
17535 * tests/synclines.at: Be sure to prototype yylex and yyerror to
17536 avoid GCC warnings.
17537
0c2d3f4c
AD
175382002-05-07 Akim Demaille <akim@epita.fr>
17539
17540 Kill GCC warnings.
17541
17542 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
17543 over the RHS of each rule.
17544 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
17545 * src/state.h (state_t): Member `nitems' is unsigned short.
17546 * src/LR0.c (get_state): Adjust.
17547 * src/reader.c (packgram): Likewise.
17548 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
17549 `Type'.
17550 (muscle_insert_int_table): Remove, unused.
17551 (prepare_rules): Remove `max'.
17552
1565b720
AD
175532002-05-06 Akim Demaille <akim@epita.fr>
17554
17555 * src/closure.c (print_firsts): Display of the symbol tags.
17556 (bitmatrix_print): Move to...
17557 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
17558 here.
17559 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
17560
cfaee611
AD
175612002-05-06 Akim Demaille <akim@epita.fr>
17562
17563 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
17564 hash_do_for_each.
17565
458be8e0
AD
175662002-05-06 Akim Demaille <akim@epita.fr>
17567
17568 * src/LR0.c (new_state, get_state): Instead of using the global
17569 `kernel_size' and `kernel_base', have two new arguments:
17570 `core_size' and `core'.
17571 Adjust callers.
17572
a900a624
AD
175732002-05-06 Akim Demaille <akim@epita.fr>
17574
17575 * src/reader.c (packgram): No longer end `ritem' with a 0
17576 sentinel: it is not used.
17577
d4e7d3a1
AD
175782002-05-05 Akim Demaille <akim@epita.fr>
17579
17580 New experimental feature: display the lookaheads in the report and
17581 graph.
17582
17583 * src/print (print_core): When --trace-flag, display the rules
17584 lookaheads.
17585 * src/print_graph.c (print_core): Likewise.
17586 Swap the arguments.
17587 Adjust caller.
17588
39ceb25b
AD
175892002-05-05 Akim Demaille <akim@epita.fr>
17590
17591 * tests/torture.at (Many lookaheads): New test.
17592
5372019f
AD
175932002-05-05 Akim Demaille <akim@epita.fr>
17594
17595 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
17596 (GENERATE_MUSCLE_INSERT_TABLE): this.
17597 (output_int_table, output_unsigned_int_table, output_short_table)
17598 (output_token_number_table, output_item_number_table): Replace with...
17599 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
17600 (muscle_insert_short_table, muscle_insert_token_number_table)
17601 (muscle_insert_item_number_table): these.
17602 Adjust all callers.
17603 (prepare_tokens): Don't free `translations', since...
17604 * src/reader.h, src/reader.c (grammar_free): do it.
17605 Move to...
17606 * src/gram.h, src/gram.c (grammar_free): here.
17607 * data/bison.simple, data/bison.c++: b4_token_number_max is now
17608 b4_translate_max.
17609
5df5f6d5
AD
176102002-05-05 Akim Demaille <akim@epita.fr>
17611
17612 * src/output.c (output_unsigned_int_table): New.
17613 (prepare_rules): `i' is unsigned.
17614 `prhs', `rline', `r2' are unsigned int.
17615 Rename muscle `rhs_number_max' as `rhs_max'.
17616 Output muscles `prhs_max', `rline_max', and `r2_max'.
17617 Free rline and r1.
17618 * data/bison.simple, data/bison.c++: Adjust to use these muscles
17619 to compute types instead of constant types.
17620 * tests/regression.at (Web2c Actions): Adjust.
17621
b87f8b21
AD
176222002-05-04 Akim Demaille <akim@epita.fr>
17623
17624 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17625 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17626 Adjust dependencies.
17627 * src/output.c (token_definitions_output): Be sure not to output a
17628 `#define 'a'' when fed with `%token 'a' "a"'.
17629 * tests/regression.at (Token definitions): New.
17630
8bb936e4
PE
176312002-05-03 Paul Eggert <eggert@twinsun.com>
17632
17633 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17634 for K&R C.
17635
176362002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17637
17638 * Makefile.am (SUBDIRS): Remove intl.
17639 (EXTRA_DIST): Add config/config.rpath.
17640
53c71a12
AD
176412002-05-03 Akim Demaille <akim@epita.fr>
17642
17643 * data/bison.simple (m4_if): Don't output empty enums.
17644 And actually, output valid enum definitions :(.
17645
289dd0cf
AD
176462002-05-03 Akim Demaille <akim@epita.fr>
17647
17648 * configure.bat: Remove, completely obsolete.
17649 * Makefile.am (EXTRA_DIST): Adjust.
17650 Don't distribute config.rpath...
17651 * config/Makefile.am (EXTRA_DIST): Do it.
17652
db85e524
AD
176532002-05-03 Akim Demaille <akim@epita.fr>
17654
17655 * configure.in (GETTEXT_VERSION): New.
17656 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17657
83ccf991
AD
176582002-05-03 Akim Demaille <akim@epita.fr>
17659
17660 * data/bison.simple (b4_token_enum): New.
17661 (b4_token_defines): Use it to output tokens both as #define and
17662 enums.
17663 Suggested by Paul Eggert.
17664 * src/output.c (token_definitions_output): Don't output spurious
17665 white spaces.
17666
1f418995
AD
176672002-05-03 Akim Demaille <akim@epita.fr>
17668
17669 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17670
45119f04
RA
176712002-05-02 Robert Anisko <robert@lrde.epita.fr>
17672
17673 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17674 Update the stack class, give a try to deque as the default container.
17675
b2d52318
AD
176762002-05-02 Akim Demaille <akim@epita.fr>
17677
17678 * data/bison.simple (yyparse): Do not implement @$ = @1.
17679 (YYLLOC_DEFAULT): Adjust to do it.
17680 * doc/bison.texinfo (Location Default Action): Fix.
17681
3a8b4109
AD
176822002-05-02 Akim Demaille <akim@epita.fr>
17683
17684 * src/reader.c (parse_braces): Merge into...
17685 (parse_action): this.
17686
84614e13
AD
176872002-05-02 Akim Demaille <akim@epita.fr>
17688
17689 * configure.in (ALL_LINGUAS): Remove.
17690 * po/LINGUAS, hr.po: New.
17691
fdbcd8e2
AD
176922002-05-02 Akim Demaille <akim@epita.fr>
17693
17694 Remove the so called hairy (semantic) parsers.
17695
17696 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17697 * src/gram.h, src/gram.c (semantic_parser): Remove.
17698 (rule_t): Remove the guard and guard_line members.
17699 * src/lex.h (token_t): remove tok_guard.
17700 * src/options.c (option_table): Remove %guard and %semantic_parser
17701 support.
17702 * src/output.c, src/output.h (guards_output): Remove.
17703 (prepare): Adjust.
17704 (token_definitions_output): Don't output the `T'
17705 tokens (???).
17706 (output_skeleton): Don't output the guards.
17707 * src/files.c, src/files.c (attrsfile): Remove.
17708 * src/reader.c (symbol_list): Remove the guard and guard_line
17709 members.
17710 Adjust dependencies.
17711 (parse_guard): Remove.
17712 * data/bison.hairy: Remove.
17713 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17714 BISON_HAIRY.
17715
82b6cb3f
AD
177162002-05-02 Akim Demaille <akim@epita.fr>
17717
17718 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17719 (parse_guard): Rename the formal argument `stack_offset' as
17720 `rule_length', which is more readable.
17721 Adjust callers.
17722 (copy_at, copy_dollar): Instead of outputting the hard coded
17723 values of $$, $n and so forth, output invocation to b4_lhs_value,
17724 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
17725 Note: this patch partially drops `semantic-parser' support: it
17726 always does `rule_length - n', where semantic parsers ought to
17727 always use `-n'.
82b6cb3f
AD
17728 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17729 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17730
6cbfbcc5
AD
177312002-05-02 Akim Demaille <akim@epita.fr>
17732
17733 * configure.in (AC_INIT): Bump to 1.49b.
17734 (AM_INIT_AUTOMAKE): Short invocation.
17735
b8548114
AD
177362002-05-02 Akim Demaille <akim@epita.fr>
17737
17738 Version 1.49a.
17739
c20cd1fa
AD
177402002-05-01 Akim Demaille <akim@epita.fr>
17741
17742 * src/skeleton.h: Remove.
17743
8a9566d4
AD
177442002-05-01 Akim Demaille <akim@epita.fr>
17745
17746 * src/skeleton.h: Fix the #endif.
17747 Reported by Magnus Fromreide.
17748
8c6d399a
PE
177492002-04-26 Paul Eggert <eggert@twinsun.com>
17750
17751 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17752 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 17753 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 17754
2b7ed18a
RA
177552002-04-25 Robert Anisko <robert@lrde.epita.fr>
17756
17757 * src/scan-skel.l: Postprocess quadrigraphs.
17758
17759 * src/reader.c (copy_character): New function, used to output
17760 single characters while replacing `[' and `]' with quadrigraphs, to
17761 avoid troubles with M4 quotes.
17762 (copy_comment): Output characters with copy_character.
17763 (read_additionnal_code): Likewise.
17764 (copy_string2): Likewise.
17765 (copy_definition): Likewise.
17766
17767 * tests/calc.at: Exercise M4 quoting.
17768
34a89c50
AD
177692002-04-25 Akim Demaille <akim@epita.fr>
17770
17771 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17772 between `!' and the command.
17773 Reported by Paul Eggert.
17774
0dd1580a
RA
177752002-04-24 Robert Anisko <robert@lrde.epita.fr>
17776
17777 * tests/calc.at: Exercise prologue splitting.
17778
17779 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17780 `b4_post_prologue' instead of `b4_prologue'.
17781
17782 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17783 muscles.
17784 (output): Free pre_prologue_obstack and post_prologue_obstack.
17785 * src/files.h, src/files.c (attrs_obstack): Remove.
17786 (pre_prologue_obstack, post_prologue_obstack): New.
17787 * src/reader.c (copy_definition): Add a parameter to specify the
17788 obstack to fill, instead of using attrs_obstack unconditionally.
17789 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17790 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17791
83c1796f
PE
177922002-04-23 Paul Eggert <eggert@twinsun.com>
17793
17794 * data/bison.simple: Remove unnecessary commentary and white
17795 space differences from 1_29-branch.
17796 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17797
17798 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17799 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17800 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17801 constructors or destructors.
17802
17803 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17804
1207eeac
AD
178052002-04-23 Akim Demaille <akim@epita.fr>
17806
17807 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17808 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17809 location with columns.
17810 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17811 All reported by Paul Eggert.
17812
78ab8f67
AD
178132002-04-22 Akim Demaille <akim@epita.fr>
17814
17815 * src/reduce.c (dump_grammar): Move to...
17816 * src/gram.h, src/gram.c (grammar_dump): here.
17817 Be sure to separate long item numbers.
17818 Don't read the members of a rule's prec if its nil.
17819
133c20e2
AD
178202002-04-22 Akim Demaille <akim@epita.fr>
17821
17822 * src/output.c (table_size, table_grow): New.
17823 (MAXTABLE): Remove, replace uses with table_size.
17824 (pack_vector): Instead of dying when the table is too big, grow it.
17825
9515e8a7
AD
178262002-04-22 Akim Demaille <akim@epita.fr>
17827
17828 * data/bison.simple (yyr1): Its type is that of a token number.
17829 * data/bison.c++ (r1_): Likewise.
17830 * tests/regression.at (Web2c Actions): Adjust.
17831
23c5a174
AD
178322002-04-22 Akim Demaille <akim@epita.fr>
17833
17834 * src/reader.c (token_translations_init): 256 is now the default
17835 value for the error token, i.e., it will be assigned another
17836 number if the user assigned 256 to one of her tokens.
17837 (reader): Don't force 256 to error.
17838 * doc/bison.texinfo (Symbols): Adjust.
17839 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17840 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17841 etc. instead of 10, 20, 30 (which was used to `jump' over error
17842 (256) and undefined (2)).
17843
5fbb0954
AD
178442002-04-22 Akim Demaille <akim@epita.fr>
17845
17846 Propagate more token_number_t.
17847
17848 * src/gram.h (token_number_as_item_number)
17849 (item_number_as_token_number): New.
17850 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17851 Use it to create output_item_number_table and
17852 output_token_number_table.
17853 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17854 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17855 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17856 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17857
4f940944
AD
178582002-04-22 Akim Demaille <akim@epita.fr>
17859
17860 * src/output.h, src/output.c (get_lines_number): Remove.
17861
3ded9a63
AD
178622002-04-19 Akim Demaille <akim@epita.fr>
17863
17864 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17865 as Lex/Flex'.
17866 (Debugging): More details about enabling the debugging features.
17867 (Table of Symbols): Describe $$, $n, @$, and @n.
17868 Suggested by Tim Josling.
17869
e0c471a9
AD
178702002-04-19 Akim Demaille <akim@epita.fr>
17871
17872 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17873
fecc10cd
AD
178742002-04-10 Akim Demaille <akim@epita.fr>
17875
17876 * src/system.h: Rely on HAVE_LIMITS_H.
17877 Suggested by Paul Eggert.
17878
51dec47b
AD
178792002-04-09 Akim Demaille <akim@epita.fr>
17880
17881 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17882 full stderr, and strip it according to the bison options, instead
17883 of composing the error message from different bits.
17884 This makes it easier to check for several error messages.
17885 Adjust all the invocations.
17886 Add an invocation exercising the error token.
17887 Add an invocation demonstrating a stupid error message.
17888 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17889 Adjust the tests.
17890 Error message are for stderr, not stdout.
17891
007a50a4
AD
178922002-04-09 Akim Demaille <akim@epita.fr>
17893
17894 * src/gram.h, src/gram.c (error_token_number): Remove, use
17895 errtoken->number.
17896 * src/reader.c (reader): Don't specify the user token number (2)
17897 for $undefined, as it uselessly prevents using it.
17898 * src/gram.h (token_number_t): Move to...
17899 * src/symtab.h: here.
17900 (state_t.number): Is a token_number_t.
17901 * src/print.c, src/reader.c: Use undeftoken->number instead of
17902 hard coded 2.
17903 (Even though this 2 is not the same as above: the number of the
17904 undeftoken remains being 2, it is its user token number which
17905 might not be 2).
17906 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17907 `user_token_number_max'.
17908 Output `undef_token_number'.
17909 * data/bison.simple, data/bison.c++: Use them.
17910 Be sure to map invalid yylex return values to
17911 `undef_token_number'. This saves us from gratuitous SEGV.
17912
17913 * tests/conflicts.at (Solved SR Conflicts)
17914 (Unresolved SR Conflicts): Adjust.
17915 * tests/regression.at (Web2c Actions): Adjust.
17916
06446ccf
AD
179172002-04-08 Akim Demaille <akim@epita.fr>
17918
17919 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17920 Adding #line.
17921 Remove the duplicate `typedefs'.
17922 (RhsNumberType): Fix the declaration and various other typos.
17923 Use __ofile__.
17924 * data/bison.simple: Use __ofile__.
17925 * src/scan-skel.l: Handle __ofile__.
17926
62a3e4f0
AD
179272002-04-08 Akim Demaille <akim@epita.fr>
17928
17929 * src/gram.h (item_number_t): New, the type of item numbers in
17930 RITEM. Note that it must be able to code symbol numbers as
17931 positive number, and the negation of rule numbers as negative
17932 numbers.
17933 Adjust all dependencies (pretty many).
17934 * src/reduce.c (rule): Remove this `short *' pointer: use
17935 item_number_t.
17936 * src/system.h (MINSHORT, MAXSHORT): Remove.
17937 Include `limits.h'.
17938 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17939 (shortcpy): Remove.
17940 (MAXTABLE): Move to...
17941 * src/output.c (MAXTABLE): here.
17942 (prepare_rules): Use output_int_table to output rhs.
17943 * data/bison.simple, data/bison.c++: Adjust.
17944 * tests/torture.at (Big triangle): Move the limit from 254 to
17945 500.
17946 * tests/regression.at (Web2c Actions): Ajust.
17947
17948 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17949 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17950 passes, but produces negative #line number, once fixed, GCC is
17951 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17952 C), it passes.
17953 * src/state.h (state_h): Code input lines on ints, not shorts.
17954
bb88b0fc
AD
179552002-04-08 Akim Demaille <akim@epita.fr>
17956
17957 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17958 and then the grammar.
17959
9a636f47
AD
179602002-04-08 Akim Demaille <akim@epita.fr>
17961
17962 * src/system.h: No longer using strndup.
17963
680e8701
AD
179642002-04-07 Akim Demaille <akim@epita.fr>
17965
17966 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17967 * src/output.c (output_table_data): Return the longest number.
17968 (prepare_tokens): Output `token_number_max').
17969 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17970 New.
17971 Use them to define yy_token_number_type/TokenNumberType.
17972 Use this type for yytranslate.
17973 * tests/torture.at (Big triangle): Push the limit from 124 to
17974 253.
17975 * tests/regression.at (Web2c Actions): Adjust.
17976
817e9f41
AD
179772002-04-07 Akim Demaille <akim@epita.fr>
17978
17979 * tests/torture.at (Big triangle): New.
17980 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17981 * tests/existing.at: here.
17982
5123689b
AD
179832002-04-07 Akim Demaille <akim@epita.fr>
17984
17985 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17986 nritems.
17987 Adjust dependencies.
17988
f3849179
AD
179892002-04-07 Akim Demaille <akim@epita.fr>
17990
17991 * src/reader.c: Normalize increments to prefix form.
17992
bd02036a
AD
179932002-04-07 Akim Demaille <akim@epita.fr>
17994
17995 * src/reader.c, symtab.c: Remove debugging code.
17996
db8837cb
AD
179972002-04-07 Akim Demaille <akim@epita.fr>
17998
17999 Rename all the `bucket's as `symbol_t'.
18000
18001 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18002 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18003 * src/symtab.c, src/symtab.h (bucket): Rename as...
18004 (symbol_t): this.
18005 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18006 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18007 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18008 (buckets_new, buckets_free, buckets_do): Rename as...
18009 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18010 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18011 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
18012 (symbols_new, symbols_free, symbols_do): these.
18013
72a23c97
AD
180142002-04-07 Akim Demaille <akim@epita.fr>
18015
18016 Use lib/hash for the symbol table.
18017
18018 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
18019 EOF.
18020 * src/lex.c (lex): Set the `number' member of new terminals.
18021 * src/reader.c (bucket_check_defined, bucket_make_alias)
18022 (bucket_check_alias_consistence, bucket_translation): New.
18023 (reader, grammar_free, readgram, token_translations_init)
18024 (packsymbols): Adjust.
18025 (reader): Number the predefined tokens.
18026 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
18027 for predefined tokens.
18028 * src/symtab.h (bucket): Remove all the hash table related
18029 members.
18030 * src/symtab.c (symtab): Replace by...
18031 (bucket_table): this.
18032 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18033 (buckets_new, buckets_do): New.
18034
280a38c3
AD
180352002-04-07 Akim Demaille <akim@epita.fr>
18036
18037 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
18038 (start_symbol, max_user_token_number, semantic_parser)
18039 (error_token_number): Initialize.
18040 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
18041 Initialize.
18042 (reader): Don't.
18043 (errtoken, eoftoken, undeftoken, axiom): Extern.
18044
03b31c0c
AD
180452002-04-07 Akim Demaille <akim@epita.fr>
18046
18047 * src/gram.h (rule_s): prec and precsym are now pointers
18048 to the bucket giving the priority/associativity.
18049 Member `associativity' removed: useless.
18050 * src/reduce.c, src/conflicts.c: Adjust.
18051
8b3df748
AD
180522002-04-07 Akim Demaille <akim@epita.fr>
18053
18054 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
18055 Properly escape the symbols' TAG when outputting them.
18056
e601aa1d
AD
180572002-04-07 Akim Demaille <akim@epita.fr>
18058
18059 * src/lalr.h (LA): Is a bitsetv, not bitset*.
18060
b0299a2e
AD
180612002-04-07 Akim Demaille <akim@epita.fr>
18062
18063 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
18064 (LArule): this, which is an array to rule_t*.
18065 * src/print.c, src/conflicts.c: Adjust.
18066
d7e1f00c
AD
180672002-04-07 Akim Demaille <akim@epita.fr>
18068
18069 * src/gram.h (rule_t): Rename `number' as `user_number'.
18070 `number' is a new member.
18071 Adjust dependencies.
18072 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
18073
cc9305dd
AD
180742002-04-07 Akim Demaille <akim@epita.fr>
18075
18076 As a result of the previous patch, it is no longer needed
18077 to reorder ritem itself.
18078
18079 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
18080
b0940840
AD
180812002-04-07 Akim Demaille <akim@epita.fr>
18082
18083 Be sure never to walk through RITEMS, but use only data related to
18084 the rules themselves. RITEMS should be banished.
18085
18086 * src/output.c (output_token_translations): Rename as...
18087 (prepare_tokens): this.
18088 In addition to `translate', prepare the muscles `tname' and
18089 `toknum', which were handled by...
18090 (output_rule_data): this.
18091 Remove, and move the remainder of its outputs into...
18092 (prepare_rules): this new routines, which also merges content from
18093 (output_gram): this.
18094 (prepare_rules): Be sure never to walk through RITEMS.
18095 (output_stos): Rename as...
18096 (prepare_stos): this.
18097 (output): Always invoke prepare_states, after all, just don't use it
18098 in the output if you don't need it.
18099
643a5994
AD
181002002-04-07 Akim Demaille <akim@epita.fr>
18101
18102 * src/LR0.c (new_state): Display `nstates' as the name of the
18103 newly created state.
18104 Adjust to initialize first_state and last_state if needed.
18105 Be sure to distinguish the initial from the final state.
18106 (new_states): Create the itemset of the initial state, and use
18107 new_state.
18108 * src/closure.c (closure): Now that the initial state has its
18109 items properly set, there is no need for a special case when
18110 creating `ruleset'.
18111
18112 As a result, now the rule 0, reducing to $axiom, is visible in the
18113 outputs. Adjust the test suite.
18114
18115 * tests/conflicts.at (Solved SR Conflicts)
18116 (Unresolved SR Conflicts): Adjust.
18117 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
18118 * tests/conflicts.at (S/R in initial): New.
18119
b4c4ccc2
AD
181202002-04-07 Akim Demaille <akim@epita.fr>
18121
18122 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
18123 the RHS of the rules.
18124 * src/output.c (output_gram): Likewise.
18125
bba97eb2
AD
181262002-04-07 Akim Demaille <akim@epita.fr>
18127
18128 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
18129 bucket.
18130 Adjust all dependencies.
18131 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
18132 `number' of the buckets too.
18133 * src/gram.h: Include `symtab.h'.
18134 (associativity): Move to...
18135 * src/symtab.h: here.
18136 No longer include `gram.h'.
18137
c3b407f4
AD
181382002-04-07 Akim Demaille <akim@epita.fr>
18139
18140 * src/gram.h, src/gram.c (rules_rhs_length): New.
18141 (ritem_longest_rhs): Use it.
18142 * src/gram.h (rule_t): `number' is a new member.
18143 * src/reader.c (packgram): Set it.
18144 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
18145 the end of `rules', and count them out of `nrules'.
18146 (reduce_output, dump_grammar): Adjust.
18147 * src/print.c (print_grammar): It is no longer needed to check for
18148 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
18149 * tests/reduce.at (Reduced Automaton): New test.
18150
11652ab3
AD
181512002-04-07 Akim Demaille <akim@epita.fr>
18152
18153 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
18154 lacking `+ 1' to nrules, Bison reported as useless a token if it
18155 was used solely to set the precedence of the last rule...
18156
26b23c1a
AD
181572002-04-07 Akim Demaille <akim@epita.fr>
18158
18159 * data/bison.c++, data/bison.simple: Don't output the current file
18160 name in #line, to avoid useless diffs between two identical
18161 outputs under different names.
18162
18bcecb0
AD
181632002-04-07 Akim Demaille <akim@epita.fr>
18164
18165 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
18166 Normalize loops to using `< nrules + 1', not `<= nrules'.
18167
fa770c86
AD
181682002-04-07 Akim Demaille <akim@epita.fr>
18169
18170 * TODO: Update.
18171
d9b739c3
AD
181722002-04-07 Akim Demaille <akim@epita.fr>
18173
18174 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
18175 bucket.value as bucket.number.
18176
99013900
AD
181772002-04-07 Akim Demaille <akim@epita.fr>
18178
18179 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
18180 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18181 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
18182 RHS, instead of being an index in RITEMS.
18183
e966383b
PE
181842002-04-04 Paul Eggert <eggert@twinsun.com>
18185
18186 * doc/bison.texinfo: Update copyright date.
18187 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
18188 (Symbols): Warn about running Bison in one character set,
18189 but compiling and/or running in an incompatible one.
18190 Warn about character code 256, too.
18191
181922002-04-03 Paul Eggert <eggert@twinsun.com>
18193
18194 * src/bison.data (YYSTACK_ALLOC): Depend on whether
18195 YYERROR_VERBOSE is nonzero, not whether it is defined.
18196
18197 Merge changes from bison-1_29-branch.
c307773e 18198
8d6c48b9
PE
181992002-03-20 Paul Eggert <eggert@twinsun.com>
18200
18201 Merge fixes from Debian bison_1.34-1.diff.
18202
18203 * configure.in (AC_PREREQ): 2.53.
18204
e53c6322
AD
182052002-03-20 Akim Demaille <akim@epita.fr>
18206
18207 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18208
9ffbeca7
PE
182092002-03-19 Paul Eggert <eggert@twinsun.com>
18210
21db0b2a
PE
18211 * src/bison.simple (YYCOPY): New macro.
18212 (YYSTACK_RELOCATE): Use it.
18213 Remove Type arg; no longer needed. All callers changed.
18214 (yymemcpy): Remove; no longer needed.
18215
9ffbeca7
PE
18216 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18217 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18218
642cb8f8
AD
182192002-03-19 Akim Demaille <akim@epita.fr>
18220
18221 Test and fix the #line outputs.
18222
18223 * tests/atlocal.at (GCC): New.
18224 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 18225 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
18226 (Action synch line, Epilogue synch line): New tests.
18227 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18228 * data/bison.simple, data/bison.c++: Use it.
18229
3c31a486
AD
182302002-03-19 Akim Demaille <akim@epita.fr>
18231
18232 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18233 (Solved SR Conflicts, %expect not enough, %expect right)
18234 (%expect too much): Move to...
18235 * tests/conflicts.at: this new file.
18236
0d8bed56
AD
182372002-03-19 Akim Demaille <akim@epita.fr>
18238
18239 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18240 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18241 that we can move to enums for instance.
18242 * src/output.c (token_definitions_output): Output a list of
18243 `token-name, token-number' instead of the #define.
18244 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18245
9208d17f
AD
182462002-03-14 Akim Demaille <akim@epita.fr>
18247
18248 Use Gettext 0.11.1.
18249
af27eacb
RA
182502002-03-09 Robert Anisko <robert@lrde.epita.fr>
18251
18252 * data/bison.c++: Make the user able to add members to the generated
18253 parser by subclassing.
18254
9101a310
RA
182552002-03-05 Robert Anisko <robert@lrde.epita.fr>
18256
18257 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18258 a character.
18259 Reported by Nicolas Tisserand and Nicolas Burrus.
18260
fff9bf0b
RA
182612002-03-04 Robert Anisko <robert@lrde.epita.fr>
18262
18263 * src/reader.c: Warn about lacking semi-colons, do not complain.
18264
64dba31e
RA
182652002-03-04 Robert Anisko <robert@lrde.epita.fr>
18266
18267 * data/bison.c++: Remove a debug line.
18268
374f5a14
RA
182692002-03-04 Robert Anisko <robert@lrde.epita.fr>
18270
18271 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18272 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18273 provide a default implementation.
18274
bfcf1f3a
AD
182752002-03-04 Akim Demaille <akim@epita.fr>
18276
18277 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18278 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18279 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18280 * tests/semantic.at (Parsing Guards): Similarly.
18281 * src/reader.at (readgram): Complain if the last rule is not ended
18282 with a semi-colon.
18283
65ccf9fc
AD
182842002-03-04 Akim Demaille <akim@epita.fr>
18285
18286 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18287 * src/closure.c: here.
18288 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18289 RTC.
18290 * src/warshall.h, src/warshall.c: Remove.
18291 * tests/sets.at (Broken Closure): Adjust.
18292
d0039cbc
AD
182932002-03-04 Akim Demaille <akim@epita.fr>
18294
18295 * src/output.c (output_skeleton): tempdir is const.
18296 bytes_read is unused.
18297
345cea78
AD
182982002-03-04 Akim Demaille <akim@epita.fr>
18299
18300 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18301 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18302 Update.
18303 From Michael Hayes.
18304
564801f7
AD
183052002-03-04 Akim Demaille <akim@epita.fr>
18306
18307 * src/closure.c (closure): `r' is unused.
18308
e5352bc7
AD
183092002-03-04 Akim Demaille <akim@epita.fr>
18310
18311 * tests/sets.at (Broken Closure): Add the ending `;'.
18312 * src/reader.at (readgram): Complain if a rule is not ended with a
18313 semi-colon.
18314
914feea9
AD
183152002-03-04 Akim Demaille <akim@epita.fr>
18316
18317 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18318 (count_sr_conflicts): Use bitset_count.
18319 * src/reduce.c (inaccessable_symbols): Ditto.
18320 (bits_size): Remove.
18321 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18322
f0250de6
AD
183232002-03-04 Akim Demaille <akim@epita.fr>
18324
18325 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18326 * src/reduce.c: Remove the `bitset_zero's following the
18327 `bitset_create's, as now it is performed by the latter.
18328
ef017502
AD
183292002-03-04 Akim Demaille <akim@epita.fr>
18330
18331 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18332 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18333 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18334 latest sources from Michael.
18335
76514394
AD
183362002-03-04 Akim Demaille <akim@epita.fr>
18337
18338 * src/output.c (output): Don't free the grammar.
18339 * src/reader.c (grammar_free): New.
18340 * src/main.c (main): Call it and don't free symtab here.
18341
55024580
AD
183422002-03-04 Akim Demaille <akim@epita.fr>
18343
18344 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18345 before returning.
18346 Reported by Benoit Perrot.
18347
f9abaa2c
AD
183482002-03-04 Akim Demaille <akim@epita.fr>
18349
18350 Use bitset operations when possible, not loops over bits.
18351
18352 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18353 bitset_or.
18354 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18355 * src/reduce.c (useless_nonterminals): Formatting changes.
18356 * src/warshall.c (TC): Use bitset_or.
18357
0e721e75
AD
183582002-03-04 Akim Demaille <akim@epita.fr>
18359
18360 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18361 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18362 Ditto.
18363
0fb1ffb1
AD
183642002-03-04 Akim Demaille <akim@epita.fr>
18365
18366 * src/lalr.c (F): Now a bitset*.
18367 Adjust all dependencies.
18368
b86796bf
AD
183692002-03-04 Akim Demaille <akim@epita.fr>
18370
18371 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18372 Adjust all dependencies.
18373
602bbf31
AD
183742002-03-04 Akim Demaille <akim@epita.fr>
18375
18376 * src/L0.c, src/LR0.h (nstates): Be size_t.
18377 Adjust comparisons (signed vs unsigned).
18378 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18379 bitset*.
18380 Adjust all dependencies.
18381
d8a0245c
AD
183822002-03-04 Akim Demaille <akim@epita.fr>
18383
18384 * src/closure.c (firsts): Now, also a bitset.
18385 Adjust all dependencies.
18386 (varsetsize): Remove, now unused.
18387 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18388
34ba9743
AD
183892002-03-04 Akim Demaille <akim@epita.fr>
18390
18391 * src/print.c: Convert to use bitset.h, not hand coded iterations
18392 over ints.
18393
ed86e78c
AD
183942002-03-04 Akim Demaille <akim@epita.fr>
18395
18396 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18397
dfdb1797
AD
183982002-03-04 Akim Demaille <akim@epita.fr>
18399
18400 * src/closure.c (ruleset): Be a bitset.
18401 (rulesetsize): Remove.
18402
7086e707
AD
184032002-03-04 Akim Demaille <akim@epita.fr>
18404
18405 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18406 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18407 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18408 * src/closure.c (fderives): Be an array of bitsets.
18409
98254360
RA
184102002-02-28 Robert Anisko <robert@lrde.epita.fr>
18411
18412 * data/bison.c++: Merge the two generated headers. Insert a copyright
18413 notice in each output file.
18414
a75c057f
AD
184152002-02-28 Akim Demaille <akim@epita.fr>
18416
18417 * data/bison.c++: Copy the prologue of bison.simple to fetch
18418 useful M4 definitions, such as b4_header_guard.
18419
06b00abc
AD
184202002-02-25 Akim Demaille <akim@epita.fr>
18421
18422 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
18423 translator friendly scheme for the bgr
18424 copyright notice.
06b00abc 18425
70e7d534
AD
184262002-02-25 Akim Demaille <akim@epita.fr>
18427
18428 * src/output.c (header_output): Remove, now handled completely via
18429 M4.
18430
abe017f6
AD
184312002-02-25 Akim Demaille <akim@epita.fr>
18432
18433 * m4/m4.m4: New, from CVS Autoconf.
18434 * configure.in: Invoke it.
18435 * src/output.c (output_skeleton): Use its result instead of the
18436 hard coded name.
18437
381fb12e
AD
184382002-02-25 Akim Demaille <akim@epita.fr>
18439
18440 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18441 Fileutils 4.1.5.
18442 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18443 * src/output.c (output_skeleton): Use mkstemp to create a real
18444 temporary file.
18445 Move the filling of `skeleton' and its muscle to...
18446 (prepare): here.
18447 (output): Move the definition of the prologue muscle to...
18448 (prepare): here.
18449 * src/system.h (DEFAULT_TMPDIR): New.
18450
6f38107f
PE
184512002-02-14 Paul Eggert <eggert@twinsun.com>
18452
18453 Remove the support for C++ namespace cleanliness; it was
18454 causing more problems than it was curing, since it didn't work
18455 properly on some nonstandard C++ compilers. This can wait
18456 for a proper C++ parser.
18457
18458 * NEWS: Document this.
18459 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18460 of C++, as it's treated like C now.
18461 * src/bison.simple (YYSTD): Remove.
18462 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18463 Treat C++ just like Standard C instead of trying to support
18464 namespace cleanliness.
18465
80cce3da
AD
184662002-02-14 Akim Demaille <akim@epita.fr>
18467
18468 * tests/regression.at (else): Adjust to Andreas' change.
18469
842e8679
AD
184702002-02-14 Akim Demaille <akim@epita.fr>
18471
18472 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18473
4bda3f10
AD
184742002-02-13 Andreas Schwab <schwab@suse.de>
18475
18476 * src/output.c (output_rule_data): Don't output NULL, it might
18477 not be defined yet.
18478
4162fa07 184792002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 18480
4162fa07
RA
18481 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18482 (Copyright notice): Update.
b418ecd8 18483
bd16a5dc
AD
184842002-02-11 Akim Demaille <akim@epita.fr>
18485
18486 * tests/regression.at (%nonassoc and eof): Don't include
18487 nonportable headers.
18488
8d69a1a3
RA
184892002-02-08 Robert Anisko <robert@lrde.epita.fr>
18490
18491 * data/bison.c++: Correct error recovery. Make the user able to
18492 initialize the starting location.
18493
9b2d0677
AD
184942002-02-07 Akim Demaille <akim@epita.fr>
18495
18496 * tests/input.at: New.
18497
69e2658b
RA
184982002-02-07 Robert Anisko <robert@lrde.epita.fr>
18499
18500 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 18501 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
18502 directives around tables only needed for debugging.
18503
4aacc3a7
RA
185042002-02-07 Robert Anisko <robert@lrde.epita.fr>
18505
18506 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18507 C++ parsers.
18508 (yy::b4_name::parse): Use print_.
18509
762a801e
RA
185102002-02-07 Robert Anisko <robert@lrde.epita.fr>
18511
18512 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18513
4bb2bc3f
RA
185142002-02-07 Robert Anisko <robert@lrde.epita.fr>
18515
18516 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18517 C++ parsers.
18518 (yy::b4_name::parse): Build verbose error messages, and use error_.
18519
6b45a3ca
RA
185202002-02-06 Robert Anisko <robert@lrde.epita.fr>
18521
18522 * data/bison.c++: Fix m4 quoting in comments.
18523
50997c6e
RA
185242002-02-06 Robert Anisko <robert@lrde.epita.fr>
18525
18526 * data/bison.c++: Adjust the parser code. Fix some muscles that were
18527 not expanded by m4.
18528
3f3eed27
AD
185292002-02-05 Akim Demaille <akim@epita.fr>
18530
18531 * data/bison.c++: Adjust to the M4 back end.
18532 More is certainly needed.
18533
be2a1a68
AD
185342002-02-05 Akim Demaille <akim@epita.fr>
18535
18536 Give a try to M4 as a back end.
18537
18538 * lib/readpipe.c: New, from wdiff.
18539 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
18540 BISON_HAIRY.
18541 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
18542 specific values. Now it is m4 that performs the lookup.
18543 * src/parse-skel.y: Remove.
18544 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
18545 * src/output.c (actions_output, guards_output)
18546 (token_definitions_output): No longer keeps track of the output
18547 line number, hence remove the second argument.
18548 (guards_output): Check against the guard member of a rule, not the
18549 action member.
18550 Adjust callers.
18551 (output_skeleton): Don't look for the skeleton location, let m4 do
18552 that.
18553 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
18554 file will be used.
18555 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
18556 (prepare): Given that for the time being changesyntax is not
18557 usable in M4, rename the muscles using `-' to `_'.
18558 Define `defines_flag', `output_parser_name' and `output_header_name'.
18559 * src/output.h (actions_output, guards_output)
18560 (token_definitions_output): Adjust prototypes.
18561 * src/scan-skel.l: Instead of scanning the skeletons, it now
18562 processes the output of m4: `__oline__' and `#output'.
18563 * data/bison.simple: Adjust to be used by M4(sugar).
18564 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
18565 to date.
18566 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
18567 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
18568 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
18569 shamelessly stolen from CVS Autoconf.
18570
beda758b
AD
185712002-02-05 Akim Demaille <akim@epita.fr>
18572
18573 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
18574 * configure.in: Check for the declarations of free and malloc.
18575 * src/muscle_tab.c: Adjust.
18576
5ece6d43
AD
185772002-02-05 Akim Demaille <akim@epita.fr>
18578
18579 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
18580 which have no values.
18581
5bb18f9a
AD
185822002-02-05 Akim Demaille <akim@epita.fr>
18583
18584 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18585 * data/: here.
18586
894dd62e
PE
185872002-01-29 Paul Eggert <eggert@twinsun.com>
18588
18589 * src/bison.simple (YYSIZE_T): Do not define merely because
18590 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
18591 On some platforms, <alloca.h> does not declare YYSTD (size_t).
18592
82841af7
AD
185932002-01-27 Akim Demaille <akim@epita.fr>
18594
18595 Fix `%nonassoc and eof'.
18596
18597 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
18598 which were not properly copied! Replace
18599 memcpy (res->errs, src->errs, src->nerrs);
18600 with
18601 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
18602 !!!
18603 * tests/regression.at (%nonassoc and eof): Adjust to newest
18604 Autotest: `.' is not in the PATH.
18605
318b76e9
AD
186062002-01-27 Akim Demaille <akim@epita.fr>
18607
18608 * tests/sets.at (AT_EXTRACT_SETS): New.
18609 (Nullable): Use it.
18610 (Firsts): New.
18611
30d2f3d5
AD
186122002-01-26 Akim Demaille <akim@epita.fr>
18613
18614 * tests/actions.at, tests/calc.at, tests/headers.at,
18615 * tests/torture.at: Adjust to the newest Autotest which no longer
18616 forces `.' in the PATH.
18617
30f8c395
AD
186182002-01-25 Akim Demaille <akim@epita.fr>
18619
18620 * tests/regression.at (%nonassoc and eof): New.
18621 Suggested by Robert Anisko.
18622
29ae55f1
AD
186232002-01-24 Akim Demaille <akim@epita.fr>
18624
18625 Bison dumps core when trying to complain about broken input files.
18626 Reported by Cris van Pelt.
18627
18628 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18629 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18630 into...
18631 (Invalid inputs): Strengthen: exercise parse_percent_token.
18632
2b548aa6
RA
186332002-01-24 Robert Anisko <robert.anisko@epita.fr>
18634
18635 * src/Makefile.am: Add bison.c++.
18636 * src/bison.c++: New skeleton.
18637
bb0146c2
AD
186382002-01-21 Paolo Bonzini <bonzini@gnu.org>
18639
18640 * po/it.po: New.
18641
bec30531
AD
186422002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18643
18644 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18645
fc6edc45
MA
186462002-01-20 Marc Autret <marc@gnu.org>
18647
18648 * src/files.c (compute_output_file_names): Fix
18649
5e5d5415
MA
186502002-01-20 Marc Autret <marc@gnu.org>
18651
18652 * tests/output.at: New test.
18653 * src/files.c (compute_base_names): Don't map extensions when
18654 the YACC flag is set, use defaults.
18655 Reported by Evgeny Stambulchik.
18656
44ea3fbd
MA
186572002-01-20 Marc Autret <marc@gnu.org>
18658
ba0fe3c7
PE
18659 * src/system.h: Need to define __attribute__ away for non-GCC
18660 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
18661 Suggested by Albert Chin-A-Young.
18662
338963d1
TVH
186632002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18664
18665 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18666 canonical definition.
18667 * src/system.h: Use the canonical definition for PARAMS (avoids
18668 a conflict with the macro from lib/hash.h).
18669
c57b2479
AD
186702002-01-11 Akim Demaille <akim@epita.fr>
18671
18672 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 18673 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 18674
b85810ae
AD
186752002-01-09 Akim Demaille <akim@epita.fr>
18676
18677 * src/files.c, src/files.h (output_infix): New.
18678 (tab_extension): Remove.
18679 (compute_base_names): Compute the former, drop the latter.
18680 * src/output.c (prepare): Insert the muscles `output-infix', and
18681 `output-suffix'.
18682 * src/parse-skel.y (string, string.1): New.
18683 (section.header): Use it.
18684 (section.yacc): Remove.
18685 (prefix): Remove too.
18686 * src/scan-skel.l: Adjust.
18687 * src/bison.simple, src/bison.hairy: Adjust.
18688
cae60122
AD
186892002-01-09 Akim Demaille <akim@epita.fr>
18690
18691 * configure.in (WERROR_CFLAGS): Compute it.
18692 * src/Makefile.am (CFLAGS): Pass it.
18693 * tests/atlocal.in (CFLAGS): Idem.
18694 * src/files.c: Fix a few warnings.
18695 (get_extension_index): Remove, unused.
18696
ae404801
AD
186972002-01-08 Akim Demaille <akim@epita.fr>
18698
18699 * src/getargs.c (AS_FILE_NAME): New.
18700 (getargs): Use it to convert DOSish file names.
18701 * src/files.c (base_name): Rename as full_base_name to avoid
18702 clashes with `base_name ()'.
18703 (filename_split): New.
18704 (compute_base_names): N-th rewrite, using filename_split.
18705
22312b71
AD
187062002-01-08 Akim Demaille <akim@epita.fr>
18707
18708 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18709 New, stolen from the Fileutils 4.1.
18710 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18711 * configure.in: Check for the presence of memrchr, and of its
18712 prototype.
18713
a67cef01
TVH
187142002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18715
18716 * lib/hash.h (__P): Added definition for this macro.
18717 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18718 BUILT_SOURCES, to ensure they are generated first.
18719 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18720 %error-verbose to allow bootstrapping with bison 1.30x.
18721
2b25d624
AD
187222002-01-06 Akim Demaille <akim@epita.fr>
18723
18724 * src/reader.c (parse_braces): Don't fetch the next char, the
18725 convention is to fetch on entry.
18726 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18727 'switch' without a following semicolon.
18728 * tests/regression.at (braces parsing): New.
18729
3460813b
AD
187302002-01-06 Akim Demaille <akim@epita.fr>
18731
18732 Bison is dead wrong in its RR conflict reports.
18733
18734 * tests/torture.at (GNU Cim Grammar): New.
18735 * src/conflicts.c (count_rr_conflicts): Fix.
18736
73784c64
AD
187372002-01-06 Akim Demaille <akim@epita.fr>
18738
18739 Creating package.m4 from configure.ac causes too many problems.
18740
18741 * tests/Makefile.am (package.m4): Create it by hand,
18742 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18743
25d81090
AD
187442002-01-06 Akim Demaille <akim@epita.fr>
18745
18746 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18747 skeleton.h.
18748
a9b8959e
PE
187492002-01-04 Paul Eggert <eggert@twinsun.com>
18750
18751 * doc/bison.texinfo (Debugging):
18752 Remove YYSTDERR; it's no longer defined or used.
18753 Also, s/cstdio.h/cstdio/.
18754
25d81090
AD
187552002-01-03 Akim Demaille <akim@epita.fr>
18756
18757 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18758
1109455c
AD
187592002-01-03 Akim Demaille <akim@epita.fr>
18760
18761 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18762 tracing code to --trace, wait for a better --trace option, with
18763 args.
18764
7ea5e977
AD
187652002-01-03 Akim Demaille <akim@epita.fr>
18766
18767 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18768 The ISO C++ standard is extremely clear about it: stderr is
18769 considered a macro, not a regular symbol (see table 94 `Header
18770 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18771 Therefore std:: does not apply to it. It still does with fprintf.
18772 Also, s/cstdio.h/cstdio/.
18773
fab5b110
AD
187742002-01-03 Akim Demaille <akim@epita.fr>
18775
18776 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18777 for non system headers.
18778
aed7fd9b
AD
187792002-01-02 Akim Demaille <akim@epita.fr>
18780
18781 Equip the skeleton chain with location tracking, runtime trace,
18782 pure parser and scanner.
18783
18784 * src/parse-skel.y: Request a pure parser, locations, and prefix
18785 renaming.
18786 (%union): Having several members with the same type does not help
18787 type mismatches, simplify.
18788 (YYPRINT, yyprint): New.
18789 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18790 (skel_error): this.
18791 Handle locations.
18792 * src/scan-skel.l: Adjust to these changes.
18793 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18794 (LOCATION_PRINT, skel_control_t): New.
18795
24fad99e
AD
187962001-12-30 Akim Demaille <akim@epita.fr>
18797
18798 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18799 replace `gb' with BLANKS.
18800 * src/scan-skel.l: Adjust.
18801
a4b36db4
AD
188022001-12-30 Akim Demaille <akim@epita.fr>
18803
18804 * src/system.h: We don't need nor want bcopy.
18805 Throw away MS-DOS crap: we don't need getpid.
18806 * configure.in: We don't need strndup. It was even causing
18807 problems: because Flex includes the headers *before* us,
18808 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18809 not visible.
18810 * lib/xstrndup.c: New.
18811 * src/scan-skel.l: Use it.
18812 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18813 * src/parse-skel.y: Use %directives instead of #defines.
18814
1239777d
AD
188152001-12-30 Akim Demaille <akim@epita.fr>
18816
18817 * src/skeleton.h: New.
18818 * src/output.c (output_parser, output_master_parser): Remove, dead
18819 code.
18820 * src/output.h (get_lines_number, actions_output, guards_output)
18821 (token_definitions_output): Prototype them.
18822 * src/parse-skel.y: Add the license notice.
18823 Include output.h and skeleton.h.
18824 (process_skeleton): Returns void, and takes a single parameter.
18825 * src/scan-skel.l: Add the license notice.
18826 Include skeleton.h.
18827 Don't use %option yylineno: it seems that then Flex imagines
18828 REJECT has been used, and therefore it won't reallocate its
18829 buffers (which makes no other sense to me than a bug). It results
18830 in warnings for `unused: yy_flex_realloc'.
18831
9b3add5b
RA
188322001-12-30 Robert Anisko <robert.anisko@epita.fr>
18833
18834 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18835 (MUSCLE_INSERT_PREFIX): ...to there.
18836 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18837 (MUSCLE_INSERT_PREFIX): Move from here...
18838
18839 * src/bison.hairy: Add a section directive. Put braces around muscle
18840 names. This parser skeleton is still broken, but Bison should not
18841 choke on a bad muscle 'syntax'.
18842 * src/bison.simple: Add a section directive. Put braces around muscle
18843 names.
18844
18845 * src/files.h (strsuffix, stringappend): Add declarations.
18846 (tab_extension): Add declaration.
18847 (short_base_name): Add declaration.
18848
18849 * src/files.c (strsuffix, stringappend): No longer static. These
18850 functions are used in the skeleton parser.
18851 (tab_extension): New.
18852 (compute_base_names): Use the computations done in this function
fab5b110 18853 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
18854 names.
18855 (short_base_name): No longer static.
18856
18857 * src/output.c (output_skeleton): New.
18858 (output): Disable call to output_master_parser, and give a try to
18859 a new skeleton handling system.
18860 (guards_output, actions_output): No longer static.
18861 (token_definitions_output, get_lines_number): No longer static.
18862
18863 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18864
fab5b110 18865 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
18866 parse-skel.y.
18867
18868 * src/parse-skel.y: New file.
18869 * src/scan-skel.l: New file.
18870
b5b61c61
AD
188712001-12-29 Akim Demaille <akim@epita.fr>
18872
18873 %name-prefix is broken.
18874
18875 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18876 Adjust all dependencies.
18877 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18878 %name-prefix.
18879
18880 Renaming yylval but not yylloc is not consistent. Now we do.
18881
18882 * src/bison.simple: Prefix yylloc if used.
18883 * doc/bison.texinfo (Decl Summary): Document that.
18884
8c9a50be
AD
188852001-12-29 Akim Demaille <akim@epita.fr>
18886
18887 * doc/bison.texinfo: Promote `%long-directive' over
18888 `%long_directive'.
18889 Remove all references to fixed-output-files, yacc is enough.
18890
d99361e6
AD
188912001-12-29 Akim Demaille <akim@epita.fr>
18892
18893 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18894 user prologue. These are defaults.
18895 * tests/actions.at (Mid-rule actions): Make sure the user can
18896 define YYDEBUG and YYERROR_VERBOSE.
18897
b9cecb91
AD
188982001-12-29 Akim Demaille <akim@epita.fr>
18899
18900 * src/output.c (header_output): Don't forget to export YYLTYPE and
18901 yylloc.
18902 * tests/headers.at (export YYLTYPE): New, make sure it does.
18903 * tests/regression.at (%union and --defines, Invalid CPP headers):
18904 Move to...
18905 * tests/headers.at: here.
18906
aea13e97
AD
189072001-12-29 Akim Demaille <akim@epita.fr>
18908
18909 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18910
931394cb
AD
189112001-12-29 Akim Demaille <akim@epita.fr>
18912
18913 * tests/actions.at (Mid-rule actions): Output on a single line
18914 instead of several.
18915
704a47c4
AD
189162001-12-29 Akim Demaille <akim@epita.fr>
18917
18918 * doc/bison.texinfo: Formatting changes.
18919
091e20bb
AD
189202001-12-29 Akim Demaille <akim@epita.fr>
18921
18922 Don't store the token defs in a muscle, just be ready to output it
18923 on command. Now possible via `symbols'. Fixes a memory leak.
18924
18925 * src/output.c (token_definitions_output): New.
18926 (output_parser, header_output): Use it.
18927 * src/reader.c (symbols_save): Remove.
18928
cce71710
AD
189292001-12-29 Akim Demaille <akim@epita.fr>
18930
18931 * src/bison.simple: Do not provide a default for YYSTYPE and
18932 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18933 default.
18934
82c035a8
AD
189352001-12-29 Akim Demaille <akim@epita.fr>
18936
18937 Mid-rule actions are simply... ignored!
18938
18939 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18940 the empty-rule associated to the dummy symbol, not to the host
18941 rule.
18942 * tests/actions.at (Mid-rule actions): New.
18943
8419d367
AD
189442001-12-29 Akim Demaille <akim@epita.fr>
18945
18946 Memory leak.
18947
18948 * src/reader.c (reader): Free grammar.
18949
375d5806
AD
189502001-12-29 Akim Demaille <akim@epita.fr>
18951
18952 Memory leak.
18953
18954 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18955 since it allocates it for each state, although only one is needed.
18956 (allocate_storage): Do it here.
18957
f51cb8ff
AD
189582001-12-29 Akim Demaille <akim@epita.fr>
18959
18960 * src/options.h, src/options.c (create_long_option_table): Rename
18961 as...
18962 (long_option_table_new): this, with a clearer prototype.
18963 (percent_table): Remove, unused,
18964 * src/getargs.c (getargs): Adjust.
18965
29e88316
AD
189662001-12-29 Akim Demaille <akim@epita.fr>
18967
18968 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18969 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18970 as states.
18971
b9f71f19
AD
189722001-12-29 Akim Demaille <akim@epita.fr>
18973
18974 * src/lalr.c (build_relations): Rename `states' as `states1'.
18975 Sorry, I don't understand exactly what it is, no better name...
18976
1a2b5d37
AD
189772001-12-29 Akim Demaille <akim@epita.fr>
18978
18979 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18980 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18981 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18982 as rules.
18983
1cca533e
AD
189842001-12-29 Akim Demaille <akim@epita.fr>
18985
18986 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18987 ago.
18988
c03ae966
AD
189892001-12-29 Akim Demaille <akim@epita.fr>
18990
18991 * src/reader.c, src/reader.h (user_toknums): Remove.
18992 Adjust all users to use symbols[i]->user_token_number.
18993
5a670b1e
AD
189942001-12-29 Akim Demaille <akim@epita.fr>
18995
18996 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18997 Adjust all users to use symbols[i]->prec or ->assoc.
18998
ad949da9
AD
189992001-12-29 Akim Demaille <akim@epita.fr>
19000
19001 * src/reader.c, src/reader.h (tags): Remove.
19002 Adjust all users to use symbols[i]->tag.
19003
0e78e603
AD
190042001-12-29 Akim Demaille <akim@epita.fr>
19005
19006 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19007 and rule_table.
19008 * src/reader.c (packsymbols): Fill this table.
19009 Drop sprec.
19010 * src/conflicts.c (resolve_sr_conflict): Adjust.
19011 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
19012 single table.
19013 Use symbols[i]->tag instead of tags[i].
19014
213e640e
AD
190152001-12-29 Akim Demaille <akim@epita.fr>
19016
19017 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
19018 In addition, put a comment in there, to replace...
19019 * tests/regression.at (%union and C comments): Remove.
19020
e7b8bef1
AD
190212001-12-29 Akim Demaille <akim@epita.fr>
19022
19023 * tests/regression.at (Web2c Actions): Blindly move the actual
19024 output as expected output. The contents *seem* right to me, but I
19025 can't pretend reading perfectly parser tables... Nonetheless, all
19026 the other tests pass correctly, the table look OK, even though the
19027 presence of `$axiom' is to be noted: AFAICS it is useless (but
19028 harmless).
19029
b68e7744
AD
190302001-12-29 Akim Demaille <akim@epita.fr>
19031
19032 * src/reader.c (readgram): Don't add the rule 0 if there were no
19033 rules read. In other words, add it _after_ having performed
19034 grammar sanity checks.
19035 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
19036
78d5bae9
AD
190372001-12-29 Akim Demaille <akim@epita.fr>
19038
19039 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
19040 visible, and some states have now a different number.
19041
ff442794
AD
190422001-12-29 Akim Demaille <akim@epita.fr>
19043
19044 * src/reader.c (readgram): Bind the initial rule's lineno to that
19045 of the first rule.
19046 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
19047 (Solved SR Conflicts): Adjust rule 0's line number.
19048
610ab194
AD
190492001-12-29 Akim Demaille <akim@epita.fr>
19050
19051 Fix the `GAWK Grammar' failure.
19052
19053 * src/LR0.c (final_state): Initialize to -1 so that we do compute
19054 the reductions of the first state which was mistakenly confused
19055 with the final state because precisely final_state was initialized
19056 to 0.
19057 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
19058 now noticed by Bison.
19059 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
19060 have a reduction on $default.
19061
29d29c8f
AD
190622001-12-29 Akim Demaille <akim@epita.fr>
19063
19064 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
19065 rule line numbers.
19066 * src/closure.c (print_closure): Likewise.
19067 * src/derives.c (print_derives): Likewise.
19068 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
19069 now.
19070
7c6b64d0
AD
190712001-12-29 Akim Demaille <akim@epita.fr>
19072
19073 * src/lalr.c (lookaheads_print): New.
19074 (lalr): Call it when --trace-flag.
19075 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
19076 are dumped.
19077
3d4daee3
AD
190782001-12-29 Akim Demaille <akim@epita.fr>
19079
19080 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
19081 when walking through ritem, even via rule->rhs.
19082 * src/reduce.c (dump_grammar, useful_production, reduce_output)
19083 (useful_production, useless_nonterminals): Likewise.
19084 (reduce_grammar_tables): Likewise, plus update nritems.
19085 * src/nullable.c (set_nullable): Likewise.
19086 * src/lalr.c (build_relations): Likewise.
19087 * tests/sets.at (Nullable): Adjust.
19088 Fortunately, now, the $axiom is no longer nullable.
19089
9e7f6bbd
AD
190902001-12-29 Akim Demaille <akim@epita.fr>
19091
19092 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
19093 the 0-sentinel.
19094 * src/gram.c (ritem_longest_rhs): Likewise.
19095 * src/reduce.c (nonterminals_reduce): Likewise.
19096 * src/print_graph.c (print_graph): Likewise.
19097 * src/output.c (output_rule_data): Likewise.
19098 * src/nullable.c (set_nullable): Likewise.
19099
255ef638
AD
191002001-12-29 Akim Demaille <akim@epita.fr>
19101
19102 * src/output.c: Comment changes.
19103
0d8a7363
AD
191042001-12-27 Paul Eggert <eggert@twinsun.com>
19105
19106 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
19107 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
19108 Sparc, as they were causing more porting problems than the
19109 (minor) performance improvement was worth.
19110
19111 Also, catch up with 1.31's YYSTD.
19112
3db472b9
AD
191132001-12-27 Akim Demaille <akim@epita.fr>
19114
19115 * src/output.c (output_gram): Rely on nritems, not the
19116 0-sentinel. See below.
19117 Use -1 as separator, not 0.
19118 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
19119 Rely on -1 as separator in yyrhs, instead of 0.
19120 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
19121 twice `Now at end of input', therefore there are two lines less to
19122 expect.
19123
b365aa05
AD
191242001-12-27 Akim Demaille <akim@epita.fr>
19125
19126 * tests/regression.at (Unresolved SR Conflicts):
19127 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
19128 below.
19129
30171f79
AD
191302001-12-27 Akim Demaille <akim@epita.fr>
19131
19132 * src/LR0.c (new_state): Recognize the final state by the fact it
19133 is reached by eoftoken.
19134 (insert_start_shifting_state, insert_eof_shifting_state)
19135 (insert_accepting_state, augment_automaton): Remove, since now
19136 these states are automatically computed from the initial state.
19137 (generate_states): Adjust.
19138 * src/print.c: When reporting a rule number to the user, substract
19139 1, so that the axiom rule is rule 0, and the first user rule is 1.
19140 * src/reduce.c: Likewise.
19141 * src/print_graph.c (print_core): For the time being, just as for
19142 the report, depend upon --trace-flags to dump the full set of
19143 items.
19144 * src/reader.c (readgram): Once the grammar read, insert the rule
19145 0: `$axiom: START-SYMBOL $'.
19146 * tests/set.at: Adjust: rule 0 is now displayed, and since the
19147 number of the states has changed (the final state is no longer
19148 necessarily the last), catch up.
19149
75142d45
AD
191502001-12-27 Akim Demaille <akim@epita.fr>
19151
19152 Try to make the use of the eoftoken valid. Given that its value
19153 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
19154 is used instead of > 0 where appropriate, (ii), depend upon nritems
19155 instead of the 0-sentinel.
19156
19157 * src/gram.h, src/gram.c (nritems): New.
19158 Expected to be duplication of nitems, but for the time being...
19159 * src/reader.c (packgram): Assert nritems and nitems are equal.
19160 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
19161 * src/closure.c (print_closure, print_fderives): Likewise.
19162 * src/gram.c (ritem_print): Likewise.
19163 * src/print.c (print_core, print_grammar): Likewise.
19164 * src/print_graph.c: Likewise.
19165
b7c49edf
AD
191662001-12-27 Akim Demaille <akim@epita.fr>
19167
19168 * src/main.c (main): If there are complains after grammar
19169 reductions, then output the report anyway if requested, then die.
19170 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
19171 * src/reader.c (eoftoken): New.
19172 (parse_token_decl): If the token being defined has value `0', it
19173 is the eoftoken.
19174 (packsymbols): No longer hack `tags' to insert `$' by hand.
19175 Be sure to preserve the value of the eoftoken.
19176 (reader): Make sure eoftoken is defined.
19177 Initialize nsyms to 0: now eoftoken is created just like the others.
19178 * src/print.c (print_grammar): Don't special case the eof token.
19179 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
19180 lie anyway, albeit pleasant.
19181 * tests/calc.at: Exercise error messages with eoftoken.
19182 Change the grammar so that empty input is invalid.
19183 Adjust expectations.
19184 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
19185
ec2da99f
AD
191862001-12-27 Akim Demaille <akim@epita.fr>
19187
19188 * configure.in: Check the protos of strchr ans strspn.
19189 Replace strchr if needed.
19190 * src/system.h: Provide the protos of strchr, strspn and memchr if
19191 missing.
19192 * lib/strchr.c: New.
19193 * src/reader.c (symbols_save): Use strchr.
19194
8adfa272
AD
191952001-12-27 Akim Demaille <akim@epita.fr>
19196
19197 * src/print.c, src/print_graph.c (escape): New.
19198 Use it to quote the TAGS outputs.
19199 * src/print_graph.c (print_state): Now errors are in red, and
19200 reductions in green.
19201 Prefer high to wide: output the state number on a line of its own.
19202
80dac38c
AD
192032001-12-27 Akim Demaille <akim@epita.fr>
19204
19205 * src/state.h, src/state.c (reductions_new): New.
19206 * src/LR0.c (set_state_table): Let all the states have a
19207 `reductions', even if reduced to 0.
19208 (save_reductions): Adjust.
19209 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19210 * src/print.c (print_reductions, print_actions): Adjust.
19211 * src/output.c (action_row): Adjust.
19212
2cec70b9
AD
192132001-12-27 Akim Demaille <akim@epita.fr>
19214
19215 * src/state.h, src/state.c (errs_new, errs_dup): New.
19216 * src/LR0.c (set_state_table): Let all the states have an errs,
19217 even if reduced to 0.
19218 * src/print.c (print_errs, print_reductions): Adjust.
19219 * src/output.c (output_actions, action_row): Adjust.
19220 * src/conflicts.c (resolve_sr_conflict): Adjust.
19221
13ca549a
AD
192222001-12-27 Akim Demaille <akim@epita.fr>
19223
19224 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19225
5092aba5
AD
192262001-12-27 Akim Demaille <akim@epita.fr>
19227
19228 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19229 * src/print.c: here.
19230 (lookaheadset, shiftset): New, used as additional storage by
19231 print_reductions.
19232 (print_results): Adjust.
19233 (print_shifts, print_gotos, print_errs): New, extracted from...
19234 (print_actions): here.
19235 * src/print_graph.c (print_actions): Remove dead code.
19236
11e2beca
AD
192372001-12-27 Akim Demaille <akim@epita.fr>
19238
19239 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19240 `$n' and `@n'.
19241
dac3c910
AD
192422001-12-27 Akim Demaille <akim@epita.fr>
19243
19244 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19245 (build_relations): Adjust.
19246
d0b0fefa
AD
192472001-12-27 Akim Demaille <akim@epita.fr>
19248
19249 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19250 duplication.
19251
adc8c848
AD
192522001-12-27 Akim Demaille <akim@epita.fr>
19253
19254 * src/reader.c (packgram): Catch nitems overflows.
19255
14d293ac
AD
192562001-12-27 Akim Demaille <akim@epita.fr>
19257
19258 * src/files.c, src/files.h (guard_obstack): Remove.
19259 * src/output.c (output): Adjust.
19260 * src/reader.c (parse_braces): New, factoring...
19261 (copy_action, copy_guard): these two which are renamed as...
19262 (parse_action, parse_guard): these.
19263 As a voluntary consequence, using braces around guards is now
19264 mandatory.
19265
f499b062
AD
192662001-12-27 Akim Demaille <akim@epita.fr>
19267
19268 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19269 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19270 members.
19271 (symbol_list_new): Adjust.
19272 (copy_action): action_line is the first line, not the last.
19273 (copy_guard): Just as for actions, store the `action' only, not
19274 the switch/case/break flesh.
19275 Don't parse the user action that might follow the guard, let...
19276 (readgram): do it, i.e., now, there can be an action after a
19277 guard.
19278 In other words the guard is just explicitly optional.
19279 (packgram): Adjust.
19280 * src/output.c (guards_output): New.
19281 (output_parser): Call it when needed.
19282 (output): Also free the guard and attrs obstacks.
19283 * src/files.c, src/files.h (obstack_save): Remove.
19284 (output_files): Remove.
19285 As a result, if one needs the former `.act' file, using an
19286 appropriate skeleton which requires actions and guards is now
19287 required.
19288 * src/main.c (main): Adjust.
19289 * tests/semantic.at: New.
19290 * tests/regression.at: Use `input.y' as input file name.
19291 Avoid 8+3 problems by requiring input.c when the test needs the
19292 parser.
19293
d945f5cd
AD
192942001-12-27 Akim Demaille <akim@epita.fr>
19295
19296 * src/reader.c (symbol_list_new): Be sure to initialize all the
19297 fields.
19298
d200e455
AD
192992001-12-27 Akim Demaille <akim@epita.fr>
19300
19301 All the hacks using a final pseudo state are now useless.
19302
19303 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19304 * src/lalr.c (nLA): New.
19305 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19306 instead of lookaheadsp from the pseudo state (nstate + 1).
19307
f9507c28
AD
193082001-12-27 Akim Demaille <akim@epita.fr>
19309
19310 * src/output.c (action_row, token_actions): Use a state_t instead
19311 of a integer, and nlookaheads instead of the following state's
19312 lookaheadsp.
19313
065fbd27
AD
193142001-12-27 Akim Demaille <akim@epita.fr>
19315
19316 * src/conflicts.c (log_resolution, flush_shift)
19317 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19318 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19319 (conflicts_print, print_reductions): Use a state_t instead of an
19320 integer when referring to a state.
19321 As much as possible, depend upon nlookaheads, instead of the
19322 `lookaheadsp' member of the following state (since lookaheads of
19323 successive states are successive, the difference between state n + 1
19324 and n served as the number of lookaheads for state n).
19325 * src/lalr.c (add_lookback_edge): Likewise.
19326 * src/print.c (print_core, print_actions, print_state)
19327 (print_results): Likewise.
19328 * src/print_graph.c (print_core, print_actions, print_state)
19329 (print_graph): Likewise.
19330 * src/conflicts.h: Adjust.
19331
1b177bd7
AD
193322001-12-27 Akim Demaille <akim@epita.fr>
19333
19334 * src/bison.hairy: Formatting/comment changes.
19335 ANSIfy.
19336 Remove `register' indications.
19337 Add plenty of `static'.
19338
7742ddeb
AD
193392001-12-27 Akim Demaille <akim@epita.fr>
19340
19341 * src/output.c (prepare): Drop the muscle `ntbase' which
19342 duplicates ntokens.
19343 * src/bison.simple: Formatting/comment changes.
19344 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19345 is an undocumented synonym.
19346
1fa14068
AD
193472001-12-22 Akim Demaille <akim@epita.fr>
19348
19349 * src/output.c (output_table_data): Change the prototype to use
19350 `int' for array ranges: some invocations do pass an int, not a
19351 short.
19352 Reported by Wayne Green.
19353
b9752825
AD
193542001-12-22 Akim Demaille <akim@epita.fr>
19355
19356 Some actions of web2c.y are improperly triggered.
19357 Reported by Mike Castle.
19358
19359 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19360 * tests/regression.at (Web2c): Rename as...
19361 (Web2c Report): this.
19362 (Web2c Actions): New.
19363
776209d6
AD
193642001-12-22 Akim Demaille <akim@epita.fr>
19365
19366 Reductions in web2c.y are improperly reported.
19367 Reported by Mike Castle.
19368
19369 * src/conflicts.c (print_reductions): Fix.
19370 * tests/regression.at (Web2c): New.
19371
275fc3ad
AD
193722001-12-18 Akim Demaille <akim@epita.fr>
19373
19374 Some host fail on `assert (!"foo")', which expands to
19375 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19376 Reported by Nelson Beebee.
19377
19378 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19379 `#define it_succeeded 0' and `assert (it_succeeded)'.
19380
897668ee
MA
193812001-12-17 Marc Autret <autret_m@epita.fr>
19382
19383 * src/bison.simple: Don't hard code the skeleton line and filename.
19384 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19385 New line counter 'skeleton_line' (skeleton-line muscle).
19386
ab3399e0
PE
193872001-12-17 Paul Eggert <eggert@twinsun.com>
19388
19389 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19390 YYDEBUG must be defined to a nonzero value.
19391
19392 * src/bison.simple (yytname): Do not assume that the user defines
19393 YYDEBUG to a properly parenthesized expression.
19394
3877f72b
AD
193952001-12-17 Akim Demaille <akim@epita.fr>
19396
19397 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19398 nlookaheads is a new member.
19399 Adjust all users.
19400 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19401 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19402 state.
776209d6 19403
331dbc1b
AD
194042001-12-17 Akim Demaille <akim@epita.fr>
19405
19406 * src/files.h, src/files.c (open_files, close_files): Remove.
19407 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19408 let...
19409 * src/reader.c (reader): Do it.
776209d6 19410
be750e4c
AD
194112001-12-17 Akim Demaille <akim@epita.fr>
19412
19413 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 19414
709ae8c6
AD
194152001-12-17 Akim Demaille <akim@epita.fr>
19416
19417 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19418 (flush_reduce): New.
19419 (resolve_sr_conflict): Adjust.
776209d6 19420
f87685c3
AD
194212001-12-17 Akim Demaille <akim@epita.fr>
19422
19423 * src/output.c (output_obstack): Be static and rename as...
19424 (format_obstack): this, to avoid any confusion with files.c's
19425 output_obstack.
19426 * src/reader.h (muscle_obstack): Move to...
19427 * src/output.h: here, since it's defined in output.c.
19428
837491d8
AD
194292001-12-17 Akim Demaille <akim@epita.fr>
19430
19431 * src/output.c (action_row, save_column, default_goto)
19432 (sort_actions, matching_state, pack_vector): Better variable
19433 locality.
19434
796d61fb
AD
194352001-12-17 Akim Demaille <akim@epita.fr>
19436
19437 * src/output.c: Various formatting changes.
776209d6 19438
64d15509
AD
194392001-12-17 Akim Demaille <akim@epita.fr>
19440
19441 * src/files.c (output_files): Free the output_obstack.
19442 * src/main.c (main): Call print and print_graph conditionally.
19443 * src/print.c (print): Work unconditionally.
19444 * src/print_graph.c (print_graph): Work unconditionally.
19445 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19446
fbc8ecb7
MA
194472001-12-16 Marc Autret <autret_m@epita.fr>
19448
19449 * src/output.c (actions_output): Fix. When we use %no-lines,
19450 there is one less line per action.
19451
f0440388
MA
194522001-12-16 Marc Autret <autret_m@epita.fr>
19453
19454 * src/bison.simple: Remove a useless #line directive.
19455 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19456 * src/output.c (get_lines_number): New.
776209d6 19457 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
19458 output muscles.
19459 Fix line numbering.
19460 (actions_output): Computes the number of lines taken by actions.
19461 (output_master_parser): Insert new skeleton which is the name of
19462 the output parser file name.
19463
a79986b8
MA
194642001-12-15 Marc Autret <autret_m@epita.fr>
19465
19466 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19467
4ec8e00f
MA
194682001-12-15 Marc Autret <autret_m@epita.fr>
19469
19470 * src/output.c (output_gram): Keep track of the hairy one.
19471
1a4648ff
AD
194722001-12-15 Akim Demaille <akim@epita.fr>
19473
19474 Make `make distcheck' work.
19475
19476 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19477 system.h which uses libgettext.h.
19478
9c2c67e6
AD
194792001-12-15 Akim Demaille <akim@epita.fr>
19480
19481 * src/nullable.c (set_nullable): Useless rules must be skipped,
19482 otherwise, since we range over their symbols, we might look at a
19483 nonterminal which no longer ``exists'', i.e., it is not counted in
19484 `nvars', hence we overflow our arrays.
19485
93ede233
AD
194862001-12-15 Akim Demaille <akim@epita.fr>
19487
19488 The header can also be produced directly, without any obstack!
19489 Yahoo!
19490
19491 * src/files.c, src/files.h (defines_obstack): Remove.
19492 (compute_header_macro): Global.
19493 (defines_obstack_save): Remove.
19494 * src/reader.c (parse_union_decl): No longer output to
19495 defines_obstack: its content can be found in the `stype' muscle
19496 anyway.
19497 (output_token_translations): Merge into...
19498 (symbols_output): this.
19499 Rename as...
19500 (symbols_save): this.
19501 (reader): Adjust.
19502 * src/output.c (header_output): New.
19503 (output): Call it.
19504
2666f928
AD
195052001-12-15 Akim Demaille <akim@epita.fr>
19506
19507 * src/reader.c (parse_union_decl): Instead of handling two obstack
19508 simultaneously, use one to define the `stype' muscle, and use the
19509 value of the latter to fill defines_obstack.
19510 (copy_comment): Remove.
19511 (copy_comment2): Work for a single obstack.
19512 Rename as...
19513 (copy_comment): this.
19514
428046f8
AD
195152001-12-15 Akim Demaille <akim@epita.fr>
19516
19517 * src/lex.c, src/lex.h (xgetc): No longer static.
19518 * src/reader.c (parse_union_decl): Revamp.
19519
ea52d706
AD
195202001-12-15 Akim Demaille <akim@epita.fr>
19521
19522 Still making progress in separating Bison into (i) input, (ii)
19523 process, (iii) output: now we can directly output the parser file
19524 without using table_obstack at all.
19525
19526 * src/files.c, src/files.h (table_obstack): Bye bye.
19527 (parser_file_name): New.
19528 * src/files.c (compute_output_file_names): Compute it.
19529 * src/output.c (actions_output, output_parser)
19530 (output_master_parser): To a file instead of an obstack.
19531
3f96f4dc
AD
195322001-12-15 Akim Demaille <akim@epita.fr>
19533
19534 Attach actions to rules, instead of pre-outputting them to
19535 actions_obstack.
19536
19537 * src/gram.h (rule_t): action and action_line are new members.
19538 * src/reader.c (symbol_list): Likewise.
19539 (copy_action): Save the actions within the rule.
19540 (packgram): Save them in rule_table.
19541 * src/output.c (actions_output): New.
19542 (output_parser): Use it on `%%actions'.
19543 (output_rule_data): Don't free rule_table.
19544 (output): Do it.
19545 (prepare): Don't save the `action' muscle.
19546 * src/bison.simple: s/%%action/%%actions/.
19547
51576fb3
AD
195482001-12-15 Akim Demaille <akim@epita.fr>
19549
19550 * src/reader.c (copy_action): When --yacc, don't append a `;'
19551 to the user action: let it fail if lacking.
dee049eb 19552 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 19553
2648a72d
AD
195542001-12-14 Akim Demaille <akim@epita.fr>
19555
19556 * src/lex.c (literalchar): Simply return the char you decoded, non
19557 longer mess around with obstacks and int pointers.
19558 Adjust all callers.
19559
92790e5b
AD
195602001-12-14 Akim Demaille <akim@epita.fr>
19561
19562 * src/lex.c (literalchar): Don't escape the special characters,
19563 just decode them, and keep them as char (before, eol was output as
19564 the 2 char string `\n' etc.).
19565 * src/output.c (output_rule_data): Use quotearg to output the
19566 token strings.
19567
927c1557
PE
195682001-12-13 Paul Eggert <eggert@twinsun.com>
19569
19570 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
19571 Do not infringe on the global user namespace when using C++.
19572 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
19573 All uses of `fprintf' and `stderr' changed.
19574
19575 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
19576
ed8e1f68
AD
195772001-12-13 Akim Demaille <akim@epita.fr>
19578
19579 The computation of nullable is broken: it doesn't handle empty
19580 RHS's properly.
19581
19582 * tests/torture.at (GNU AWK Grammar): New.
19583 * tests/sets.at (Nullable): New.
19584 * src/nullable.c (set_nullable): Instead of blindly looping over
19585 `ritems', loop over the rules, and then over their rhs's.
19586
19587 Work around Autotest bugs.
19588
19589 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
19590 frame, because Autotest understand lines starting with a `+' as
19591 traces from the shell. Then, they are not processed properly.
19592 Admittedly an Autotest bug, but we don't have time to wait for
19593 Autotest to catch up.
19594 * tests/regression.at (Broken Closure): Adjust to the new table
19595 frames.
19596 Move to...
19597 * tests/sets.at: here.
19598
cb581495
AD
195992001-12-13 Akim Demaille <akim@epita.fr>
19600
19601 * src/closure.c (closure): Use nrules instead of playing tricks
19602 with BITS_PER_WORD.
19603
2e729273
AD
196042001-12-13 Akim Demaille <akim@epita.fr>
19605
19606 * src/print.c (print_actions): Output the handling of `$' as the
19607 traces do: shifting the token EOF. Before EOF was treated as a
19608 nonterminal.
19609 * tests/regression.at: Adjust some tests.
19610 * src/print_graph.c (print_core): Complete the set of items via
19611 closure. The next-to-final and final states are still unsatisfying,
19612 but that's to be addressed elsewhere.
19613 No longer output the rule numbers, but do output the state number.
19614 A single loop for the shifts + gotos is enough, but picked a
19615 distinct color for each.
19616 (print_graph): Initialize and finalize closure.
19617
107f7dfb
AD
196182001-12-13 Akim Demaille <akim@epita.fr>
19619
19620 * src/reader.c (readgram): Remove dead code, an strip useless
19621 braces.
19622 (get_type): Remove, unused.
19623
9b53a24f
AD
196242001-12-12 Akim Demaille <akim@epita.fr>
19625
19626 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19627 on that of lib/error.c.
19628
dbfb6dcd
AD
196292001-12-12 Akim Demaille <akim@epita.fr>
19630
19631 Some hosts don't like `/' in includes.
19632
19633 * src/system.h: Include libgettext.h without qualifying the path.
19634 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19635 $(top_srcdir).
19636
c25fb648
MA
196372001-12-11 Marc Autret <autret_m@epita.fr>
19638
19639 * src/output.c (output_parser): Remove useless muscle.
19640
710ddc4f
MA
196412001-12-11 Marc Autret <autret_m@epita.fr>
19642
19643 * src/bison.simple: Remove #line just before %%epilogue. It
19644 is now handled in ...
19645 * src/reader.c (read_additionnal_code): Add the output of a
19646 #line for the epilogue.
19647
e83d80b8
MA
196482001-12-10 Marc Autret <autret_m@epita.fr>
19649
927c1557 19650 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
19651 replace precedent remove.
19652 * src/bison.simple: Remove #line before %%prologue because
19653 %%input-line is wrong at this time.
19654
971d5158
MA
196552001-12-10 Marc Autret <autret_m@epita.fr>
19656
19657 * src/reader.c (symbols_output): Clean up.
927c1557 19658 * src/output.c (output_gram, output): Clean up.
971d5158 19659
5edafffd
AD
196602001-12-10 Akim Demaille <akim@epita.fr>
19661
19662 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19663 * src/LR0.c (set_state_table): here.
19664 * src/lalr.c (lalr): Call it.
19665
0279f8e9
AD
196662001-12-10 Akim Demaille <akim@epita.fr>
19667
19668 * src/state.h (shifts): Remove the `number' member: shifts are
19669 attached to state, hence no longer need to be labelled with a
19670 state number.
19671
190c4f5f
AD
196722001-12-10 Akim Demaille <akim@epita.fr>
19673
19674 Now that states have a complete set of members, the linked list of
19675 shifts is useless: just fill directly the state's shifts member.
19676
19677 * src/state.h (shifts): Remove the `next' member.
19678 * src/LR0.c (first_state, last_state): Remove.
19679 Adjust the callers.
19680 (augment_automaton): Don't look for the shifts that must be added
19681 a shift on EOF: it is those of the state we looked for! But now,
19682 since shifts are attached, it is no longer needed to looking
19683 merely by its id: its number.
19684
2a73b93d
AD
196852001-12-10 Akim Demaille <akim@epita.fr>
19686
19687 * src/LR0.c (augment_automaton): Better variable locality.
19688 Remove an impossible branch: if there is a state corresponding to
19689 the start symbol being shifted, then there is shift for the start
19690 symbol from the initial state.
19691
74392f6a
AD
196922001-12-10 Akim Demaille <akim@epita.fr>
19693
19694 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19695 only when appropriate: when insert_start_shifting_state' is not
19696 invoked.
19697 * tests/regression.at (Rule Line Numbers): Adjust.
19698
37c82725
AD
196992001-12-10 Akim Demaille <akim@epita.fr>
19700
19701 * src/LR0.c (augment_automaton): Now that all states have shifts,
19702 merge the two cases addition shifts to the initial state.
19703
6a164e0c
AD
197042001-12-10 Akim Demaille <akim@epita.fr>
19705
19706 * src/lalr.c (set_state_table): Move to...
19707 * src/LR0.c: here.
19708 * src/lalr.c (lalr): Don't call it...
19709 * src/LR0.c (generate_states): do it.
19710 * src/LR0.h (first_state): Remove, only the table is used.
19711
7215de24
AD
197122001-12-10 Akim Demaille <akim@epita.fr>
19713
19714 * src/LR0.h (first_shift, first_reduction): Remove.
19715 * src/lalr.c: Don't use first_shift: find shifts through the
19716 states.
19717
80e25d4d
AD
197182001-12-10 Akim Demaille <akim@epita.fr>
19719
19720 * src/LR0.c: Attach shifts to states as soon as they are
19721 computed.
19722 * src/lalr.c (set_state_table): Instead of assigning shifts to
19723 state, just assert that the mapping was properly done.
19724
0ab3728b
AD
197252001-12-10 Akim Demaille <akim@epita.fr>
19726
19727 * src/LR0.c (insert_start_shift): Rename as...
19728 (insert_start_shifting_state): this.
19729 (insert_eof_shifting_state, insert_accepting_state): New.
19730 (augment_automaton): Adjust.
19731 Better locality of the variables.
19732 When looking if the start_symbol is shifted from the initial
19733 state, using `while (... symbol != start_symbol ...)' sounds
19734 better than `while (... symbol < start_symbol ...)': If fail
19735 to see how the order between symbols could be relevant!
19736
78af9bbc
AD
197372001-12-10 Akim Demaille <akim@epita.fr>
19738
19739 * src/getargs.h: Don't declare `spec_name_prefix' and
19740 `spec_file_prefix', declared by src/files.h.
19741 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19742 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19743 * src/output.c (prepare): Adjust.
19744 * src/reader.c (symbols_output): Likewise.
19745 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19746
bdef2a41
AD
197472001-12-10 Akim Demaille <akim@epita.fr>
19748
19749 * src/muscle_tab.c (muscle_init): NULL is a better default than
19750 `"0"'.
19751
3735969c
AD
197522001-12-10 Akim Demaille <akim@epita.fr>
19753
19754 * src/reader.c (reader): Calling symbols_output once is enough.
19755
49701457
AD
197562001-12-10 Akim Demaille <akim@epita.fr>
19757
19758 Now that states have a complete set of members, the linked list of
19759 reductions is useless: just fill directly the state's reductions
19760 member.
19761
19762 * src/state.h (struct reductions): Remove member `number' and
19763 `next'.
19764 * src/LR0.c (first_reduction, last_reduction): Remove.
19765 (save_reductions): Don't link the new reductions, store them in
19766 this_state.
19767 * src/lalr.c (set_state_table): No need to attach reductions to
19768 states, it's already done.
19769 * src/output.c (output_actions): No longer free the shifts, then
19770 the reductions, then the states: free all the states and their
19771 members.
19772
0edad749
AD
197732001-12-10 Akim Demaille <akim@epita.fr>
19774
19775 * src/options.c (OPTN, DRTV, BOTH): New.
19776 (option_table): Use them.
19777
0edad749
AD
19778 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19779 the job of system.h.
19780 * src/options.c: Don't include stdio.h and xalloc.h for the same
19781 reasons.
19782
5449dd0f
AD
197832001-12-10 Akim Demaille <akim@epita.fr>
19784
19785 * src/output.c (output, prepare): Make sure the values of the
19786 muscles `action' and `prologue' are 0-terminated.
19787
a870c567
AD
197882001-12-10 Akim Demaille <akim@epita.fr>
19789
19790 Clean up GCC warnings.
19791
19792 * src/reader.c (copy_action): `buf' is not used.
19793 (parse_skel_decl): Be static.
19794 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19795 * src/options.h (create_long_option_table): Have a real prototype.
19796 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19797 (hash_delete_at): Return const void *.
19798 Adjust casts to preserve the const.
19799
80df8768
AD
198002001-12-10 Akim Demaille <akim@epita.fr>
19801
19802 * configure.in: Require 2.52g.
19803 M4 is not needed, but AUTOM4TE is.
19804 * m4/m4.m4: Remove.
19805 * tests/Makefile.am: Adjust.
19806
f693ad14
AD
198072001-12-10 Akim Demaille <akim@epita.fr>
19808
19809 One structure for states is enough, even though theoretically
19810 there are LR(0) states and LALR(1) states.
19811
19812 * src/lalr.h (state_t): Remove.
19813 (state_table): Be state_t **, not state_t *.
19814 * src/state.h (core, CORE_ALLOC): Rename as...
19815 (state_t, STATE_ALLOC): this.
19816 Add the LALR(1) members: shifts, reductions, errs.
19817 * src/LR0.c (state_table): Rename as...
19818 (state_hash): this, to avoid name clashes with the global
19819 `state_table'.
19820 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19821 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19822
74ffbcb6
AD
198232001-12-10 Akim Demaille <akim@epita.fr>
19824
19825 Bison dumps core on bash.y.
19826 Reported by Pascal Bart.
19827
19828 * src/warshall.c (bitmatrix_print): New.
19829 (TC): Use it.
ba0fe3c7 19830 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
19831 j must be the outer loop.
19832 * tests/regression.at (Broken Closure): New.
19833
07708e19
AD
198342001-12-05 Akim Demaille <akim@epita.fr>
19835
19836 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19837 its argument.
ba1ecc07 19838 Reported by Peter Hamorsky.
07708e19 19839
92b16366
AD
198402001-12-05 Akim Demaille <akim@epita.fr>
19841
19842 * src/conflicts.c (err_table): Remove.
19843 (resolve_sr_conflict): Adjust.
19844 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19845 Rename as...
19846 (state_t.reductions, state_t.shifts): this.
19847
076ab033
AD
198482001-12-05 Akim Demaille <akim@epita.fr>
19849
19850 * src/reduce.c (reduce_grammar_tables): No longer disable the
19851 removal of useless rules via CPP but via `if (0)', so that the
19852 compiler still check the code is valid.
19853 For instance, it should have noticed `rline' no longer exists: use
19854 the `line' member of rule_t.
19855 * src/gram.c (dummy, rline): Remove, unused.
19856
3843c413
AD
198572001-12-05 Akim Demaille <akim@epita.fr>
19858
19859 * src/output.c (pack_vector): Use assert, not berror.
19860 * src/main.c (berror): Remove, unused.
19861
43168960
AD
198622001-12-05 Akim Demaille <akim@epita.fr>
19863
19864 New experimental feature: if --verbose --trace output all the
19865 items of a state, not only its kernel.
19866
19867 * src/print.c (print_core): If `trace_flag', then invoke closure
19868 before outputting the items of the state (print_core is no longer
19869 a correct name them).
19870 (print_results): Invoke new_closure/free_closure if needed.
19871
b2872512
AD
198722001-12-05 Akim Demaille <akim@epita.fr>
19873
19874 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19875 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19876 (nitemset): for consistency with the rest of the project.
19877
23cbcc6c
AD
198782001-12-05 Akim Demaille <akim@epita.fr>
19879
19880 * src/closure.c (print_closure): Improve.
19881 (closure): Use it for printing input and output.
19882
03ec521c
AD
198832001-12-05 Akim Demaille <akim@epita.fr>
19884
19885 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19886 indexed by nonterminals.
19887
3a7456dd
AD
198882001-12-05 Akim Demaille <akim@epita.fr>
19889
19890 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19891 what it was!).
19892 * src/warshall.h: Remove accidental duplication of the content.
19893
1cbcf2e7
AD
198942001-12-05 Akim Demaille <akim@epita.fr>
19895
19896 * src/closure.c (set_fderives): De-obfuscate.
19897
84182270
AD
198982001-12-05 Akim Demaille <akim@epita.fr>
19899
19900 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19901
3f6f053c
AD
199022001-12-05 Akim Demaille <akim@epita.fr>
19903
19904 * src/closure.c (set_firsts): De-obfuscate.
19905
7a5350ba
AD
199062001-12-05 Akim Demaille <akim@epita.fr>
19907
19908 * src/output.c (action_row): De-obfuscate
19909 using the good o' techniques: arrays not pointers, variable
19910 locality, BITISSET, RESETBIT etc.
19911
d954473d
AD
199122001-12-05 Akim Demaille <akim@epita.fr>
19913
19914 Pessimize the code to simplify it: from now on, all the states
19915 have a valid SHIFTS, which NSHIFTS is possibly 0.
19916
19917 * src/LR0.c (shifts_new): Be global and move to..
19918 * src/state.c, src/state.h: here.
19919 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19920 * src/print_graph: Adjust.
19921
9839bbe5
AD
199222001-12-05 Akim Demaille <akim@epita.fr>
19923
19924 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19925 * src/conflicts.c: Use it.
19926 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19927 incorrectly ``simplified''.
19928
9f136c07
AD
199292001-12-05 Akim Demaille <akim@epita.fr>
19930
19931 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19932 using the good o' techniques: arrays not pointers, variable
19933 locality, BITISSET, RESETBIT etc.
19934
b608206e
AD
199352001-12-05 Akim Demaille <akim@epita.fr>
19936
19937 * src/state.h (SHIFT_SYMBOL): New.
19938 * src/conflicts.c: Use it to deobfuscate.
19939
52afa962
AD
199402001-12-05 Akim Demaille <akim@epita.fr>
19941
19942 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19943 (print_reductions): De-obfuscate using the good o' techniques:
19944 arrays not pointers, variable locality, BITISSET.
19945
e74dc321
AD
199462001-12-05 Akim Demaille <akim@epita.fr>
19947
19948 * src/conflicts.c (print_reductions): Arrays, not pointers.
19949 Use BITISSET.
19950
768fca83
AD
199512001-12-05 Akim Demaille <akim@epita.fr>
19952
19953 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19954
a17e599f
AD
199552001-12-05 Akim Demaille <akim@epita.fr>
19956
19957 * src/conflicts.c (print_reductions): Improve variable locality.
19958
a04bc341
AD
199592001-12-05 Akim Demaille <akim@epita.fr>
19960
19961 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19962
c8ea038e
AD
199632001-12-05 Akim Demaille <akim@epita.fr>
19964
19965 * src/conflicts.c (print_reductions): Improve variable locality.
19966
aa2aab3c
AD
199672001-12-05 Akim Demaille <akim@epita.fr>
19968
19969 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19970 * src/lalr.c: Use them.
19971
b178c8cc
AD
199722001-12-05 Akim Demaille <akim@epita.fr>
19973
19974 * src/LR0.c (augment_automaton): Formatting changes.
19975 Better variable locality.
19976
f67d13aa
AD
199772001-12-05 Akim Demaille <akim@epita.fr>
19978
19979 * src/lalr.c (matrix_print): New.
19980 (transpose): Use it.
19981 Use arrays instead of pointers.
19982
c2713865
AD
199832001-12-05 Akim Demaille <akim@epita.fr>
19984
19985 * src/lalr.c (maxrhs): Move to...
19986 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19987 * src/lalr.c (build_relations): Adjust.
19988
9887c18a
AD
199892001-12-05 Akim Demaille <akim@epita.fr>
19990
19991 * src/lalr.c (transpose): Free the memory allocated to the
19992 argument, as it is replaced by the results by the unique caller.
19993 (build_relations): Merely invoke transpose: it handles the memory
19994 deallocation.
19995 Improve variable locality.
19996 Avoid variables used as mere abbreviations.
19997 (compute_lookaheads): Use arrays instead of pointers.
19998
4d4f699c
AD
199992001-12-05 Akim Demaille <akim@epita.fr>
20000
20001 * src/lalr.c (initialize_F): Improve variable locality.
20002 Avoid variables used as mere abbreviations.
20003
80a69750
AD
200042001-12-05 Akim Demaille <akim@epita.fr>
20005
20006 * src/derives.c (print_derives): Display the ruleno.
20007 * src/lalr.c (initialize_F, transpose): Better variable locality
20008 to improve readability.
20009 Avoid variables used as mere abbreviations.
20010
fe961097
AD
200112001-12-05 Akim Demaille <akim@epita.fr>
20012
20013 * src/lalr.c (traverse): Use arrays instead of pointers.
20014
e3e4e814
AD
200152001-12-05 Akim Demaille <akim@epita.fr>
20016
20017 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
20018 the handling of squeue.
20019 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20020
630e182b
AD
200212001-12-05 Akim Demaille <akim@epita.fr>
20022
20023 Because useless nonterminals are now kept alive (instead of being
20024 `destroyed'), we now sometimes examine them, and store information
20025 related to them. Hence we need to know their number, and adjust
20026 memory allocations.
20027
20028 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
20029 static.
20030 * src/LR0.c (allocate_itemsets): The memory allocated to
20031 `symbol_count' was used for two different purpose: once to count
20032 the number of occurrences of each symbol, and later reassigned to
20033 `shift_symbol', containing the symbol that can be shifted from a
20034 given state.
20035 Deobfuscate, i.e., allocate, use and free `symbol_count' here
20036 only, and...
20037 (new_itemsets): Allocate `shift_symbol' here.
20038 (allocate_itemsets): symbol_count includes useless nonterminals.
20039 Make room for them.
20040 (free_storage): Use `free', not `XFREE', for pointers that cannot
20041 be null.
20042
81b51460
AD
200432001-12-05 Akim Demaille <akim@epita.fr>
20044
20045 * src/nullable.c (set_nullable): Deobfuscate the handling of
20046 ritem.
20047 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20048
3067fbef
AD
200492001-12-05 Akim Demaille <akim@epita.fr>
20050
20051 * src/gram.c, src/gram.h (ritem_print): New.
20052 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
20053 (This useless function was defined only to work around VMS linkers
20054 that can't handle compilation units with variables only).
20055 * src/reduce.c (dump_grammar): Use it to trace the construction of
20056 ritem.
20057
c2bea5f9
PE
200582001-12-04 Paul Eggert <eggert@twinsun.com>
20059
7d27c823
PE
20060 * src/bison.simple (union yyalloc): Change member names
20061 to be the same as the stack names.
20062 (yyparse): yyptr is now union yyalloc *, not char *.
20063 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
20064 and may generate better code on some machines.
c2bea5f9
PE
20065 (yystpcpy): Use prototype if __STDC__ is defined, not just
20066 if __cplusplus is defined.
35687a9d 20067
2c8a9dfa
AD
200682001-11-30 Akim Demaille <akim@epita.fr>
20069
20070 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
20071 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
20072 Gettext doesn't compile cleanly, and dies with -Werror.
20073 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
20074 Include WARNING_CFLAGS here.
20075 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
20076 before being defined.
20077
f4e421e6
AD
200782001-11-27 Paul Eggert <eggert@twinsun.com>
20079
20080 * lib/quotearg.h (quotearg_n, quotearg_n_style):
20081 First arg is int, not unsigned.
20082 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
20083 (SIZE_MAX, UINT_MAX): New macros.
20084 (quotearg_n_options): Abort if N is negative.
20085 Avoid overflow check on hosts where size_t is 64 bits and int
20086 is 32 bits, as overflow is impossible there.
20087 Fix off-by-one typo that caused unnecessary reallocation.
20088
7093d0f5
AD
200892001-11-29 Paul Eggert <eggert@twinsun.com>
20090
20091 Name space cleanup in generated parser.
20092
20093 * doc/bison.texinfo (Bison Parser): Discuss system headers
20094 and their effect on the user name space.
20095
20096 * src/bison.simple:
20097 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
20098 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
20099 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
20100
20101 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
20102 on user names when possible.
20103
20104 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
20105 Simplify test for whather <alloca.h> exists.
20106
20107 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
20108
20109 (<stdio.h>): Include if YYDEBUG.
20110
20111 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
20112 ! defined (yyoverflow) && ! defined (yymemcpy).
20113
20114 (yymemcpy, yyparse): Rename local variables as needed so that
20115 they all begin with 'yy'.
20116
20117 (yystrlen, yystpcpy): New functions.
20118
20119 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
20120 All uses changed.
20121
20122 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
20123 instead of relying on string.h functions. Use YYSTACK_ALLOC
20124 and YYSTACK_FREE instead of malloc and free.
20125
fd51e5ff
AD
201262001-11-30 Akim Demaille <akim@epita.fr>
20127
20128 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
20129 before their first uses.
20130 (YYBISON, YYPURE): Move to the top of the output.
20131
7d13ff5f
AD
201322001-11-30 Akim Demaille <akim@epita.fr>
20133
20134 * tests/reduce.at (Useless Nonterminals): Fix.
20135
892a3995
AD
201362001-11-30 Akim Demaille <akim@epita.fr>
20137
20138 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
20139 if body instead of `;' to pacify GCC's warnings.
20140
68f1e3ed
AD
201412001-11-30 Akim Demaille <akim@epita.fr>
20142
20143 Instead of mapping the LHS of unused rules to -1, keep the LHS
20144 valid, but flag the rules as invalid.
20145
20146 * src/gram.h (rule_t): `useful' is a new member.
20147 * src/print.c (print_grammar): Adjust.
20148 * src/derives.c (set_derives): Likewise.
20149 * src/reader.c (packgram, reduce_output): Likewise.
20150 * src/reduce.c (reduce_grammar_tables): Likewise.
20151 * tests/reduce.at (Underivable Rules, Useless Rules): New.
20152
d2d1b42b
AD
201532001-11-30 Akim Demaille <akim@epita.fr>
20154
20155 * src/reduce.c (reduce_output): Formatting changes.
20156 * src/print.c (print_results, print_grammar): Likewise.
20157 * tests/regression.at (Rule Line Numbers)
20158 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
20159
760b53a8
AD
201602001-11-30 Akim Demaille <akim@epita.fr>
20161
20162 * src/reduce.c (nonterminals_reduce): Instead of throwing away
20163 useless nonterminals, move them at the end of the symbol arrays.
20164 (reduce_output): Adjust.
20165 * tests/reduce.at (Useless Nonterminals): Adjust.
20166
00238958
AD
201672001-11-30 Akim Demaille <akim@epita.fr>
20168
20169 * src/reduce.c: Various comment/formatting changes.
20170 (nonterminals_reduce): New, extracted from...
20171 (reduce_grammar_tables): here.
20172 (reduce_grammar): Call nonterminals_reduce.
20173
396452de
PE
201742001-11-29 Paul Eggert <eggert@twinsun.com>
20175
20176 * src/bison.simple (YYSTACK_REALLOC): Remove.
20177 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
20178 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
20179 New macros.
20180 (union yyalloc): New type.
20181 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
20182 an arbitrary restriction on hosts where size_t is wider than int.
20183
20184 (yyparse): Don't dump core if alloca or malloc fails; instead, report
20185 a parser stack overflow. Allocate just one block of memory for all
20186 three stacks, instead of allocating three blocks; this typically is
20187 faster and reduces fragmentation.
20188
20189 Do not limit the number of items in the stack to a value that fits
20190 in 'int', as this is an arbitrary limit on hosts with 64-bit
20191 size_t and 32-bit int.
20192
147e184c
MA
201932001-11-29 Marc Autret <autret_m@epita.fr>
20194
20195 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
20196 of defining YYERROR_VERBOSE.
20197 [AT_DATA]: $4 is now out of C declarations in the prologue.
20198
426cf563
MA
201992001-11-28 Marc Autret <autret_m@epita.fr>
20200
20201 * src/reader.c (parse_dquoted_param): New.
20202 (parse_skel_decl): Use it.
20203 * src/lex.h: Add its prototype.
20204 * src/lex.c (literalchar): Become not static.
20205
c7925b99
MA
202062001-11-28 Marc Autret <autret_m@epita.fr>
20207
20208 * src/output.h: And put its extern declaration here.
20209 * src/output.c (error_verbose): Define here.
20210 (prepare): Echo name modification.
20211 * src/getargs.h: Clean its extern declaration.
20212 * src/getargs.c (error_verbose_flag): Remove.
20213 (getargs): Remove case 'e'.
20214 * src/options.c (option_table): 'error-verbose' is now seen as simple
20215 percent option.
20216 Include output.h.
20217
20218 * src/reader.c (read_declarations): Remove case tok_include.
20219 (parse_include_decl): Remove.
20220 * src/lex.h (token_t): Remove tok_include.
20221 * src/options.c (option_table): 'include' is now a simple command line
20222 option.
20223
5b5d1929
MA
202242001-11-28 Marc Autret <autret_m@epita.fr>
20225
20226 * src/bison.simple: Adjust muscle names.
20227 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20228 * src/output.c (prepare): s/_/-/ for the muscles names.
20229 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20230
8850be4b
MA
202312001-11-28 Marc Autret <autret_m@epita.fr>
20232
20233 * src/bison.simple: Fix debug.
20234 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20235
4a38e613
AD
202362001-11-28 Akim Demaille <akim@epita.fr>
20237
20238 * src/LR0.c (shifts_new): New.
20239 (save_shifts, insert_start_shift, augment_automaton): Use it.
20240
4b35e1c1
AD
202412001-11-28 Akim Demaille <akim@epita.fr>
20242
20243 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20244 keep ruleno only.
20245
d2b04478
AD
202462001-11-28 Akim Demaille <akim@epita.fr>
20247
20248 * src/closure.c (closure): Instead of looping over word in array
20249 then bits in words, loop over bits in array.
20250
2c4c30aa
AD
202512001-11-28 Akim Demaille <akim@epita.fr>
20252
20253 * src/closure.c (closure): No longer optimize the special case
20254 where all the bits of `ruleset[r]' are set to 0, to make the code
20255 clearer.
20256
576890b7
AD
202572001-11-28 Akim Demaille <akim@epita.fr>
20258
20259 * src/closure.c (closure): `r' and `c' are new variables, used to
20260 de-obfuscate accesses to RULESET and CORE.
20261
cb487d7d
AD
202622001-11-28 Akim Demaille <akim@epita.fr>
20263
20264 * src/reduce.c (reduce_print): Use ngettext.
20265 (dump_grammar): Improve the trace accuracy.
20266
6013d43f
AD
202672001-11-28 Akim Demaille <akim@epita.fr>
20268
20269 * src/reduce.c (dump_grammar): Don't translate trace messages.
20270
cb4956ee
AD
202712001-11-28 Akim Demaille <akim@epita.fr>
20272
20273 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20274 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20275 as all tags are free'ed afterwards.
20276 From Enrico Scholz.
20277
648185ab
PE
202782001-11-27 Paul Eggert <eggert@twinsun.com>
20279
20280 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20281 use alloca when we didn't want to, and vice versa.
20282
68254a03
MA
202832001-11-27 Marc Autret <autret_m@epita.fr>
20284
9113b58f
AD
20285 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20286 initialization.
68254a03
MA
20287 * src/output.c (prepare): Remove its update.
20288
04d843a2
MA
202892001-11-27 Marc Autret <autret_m@epita.fr>
20290
20291 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20292 Use %error-verbose.
20293
d2079671 202942001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
20295
20296 * src/bison.simple: Remove YYERROR_VERBOSE using.
20297 Use %%error_verbose.
20298 (yyparse): Likewise.
20299 * src/output.c (prepare): Give its final value.
20300 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20301 * src/getargs.h: Add its extern declaration.
20302 * src/getargs.c (error_verbose_flag): New int.
20303 (getargs): Update to catch new case.
20304 * src/options.c (option_table): 'error-verbose' is a new option.
20305 (shortopts): Update.
20306
e0327bc8
AD
203072001-11-27 Akim Demaille <akim@epita.fr>
20308
20309 * src/system.h: Use intl/libgettext.h.
20310 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20311
000f1a3c
AD
203122001-11-27 Akim Demaille <akim@epita.fr>
20313
20314 * tests/torture.at (Exploding the Stack Size with Malloc):
20315 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20316
26cfe0be
AD
203172001-11-27 Akim Demaille <akim@epita.fr>
20318
20319 * src/files.c: Include error.h.
20320 Reported by Hans Aberg.
20321
f6bd5427
MA
203222001-11-26 Marc Autret <autret_m@epita.fr>
20323
d2079671 20324 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
20325 (read_declarations): Add case tok_include.
20326 * src/getargs.h (include): Add its extern definition.
20327 * src/getargs.c (include): New const char *.
20328 (getargs): Add case '-I'.
20329 * src/options.c (option_table): Add include as command line and
20330 percent option.
20331 * src/lex.h (token_t): Add tok_include.
20332
2ca209c1
AD
203332001-11-26 Akim Demaille <akim@epita.fr>
20334
20335 * src/reader.c (readgram): Make sure rules for mid-rule actions
20336 have a lineno equal to that of their host rule.
20337 Reported by Hans Aberg.
20338 * tests/regression.at (Rule Line Numbers): New.
20339
0e41b407
AD
203402001-11-26 Akim Demaille <akim@epita.fr>
20341
20342 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20343 size_ts.
20344
203452001-11-26 Akim Demaille <akim@epita.fr>
20346
20347 * src/complain.c, src/complain.h (error): Remove, provided by
20348 lib/error.[ch].
20349
e0c40012
AD
203502001-11-26 Akim Demaille <akim@epita.fr>
20351
20352 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20353 issue an error message.
20354 * tests/regression.at (Invalid %directive): New.
20355 Reported by Hans Aberg.
20356
5e147124
AD
203572001-11-26 Akim Demaille <akim@epita.fr>
20358
20359 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20360 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20361
a034c8b8
AD
203622001-11-26 Akim Demaille <akim@epita.fr>
20363
20364 * src/conflicts.c (conflicts_print): Don't complain at all when
20365 there are no reduce/reduce conflicts, and as many shift/reduce
20366 conflicts as expected.
20367 * tests/regression.at (%expect right): Adjust.
20368
c64a20f3
AD
203692001-11-23 Akim Demaille <akim@epita.fr>
20370
20371 * lib/alloca.c: Update, from fileutils.
20372
5b0d29bb
AD
203732001-11-23 Akim Demaille <akim@epita.fr>
20374
20375 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20376
722c4bfe
AD
203772001-11-23 Akim Demaille <akim@epita.fr>
20378
20379 * src/system.h: Include alloca.h.
20380 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20381
6255b435
AD
203822001-11-23 Akim Demaille <akim@epita.fr>
20383
20384 * src/print_graph.c (print_actions): Remove `rule', unused.
20385 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20386 pacify GCC's signed < unsigned warnings.
20387 * src/closure.c (itemsetsize): Likewise.
20388 * src/reader.c (symbol_list_new): Static.
20389
b29b2ed5
AD
203902001-11-23 Akim Demaille <akim@epita.fr>
20391
20392 Attaching lineno to buckets is stupid, since only one copy of each
20393 symbol is kept, only the line of the first occurrence is kept too.
20394
20395 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20396 * src/reader.c (rline_allocated): Remove, unused.
20397 (symbol_list): Have a `line' member.
20398 (symbol_list_new): New.
20399 (readgram): Use it.
20400 * src/print.c (print_grammar): Output the rule line numbers.
20401 * tests/regression.at (Solved SR Conflicts)
20402 (Unresolved SR Conflicts): Adjust.
20403 Reported by Hans Aberg.
20404
a81b1d4a
MA
204052001-11-22 Marc Autret <autret_m@epita.fr>
20406
20407 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20408
c1ecb3c1
MA
204092001-11-22 Marc Autret <autret_m@epita.fr>
20410
20411 * src/muscle_tab.c (muscle_init): Remove initialization of
20412 skeleton muscle.
20413 * src/output.c (output_master_parser): Do it here.
20414
fbe01355
AD
204152001-11-20 Akim Demaille <akim@epita.fr>
20416
20417 * po/sv.po: New.
20418 * configure.in (ALL_LINGUAS): Adjust.
20419 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20420 longer contains strings to translate.
20421
81e895c0
AD
204222001-11-19 Akim Demaille <akim@epita.fr>
20423
20424 * src/conflicts.c (conflicts_print): Add a missing \n.
20425
6bb1878b
AD
204262001-11-19 Akim Demaille <akim@epita.fr>
20427
20428 * src/nullable.c (nullable_print): New.
20429 (set_nullable): Call it when tracing.
20430 Better locality of variables.
20431
d9ec2d07
AD
204322001-11-19 Akim Demaille <akim@epita.fr>
20433
20434 * src/print.c (print_actions): Better locality of variables.
20435
720e5c1b
AD
204362001-11-19 Akim Demaille <akim@epita.fr>
20437
20438 * src/derives.c (print_derives): Fix and enrich.
20439 * src/closure.c (print_fderives): Likewise.
20440
fb908786
AD
204412001-11-19 Akim Demaille <akim@epita.fr>
20442
20443 * src/closure.c (itemsetend): Remove, replaced with...
20444 (itemsetsize): new.
20445
125ecb56
AD
204462001-11-19 Akim Demaille <akim@epita.fr>
20447
20448 * src/LR0.c (kernel_end): Remove, replaced with...
20449 (kernel_size): new.
20450
d8cf039f
AD
204512001-11-19 Akim Demaille <akim@epita.fr>
20452
20453 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20454 to clarify.
20455
7bec0760
AD
204562001-11-19 Akim Demaille <akim@epita.fr>
20457
20458 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20459
c87d4863
AD
204602001-11-19 Akim Demaille <akim@epita.fr>
20461
20462 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20463 trace messages.
20464 * src/LR0.c: Likewise.
20465 (allocate_itemsets): Use arrays instead of pointers to clarify.
20466
9bfe901c
AD
204672001-11-19 Akim Demaille <akim@epita.fr>
20468
20469 * src/getargs.c (statistics_flag): Replace with...
20470 (trace_flag): New.
20471 (longopts): Accept --trace instead of --statistics.
20472 * src/getargs.h, src/options.c: Adjust.
20473 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20474 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20475
97db7bd4
AD
204762001-11-19 Akim Demaille <akim@epita.fr>
20477
cc72668c 20478 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
20479 pointers to clarify the code.
20480 (save_reductions, save_shifts): Factor common parts of alternatives.
20481
2c5f66ed
AD
204822001-11-19 Akim Demaille <akim@epita.fr>
20483
20484 * src/LR0.c (new_state, get_state): Complete TRACE code.
20485 * src/closure.c: Include `reader.h' to get `tags', needed by the
20486 trace code.
20487 Rename the conditional DEBUG as TRACE.
20488 Output consistently TRACEs to stderr, not stdout.
20489 * src/derives.c: Likewise.
20490 * src/reduce.c: (inaccessable_symbols): Using if is better style
20491 than goto.
20492 Use `#if TRACE' instead of `#if 0' for tracing code.
20493
300f275f
AD
204942001-11-19 Akim Demaille <akim@epita.fr>
20495
20496 * src/system.h (LIST_FREE, shortcpy): New.
20497 * src/LR0.c: Use them.
20498 * src/output.c (free_itemsets, free_reductions, free_shifts):
20499 Remove, replaced by LIST_FREE.
20500
f59c437a
AD
205012001-11-19 Akim Demaille <akim@epita.fr>
20502
20503 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20504 (REDUCTIONS_ALLOC): New.
20505 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20506 allocation.
20507
6986fd9e
AD
205082001-11-19 Akim Demaille <akim@epita.fr>
20509
20510 * src/LR0.c (new_state): Complete trace code.
20511 * src/nullable.c (set_nullable): Don't translate traces.
20512
4bc30f78
AD
205132001-11-19 Akim Demaille <akim@epita.fr>
20514
20515 * src/print_graph.c (print_core): Better locality of variables.
20516 * src/print.c (print_core): Likewise.
20517
08a946e0
AD
205182001-11-19 Akim Demaille <akim@epita.fr>
20519
20520 * src/vcg.c: You do the output, so you are responsible of the
20521 handling of VCG syntax, in particular: use quotearg.
20522 * src/print_graph.c: Don't.
20523 (print_actions): Don't output the actions as part of the nodes,
20524 since that's the job of the edges.
20525 (print_state): Don't output by hand: fill the node description,
9bfe901c 20526 and ask for its output.
08a946e0 20527
f0473484
AD
205282001-11-19 Akim Demaille <akim@epita.fr>
20529
cc72668c
AD
20530 * src/bison.simple (yyparse): When verbosely reporting an error,
20531 no longer put additional quotes around token names.
f0473484
AD
20532 * tests/calc.at: Adjust.
20533
e41dc700
AD
205342001-11-19 Akim Demaille <akim@epita.fr>
20535
20536 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
20537 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
20538 * src/output.c: Adjust.
20539
652a871c
AD
205402001-11-19 Akim Demaille <akim@epita.fr>
20541
20542 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
20543 (rule_t): this.
20544 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
20545
b2ed6e58
AD
205462001-11-19 Akim Demaille <akim@epita.fr>
20547
20548 * src/gram.h (rule_t): New.
20549 (rule_table): New.
20550 (rrhs, rlhs): Remove, part of state_t.
20551 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
20552 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
20553 * src/reader.c, src/reduce.c: Adjust.
20554
edad7067
AD
205552001-11-19 Akim Demaille <akim@epita.fr>
20556
20557 * src/reader.c (symbols_output): New, extracted from...
20558 (packsymbols): Here.
20559 (reader): Call it.
20560
3feec034
AD
205612001-11-19 Akim Demaille <akim@epita.fr>
20562
20563 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20564 (maxrhs): this new function.
20565
ddcd5fdf
AD
205662001-11-19 Akim Demaille <akim@epita.fr>
20567
cc72668c 20568 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
20569 Adjust.
20570
bb527fc2
AD
205712001-11-19 Akim Demaille <akim@epita.fr>
20572
cc72668c 20573 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
20574 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20575 * src/lalr.c: Adjust.
20576
a845a697
AD
205772001-11-19 Akim Demaille <akim@epita.fr>
20578
20579 * src/lalr.c (initialize_LA): Only initialize LA. Let...
20580 (set_state_table): handle the `lookaheads' members.
20581
f004bf6a
AD
205822001-11-19 Akim Demaille <akim@epita.fr>
20583
cc72668c
AD
20584 * src/lalr.h (lookaheads): Removed array, whose contents is now
20585 a member of...
f004bf6a
AD
20586 (state_t): this structure.
20587 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20588 Adjust.
20589
de326cc0
AD
205902001-11-19 Akim Demaille <akim@epita.fr>
20591
cc72668c
AD
20592 * src/lalr.h (consistent): Removed array, whose contents is now
20593 a member of...
de326cc0
AD
20594 (state_t): this structure.
20595 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20596 Adjust.
20597
90b4416b
AD
205982001-11-19 Akim Demaille <akim@epita.fr>
20599
cc72668c
AD
20600 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20601 contents are now members of...
90b4416b
AD
20602 (state_t): this structure.
20603 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20604 Adjust.
20605
9703cc49
AD
206062001-11-19 Akim Demaille <akim@epita.fr>
20607
20608 * src/lalr.h (state_t): New.
20609 (state_table): Be a state_t * instead of a core **.
20610 (accessing_symbol): Remove, part of state_t.
20611 * src/lalr.c: Adjust.
20612 (set_accessing_symbol): Merge into...
20613 (set_state_table): this.
20614 * src/print_graph.c, src/conflicts.c: Adjust.
20615
d803322e
AD
206162001-11-14 Akim Demaille <akim@epita.fr>
20617
20618 * tests/calc.at, tests/output.at, tests/regression.at,
20619 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
20620 now the tests are run in private dirs, therefore AC_CLEANUP and
20621 family can be simplified to 0-ary.
20622 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
20623 use abs. path to find config.h.
20624 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20625 stderr, there can be way too much random noise.
20626 Instead pass -Werror to GCC and rely on the exit status.
20627 Reported by Wolfram Wagner.
20628
3d76b07d
AD
206292001-11-14 Akim Demaille <akim@epita.fr>
20630
20631 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20632 defined only if yyoverflow is defined, to avoid `warning: unused
20633 variable `yyvs1''.
20634 Reported by The Test Suite.
20635
09b503c8
AD
206362001-11-14 Akim Demaille <akim@epita.fr>
20637
20638 * src/print.c: Include reduce.h.
20639 Reported by Hans Aberg.
20640
206412001-11-14 Akim Demaille <akim@epita.fr>
20642
20643 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20644 Revert a previous patch: these are really const.
20645 * src/conflicts.c (conflict_report): Additional useless pair of
20646 braces to pacify GCC's warnings for `if () if () {} else {}'.
20647 * src/lex.c (parse_percent_token): Replace equal_offset with
20648 arg_offset.
20649 arg is const.
20650 Be sure to strdup `arg' when used, since there is no reason for
20651 token_buffer not to change.
20652
0f37a994
AD
206532001-11-14 Akim Demaille <akim@epita.fr>
20654
20655 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20656 definition.
20657 * src/main.c (main): Use them.
20658 Suggested by Hans Aberg.
20659
d39d93b8
AD
206602001-11-12 Akim Demaille <akim@epita.fr>
20661
20662 * src/system.h (ngettext): Now that we use ngettext, be sure to
20663 provide a default definition when NLS are not used.
20664
9edcd895
AD
206652001-11-12 Akim Demaille <akim@epita.fr>
20666
20667 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20668 Use @kbd to denote user input.
20669 (Language and Grammar): ANSIfy the example.
20670 Adjust its layout for info/notinfo.
20671 (Location Tracking Calc): Output error messages to stderr.
20672 Output locations in a more GNUtically correct way.
20673 Fix a couple of Englishos.
20674 Adjust @group/@end group pairs.
20675
7da99ede
AD
206762001-11-12 Akim Demaille <akim@epita.fr>
20677
e3aa65c5 20678 %expect was not functioning at all.
7da99ede
AD
20679
20680 * src/conflicts.c (expected_conflicts): Set to -1.
20681 (conflict_report): Use ngettext.
20682 (conflicts_print): Check %expect and make its violation an error.
20683 * doc/bison.texinfo (Expect Decl): Adjust.
20684 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20685 * tests/regression.at (%expect not enough, %expect right)
20686 (%expect too much): New.
20687
ba9dda1a
AD
206882001-11-12 Akim Demaille <akim@epita.fr>
20689
20690 * tests/regression.at (Conflicts): Rename as...
20691 (Unresolved SR Conflicts): this.
20692 (Solved SR Conflicts): New.
20693
337c5bd1
AD
206942001-11-12 Akim Demaille <akim@epita.fr>
20695
20696 * src/reduce.c (print_results): Rename as...
20697 (reduce_output): This.
20698 Output to OUT, passed as argument, instead of output_obstack.
20699 (dump_grammar): Likewise.
20700 (reduce_free): New.
20701 Also free V1.
20702 (reduce_grammar): No longer call reduce_output, since...
20703 * src/print.c (print_results): do it.
20704 * src/main.c (main): Call reduce_free;
20705
c73a41af
AD
207062001-11-12 Akim Demaille <akim@epita.fr>
20707
20708 * src/conflicts.c (print_reductions): Accept OUT as argument.
20709 Output to it, not to output_obstack.
20710 * src/print.c (print_actions): Adjust.
20711
0df87bb6
AD
207122001-11-12 Akim Demaille <akim@epita.fr>
20713
20714 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20715 the result instead of using...
20716 (src_total, rrc_total, src_count, rrc_count): Remove.
20717 (any_conflicts): Remove.
20718 (print_conflicts): Split into...
20719 (conflicts_print, conflicts_output): New.
20720 * src/conflicts.h: Adjust.
20721 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 20722 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
20723 * tests/regression.at (Conflicts): New.
20724 Reported by Tom Lane.
20725
e4d3d4de
AD
207262001-11-12 Akim Demaille <akim@epita.fr>
20727
20728 * tests/regression.at (Invalid input): Remove, duplicate with
20729 ``Invalid input: 1''.
20730
6d7d248e
AD
207312001-11-12 Akim Demaille <akim@epita.fr>
20732
20733 * tests/torture.at (AT_DATA_STACK_TORTURE)
20734 (Exploding the Stack Size with Alloca)
20735 (Exploding the Stack Size with Malloc): New.
20736
e9e4c321
AD
207372001-11-12 Akim Demaille <akim@epita.fr>
20738
20739 * src/bison.simple (YYSTACK_REALLOC): New.
20740 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 20741 Reported by Per Allansson.
e9e4c321 20742
5f7e0832
AD
207432001-11-12 Pascal Bart <pascal.bart@epita.fr>
20744
20745 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20746 define CPP macro, which substitute YYSTYPE by yystype.
20747 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20748 with yyltype/YYLTYPE. This allows inclusion of the generated
20749 header within the parser if the compiler, such as GGC, accepts
20750 multiple equivalent #defines.
20751 From Akim.
20752
e3f1699f
AD
207532001-11-05 Akim Demaille <akim@epita.fr>
20754
20755 * src/reader.c (symbols_output): New, extracted from...
20756 (packsymbols): here.
20757 (reader): Adjust.
20758
65be0866
AD
207592001-11-05 Akim Demaille <akim@epita.fr>
20760
20761 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20762
e4d910bf
AD
207632001-11-05 Akim Demaille <akim@epita.fr>
20764
20765 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20766 pattern.
20767
951366c1
AD
207682001-11-05 Akim Demaille <akim@epita.fr>
20769
20770 * src/options.h (struct option_table_struct): set_flags is void*.
20771 * src/options.c (longopts): Support `--output' and `%output'.
20772 (usage): Adjust.
20773 * src/lex.h (tok_setopt): Remove, replaced with...
20774 (tok_intopt, tok_stropt): these new guys.
20775 * src/lex.c (getopt.h): Not needed.
20776 (token_buffer, unlexed_token_buffer): Not const.
20777 (percent_table): Promote `-' over `_' in directive names.
20778 Active `%name-prefix', `file-prefix', and `output'.
20779 (parse_percent_token): Accept possible arguments to directives.
20780 Promote `-' over `_' in directive names.
20781
d8988b2f
AD
207822001-11-04 Akim Demaille <akim@epita.fr>
20783
20784 * doc/bison.texinfo (Decl Summary): Split the list into
20785 `directives for grammars' and `directives for bison'.
20786 Sort'em.
20787 Add description of `%name-prefix', `file-prefix', and `output'.
20788 Promote `-' over `_' in directive names.
20789 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20790 Simplify the description of `--name-prefix'.
20791 Promote `-' over `_' in directive names.
20792 Promote `--output' over `--output-file'.
20793 Fix the description of `--defines'.
20794 * tests/output.at: Exercise %file-prefix and %output.
20795
6468d18e
AD
207962001-11-02 Akim Demaille <akim@epita.fr>
20797
20798 * doc/refcard.tex: Update.
20799
6b7e85b9
AD
208002001-11-02 Akim Demaille <akim@epita.fr>
20801
20802 * src/symtab.h (SUNDEF): New.
20803 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20804 stand for `uninitialized', instead of 0.
20805 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20806 * src/lex.c (lex): Adjust.
20807
20808 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20809 Number it 0.
20810 Let yylex return it instead of a plain 0.
20811 Reported by Dick Streefland.
20812
cd5aafcf
AD
208132001-11-02 Akim Demaille <akim@epita.fr>
20814
20815 * tests/regression.at (Mixing %token styles): New test.
20816
037ca2f1
AD
208172001-11-02 Akim Demaille <akim@epita.fr>
20818
20819 * src/reader.c (parse_thong_decl): Formatting changes.
20820 (token_translations_init): New, extracted from...
20821 (packsymbols): Here.
20822 Adjust.
20823
270a173c
AD
208242001-11-01 Akim Demaille <akim@epita.fr>
20825
20826 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20827 Check that `9foo.y' produces correct cpp guards.
20828 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20829 guards.
20830 Reported by Wwp.
20831
561f9a30
AD
208322001-11-01 Akim Demaille <akim@epita.fr>
20833
20834 * tests/regression.at (Invalid input: 2): New.
20835 * src/lex.c (unlexed_token_buffer): New.
20836 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20837 too.
20838 Reported by Wwp.
20839
f987e9d2
AD
208402001-11-01 Akim Demaille <akim@epita.fr>
20841
20842 * tests/calc.at: Catch up with 1.30.
20843 * configure.in: Bump to 1.49a.
20844 Adjust to newer Autotest.
20845
0846f581
PB
208462001-10-19 Pascal Bart <pascal.bart@epita.fr>
20847
20848 * src/conflicts.c: Move global variables rrc_total and src_total ...
20849 (print_conflicts): here.
20850 * src/output.c (output): Free global variable user_toknums.
20851 * src/lex.c (token_obstack): Become static.
20852
3c1a79b3
AD
208532001-10-18 Akim Demaille <akim@epita.fr>
20854
20855 * tests/atlocal.in (GCC): Add.
20856 * tests/calc.at: s/m4_match/m4_bmatch/.
20857 s/m4_patsubst/m4_bpatsubst/.
20858 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20859 * configure.in: AC_SUBST(GCC).
20860
5d52e7d0
MA
208612001-10-14 Marc Autret <autret_m@epita.fr>
20862
20863 * src/options.c (create_long_option_table): Fix.
20864
631aa1d3
AD
208652001-10-10 Akim Demaille <akim@epita.fr>
20866
20867 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20868
f6ec6d13
AD
208692001-10-04 Akim Demaille <akim@epita.fr>
20870
20871 * src/reader.c (parse_union_decl): Push the caracters in
20872 union_obstack, not attrs_obstack.
20873
342b8b6e
AD
208742001-10-04 Akim Demaille <akim@epita.fr>
20875
20876 Merge in the branch 1.29.
20877
20878 * src/reader.c (packsymbols): Use a temporary obstack for
20879 `%%tokendef', since output_stack is already used elsewhere.
20880
20881 2001-10-02 Akim Demaille <akim@epita.fr>
20882
20883 Bump 1.29d.
20884
20885 2001-10-02 Akim Demaille <akim@epita.fr>
20886
20887 Version 1.29c.
20888
20889 2001-10-02 Akim Demaille <akim@epita.fr>
20890
20891 * tests/regression.at (Invalid CPP headers): New.
20892 From Alexander Belopolsky.
20893 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20894
20895 2001-10-02 Akim Demaille <akim@epita.fr>
20896
20897 * tests/regression.at (Invalid input): New.
20898 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20899 Reported by Shura.
20900
20901 2001-10-02 Akim Demaille <akim@epita.fr>
20902
20903 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20904
20905 2001-10-02 Akim Demaille <akim@epita.fr>
20906
20907 * src/output.c (output_parser): Assert `skeleton'.
20908 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20909 systems.
20910 From Shura.
20911
20912 2001-10-01 Marc Autret <autret_m@epita.fr>
20913
20914 * src/lex.h: Echo modifications.
20915 * src/lex.c (unlex): Parameter is now token_t.
20916 From Hans Aberg.
20917
20918 2001-10-01 Marc Autret <autret_m@epita.fr>
20919
20920 * src/main.c: Include lex.h.
20921 From Hans Aberg.
20922
20923 2001-09-29 Akim Demaille <akim@epita.fr>
20924
20925 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20926
20927 2001-09-28 Akim Demaille <akim@epita.fr>
20928
20929 * tests/testsuite.at: Update to newer Autotest.
20930 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20931
20932 2001-09-27 Akim Demaille <akim@epita.fr>
20933
20934 Position independent wrapper.
20935
20936 * tests/bison: Remove.
20937 * tests/bison.in: New.
20938 * configure.in: Adjust.
20939
20940 2001-09-27 Paul Eggert <eggert@twinsun.com>
20941
20942 Port quotearg fixes from tar 1.13.24.
20943
20944 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20945 tm to be declared.
20946 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20947 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20948
20949 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20950 * m4/mbrtowc.m4: New file.
20951 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20952 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20953
20954 2001-09-27 Akim Demaille <akim@epita.fr>
20955
20956 Bump to 1.29c.
20957
20958 2001-09-27 Akim Demaille <akim@epita.fr>
20959
20960 Version 1.29b.
20961
20962 2001-09-25 Akim Demaille <akim@epita.fr>
20963
20964 * src/system.h: Include `xalloc.h'.
20965 Remove it from the C files.
20966 * src/files.c (output_files): Free the obstacks.
20967 * src/lex.c (init_lex): Rename as...
20968 (lex_init): this.
20969 (lex_free): New.
20970 * src/main.c (main): Use it.
20971
20972 2001-09-24 Marc Autret <autret_m@epita.fr>
20973
20974 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20975 to output informations in fout (FILE*).
20976 (open_graph, close_graph): Likewise.
20977 (output_graph, output_edge, output_node): Likewise.
20978 * src/vcg.h: Update function prototypes.
20979 * src/print_graph.c (print_graph): Open output graph file.
20980 (print_actions): Adjust.
20981 * src/files.h: Remove extern declaration.
20982 * src/files.c: Remove graph_obstack declaration.
20983 (open_files): Remove graph_obstack initialization.
20984 (output_files): Remove graph_obstack saving.
20985
20986 2001-09-24 Marc Autret <autret_m@epita.fr>
20987
20988 * src/files.c (compute_output_file_names): Fix.
20989
20990 2001-09-24 Marc Autret <autret_m@epita.fr>,
20991 Akim Demaille <akim@epita.fr>
20992
20993 * src/reader.c (reader): Remove call to free_symtab ().
20994 * src/main.c (main): Call it here.
20995 Include symtab.h.
20996 * src/conflicts.c (initialize_conflicts): Rename as...
20997 (solve_conflicts): this.
20998 * src/print.c (print_core, print_actions, print_state)
20999 (print_grammar): Dump to a file instead a `output_obstack'.
21000 (print_results): Dump `output_obstack', and then proceed with the
21001 FILE *.
21002 * src/files.c (compute_output_file_names, close_files): New.
21003 (output_files): Adjust.
21004 * src/main.c (main): Adjust.
21005
21006 2001-09-23 Marc Autret <autret_m@epita.fr>
21007
21008 * src/files.c (compute_header_macro): Computes header macro name
21009 from spec_defines_file when given.
21010
21011 2001-09-23 Marc Autret <autret_m@epita.fr>
21012
21013 * src/files.c (output_files): Add default extensions.
21014
21015 2001-09-22 Akim Demaille <akim@epita.fr>
21016
21017 * src/conflicts.c (finalize_conflicts): Rename as...
21018 (free_conflicts): this.
21019
21020 2001-09-22 Akim Demaille <akim@epita.fr>
21021
21022 * src/gram.c (gram_free): Rename back as...
21023 (dummy): this.
21024 (output_token_translations): Free `token_translations'.
21025 * src/symtab.c (free_symtab): Free the tag field.
21026
21027 2001-09-22 Akim Demaille <akim@epita.fr>
21028
21029 Remove `translations' as it is always set to true.
21030
21031 * src/gram.h: Adjust.
21032 * src/reader.c (packsymbols, parse_token_decl): Adjust
21033 * src/print.c (print_grammar): Adjust.
21034 * src/output.c (output_token_translations): Adjust.
21035 * src/lex.c (lex): Adjust.
21036 * src/gram.c: Be sure the set pointers to NULL.
21037 (dummy): Rename as...
21038 (gram_free): this.
21039
21040 2001-09-22 Akim Demaille <akim@epita.fr>
21041
21042 * configure.in: Invoke AM_LIB_DMALLOC.
21043 * src/system.h: Use dmalloc.
21044 * src/LR0.c: Be sure to have pointers initialized to NULL.
21045 (allocate_itemsets): Allocate kernel_items only if needed.
21046
21047 2001-09-22 Akim Demaille <akim@epita.fr>
21048
21049 * configure.in: Bump to 1.29b.
21050 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
21051 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
21052 need xmalloc.c in calc.y.
21053 From Pascal Bart.
21054
21055 2001-09-21 Akim Demaille <akim@epita.fr>
21056
21057 Version 1.29a.
21058 * Makefile.maint, config/config.guess, config/config.sub,
21059 * config/missing: Update from masters.
21060 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
21061 upon package.m4.
21062 * configure.in (ALL_LINGUAS): Add `tr'.
21063
21064 2001-09-21 Akim Demaille <akim@epita.fr>
21065
21066 * tests/Makefile.am (package.m4): Move to...
21067 ($(srcdir)/$(TESTSUITE)): here.
21068
21069 2001-09-20 Akim Demaille <akim@epita.fr>
21070
21071 * src/complain.c: No longer try to be standalone: use system.h.
21072 Don't assume __STDC__ is defined to 1. Just test if it is defined.
21073 * src/complain.h: Likewise.
21074 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
21075 Remove the unused variable `n'.
21076 From Albert Chin-A-Young.
21077
21078 2001-09-18 Marc Autret <autret_m@epita.fr>
21079
21080 * doc/bison.1: Update.
21081 * doc/bison.texinfo (Bison Options): Update --defines and --graph
21082 descriptions.
21083 (Option Cross Key): Update.
21084 Add --graph.
21085
21086 2001-09-18 Marc Autret <autret_m@epita.fr>
21087
21088 * tests/regression.at: New test (comment in %union).
21089
21090 2001-09-18 Marc Autret <autret_m@epita.fr>
21091
21092 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
21093 do that.
21094 Reported by Keith Browne.
21095
21096 2001-09-18 Marc Autret <autret_m@epita.fr>
21097
21098 * tests/output.at: Add tests for --defines and --graph.
21099
21100 2001-09-18 Marc Autret <autret_m@epita.fr>
21101
21102 * tests/output.at: Removes tests of %{header,src}_extension features.
21103
21104 2001-09-18 Akim Demaille <akim@epita.fr>
21105
21106 * tests/Makefile.am (package.m4): New.
21107 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
21108 (_AT_CHECK_CALC_ERROR): Likewise.
21109 Factor the `, ' part of verbose error messages.
21110
21111 2001-09-18 Marc Autret <autret_m@epita.fr>
21112
21113 * src/getargs.c (longopts): Declare --defines and --graph as options
21114 with optional arguments.
21115 * src/files.h: Add extern declarations.
21116 * src/files.c (spec_graph_file, spec_defines_file): New.
21117 (output_files): Update.
21118 Remove CPP-outed code.
21119
21120 2001-09-18 Marc Autret <autret_m@epita.fr>
21121
21122 Turn off %{source,header}_extension feature.
21123
21124 * src/files.c (compute_exts_from_gf): Update.
21125 (compute_exts_from_src): Update.
21126 (output_files): CPP-out useless code.
21127 * src/files.h: Remove {header,source}_extension extern declarations.
21128 * src/reader.c (parse_dquoted_param): CPP-out.
21129 (parse_header_extension_decl): Remove.
21130 (parse_source_extension_decl): Remove.
21131 (read_declarations): Remove cases tok_{hdrext,srcext}.
21132 * src/lex.c (percent_table): Remove {header,source}_extension entries.
21133 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
21134
21135 2001-09-10 Akim Demaille <akim@epita.fr>
21136
21137 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
21138 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
21139 (AT_CHECK_OUTPUT): this.
21140 Merely check ls' exit status, its output is useless.
21141
21142 2001-09-10 Akim Demaille <akim@epita.fr>
21143
21144 * tests/calc.at: Use m4_match.
21145 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
21146
21147 2001-09-10 Marc Autret <autret_m@epita.fr>,
21148 Akim Demaille <akim@epita.fr>
21149
21150 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
21151 enum color_e.
21152 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
21153 to `normal'.
21154 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
21155 * src/lex.h: Adjust prototype.
21156 (token_t): Add `tok_undef'.
21157 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
21158 (parse_percent_token): Now returns token_t.
21159 Add default statement in switch.
21160 (lex): Separate `c' as an input variable, from the token_t result
21161 part.
21162 (unlexed): Is a token_t.
21163
21164 2001-09-10 Akim Demaille <akim@epita.fr>
21165
21166 * configure.in: Bump to 1.29a.
21167
21168 2001-09-07 Akim Demaille <akim@epita.fr>
21169
21170 Version 1.29.
21171
21172 2001-08-30 Akim Demaille <akim@epita.fr>
21173
21174 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
21175 * m4/atconfig.m4: Remove.
21176 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
21177 * tests/bison: New.
21178 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
21179 m4_if, m4_patsubst, and m4_regexp.
21180 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
21181 `input' file instead of echo.
21182
21183 2001-08-29 Akim Demaille <akim@epita.fr>
21184
21185 Bump to 1.28e.
21186
21187 2001-08-29 Akim Demaille <akim@epita.fr>
21188
21189 Version 1.28d.
21190
21191 2001-08-29 Paul Eggert <eggert@twinsun.com>
21192
21193 * src/bison.simple (yyparse): Don't take the address of an
21194 item before the start of an array, as that doesn't conform to
21195 the C Standard.
21196
21197 2001-08-29 Robert Anisko <anisko_r@epita.fr>
21198
21199 * doc/bison.texinfo (Location Tracking Calc): New node.
21200
21201 2001-08-29 Paul Eggert <eggert@twinsun.com>
21202
21203 * src/output.c (output): Do not define const, as this now
21204 causes more problems than it cures.
21205
21206 2001-08-29 Akim Demaille <akim@epita.fr>
21207
21208 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21209 the nodes.
21210 Be sure to tag the `detailmenu'.
21211
21212 2001-08-29 Akim Demaille <akim@epita.fr>
21213
21214 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21215 download in a tmp dir.
21216
21217 2001-08-28 Marc Autret <autret_m@epita.fr>
21218
21219 * config/depcomp: New file.
21220
21221 2001-08-28 Marc Autret <autret_m@epita.fr>
21222
21223 * doc/bison.1 (mandoc): Adjust.
21224 From Juan Manuel Guerrero.
21225
21226 2001-08-28 Marc Autret <autret_m@epita.fr>
21227
21228 * src/print_graph.c (print_state): Fix.
21229
21230 2001-08-27 Marc Autret <autret_m@epita.fr>
21231
21232 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21233 char * members.
21234 Echo modifications to the functions prototypes.
21235 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21236
21237 2001-08-27 Marc Autret <autret_m@epita.fr>
21238
21239 * src/vcg.c: Include `xalloc.h'.
21240 (add_colorentry): New.
21241 (add_classname): New.
21242 (add_infoname): New.
21243 * src/vcg.h: Add new prototypes.
21244
21245 2001-08-27 Akim Demaille <akim@epita.fr>
21246
21247 * Makefile.maint: Sync. again with CVS Autoconf.
21248
21249 2001-08-27 Akim Demaille <akim@epita.fr>
21250
21251 * Makefile.maint: Formatting changes.
21252 (po-update, cvs-update, update): New targets.
21253 (AMTAR): Remove.
21254
21255 2001-08-27 Akim Demaille <akim@epita.fr>
21256
21257 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21258 * Makefile.maint: Sync. with CVS Autoconf.
21259
21260 2001-08-27 Marc Autret <autret_m@epita.fr>
21261
21262 * src/vcg.h (struct infoname_s): New.
21263 (struct colorentry_s): New.
21264 (graph_s): New fields {vertical,horizontal}_order in structure.
21265 Add `infoname' field.
21266 Add `colorentry' field;
21267 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21268 (G_HORIZONTAL_ORDER): New.
21269 (G_INFONAME): New.
21270 (G_COLORENTRY): New.
21271 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21272 Add output of `infoname'.
21273 Add output of `colorentry'.
21274
21275 2001-08-27 Marc Autret <autret_m@epita.fr>
21276
21277 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21278 This one shadowed a global parameter.
21279
21280 2001-08-24 Marc Autret <autret_m@epita.fr>
21281
21282 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21283 instead of `unsigned'.
21284 (print_state): Do not call obstack_object_size () in obstack_grow ()
21285 to avoid macro variables shadowing.
21286
21287 2001-08-23 Marc Autret <autret_m@epita.fr>
21288
21289 * src/lex.c (percent_table): Typo: s/naem/name/.
21290 Add graph option.
21291 Normalize new options declarations.
21292
21293 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21294
21295 * tests/suite.at: Exercise %header_extension and %source_extension.
21296
21297 2001-08-16 Marc Autret <autret_m@epita.fr>
21298
21299 * src/reader.c (parse_dquoted_param): New.
21300 (parse_header_extension_decl): Use it.
21301 (parse_source_extension_decl): Likewise.
21302
21303 2001-08-16 Marc Autret <autret_m@epita.fr>
21304
21305 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21306 (get_xxxx_str): Use assert () instead of complain ().
21307 Remove return invokations in default cases.
21308 (get_decision_str): Modify default behaviour. Remove second argument.
21309 Echo modifications on calls.
21310 (output_graph): Fix.
21311
21312 2001-08-16 Marc Autret <autret_m@epita.fr>
21313
21314 * src/getargs.c (usage): Update with ``-g, --graph''.
21315
21316 2001-08-16 Marc Autret <autret_m@epita.fr>
21317
21318 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21319 (Option Cross Key): Likewise.
21320 * doc/bison.1: Update.
21321
1c8c2190
PB
213222001-09-25 Pascal Bart <pascal.bart@epita.fr>
21323
21324 * src/output.c (output_master_parser): Don't finish action_obstack.
21325 (output_parser): Don't care about the muscle action, here.
21326 (prepare): Copy the action_obstack in the action muscle.
21327 (output): Free action_obstack.
21328
180d45ba
PB
213292001-09-23 Pascal Bart <pascal.bart@epita.fr>
21330
21331 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21332 will contain `%union' declaration.
21333 (parse_union_decl): Delete #line directive output.
21334 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21335 informations about %union.
21336 (parse_union_decl): Copy the union_obstack in the muscle stype.
21337 * src/bison.simple: Add new #line directive.
21338 Add typdef %%stype YYSTYPE.
21339
c51d1a19
PB
213402001-09-23 Pascal Bart <pascal.bart@epita.fr>
21341
21342 * src/bison.simple: Add new `#line' directive.
21343
6f9344da
PB
213442001-09-22 Pascal Bart <pascal.bart@epita.fr>
21345
21346 * src/bison.simple: New `#line' directive.
21347 * src/output.c (output_parser): Support new dynamic muscle input_line.
21348
652def80
MA
213492001-09-22 Marc Autret <autret_m@epita.fr>
21350
21351 * src/output.c (output_master_parser): New.
21352 (output_parser): Be more re-entrant.
21353
25b222fa
MA
213542001-09-21 Marc Autret <autret_m@epita.fr>
21355
21356 * src/reader.c (copy_definition, parse_union_decl): Update and use
21357 `linef' muscle.
21358 (copy_action): Likewise.
21359 Use obstack_1grow ().
21360 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21361
6bc35ae5
MA
213622001-09-21 Marc Autret <autret_m@epita.fr>
21363
21364 * src/options.c (option_table): Adjust.
21365 * src/lex.c (parse_percent_token): Fix.
21366
c0629aa1
PB
213672001-09-20 Pascal Bart <pascal.bart@epita.fr>
21368
21369 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 21370
82b6d266
PB
213712001-09-20 Pascal Bart <pascal.bart@epita.fr>
21372
21373 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21374 is now an option_table_struct*.
21375 (option_strcmp): New function option_strcmp.
21376 (parse_percent_token): Call option_strcmp.
21377 * src/getargs.c (xalloc.h, options.h): Include it.
21378 (getargs): Call create_long_option_table.
21379 (getargs): Free longopts at the end of the function.
21380 (shortopts): Move in options.c.
21381 * src/options.c (create_long_option_table): New function. Convert
21382 information from option_table to option structure.
21383 * src/reader.c (options.h): Include it.
21384
21385 * src/Makefile.am: Adjust.
21386 * src/options.c (option_table): Create from longopts and percent_table.
21387 * src/getargs.c (longopts): Delete.
21388 * src/lex.c (struct percent_table_struct): Delete.
21389 (percent_table): Delete.
21390 (options.h): Include it.
21391 * src/options.c: Create.
21392 * src/options.h: Create.
21393 Declare enum opt_access_e.
21394 Define struct option_table_struct.
21395
75f5aaea
MA
213962001-09-20 Marc Autret <autret_m@epita.fr>
21397
21398 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21399 sections of Bison.
21400
f508cb0a
PB
214012001-09-19 Pascal Bart <pascal.bart@epita.fr>
21402
21403 * src/bison.simple: s/%%filename/%%skeleton.
21404 * src/muscle_tab.c (getargs.h): Include it.
21405 (muscle_init): Insert new muscle skeleton.
21406
13105fc1
PB
214072001-09-18 Pascal Bart <pascal.bart@epita.fr>
21408
21409 * src/output.c (output_parser): Delete unused variable actions_dumped.
21410
b0c4483e
PB
214112001-09-07 Pascal Bart <pascal.bart@epita.fr>
21412
21413 * src/output.c (output): Delete call to reader_output_yylsp.
21414 * src/reader.c (reader): Likewise.
ba0fe3c7 21415 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 21416
11d82f03
MA
214172001-09-02 Marc Autret <autret_m@epita.fr>
21418
21419 * src/reader.c: Include muscle_tab.h.
21420 (parse_union_decl): Update.
21421 (parse_macro_decl): Rename parse_muscle_decl.
21422 Update to use renamed functions and variable.
21423 (read_declarations, copy_action, read_additionnal_code, : Updated
21424 with correct variables and functions names.
21425 (packsymbols, reader): Likewise.
342b8b6e 21426
11d82f03 21427 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 21428
11d82f03
MA
21429 * src/output.c: Include muscle_tab.h
21430 In all functions using macro_insert, change by using muscle_insert ().
21431 (macro_obstack): Rename muscle_obstack.
21432 Echo modifications in the whole file.
21433 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21434 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21435 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21436
21437 * src/muscle_tab.h: Update double inclusion macros.
21438 (macro_entry_s): Rename muscle_entry_s.
21439 Update prototypes.
342b8b6e 21440
11d82f03
MA
21441 * src/muscle_tab.c: Include muscle_tab.h.
21442 Rename macro_tabble to muscle_table.
21443 (mhash1, mhash2, mcmp): Use muscle_entry.
21444 (macro_init): Rename muscle_init. Update.
21445 (macro_insert): Rename muscle_insert. Update.
21446 (macro_find): Rename muscle_find. Update.
21447
21448 * src/main.c: Include muscle_tab.h.
21449 (main): Call muscle_init ().
21450 * src/Makefile.am (bison_SOURCES): Echo modifications.
21451
93a37297
MA
214522001-09-02 Marc Autret <autret_m@epita.fr>
21453
f753cd62 21454 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 21455
f753cd62
MA
21456 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21457
214582001-09-02 Marc Autret <autret_m@epita.fr>
21459
21460 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 21461
682d48cd
PB
214622001-09-01 Pascal Bart <pascal.bart@epita.fr>
21463
342b8b6e 21464 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
21465 filename.
21466
087c8fda
MA
214672001-09-01 Marc Autret <autret_m@epita.fr>
21468
21469 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21470 to an explicit value to activate the feature. We do it here.
21471
dda680cb
PB
214722001-08-31 Pascal Bart <pascal.bart@epita.fr>
21473
21474 * src/output.c (prepare): Delete the `filename' muscule insertion.
21475 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21476 (parse_union_decl): Likewise.
21477 * src/macrotab.c (macro_init): Initialize filename by infile.
21478
9e644e64
MA
214792001-08-31 Marc Autret <autret_m@epita.fr>
21480
21481 * src/bison.simple (YYLSP_NEEDED): New definition.
21482 * src/output.c (prepare): Add macro insertion of `locations_flag'
21483
17da6427
PB
214842001-08-31 Pascal Bart <pascal.bart@epita.fr>
21485
21486 * src/output.c (prepare): Delete insertion of previous muscles,
21487 and insert the `prefix' muscles.
21488 * src/macrotab.c (macro_init): Likewise.
21489 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 21490 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
21491 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21492 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 21493 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
21494 name_prefix.
21495
e8cb70b9
PB
214962001-08-31 Pascal Bart <pascal.bart@epita.fr>
21497
21498 * src/main.c (main): Standardize.
21499 * src/output.c (output_table_data, output_parser): Likewise.
21500 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21501
63c2d5de
MA
215022001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21503
342b8b6e 21504 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
21505 %%epilogue.
21506 * src/output.c (output): Rename %%declarations to %%prologue.
21507 * src/bison.simple: Echo modifications.
342b8b6e 21508
d8cb5183
MA
215092001-08-31 Marc Autret <autret_m@epita.fr>
21510
21511 * src/reader.c (readgram): CleanUp.
21512 (output_token_defines): Likewise.
21513 (packsymbols): Likewise.
21514 (reader): Likewise.
21515 * src/output.c (output): CPP-out useless code.
21516
6c686258
PB
215172001-08-31 Pascal Bart <pascal.bart@epita.fr>
21518
342b8b6e 21519 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
21520 output_trailers and output_headers.
21521 * src/output.h: Remove obsolete functions prototypes of output_headers
21522 and output_trailers.
21523
8f451ef7
PB
215242001-08-30 Pascal Bart <pascal.bart@epita.fr>
21525
21526 * src/main.c: Include macrotab.h.
342b8b6e 21527 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
21528 Adjust functions prototypes.
21529 * src/macrotab.c (macro_insert): Constify key and value.
21530 (macro_find): Constify key.
21531 (macro_insert): Include 'xalloc.h'
21532 (macro_insert): Use XMALLOC.
21533 (macro_find): Constify return value.
21534 * src/output.c (output_table_data): Rename table to table_data.
21535 (output_parser): Constify macro_key, macro_value.
21536
997b6fd0 215372001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
21538
21539 * src/reader.c (parse_skel_decl): New.
342b8b6e 21540 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
21541 * src/lex.h (token_t): New token `tok_skel'.
21542 * src/lex.c (percent_table): Add skeleton option entry.
21543 Standardize.
21544
ff48177d
MA
215452001-08-29 Marc Autret <autret_m@epita.fr>
21546
21547 * src/bison.simple: Add %%user_code directive at the end.
21548 * src/reader.c (read_additionnal_code): New.
21549 (reader): Use it.
21550 * src/output.c (output_program): Remove.
21551 (output): Update.
21552
b33160bf
MA
215532001-08-28 Marc Autret <autret_m@epita.fr>
21554
21555 * src/output.c (output_actions): Clean up.
4e5caae2 21556 (output_gram): CPP-out useless code.
b33160bf
MA
21557 * src/reader.c (reader): Clean up, CPP-out useless code.
21558
d1a2daf7
PB
215592001-08-28 Pascal Bart <pascal.bart@epita.fr>
21560
342b8b6e 21561 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 21562 directive.
d1a2daf7
PB
21563 * src/bison.simple: Add `%%definitions'.
21564
2b763dfe
MA
215652001-08-28 Marc Autret <autret_m@epita.fr>
21566
21567 * config/depcomp: New file.
21568
f1a87ef6
PE
215692001-08-27 Paul Eggert <eggert@twinsun.com>
21570
21571 * src/bison.simple (yyparse): Don't take the address of an
21572 item before the start of an array, as that doesn't conform to
21573 the C Standard.
21574
82e236e2
RA
215752001-08-27 Robert Anisko <robert.anisko@epita.fr>
21576
f1a87ef6 21577 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
21578 obstack. It was done too late here.
21579
21580 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
21581 completely wrong.
21582 (reader): Initialize the macro obstack here, since we need it to grow
21583 '%define' directives.
21584
21585 * src/reader.h: Declare the macro obstack as extern.
21586
b0cfa28a
RA
215872001-08-27 Robert Anisko <robert.anisko@epita.fr>
21588
21589 * src/output.c (output_parser): Fix. Store single '%' characters in
21590 the output obstack instead of throwing them away.
21591
6fc74234
AD
215922001-08-27 Akim Demaille <akim@epita.fr>
21593
21594 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21595
9c76d118
RA
215962001-08-25 Robert Anisko <robert.anisko@epita.fr>
21597
21598 * lib/Makefile.am: Adjust.
21599
a8289c62
RA
216002001-08-25 Robert Anisko <robert.anisko@epita.fr>
21601
21602 * src/bison.simple: Update and add '%%' directives.
21603
b6610515
RA
216042001-08-25 Robert Anisko <robert.anisko@epita.fr>
21605
21606 * src/reader.c (reader): Remove calls to 'output_headers' and
21607 'output_trailers'. Remove some C output.
21608 (readgram): Disable a piece of code that was writing a default
21609 definition for 'YYSTYPE'.
21610 (reader_output_yylsp): Remove.
21611 (packsymbols): Output token defintions to a macro.
21612 (copy_definition): Disable C output.
6fc74234 21613
b6610515
RA
21614 * src/reader.c (parse_macro_decl): New function used to parse macro
21615 declarations.
21616 (copy_string2): Put the body of copy_string into this new function.
21617 Add a parameter to let the caller choose whether he wants to copy the
21618 string delimiters or not.
21619 (copy_string): Be a simple call to copy_string2 with the last argument
21620 bound to true.
21621 (read_declarations): Add case for macro definition.
21622 (copy_identifier): New.
6fc74234 21623 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
21624 rather than lex.
21625
26f609ff
RA
216262001-08-25 Robert Anisko <robert.anisko@epita.fr>
21627
21628 * src/output.c (prepare): Add prefixed names.
21629 (output_parser): Output semantic actions.
21630 (output_parser): Fix bug on '%%line' directives.
6fc74234 21631
26f609ff
RA
21632 * src/output.c (output_headers): Remove. The C code printed by this
21633 function should now be in the skeletons.
21634 (output_trailers): Remove.
21635 (output): Disable call to 'reader_output_yylsp'.
21636 (output_rule_data): Do not output tables to the table obstack.
21637
21638 * src/output.c: Remove some C dedicated output.
21639 Improve the use of macro and output obstacks.
21640 (output_defines): Remove.
6fc74234 21641
26f609ff
RA
21642 * src/output.c (output_token_translations): Associate 'translate'
21643 table with a macro. No output to the table obstack.
21644 (output_gram): Same for 'rhs' and 'prhs'.
21645 (output_stos): Same for 'stos'.
21646 (output_rule_data): Same for 'r1' and 'r2'.
21647 (token_actions): Same for 'defact'.
21648 (goto_actions): Same for 'defgoto'.
21649 (output_base): Same for 'pact' and 'pgoto'.
21650 (output_table): Same for 'table'.
21651 (output_check): Same for 'check'.
6fc74234 21652
26f609ff
RA
21653 * src/output.c (output_table_data): New function.
21654 (output_short_table): Remove.
21655 (output_short_or_char_table): Remove.
6fc74234 21656
26f609ff
RA
21657 * src/output.c (output_parser): Replace most of the skeleton copy code
21658 with something new. Skeletons are now processed character by character
21659 rather than line by line, and Bison looks for '%%' macros. This is the
21660 first step in making Bison's output process (a lot) more flexible.
21661 (output_parser): Use the macro table.
21662
6f43b113
RA
216632001-08-25 Robert Anisko <robert.anisko@epita.fr>
21664
21665 * src/main.c (main): Initialize the macro table.
21666
dd3127cf
RA
216672001-08-25 Robert Anisko <robert.anisko@epita.fr>
21668
21669 * src/lex.c (percent_table): Add tok_define.
21670 * src/lex.h: Add tok_define.
21671
aa321494
RA
216722001-08-25 Robert Anisko <robert.anisko@epita.fr>
21673
21674 * src/macrotab.c: New file.
21675 * src/macrotab.h: New file.
21676 * src/Makefile.am: Update.
21677
68bd3b6b
RA
216782001-08-25 Robert Anisko <robert.anisko@epita.fr>
21679
21680 * lib/hash.c: New file.
21681 * lib/hash.h: New file.
21682 * lib/Makefile.am: Update.
21683
45f8dd1e
AD
216842001-08-15 Akim Demaille <akim@epita.fr>
21685
21686 Version 1.28c.
21687
40a64a7a 216882001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
21689
21690 * src/reader.c (readgram): Indent output macro YYSTYPE.
21691 (packsymbols): Likewise.
21692 (output_token_defines): Likewise.
21693 * src/files.c: Standardize.
21694 (compute_header_macro): New.
21695 (defines_obstack_save): New. Use compute_header_macro.
21696 (output_files): Update. Use defines_obstack_save.
21697
f9a8293a
AD
216982001-08-15 Akim Demaille <akim@epita.fr>
21699
21700 * doc/bison.texinfo (Table of Symbols): Document
21701 YYSTACK_USE_ALLOCA.
21702
150ca7a7
AD
217032001-08-15 Akim Demaille <akim@epita.fr>
21704
21705 * missing: Update from CVS Automake.
21706 * config/config.guess, config/config.sub, config/texinfo.tex:
21707 Update from gnu.org.
21708
69b5cec4
AD
217092001-08-15 Akim Demaille <akim@epita.fr>
21710
21711 * Makefile.maint: Sync with CVS Autoconf.
21712
f2b5126e
PB
217132001-08-14 Pascal Bart <pascal.bart@epita.fr>
21714
69b5cec4 21715 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
21716 `fdl.texi'.
21717 * doc/fdl.texi: Add to package.
21718
4ecbf796
MA
217192001-08-14 Marc Autret <autret_m@epita.fr>
21720
21721 Turn on %{source,header}_extension features.
21722
69b5cec4 21723 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
21724 source_extension.
21725 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 21726 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
21727 between options.
21728
95fb5662
MA
217292001-08-14 Marc Autret <autret_m@epita.fr>
21730
21731 * src/files.c (compute_base_names): Add extensions computing when
21732 `--file-prefix' used.
21733 Standardize function calls.
21734
78d09da9
MA
217352001-08-13 Marc Autret <autret_m@epita.fr>
21736
69b5cec4 21737 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
21738 defining it (defined but null disables alloca).
21739
5a009f2c
MA
217402001-08-13 Marc Autret <autret_m@epita.fr>
21741
21742 * src/bison.simple (_yy_memcpy): CPP reformat.
21743
1e41465a
PB
217442001-08-13 Pascal Bart <pascal.bart@epita.fr>
21745
21746 * tests/atconfig.in (CPPFLAGS): Fix.
21747
c67a198d
PB
217482001-08-10 Pascal Bart <pascal.bart@epita.fr>
21749
79282c6c 21750 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
21751 `gpl.texi'.
21752 * doc/gpl.texi: Add to package.
21753
09a6de7e
MA
217542001-08-10 Marc Autret <autret_m@epita.fr>
21755
21756 * src/print_graph.h: Fix.
21757 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21758
b77b9ee0
AD
217592001-08-10 Akim Demaille <akim@epita.fr>
21760
21761 * src/system.h: Provide default declarations for stpcpy, strndup,
21762 and strnlen.
21763
3e259915
MA
217642001-08-10 Robert Anisko <anisko_r@epita.fr>
21765
21766 * doc/bison.texinfo (Locations): Update @$ stuff.
21767
ca96bc2d
MA
217682001-08-09 Robert Anisko <anisko_r@epita.fr>
21769
21770 * src/bison.simple (YYLLOC_DEFAULT): Update.
21771 (yyparse): Adjust.
21772
fdc6758b
MA
217732001-08-08 Marc Autret <autret_m@epita.fr>
21774
b77b9ee0 21775 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
21776 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21777 Reported by Fabrice Bauzac.
957d4dbf 21778
600cad3b
MA
217792001-08-08 Marc Autret <autret_m@epita.fr>
21780
21781 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21782 * src/vcg.c (output_node): Fix.
21783 * src/vcg.h: Cleanup.
21784 * src/print_graph.c: Add comments.
b77b9ee0 21785 (node_output_size): New global variable. Simplify the formatting of
600cad3b 21786 the VCG graph output.
b77b9ee0 21787 (print_actions): Unused code is now used. It notifies the final state
600cad3b 21788 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 21789 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
21790 blue.
21791 Get the current node name and node_obstack by argument.
21792 (node_obstack): New variable.
21793 (print_state): Manage node_obstack.
21794 (print_core): Use node_obstack given by argument.
21795 A node is not only computed here but in print_actions also.
21796 (print_graph): CPP out useless code instead of commenting it.
21797
976e528f
AD
217982001-08-07 Pascal Bart <pascal.bart@epita.fr>
21799
21800 * tests/atconfig.in (CPPFLAGS): Fix.
21801
20e8e5ca
AD
218022001-08-07 Akim Demaille <akim@epita.fr>
21803
21804 * src/print_graph.c (quote): New.
21805 (print_core): Use it.
21806
957d4dbf 218072001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 21808
3e3da797
AD
21809 * src/vcg.c (complain.h): Include it.
21810 Unepitaize `return' invocations.
c4b66126 21811 [NDEBUG] (main): Remove.
79282c6c 21812 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
21813 * src/files.c (open_files): Initialize graph_obstack.
21814 * src/print_graph.c (print_actions): CPP out useless code.
21815 (print_core): Don't output the last `\n' in labels.
21816 Use `quote'.
21817 * src/files.c (output_files): Output the VCG file.
21818 * src/main.c (main): Invoke print_graph ();
3e3da797 21819
957d4dbf 218202001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
21821
21822 Automaton VCG graph output.
21823 Using option ``-g'' or long option ``--graph'', you can generate
21824 a gram_filename.vcg file containing a VCG description of the LALR (1)
21825 automaton of your grammar.
21826
21827 * src/main.c: Call to print_graph() function.
21828 * src/getargs.h: Update.
21829 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21830 (graph_flag): New flag.
21831 (longopts): Update.
21832 (getargs): Add case `g'.
21833 * src/files.c (graph_obstack): New obstack struct.
21834 (open_files): Initialize new obstack.
21835 (output_files): Saves graph_obstack if required.
21836 * src/files.h (graph_obstack): New extern declaration.
21837 * src/Makefile.am: Add new source files.
21838
927c1557 218392001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
21840
21841 * src/print_graph.c, src/print_graph.h (graph): New.
21842 * src/vcg.h: New file.
21843 * src/vcg.c: New file, VCG graph handling.
21844
7333d403
AD
218452001-08-06 Marc Autret <autret_m@epita.fr>
21846
21847 Add of %source_extension and %header_extension which specify
21848 the source or/and the header output file extension.
21849
21850 * src/files.c (compute_base_names): Remove initialisation of
21851 src_extension and header_extension.
21852 (compute_exts_from_gf): Update.
21853 (compute_exts_from_src): Update.
21854 (output_files): Update.
21855 * src/reader.c (parse_header_extension_decl): New.
21856 (parse_source_extension_decl): New.
21857 (read_declarations): New case statements for the new tokens.
21858 * src/lex.c (percent_table): Add entries for %source_extension
21859 and %header_extension.
21860 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21861
84163231
AD
218622001-08-06 Marc Autret <autret_m@epita.fr>
21863
21864 * configure.in: Bump to 1.28c.
21865 * doc/bison.texinfo: Texinfo thingies.
21866
8303fc42
AD
218672001-08-04 Pascal Bart <pascal.bart@epita.fr>
21868
21869 * tests/atconfig.in (CPPFLAGS): Add.
21870 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21871
70a84437
AD
218722001-08-03 Akim Demaille <akim@epita.fr>
21873
21874 Version 1.28b.
21875
2ce10144
AD
218762001-08-03 Akim Demaille <akim@epita.fr>
21877
21878 * tests/Makefile.am (check-local): Ship testsuite.
21879 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21880 Include `string.h'.
21881
1e3e4bc1
AD
218822001-08-03 Akim Demaille <akim@epita.fr>
21883
21884 * configure.in: Try using -Wformat when compiling.
21885
42b45b7f
AD
218862001-08-03 Akim Demaille <akim@epita.fr>
21887
21888 * configure.in: Bump to 1.28b.
21889
8f13fe33
AD
218902001-08-03 Akim Demaille <akim@epita.fr>
21891
21892 * src/complain.c: Adjust strerror_r portability issues.
21893
b37ba92c
AD
218942001-08-03 Akim Demaille <akim@epita.fr>
21895
21896 Version 1.28a.
21897
b0ce6046
AD
218982001-08-03 Akim Demaille <akim@epita.fr>
21899
21900 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21901 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21902 * src/getargs.c: Include complain.h.
21903 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21904 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21905
d01c415b
AD
219062001-08-03 Akim Demaille <akim@epita.fr>
21907
21908 * src/reader.c (readgram): Display hidden chars in error messages.
21909
459dd1a6
AD
219102001-08-03 Akim Demaille <akim@epita.fr>
21911
21912 Update to gettext 0.10.39.
21913
53b74c0c
AD
219142001-08-03 Akim Demaille <akim@epita.fr>
21915
21916 * lib/strspn.c: New.
21917
234a3be3
AD
219182001-08-01 Marc Autret <autret_m@epita.fr>
21919
21920 * doc/bison.texinfo: Update.
21921 * doc/bison.1 (mandoc): Update.
21922 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21923 * src/files.c: Support output files extensions computing.
21924 (src_extension): New static variable.
21925 (header_extension): New static variable.
21926 (tr): New function.
21927 (get_extension_index): New function, gets the index of an extension
21928 filename in a string.
21929 (compute_exts_from_gf): New function, computes extensions from the
21930 grammar file extension.
21931 (compute_exts_from_src): New functions, computes extensions from the
21932 C source file extension, file given by ``-o'' option.
21933 (compute_base_names): Update.
21934 (output_files): Update.
21935
847bf1f5
AD
219362001-08-01 Robert Anisko <anisko_r@epita.fr>
21937
d995fee7 21938 * doc/bison.texi: Document @$.
847bf1f5
AD
21939 (Locations): New section.
21940
d074a105
AD
219412001-07-18 Akim Demaille <akim@epita.fr>
21942
21943 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21944 * config/prev-version.txt, config/move-if-change: New.
21945 * Makefile.am: Adjust.
21946
3419715d
AD
219472001-07-08 Pascal Bart <pascal.bart@epita.fr>
21948
21949 * src/bison.simple (yyparse): Suppress warning `comparaison
21950 between signed and unsigned'.
21951
62ab6972
AD
219522001-07-05 Pascal Bart <pascal.bart@epita.fr>
21953
21954 * src/getargs.h (raw_flag): Remove.
21955 * src/getargs.c: Die on `-r'/`--raw'.
21956 * src/lex.c (parse_percent_token): Die on `%raw'.
21957 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21958 * tests/calc.at: Suppress test with option `--raw'.
21959
1e24cc5b
AD
219602001-07-14 Akim Demaille <akim@epita.fr>
21961
21962 * config/: New.
21963 * configure.in: Require Autoconf 2.50.
21964 Update to gettext 0.10.38.
21965
32dfccf8
AD
219662001-03-16 Akim Demaille <akim@epita.fr>
21967
21968 * doc/bison.texinfo: ANSIfy the examples.
21969
cd5bd6ac
AD
219702001-03-16 Akim Demaille <akim@epita.fr>
21971
21972 * getargs.c (skeleton): New variable.
21973 (longopts): --skeleton is a new option.
21974 (shortopts, getargs): -S is a new option.
21975 * getargs.h: Declare skeleton.
21976 * output.c (output_parser): Use it.
21977
5141b016
AD
219782001-03-16 Akim Demaille <akim@epita.fr>
21979
21980 * m4/strerror_r.m4: New.
21981 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21982 * lib/error.h, lib/error.c: Update.
21983
447992b9
AD
219842001-03-16 Akim Demaille <akim@epita.fr>
21985
21986 * src/getargs.c (longopts): Clean up.
21987
274d42ce
AD
219882001-02-21 Akim Demaille <akim@epita.fr>
21989
21990 * src/reader.c (gensym): `gensym_count' is your own.
21991 Use a static buf to create the symbol name, as token_buffer is no
21992 longer a buffer.
21993
22c821f3
AD
219942001-02-08 Akim Demaille <akim@epita.fr>
21995
21996 * src/conflicts.c (conflict_report): Be sure not to append to res
21997 between two calls, which could happen if both first sprintf were
21998 skipped, but not the first cp += strlen.
21999
18569462
AD
220002001-02-08 Akim Demaille <akim@epita.fr>
22001
22002 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22003 New, from fileutils 4.0.37.
22004 * configure.in: Require Autoconf 2.49c. I took some time before
22005 making this decision. This is the only way out for portability
22006 issues in Bison, it would mean way too much duplicate effort to
22007 import in Bison features implemented in 2.49c since 2.13.
22008 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22009
0d8f3c8a
AD
220102001-02-02 Akim Demaille <akim@epita.fr>
22011
22012 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 22013 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 22014
f17bcd1f
AD
220152001-01-19 Akim Demaille <akim@epita.fr>
22016
22017 Get rid of the ad hoc handling of token_buffer in the scanner: use
22018 the obstacks.
22019
22020 * src/lex.c (token_obstack): New.
22021 (init_lex): Initialize it. No longer call...
22022 (grow_token_buffer): this. Remove it.
22023 Adjust all the places which used it to use the obstack.
22024
511e79b3
AD
220252001-01-19 Akim Demaille <akim@epita.fr>
22026
22027 * src/lex.h: Rename all the tokens:
22028 s/\bENDFILE\b/tok_eof/g;
22029 s/\bIDENTIFIER\b/tok_identifier/g;
22030 etc.
22031 Let them be enums, not #define, to ease debugging.
22032 Adjust all the code.
22033
0d6508ef
AD
220342001-01-18 Akim Demaille <akim@epita.fr>
22035
22036 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
22037 * src/lex.c (maxtoken, grow_token_buffer): Static.
22038
6deb4447
AD
220392001-01-18 Akim Demaille <akim@epita.fr>
22040
22041 Since we now use obstacks, more % directives can be enabled.
22042
22043 * src/lex.c (percent_table): Also accept `%yacc',
22044 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
22045 `%debug'.
22046 Handle the actions for `%semantic_parser' and `%pure_parser' here,
22047 instead of returning a token.
22048 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
22049 * src/reader.c (read_declarations): Adjust.
22050 * src/files.c (open_files): Don't call `compute_base_names', don't
22051 compute `attrsfile' since they depend upon data which might be
22052 *in* the input file now.
22053 (output_files): Do it here.
22054 * src/output.c (output_headers): Document the fact that this patch
22055 introduces a guaranteed SEGV for semantic parsers.
22056 * doc/bison.texinfo: Document them.
22057 * tests/suite.at: Exercise these %options.
22058
ff4423cc
AD
220592000-12-20 Akim Demaille <akim@epita.fr>
22060
22061 Also handle the output file (--verbose) with obstacks.
22062
22063 * files.c (foutput): Remove.
22064 (output_obstack): New.
22065 Adjust all dependencies.
22066 * src/conflicts.c: Return a string.
22067 * src/system.h (obstack_grow_string): Rename as...
22068 (obstack_sgrow): this. Be ready to work with non literals.
22069 (obstack_fgrow4): New.
22070
956dba3a
AD
220712000-12-20 Akim Demaille <akim@epita.fr>
22072
22073 * src/files.c (open_files): Fix the computation of short_base_name
22074 in the case of `-o foo.tab.c'.
22075
337bab46
AD
220762000-12-20 Akim Demaille <akim@epita.fr>
22077
22078 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
22079 (copy_dollar): Now that everything uses obstacks, get rid of the
22080 FILE * parameters.
22081
5d3214b8
AD
220822000-12-20 Akim Demaille <akim@epita.fr>
22083
22084 * src/files.c (open_files): Actually the `.output' file is based
22085 on the short_base_name, not base_name.
22086 * tests/suite.at (Checking output file names): Adjust.
22087
29092a57
AD
220882000-12-20 Akim Demaille <akim@epita.fr>
22089
22090 * src/bison.s1: Remove, we now use directly...
22091 * src/bison.simple: this.
22092 * src/Makefile.am: Use pkgdata instead of data.
22093
ea5607fd
AD
220942000-12-20 Akim Demaille <akim@epita.fr>
22095
22096 * src/files.c (guard_obstack): New.
22097 (open_files): Initialize it.
22098 (output_files): Dump it...
22099 * src/files.h: Export it.
22100 * src/reader.c (copy_guard): Use it.
22101
27110317
AD
221022000-12-19 Akim Demaille <akim@epita.fr>
22103
22104 * src/files.c (outfile, defsfile, actfile): Removed as global
22105 vars.
22106 (open_files): Don't compute them.
22107 (output_files): Adjust.
22108 (base_name, short_base_name): Be global.
22109 Adjust dependencies.
22110
19c50364
AD
221112000-12-19 Akim Demaille <akim@epita.fr>
22112
22113 * src/files.c (strsuffix): New.
22114 (stringappend): Be just like strcat but allocate.
22115 (base_names): Eve out from open_files.
22116 Try to simplify the rather hairy computation of base_name and
22117 short_base_name.
22118 (open_files): Use it.
22119 * tests/suite.at (Checking output file names): New test.
22120
573c1d9f
AD
221212000-12-19 Akim Demaille <akim@epita.fr>
22122
22123 * src/system.h (obstack_grow_literal_string): Rename as...
22124 (obstack_grow_string): this.
22125 * src/output.c (output_parser): Recognize `%% actions' instead of
22126 `$'.
22127 * src/bison.s1: s/$/%% actions/.
22128 * src/bison.hairy: Likewise.
22129
ef7ddedd
AD
221302000-12-19 Akim Demaille <akim@epita.fr>
22131
22132 * src/output.c (output_parser): Compute the `#line' lines when
22133 there are.
22134 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
22135 Suggested by Hans Aberg.
22136
ff61dabd
AD
221372000-12-19 Akim Demaille <akim@epita.fr>
22138
22139 Let the handling of the skeleton files be local to the procedures
22140 that use it.
22141
22142 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
22143 longer static.
22144 (fparser, open_extra_files): Remove.
22145 (open_files, output_files): Don't take care of fparser.
22146 * src/files.h: Adjust.
22147 * src/output.c (output_parser): Open and close the file to the
22148 skeleton.
22149 * src/reader.c (read_declarations): When %semantic_parser, open
22150 fguard.
22151
55b96341
AD
221522000-12-19 Akim Demaille <akim@epita.fr>
22153
22154 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
22155 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
22156
358c15b7
AD
221572000-12-19 Akim Demaille <akim@epita.fr>
22158
22159 * src/files.c (open_files): Yipee! We no longer need all the code
22160 looking for `/tmp' since we have no tmp file.
22161
7de3329e
AD
221622000-12-19 Akim Demaille <akim@epita.fr>
22163
22164 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
22165 New macros.
22166 * src/files.c (open_files): Less dependency on MSDOS etc.
22167
3abcd459
AD
221682000-12-14 Akim Demaille <akim@epita.fr>
22169
22170 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
22171 Provide a default definition.
22172 Use it when executing the default @ action.
22173 * src/reader.c (reader_output_yylsp): No longer include
22174 `timestamp' and `text' in the default YYLTYPE.
22175
2a91a95e
AD
221762000-12-12 Akim Demaille <akim@epita.fr>
22177
22178 * src/reader.c (copy_definition, parse_union_decl, copy_action)
22179 (copy_guard): Quote the file names.
22180 Reported by Laurent Mascherpa.
22181
14d3eb9b
AD
221822000-12-12 Akim Demaille <akim@epita.fr>
22183
22184 * src/output.c (output_headers, output_program, output): Be sure
22185 to escape special characters when outputting filenames.
22186 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
22187 (output_headers): Don't depend on them, Use ACTSTR.
22188
d7045ec6
AD
221892000-11-17 Akim Demaille <akim@epita.fr>
22190
22191 * lib/obstack.h: Formatting changes.
22192 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
22193 prevents type checking.
22194 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
22195 cast the value to (void *): assigning a `foo *' to a `void *'
22196 variable is valid.
22197 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
22198 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
22199 append characters.
22200
6fd54b73
AD
222012000-11-17 Akim Demaille <akim@epita.fr>
22202
22203 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
22204 as...
22205 (suite.m4, regression.m4, calc.m4): these.
22206 * tests/atgeneral.m4: Update from CVS Autoconf.
22207
4c50eae6
AD
222082000-11-17 Akim Demaille <akim@epita.fr>
22209
22210 * tests/regression.m4 (%union and --defines): New test,
22211 demonstrating a current bug in the obstack implementation.
22212
a35f64ea
AD
222132000-11-17 Akim Demaille <akim@epita.fr>
22214
22215 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22216 macros.
22217 Use them to declare the variables which are global or local to
22218 `yyparse'.
22219
7de23534
AD
222202000-11-17 Akim Demaille <akim@epita.fr>
22221
22222 * acconfig.h: Remove, no longer used.
22223
aa7815f5
AD
222242000-11-07 Akim Demaille <akim@epita.fr>
22225
22226 * src: s/Copyright (C)/Copyright/g.
22227
5af1f549
AD
222282000-11-07 Akim Demaille <akim@epita.fr>
22229
22230 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22231 defining.
22232 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22233
553e2b22
AD
222342000-11-07 Akim Demaille <akim@epita.fr>
22235
22236 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22237 Merge in a single CPP if/else.
22238
8a4f41d6
AD
222392000-11-07 Akim Demaille <akim@epita.fr>
22240
22241 * src/output.c (output): Remove useless variables.
22242 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22243 argument `data' for consistency with the prototypes.
22244 Qualify it `const'.
22245 (obstack_copy, obstack_copy0): Rename the second argument as
22246 `address' for consistency. Qualify it `const'.
22247 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22248 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22249 `const' their input argument (`data' or `address').
22250 Adjust the corresponding macros to include `const' in casts.
22251
095a3fb5
AD
222522000-11-03 Akim Demaille <akim@epita.fr>
22253
22254 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22255 s/PFILE1/BISON_HAIRY/.
22256 Adjust dependencies.
22257
d1cdce7c
AD
222582000-11-03 Akim Demaille <akim@epita.fr>
22259
090c5ebf 22260 For some reason, this was not applied.
d1cdce7c
AD
22261
22262 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22263 `unlink': it's no longer used.
22264
9311529b
AD
222652000-11-03 Akim Demaille <akim@epita.fr>
22266
22267 * src/files.c (skeleton_find): New function, eved out of...
22268 (open_files, open_extra_files): here.
22269
d8880f69
AD
222702000-11-03 Akim Demaille <akim@epita.fr>
22271
22272 Don't use `atexit'.
22273
22274 * src/files.c (obstack_save): New function.
22275 (done): Rename as...
22276 (output_files): this.
22277 Use `obstack_save'.
22278 * src/main.c (main): Don't use `atexit' to register `done', since
22279 it no longer has to remove tmp files, just call `output_files'
22280 when there are no errors.
22281
0dbb648e
AD
222822000-11-02 Akim Demaille <akim@epita.fr>
22283
22284 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22285 `unlink': it's no longer used.
22286 * src/files.h: Formatting changes.
22287
896fe5c1
AD
222882000-11-02 Akim Demaille <akim@epita.fr>
22289
22290 Remove the last uses of mktemp and unlink/delete.
22291
22292 * src/files.c (fdefines, ftable): Removed.
22293 (defines_ostack, table_obstack): New.
22294 Adjust dependencies of the former into uses of the latter.
22295 * src/output.c (output_short_or_char_table, output_short_table):
22296 Convert to using obstacks.
22297 * src/reader.c (copy_comment2): Accept one FILE * and two
22298 obstacks.
22299 (output_token_defines, reader_output_yylsp): Use obstacks.
22300 * src/system.h (obstack_fgrow3): New.
1f65350a 22301 * po/POTFILES.in: Adjust.
896fe5c1 22302
dd60faec
AD
223032000-11-01 Akim Demaille <akim@epita.fr>
22304
22305 Change each use of `fattrs' into a use of `attrs_obstack'.
22306
22307 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22308 * src/files.c (fattrs): Remove.
22309 (attrs_obstack): New.
22310 Adjust all dependencies.
22311 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22312
8c7ebe49
AD
223132000-11-01 Akim Demaille <akim@epita.fr>
22314
22315 Introduce obstacks.
22316 Change each use of `faction' into a use of `action_obstack'.
22317
22318 * lib/obstack.h, lib/obstack.c: New files.
22319 * src/files.c (faction): Remove.
22320 (action_obstack): New.
22321 Adjust all dependencies.
22322
77aee789
AD
223232000-10-20 Akim Demaille <akim@epita.fr>
22324
22325 * lib/quote.h (PARAMS): New macro. Use it.
22326
43591cec
AD
223272000-10-16 Akim Demaille <akim@epita.fr>
22328
22329 * src/output.c (output_short_or_char_table): New function.
22330 (output_short_table, output_token_translations): Use it.
22331 (goto_actions): Use output_short_table.
22332
1e9798d5
AD
223332000-10-16 Akim Demaille <akim@epita.fr>
22334
22335 * src/symtab.c (bucket_new): New function.
22336 (getsym): Use it.
22337
22338 * src/output.c (output_short_table): New argument to display the
22339 comment associated with the table.
22340 Adjust dependencies.
22341 (output_gram): Use it.
22342 (output_rule_data): Nicer output layout for YYTNAME.
22343
f282676b
AD
223442000-10-16 Akim Demaille <akim@epita.fr>
22345
22346 * src/lex.c (read_typename): New function.
22347 (lex): Use it.
22348 * src/reader.c (copy_dollar): Likewise.
22349
550a72a3
AD
223502000-10-16 Akim Demaille <akim@epita.fr>
22351
22352 * src/reader.c (copy_comment2): Expect the input stream to be on
22353 the `/' which is suspected to open a comment, instead of being
22354 called after `//' or `/*' was read.
22355 (copy_comment, copy_definition, parse_union_decl, copy_action)
22356 (copy_guard): Adjust.
22357
131e2fef
AD
223582000-10-16 Akim Demaille <akim@epita.fr>
22359
22360 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22361 `read_signed_integer'.
22362
79282c5a
AD
223632000-10-16 Akim Demaille <akim@epita.fr>
22364
22365 * src/reader.c (copy_dollar): New function.
22366 (copy_guard, copy_action): Use it.
22367
ff4a34be
AD
223682000-10-16 Akim Demaille <akim@epita.fr>
22369
22370 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22371 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22372 New files, from Fileutils 4.0.27.
22373 * src/main.c (printable_version): Remove.
22374 * src/lex.c, src/reader.c: Use `quote'.
22375
223762000-10-04 Akim Demaille <akim@epita.fr>
22377
22378 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22379
14ded682
AD
223802000-10-04 Akim Demaille <akim@epita.fr>
22381
22382 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22383
8e03724b
AD
223842000-10-04 Akim Demaille <akim@epita.fr>
22385
22386 When a literal string is used to define two different tokens,
22387 `bison -v' segfaults.
22388 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22389
22390 * tests/regression.m4: New file.
22391 Include the core of the sample provided by Piotr Gackiewicz.
22392 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22393 properly.
22394
a9e64249
AD
223952000-10-04 Akim Demaille <akim@epita.fr>
22396
22397 * src/reader.c (parse_expect_decl): Keep `count' within the size
22398 of `buffer'.
22399 From Neil Booth.
22400
da9abf43
AD
224012000-10-02 Paul Eggert <eggert@twinsun.com>
22402
22403 * bison.s1 (yyparse): Assign the default value
22404 unconditionally, to avoid a GCC warning and make the parser a
22405 tad smaller.
22406
c33638bb
AD
224072000-10-02 Akim Demaille <akim@epita.fr>
22408
22409 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22410 options.
22411
444c570a
AD
224122000-10-02 Akim Demaille <akim@epita.fr>
22413
22414 * src/derives.c, src/print.c, src/reduce.c: To ease the
22415 translation, move some `\n' out of the translated strings.
22416
89cab50d
AD
224172000-10-02 Akim Demaille <akim@epita.fr>
22418
22419 The location tracking mechanism is precious for parse error
22420 messages. Nevertheless, it is enabled only when `@n' is used in
22421 the grammar, which is a different issue (you can use it in error
22422 message, but not in the grammar per se). Therefore, there should
22423 be another means to enable it.
22424
22425 * src/getargs.c (getargs): Support `--locations'.
22426 (usage): Report it.
22427 * src/getargs.h (locationsflag): Export it.
22428 * src/lex.c (percent_table): Support `%locations'.
22429 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22430 with `locationsflag'.
22431 * doc/bison.texinfo: Document `--locations' and `%locations'.
22432 Sort the options.
22433 * tests/calc.m4: Test it.
22434
22435 For regularity of the names, replace each
22436 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22437 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22438 In addition replace each `flag' with `_flag'.
22439
d6c2cba0
AD
224402000-10-02 Akim Demaille <akim@epita.fr>
22441
22442 Also test parse error messages, including with YYERROR_VERBOSE.
22443
22444 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22445 associative).
22446 Use it to check the computations.
22447 Use it to check `nonassoc' is honored.
22448 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22449 `--yyerror-verbose'.
22450 (_AT_CHECK_CALC): Adjust to this option.
22451 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22452
5a35a6cb
AD
224532000-10-02 Akim Demaille <akim@epita.fr>
22454
22455 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22456 the latter demonstrates a flaw in the handling of non debugging
22457 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22458 was used in order to simplify:
22459
22460 #if YYDEBUG
22461 if (yydebug)
22462 {
22463 ...
22464 }
22465 #endif
22466
22467 into
22468
22469 if (yydebug)
22470 {
22471 ...
22472 }
22473
22474 unfortunately this leads to a CPP conflict when
22475 `--name-prefix=foo' is used since it produces `#define yydebug
22476 foodebug'.
22477
22478 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22479 (YYDPRINTF): New macro.
22480 Spread its use.
22481 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22482 the bison options.
22483 Also test `--verbose', `--defines' and `--name-prefix'.
22484
71da9eea
AD
224852000-10-02 Akim Demaille <akim@epita.fr>
22486
22487 Improve the readability of the produced parsers.
22488
22489 * src/bison.s1: Formatting changes.
22490 Improve the comment related to the `$' mark.
22491 (yydefault): Don't fall through to `yyresume': `goto' there.
22492 * src/output.c (output_parser): When the `$' is met, skip the end
22493 of its line.
22494 New variable, `number_of_dollar_signs', to check there's exactly
22495 one `$' in the parser skeleton.
22496
95e36146
AD
224972000-10-02 Akim Demaille <akim@epita.fr>
22498
22499 * lib/xstrdup.c: New file, from the fileutils.
22500 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22501 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22502 instead of strlen + xmalloc + strcpy.
22503 * src/symtab.c (copys): Remove, use xstrdup instead.
22504
d7020c20
AD
225052000-10-02 Akim Demaille <akim@epita.fr>
22506
22507 * src/gram.h (associativity): New enum type which replaces the
22508 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22509 `right_assoc', `left_assoc' and `non_assoc'.
22510 Adjust all dependencies.
22511 * src/reader.c: Formatting changes.
22512 (LTYPESTR): Don't define it, use it as a literal in
22513 `reader_output_yylsp'.
22514 * src/symtab.h (symbol_class): New enum type which replaces the
22515 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22516 `sunknown', `stoken and `snterm'.
22517
1916f98e
AD
225182000-10-02 Akim Demaille <akim@epita.fr>
22519
22520 * src/getargs.c (fixed_outfiles): Rename as...
22521 (yaccflag): for consistency and accuracy.
22522 Adjust dependencies.
22523
d7913476
AD
225242000-10-02 Akim Demaille <akim@epita.fr>
22525
22526 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
22527 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
22528 difficult and introduced a lot of core dump. It turns out that
22529 Bison used an implementation of `xmalloc' based on `calloc', and
22530 at various places it does depend upon the initialization to 0. I
22531 have not tried to isolate the pertinent places, and all the former
22532 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
22533 someone should address this issue.
22534
22535 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
22536 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
22537 files.
22538 Adjust dependencies.
22539 * src/warshall.h: New file.
22540 Propagate.
22541
340ef489
AD
225422000-10-02 Akim Demaille <akim@epita.fr>
22543
22544 Various anti-`extern in *.c' changes.
22545
22546 * src/system.h: Include `assert.h'.
22547
b2ca4022
AD
225482000-10-02 Akim Demaille <akim@epita.fr>
22549
22550 * src/state.h (nstates, final_state, first_state, first_shift)
22551 (first_reduction): Move their exportation from here...
22552 * src/LR0.h: to here.
22553 Adjust dependencies.
22554 * src/getargs.c (statisticsflag): New variable.
22555 Add support for `--statistics'.
22556 Adjust dependencies.
22557
22558 Remove a lot of now useless `extern' statements in most files.
22559
403b315b
AD
225602000-10-02 Akim Demaille <akim@epita.fr>
22561
22562 * src/LR0.h: New file.
22563 Propagate its use.
22564
07a58c13
AD
225652000-10-02 Akim Demaille <akim@epita.fr>
22566
22567 * src/print.h: New file.
22568 Propagate its use.
22569 * src/print.c: Formatting and ordering changes.
22570 (verbose, terse): Replace with...
22571 (print_results): this new function.
22572 Adjust dependencies.
22573
0619caf0
AD
225742000-10-02 Akim Demaille <akim@epita.fr>
22575
22576 * src/conflicts.c (conflict_report): New function.
22577 (conflict_log, verbose_conflict_log): Replace with...
22578 (print_conflicts): this function.
22579 Adjust dependencies.
22580 * src/conflicts.h: New file.
22581 Propagate its inclusion.
22582
3519ec76
AD
225832000-10-02 Akim Demaille <akim@epita.fr>
22584
22585 * src/nullable.h: New file.
22586 Propagate its inclusion.
22587 * src/nullable.c: Formatting changes.
22588
015acc48
AD
225892000-10-02 Akim Demaille <akim@epita.fr>
22590
22591 * src/reduce.h: New file.
22592 Propagate its inclusion.
22593 * src/reduce.c: Topological sort and other formatting changes.
22594 (bool, TRUE, FALSE): Move their definition to...
22595 * src/system.h: here.
22596
8963a27b
AD
225972000-10-02 Akim Demaille <akim@epita.fr>
22598
22599 * src/files.c: Formatting changes.
22600 (tryopen, tryclose, openfiles): Rename as...
22601 (xfopen, xfclose, open_files): this.
22602 (stringappend): static.
22603 * src/files.h: Complete the list of exported symbols.
22604 Propagate its use.
22605
a70083a3
AD
226062000-10-02 Akim Demaille <akim@epita.fr>
22607
22608 * src/reader.h: New file.
22609 Propagate its use instead of tedious list of `extern' and
22610 prototypes.
22611 * src/reader.c: Formatting changes, topological sort,
22612 s/register//.
22613
abadc117
AD
226142000-10-02 Akim Demaille <akim@epita.fr>
22615
22616 * src/lex.h: Prototype `lex.c' exported functions.
22617 * src/reader.c: Adjust.
22618 * src/lex.c: Formatting changes.
22619 (safegetc): Rename as...
22620 (xgetc): this.
22621
720d742f
AD
226222000-10-02 Akim Demaille <akim@epita.fr>
22623
22624 * src/lalr.h: New file.
22625 Propagate its inclusion instead of prototypes and `extern'.
22626 * src/lalr.c: Formatting changes, topological sorting etc.
22627
f2acea59
AD
226282000-10-02 Akim Demaille <akim@epita.fr>
22629
22630 * src/output.c (token_actions): Introduce a temporary array,
22631 YYDEFACT, that makes it possible for this function to use
22632 output_short_table.
22633
d019d655
AD
226342000-10-02 Akim Demaille <akim@epita.fr>
22635
22636 `user_toknums' is output as a `short[]' in `output.c', while it is
22637 defined as a `int[]' in `reader.c'. For consistency with the
22638 other output tables, `user_toknums' is now defined as a table of
22639 shorts.
22640
22641 * src/reader.c (user_toknums): Be a short table instead of an int
22642 table.
22643 Adjust dependencies.
22644
22645 Factor the short table outputs.
22646
22647 * src/output.c (output_short_table): New function.
22648 * src/output.c (output_gram, output_stos, output_rule_data)
22649 (output_base, output_table, output_check): Use it.
22650
6c89f1c1
AD
226512000-10-02 Akim Demaille <akim@epita.fr>
22652
22653 * src/output.c (output): Topological sort of the functions, in
22654 order to get rid of the `static' prototypes.
22655 No longer use `register'.
22656 * src/output.h: New file.
22657 Propagate its inclusion in files explicitly prototyping functions
22658 from output.c.
22659
d9efd181
AD
226602000-09-21 Akim Demaille <akim@epita.fr>
22661
22662 * src/atgeneral.m4: Update from Autoconf.
22663
c29240e7 226642000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
22665
22666 * src/closure.h: New file.
22667 * src/closure.c: Formatting changes, topological sort over the
22668 functions, use of closure.h.
22669 (initialize_closure, finalize_closure): Rename as...
22670 (new_closure, free_closure): these. Adjust dependencies.
22671 * src/LR0.c: Formatting changes, topological sort, use of
22672 cloture.h.
22673 (initialize_states): Rename as...
22674 (new_states): this.
22675 * src/Makefile.am (noinst_HEADERS): Adjust.
22676
499daa50
AD
226772000-09-20 Akim Demaille <akim@epita.fr>
22678
22679 * src/acconfig.h: Don't protect config.h against multiple
22680 inclusion.
22681 Don't define PARAMS.
22682 * src/system.h: Define PARAMS.
22683 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22684 purpose of config.h. system.h must not try to fix wrong
22685 definitions in config.h.
22686
cc84fd5d
AD
226872000-09-20 Akim Demaille <akim@epita.fr>
22688
22689 * src/derives.h: New file.
22690 * src/main.c, src/derives.h: Use it.
22691 Formatting changes.
22692 * src/Makefile.am (noinst_HEADERS): Adjust.
22693
db5b3a89
AD
226942000-09-20 Akim Demaille <akim@epita.fr>
22695
22696 * tests/atgeneral.m4: Update from Autoconf.
22697 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22698 (AT_CHECK_CALC): New macros.
22699 Use these macros to test bison with options `', `--raw',
22700 `--debug', `--yacc', `--yacc --debug'.
22701
ceed8467
AD
227022000-09-19 Akim Demaille <akim@epita.fr>
22703
22704 * src/output.c: Formatting changes.
22705 * src/machine.h: Remove, leaving its contents in...
22706 * src/system.h: here.
22707 Include stdio.h.
22708 Adjust all dependencies on stdio.h and machine.h.
22709 * src/getargs.h: New file.
22710 Let all `extern' declarations about getargs.c be replaced with
22711 inclusion of `getargs.h'.
22712 * src/Makefile.am (noinst_HEADERS): Adjust.
22713
22714 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22715 scope.
22716 (yyerror): Returns void, not int.
22717 * doc/bison.texinfo: Formatting changes.
22718
05a1d24b
AD
227192000-09-19 Akim Demaille <akim@epita.fr>
22720
22721 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22722 portable.
22723
cbd25751
AD
227242000-09-18 Akim Demaille <akim@epita.fr>
22725
22726 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22727 * src/Makefile.am (INCLUDES): Don't.
22728 Be ready to fetch headers in lib/.
22729
13863333
AD
227302000-09-18 Akim Demaille <akim@epita.fr>
22731
22732 * doc/bison.texinfo: Update the copyright.
22733 ANSIfy and GNUify the examples.
22734 Remove the old menu.
22735
0d533154
AD
227362000-09-18 Akim Demaille <akim@epita.fr>
22737
22738 First set of tests: use the `calc' example from the documentation.
22739
22740 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22741 is defined only when YYDEBUG is.
22742 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22743 * src/files.c (tryopen, tryclose): Formatting changes.
22744 Move to the top and be static.
22745 * src/reader.c (read_signed_integer): Likewise.
22746 * tests/calc.m4: New file.
22747 * Makefile.am, suite.m4: Adjust.
22748 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22749
e79137ac
AD
227502000-09-18 Akim Demaille <akim@epita.fr>
22751
22752 Add support for an Autotest test suite for Bison.
22753
22754 * m4/m4.m4, m4/atconfig.m4: New files.
22755 * m4/Makefile.am (EXTRA_DIST): Adjust.
22756 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22757 files.
22758 * src/getargs.c: Display a more standard --version message.
22759 * src/reader.c (reader): Formatting changes.
22760 No longer depend upon VERSION_STRING.
22761 * configure.in: No longer use `dnl'.
22762 Set up the test suite and the new directory `tests/.
22763 (VERSION_STRING): Remove.
22764
27821bff
AD
227652000-04-14 Akim Demaille <akim@epita.fr>
22766
22767 * src/reader.c (copy_comment2): New function, same as former
22768 `copy_comment', but outputs into two FILE *.
22769 (copy_comment): Use it.
22770 (parse_union_decl): Use it.
22771 (get_type, parse_start_decl): Use the same `invalid' message.
22772 (parse_start_decl, parse_union_decl): Use the same `multiple'
22773 message.
22774 (parse_union_decl, copy_guard, copy_action): Use the same
22775 `unmatched' message.
22776 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22777
cfe5fbc0
AD
227782000-03-31 Akim Demaille <akim@epita.fr>
22779
22780 * src/files.c (tryopen, tryclose): Move to the top.
22781 Be static.
22782
cb7db13e
AD
227832000-03-31 Akim Demaille <akim@epita.fr>
22784
22785 * src/main.c (main): Don't call `done', exit does it.
22786
a0f6b076
AD
227872000-03-31 Akim Demaille <akim@epita.fr>
22788
36281465
AD
22789 * allocate.c: s/return (foo)/return foo/.
22790 * lalr.c: Likewise.
22791 * LR0.c: Likewise.
22792 * output.c: Likewise.
22793 * reader.c: Likewise.
22794 * symtab.c: Likewise.
22795 * vmsgetargs.c: Likewise.
22796
227972000-03-31 Akim Demaille <akim@epita.fr>
22798
22799 Clean up the error reporting functions.
a0f6b076
AD
22800
22801 * src/report.c: New file.
22802 * src/report.h: Likewise.
22803 * src/Makefile.am: Adjust.
22804 * m4/error.m4: New file.
22805 * m4/Makefile.am: Adjust.
22806 * configure.in (jm_PREREQ_ERROR): Call it.
22807 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22808 Remove.
22809 (fatal, fatals): Remove. All callers use complain.c::fatal.
22810 (warn, warni, warns, warnss, warnss): Remove. All callers use
22811 complain.c::complain.
22812 (toomany): Remove, use fatal instead.
22813 * src/files.c (done): No argument, use complain_message_count.
22814 * src/main.c (main): Register `done' to `atexit'.
22815
22816 * src/getargs.c (usage): More `fputs', less `fprintf'.
22817
18539825
AD
228182000-03-28 Akim Demaille <akim@epita.fr>
22819
22820 * lib/: New directory.
22821 * Makefile.am (SUBDIRS): Adjust.
22822 * configure.in: Adjust.
22823 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22824 useless.
22825 * src/alloca.c: Moved to lib/.
22826 * src/getopt.c: Likewise.
22827 * src/getopt1.c: Likewise.
22828 * src/getopt.h: Likewise.
22829 * src/ansi2knr.c: Likewise.
22830 * src/ansi2knr.1: Likewise.
22831 * src/Makefile.am: Adjust.
22832 * lib/Makefile.am: New file.
22833
9f306f2a
AD
228342000-03-28 Akim Demaille <akim@epita.fr>
22835
22836 * src/getargs.c (usage): Refresh the help message.
22837
0ba347b6
AD
228382000-03-17 Akim Demaille <akim@epita.fr>
22839
22840 * src/getopt1.c: Updated from textutils 2.0e
22841 * src/getopt.c: Likewise.
22842 * src/getopt.h: Likewise.
22843
dbe7f271
AD
228442000-03-17 Akim Demaille <akim@epita.fr>
22845
22846 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22847 the file name, not the whole `#line LINE FILE'.
22848
75bbe78d
AD
228492000-03-17 Akim Demaille <akim@epita.fr>
22850
22851 On syntax errors, report the token on which we choked.
22852
aa5fd0ee
AD
22853 * src/bison.s1 (yyparse): In the label yyerrlab, when
22854 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 22855
7b306f52
AD
228562000-03-17 Akim Demaille <akim@epita.fr>
22857
aa5fd0ee 22858 * src/reader.c (copy_at): New function.
7b306f52
AD
22859 (copy_guard): Use it.
22860 (copy_action): Use it.
22861
e87b5700
AD
228622000-03-17 Akim Demaille <akim@epita.fr>
22863
22864 Be kind to translators, save some useless translations.
22865
aa5fd0ee 22866 * src/main.c (banner): New function.
e87b5700
AD
22867 (fatal_banner): Use it.
22868 (warn_banner): Use it.
22869
ae3c3164
AD
228702000-03-17 Akim Demaille <akim@epita.fr>
22871
aa5fd0ee
AD
22872 * src/reader.c (copy_definition): Use copy_string and
22873 copy_comment. Removed now unused `match', `ended',
22874 `cplus_comment'.
ae3c3164
AD
22875 (copy_comment, copy_string): Moved, to be visible from
22876 copy_definition.
22877
4dc58e7c
AD
228782000-03-17 Akim Demaille <akim@epita.fr>
22879
aa5fd0ee
AD
22880 * src/reader.c (copy_string): Declare `static inline'. No
22881 problems with inline, since it is checked by configure.
4dc58e7c
AD
22882 (copy_comment): Likewise.
22883
0a6384c4
AD
228842000-03-17 Akim Demaille <akim@epita.fr>
22885
aa5fd0ee 22886 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 22887
3cef001a
AD
228882000-03-17 Akim Demaille <akim@epita.fr>
22889
aa5fd0ee 22890 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
22891 (copy_action): Use it. Removed now unused `match', `ended',
22892 `cplus_comment'.
22893 (copy_guard): Likewise.
22894
ca36d2ef
AD
228952000-03-17 Akim Demaille <akim@epita.fr>
22896
aa5fd0ee 22897 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
22898 (copy_action): Use it.
22899 (copy_guard): Likewise.
22900
6666f98f
AD
229012000-03-17 Akim Demaille <akim@epita.fr>
22902
22903 Change the handling of @s so that they behave exactly like $s.
22904 There is now a pseudo variable @$ (readble and writable), location
22905 of the lhs of the rule (by default ranging from the location of
22906 the first symbol of the rhs, to the location of the last symbol,
22907 or, if the rhs is empty, YYLLOC).
22908
22909 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22910 yyval.
22911 (yyparse): When providing a default semantic action, provide a
22912 default location action.
22913 (after the $): No longer change `*YYLSP', just stack YYLOC the
22914 same way you stack YYVAL.
22915 * src/reader.c (read_declarations): Use warns.
22916 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22917 (copy_action, case '@'): Likewise.
22918 Use a standard error message, to save useless work from
22919 translators.
22920
41aca2e0
AD
229212000-03-17 Akim Demaille <akim@epita.fr>
22922
aa5fd0ee
AD
22923 * src/bison.s1: Formatting and cosmetics changes.
22924 * src/reader.c: Likewise.
41aca2e0
AD
22925 Update the Copyright notice.
22926
dc08c1d5
AD
229272000-03-17 Akim Demaille <akim@epita.fr>
22928
aa5fd0ee
AD
22929 * src/bison.s1 (#line): All set to `#line' only, since the
22930 Makefile now handles them.
dc08c1d5 22931
9ee3c97b
AD
229322000-03-16 Akim Demaille <akim@epita.fr>
22933
22934 * src/output.c (output_rule_data): Output the documentation of
22935 some of the tables.
22936 (Copyright notice): Update.
22937 Formatting changes.
22938
0de741ca
AD
229392000-03-16 Akim Demaille <akim@epita.fr>
22940
22941 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22942 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22943 One `#if YYDEBUG' remains, since it uses variables which are
22944 defined only if `YYDEBUG != 0'.
22945
bb10be54
AD
229462000-03-16 Akim Demaille <akim@epita.fr>
22947
22948 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22949 and related variables so that the similarities are highlighted.
22950
b07b484a
AD
229512000-03-16 Akim Demaille <akim@epita.fr>
22952
22953 * src/bison.s1: Properly indent CPP directives.
22954
361f60b3
AD
229552000-03-16 Akim Demaille <akim@epita.fr>
22956
22957 * src/bison.s1: Properly indent the `alloca' CPP section.
22958
8c44d3ec
AD
229592000-03-16 Akim Demaille <akim@epita.fr>
22960
22961 Do not hard code values of directories in `configure.in'.
22962 Update the `configure' tool chain.
22963
22964 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22965 src/makefile.am.
22966 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22967 (AC_OUTPUT): Add m4/Makefile.
22968 Bump to bison 1.28a, 1.29 has never been released.
22969 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22970 handled via src/Makefile.am.
22971 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22972 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22973 autoheader.
22974 * Makefile.am (SUBDIRS): Add m4.
22975 (ACLOCAL_AM_FLAGS): New variable.
22976 (AUTOMAKE_OPTIONS): Add check-news.
22977 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22978 the proper line number and file name.
22979 (DEFS): Propagate the location of bison library files and of the
22980 locale files.
22981 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22982 builddir.
22983 * acinclude.m4: Remove, replaced by the directory m4.
22984 * m4/Makefile.am (EXTRA_DIST): New variable.
22985 * m4/gettext.m4: New file, from the fileutils.
22986 * m4/lcmessage.m4: Likewise
22987 * m4/progtest.m4: Likewise.
22988 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22989
f95997e7
AD
229902000-03-10 Akim Demaille <akim@epita.fr>
22991
22992 * src/closure.c:
22993 Formatting changes of various comments.
22994 Respect the GNU coding standards at various places.
22995 Don't use `_()' when no translation is needed.
22996
229971999-12-13 Jesse Thilo <jthilo@gnu.org>
22998
22999 * src/files.c:
23000 OS/2 honors TMPDIR environment variable.
23001
230021999-12-13 Jesse Thilo <jthilo@gnu.org>
23003
23004 * doc/bison.texinfo: Tweaked spelling and grammar.
23005 Updated ISBN.
23006 Removed reference to price of printed copy.
23007 Mention BISON_SIMPLE and BISON_HAIRY.
23008
230091999-12-13 Jesse Thilo <jthilo@gnu.org>
23010
23011 * configure.in, NEWS:
23012 Bison 1.29 released.
23013
230141999-10-27 Jesse Thilo <jthilo@gnu.org>
23015
23016 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
23017 Added reference card.
23018
230191999-07-26 Jesse Thilo <jthilo@gnu.org>
23020
23021 * po/ru.po: Added Russian translation.
23022
230231999-07-26 Jesse Thilo <jthilo@gnu.org>
23024
23025 * configure.in: Added Russian translation.
23026
230271999-07-06 Jesse Thilo <jthilo@gnu.org>
23028
23029 * configure.in, NEWS, README:
23030 Released version 1.28.
23031
230321999-06-14 Jesse Thilo <jthilo@gnu.org>
23033
23034 * src/system.h:
23035 Squashed redefinition warning on some systems.
23036
23037 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
23038 Have configure build version string instead of relying on ANSI string
23039 concatentation.
23040
230411999-06-14 Jesse Thilo <jthilo@gnu.org>
23042
23043 * po/POTFILES.in: Got rid of version.c.
23044
230451999-06-14 Jesse Thilo <jthilo@gnu.org>
23046
23047 * acconfig.h, configure.in:
23048 Have configure build version string instead of relying on ANSI string
23049 concatentation.
23050
230511999-06-08 Jesse Thilo <jthilo@gnu.org>
23052
23053 * doc/bison.1:
23054 Dropped mention of `+' for long-named options.
23055
230561999-05-30 Jesse Thilo <jthilo@gnu.org>
23057
23058 * src/files.c: Added <unistd.h> for unlink().
23059
23060 * src/Makefile.am, src/system.h:
23061 I18n fixes.
23062
230631999-05-30 Jesse Thilo <jthilo@gnu.org>
23064
23065 * README: Added a FAQ list.
23066
23067 * configure.in, acconfig.h:
23068 I18n fixes.
23069
230701999-05-30 Jesse Thilo <jthilo@gnu.org>
23071
23072 * doc/FAQ, doc/Makefile.am:
23073 Added a FAQ list.
23074
230751999-05-19 Jesse Thilo <jthilo@gnu.org>
23076
23077 * src/alloc.h, src/symtab.h, src/version.c:
23078 Protected inclusion of "config.h" with HAVE_CONFIG_H.
23079
230801999-04-18 Jesse Thilo <jthilo@gnu.org>
23081
23082 * src/.cvsignore, src/Makefile.am:
23083 Reorganized: sources in `src', documentation in `doc'.
23084
23085 * src/lex.c (literalchar):
23086 fixed the code for escaping double quotes (thanks
23087 Jonathan Czisny.)
23088
230891999-04-18 Jesse Thilo <jthilo@gnu.org>
23090
23091 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
23092 Adjusted paths to reflect directory reorganization.
23093
230941999-04-18 Jesse Thilo <jthilo@gnu.org>
23095
23096 * doc/.cvsignore, doc/Makefile.am:
23097 Reorganized: sources in `src', documentation in `doc'.
23098
230991999-04-18 Jesse Thilo <jthilo@gnu.org>
23100
23101 * configure.in:
23102 Updated AC_INIT file to reflect directory reorganization.
23103
23104 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
23105 Reorganized: sources in `src', documentation in `doc'.
23106
231071999-04-13 Jesse Thilo <jthilo@gnu.org>
23108
23109 * src/allocate.c:
23110 Don't declare calloc() and realloc() if not necessary.
23111
231121999-04-13 Jesse Thilo <jthilo@gnu.org>
23113
23114 * configure.in, acconfig.h, acinclude.m4:
23115 Don't declare calloc() and realloc() if not necessary.
23116
231171999-03-23 Jesse Thilo <jthilo@gnu.org>
23118
23119 * po/.cvsignore: Added i18n support.
23120
231211999-03-23 Jesse Thilo <jthilo@gnu.org>
23122
23123 * acconfig.h, configure.in, Makefile.am:
23124 Added i18n support.
23125
231261999-03-22 Jesse Thilo <jthilo@gnu.org>
23127
23128 * src/bison.s1: Fixed #line numbers.
23129
231301999-03-15 Jesse Thilo <jthilo@gnu.org>
23131
23132 * po/es.po, po/fr.po, po/nl.po, po/de.po:
23133 Added PO files from Translation Project.
23134
231351999-03-03 Jesse Thilo <jthilo@gnu.org>
23136
23137 * Makefile.am:
23138 Added support for non-ANSI compilers (ansi2knr).
23139
231401999-02-16 Jesse Thilo <jthilo@gnu.org>
23141
23142 * configure.in: Bumped version number to 1.27.
23143
23144 * Makefile.am:
23145 Added `bison.simple' to list of files removed by `make distclean'.
23146
231471999-02-12 Jesse Thilo <jthilo@gnu.org>
23148
23149 * src/files.c, src/files.h:
23150 Defined locations of parser files in config.h instead of Makefile.
23151
231521999-02-12 Jesse Thilo <jthilo@gnu.org>
23153
23154 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
23155 Defined locations of parser files in config.h instead of Makefile.
23156
231571999-02-09 Jesse Thilo <jthilo@gnu.org>
23158
23159 * Makefile.am:
23160 Removed inappropriate use of $< macro.
23161
231621999-02-05 Jesse Thilo <jthilo@gnu.org>
23163
23164 * po/Makefile.in.in, po/POTFILES.in:
23165 Add `po' directory skeleton.
23166
231671999-01-27 Jesse Thilo <jthilo@gnu.org>
23168
23169 * README: Document help-bison list.
23170
23171 * configure.in: Add check for mkstemp().
23172
231731999-01-20 Jesse Thilo <jthilo@gnu.org>
23174
23175 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
23176 Hush a few compiler warnings.
23177
23178 * src/files.c:
23179 Add tryclose(), which verifies that fclose was successful.
23180 Hush a couple of compiler warnings.
23181
231821999-01-20 Jesse Thilo <jthilo@gnu.org>
23183
23184 * Makefile.am, OChangeLog:
23185 ChangeLog is now automatically generated. Include the old version as
23186 OChangeLog.
23187
231881999-01-14 Jesse Thilo <jthilo@gnu.org>
23189
23190 * 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:
23191 Update FSF address.
23192
231931999-01-14 Jesse Thilo <jthilo@gnu.org>
23194
23195 * doc/bison.texinfo: Fix formatting glitch.
23196
23197 * doc/bison.texinfo: Update FSF address.
23198
231991999-01-14 Jesse Thilo <jthilo@gnu.org>
23200
23201 * acconfig.h: Update FSF address.
23202
232031999-01-08 Jesse Thilo <jthilo@gnu.org>
23204
23205 * src/system.h:
23206 Don't define PACKAGE here, since config.h defines it.
23207
232081998-12-30 Jesse Thilo <jthilo@gnu.org>
23209
23210 * src/reader.c: Update copyright date.
23211
23212 * src/main.c:
23213 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23214 favor of output directly to stderr (avoids buffer overruns).
23215
23216 * src/reader.c: Some checks for premature EOF.
23217
23218 * 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:
23219 Use prototypes if the compiler understands them.
23220
23221 * src/files.c: Honor TMPDIR on Unix hosts.
23222 Use prototypes if the compiler understands them.
23223
23224 * src/reader.c:
23225 Fix a couple of buffer overrun bugs.
23226 Use prototypes if the compiler understands them.
23227
23228 * src/system.h: Include unistd.h and ctype.h.
23229 Use #ifdef instead of #if for NLS symbols.
23230
232311998-12-30 Jesse Thilo <jthilo@gnu.org>
23232
23233 * doc/bison.texinfo:
23234 Delete comment "consider using @set for edition number, etc..." since
23235 we now are doing so.
23236
232371998-12-30 Jesse Thilo <jthilo@gnu.org>
23238
23239 * configure.in:
23240 Use prototypes if the compiler understands them.
23241
23242 * NEWS: Document 1.26 highlights.
23243
23244 * Makefile.am: Require Automake 1.3 or later.
23245
23246 * acconfig.h:
23247 Use prototypes if the compiler understands them.
23248
232491998-12-29 Jesse Thilo <jthilo@gnu.org>
23250
23251 * src/version.c:
23252 Use VERSION symbol from automake for version number.
23253
232541998-12-29 Jesse Thilo <jthilo@gnu.org>
23255
23256 * acconfig.h, configure.in, version.cin:
23257 Use VERSION symbol from automake for version number.
23258
232591998-11-28 Jesse Thilo <jthilo@gnu.org>
23260
23261 * Makefile.am:
23262 Distribute original version of simple parser (bison.s1), not built
23263 version (bison.simple).
23264
232651998-11-28 Jesse Thilo <jthilo@gnu.org>
23266
23267 * doc/bison.texinfo: Add info dir entry.
23268
23269 * doc/bison.texinfo:
23270 Let automake put version number into documentation.
23271
232721998-11-26 Jesse Thilo <jthilo@gnu.org>
23273
23274 * src/bison.cld, src/build.com, src/vmshlp.mar:
23275 Add non-RCS files from /gd/gnu/bison.
23276
232771998-11-26 Jesse Thilo <jthilo@gnu.org>
23278
23279 * doc/bison.1:
23280 Document the BISON_HAIRY and BISON_SIMPLE variables.
23281
232821998-11-25 Jesse Thilo <jthilo@gnu.org>
23283
23284 * src/version.c: Build version.c automatically.
23285
23286 * src/reader.c:
23287 Fix token numbering (used to start at 258, not 257).
23288
23289 * src/system.h: Include config.h.
23290
23291 * src/getargs.c: Update bug report address.
23292
23293 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23294 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23295
232961998-11-25 Jesse Thilo <jthilo@gnu.org>
23297
23298 * Makefile.am:
23299 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23300
23301 * configure.in, version.cin:
23302 Build version.c automatically.
23303
23304 * AUTHORS: Add AUTHORS file.
23305
23306 * README: Update bug report address.
23307
23308 * bison.simple:
23309 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23310
23311 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23312 Add automake stuff.
23313
233141998-11-25 Jesse Thilo <jthilo@gnu.org>
23315
23316 * doc/bison.texinfo: Clean up some formatting.
23317
233181998-05-05 Richard Stallman <rms@gnu.org>
23319
23320 * doc/bison.texinfo:
23321 Explain better why to make a pure parser.
23322
233231998-01-05 Richard Stallman <rms@gnu.org>
23324
23325 * src/files.c (openfiles):
23326 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23327 find a temporary directory, if possible. Do not unlink files while
23328 they are open.
23329
233301997-08-25 Richard Stallman <rms@gnu.org>
23331
23332 * src/reader.c (stack_offset;):
23333 Change some warni to warns.
23334
23335 * src/lex.c (literalchar): Use warns, not warni.
23336
233371997-06-28 Richard Stallman <rms@gnu.org>
23338
23339 * src/bison.s1: Add a Bison version comment.
23340
23341 * src/main.c (fatal, warn, berror):
23342 Use program_name.
23343
233441997-06-28 Richard Stallman <rms@gnu.org>
23345
23346 * Makefile.in (bison_version): New variable.
23347 (dist): Use that variable.
23348 (bison.s1): Substitute the Bison version into bison.simple.
23349
23350 * bison.simple: Add a Bison version comment.
23351
233521997-06-18 Richard Stallman <rms@gnu.org>
23353
23354 * src/main.c (fatal, warn, berror):
23355 Make error messages standard.
23356 (toomany): Improve error message text.
23357
23358 * 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:
23359 new.h renamed to alloc.h.
23360
233611997-06-18 Richard Stallman <rms@gnu.org>
23362
23363 * Makefile.in: new.h renamed to alloc.h.
23364
233651997-05-24 Richard Stallman <rms@gnu.org>
23366
23367 * src/lex.c (literalchar):
23368 Fix the code for escaping \, " and '.
23369
23370 (lex): Avoid trouble when there are many chars
23371 to discard in a char literal with just several chars in it.
23372
233731997-05-17 Richard Stallman <rms@gnu.org>
23374
23375 * src/bison.s1:
23376 Use malloc, if using alloca is troublesome.
23377 (YYSTACK_USE_ALLOCA): New flag macro.
23378 Define it for some systems and compilers.
23379 (YYSTACK_ALLOC): New macro.
23380 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23381 If it was malloc'd, free it.
23382
233831997-05-17 Richard Stallman <rms@gnu.org>
23384
23385 * bison.simple:
23386 Use malloc, if using alloca is troublesome.
23387 (YYSTACK_USE_ALLOCA): New flag macro.
23388 Define it for some systems and compilers.
23389 (YYSTACK_ALLOC): New macro.
23390 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23391 If it was malloc'd, free it.
23392
233931997-04-23 Richard Stallman <rms@gnu.org>
23394
23395 * src/bison.s1:
23396 (alloca) [__hpux]: Always define as __builtin_alloca.
23397
233981997-04-23 Richard Stallman <rms@gnu.org>
23399
23400 * bison.simple:
23401 (alloca) [__hpux]: Always define as __builtin_alloca.
23402
234031997-04-22 Richard Stallman <rms@gnu.org>
23404
23405 * src/bison.s1:
23406 [__hpux]: Include alloca.h (right for HPUX 10)
23407 instead of declaring alloca (right for HPUX 9).
23408
23409 * src/bison.s1 (__yy_memcpy):
23410 Declare arg `count' as unsigned int.
23411 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23412
234131997-04-22 Richard Stallman <rms@gnu.org>
23414
23415 * bison.simple:
23416 [__hpux]: Include alloca.h (right for HPUX 10)
23417 instead of declaring alloca (right for HPUX 9).
23418
23419 * bison.simple (__yy_memcpy):
23420 Declare arg `count' as unsigned int.
23421 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23422
234231997-01-03 Richard Stallman <rms@gnu.org>
23424
23425 * src/allocate.c: [__STDC__ or _MSC_VER]:
23426 Declare calloc and realloc to return void *.
23427
234281997-01-02 Richard Stallman <rms@gnu.org>
23429
23430 * src/system.h:
23431 [_MSC_VER]: Include stdlib.h and process.h.
23432 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23433
23434 * src/main.c (main): Return FAILURE as a value.
23435 (printable_version): Declare arg as int, not char.
23436
234371997-01-02 Richard Stallman <rms@gnu.org>
23438
23439 * Makefile.in (dist):
23440 Explicitly check for symlinks, and copy them.
23441
234421996-12-19 Richard Stallman <rms@gnu.org>
23443
23444 * src/files.c:
23445 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23446
234471996-12-18 Paul Eggert <eggert@gnu.org>
23448
23449 * src/bison.s1 (yyparse):
23450 If __GNUC__ and YYPARSE_PARAM are both defined,
23451 declare yyparse to have a void * argument.
23452
234531996-12-18 Paul Eggert <eggert@gnu.org>
23454
23455 * bison.simple (yyparse):
23456 If __GNUC__ and YYPARSE_PARAM are both defined,
23457 declare yyparse to have a void * argument.
23458
234591996-12-17 Richard Stallman <rms@gnu.org>
23460
23461 * src/reduce.c (nbits): Add some casts.
23462
234631996-08-12 Richard Stallman <rms@gnu.org>
23464
23465 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23466
234671996-08-12 Richard Stallman <rms@gnu.org>
23468
23469 * bison.simple: Test _MSDOS as well as _MSDOS_.
23470
234711996-07-31 Richard Stallman <rms@gnu.org>
23472
23473 * src/bison.s1:
23474 [__sun && __i386]: Include alloca.h.
23475
234761996-07-31 Richard Stallman <rms@gnu.org>
23477
23478 * bison.simple:
23479 [__sun && __i386]: Include alloca.h.
23480
234811996-07-30 Richard Stallman <rms@gnu.org>
23482
23483 * src/bison.s1: Comment change.
23484
23485 * src/bison.s1: Test _MSDOS_, not MSDOS.
23486
234871996-07-30 Richard Stallman <rms@gnu.org>
23488
23489 * bison.simple: Comment change.
23490
23491 * bison.simple: Test _MSDOS_, not MSDOS.
23492
234931996-06-01 Richard Stallman <rms@gnu.org>
23494
23495 * 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:
23496 Insert `_' macro around many string constants.
23497
23498 * src/main.c:
23499 Insert `_' macro around many string constants.
23500
23501 (main): Call setlocale, bindtextdomain and textdomain.
23502
23503 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23504 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23505 [ENABLE_NLS]: Include libintl.h.
23506 [ENABLE_NLS] (gettext): Define.
23507 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23508 (N_, PACKAGE, LOCALEDIR): New macros.
23509
235101996-06-01 Richard Stallman <rms@gnu.org>
23511
23512 * POTFILES.in: New file.
23513
23514 * Makefile.in (allocate.o):
23515 Define target explicitly.
23516
23517 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23518 (LDFLAGS): Set to @LDFLAGS@.
23519 (configure): Run autoconf only if preceding `cd' succeeds.
23520 (bison.s1): Redirect output to temporary file then move the
23521 temporary to the target, rather than redirecting directly to bison.s1.
23522 (clean): Remove config.status and config.log.
23523 (distclean): Don't remove config.status here.
23524
235251996-05-12 Richard Stallman <rms@gnu.org>
23526
23527 * src/bison.s1:
23528 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23529
235301996-05-12 Richard Stallman <rms@gnu.org>
23531
23532 * bison.simple:
23533 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23534
235351996-05-11 Richard Stallman <rms@gnu.org>
23536
23537 * src/bison.s1 (__yy_memcpy):
23538 Really reorder the args, as was supposedly done on Feb 14 1995.
23539 (yyparse): Calls changed accordingly.
23540
235411996-05-11 Richard Stallman <rms@gnu.org>
23542
23543 * Makefile.in (dist): Don't use $(srcdir).
23544
23545 * bison.simple (__yy_memcpy):
23546 Really reorder the args, as was supposedly done on Feb 14 1995.
23547 (yyparse): Calls changed accordingly.
23548
235491996-01-27 Richard Stallman <rms@gnu.org>
23550
23551 * src/output.c (output_rule_data):
23552 Test YYERROR_VERBOSE in the conditional
23553 around the definition of ttyname.
23554
235551995-12-29 Richard Stallman <rms@gnu.org>
23556
23557 * src/bison.s1:
23558 Fix line numbers in #line commands.
23559
235601995-12-29 Richard Stallman <rms@gnu.org>
23561
23562 * bison.simple:
23563 Fix line numbers in #line commands.
23564
235651995-12-27 Richard Stallman <rms@gnu.org>
23566
23567 * src/bison.s1 (YYPARSE_PARAM_DECL):
23568 In C++, make it always null.
23569 (YYPARSE_PARAM_ARG): New macro.
23570 (yyparse): Use YYPARSE_PARAM_ARG.
23571
235721995-12-27 Richard Stallman <rms@gnu.org>
23573
23574 * bison.simple (YYPARSE_PARAM_DECL):
23575 In C++, make it always null.
23576 (YYPARSE_PARAM_ARG): New macro.
23577 (yyparse): Use YYPARSE_PARAM_ARG.
23578
235791995-11-29 Richard Stallman <rms@gnu.org>
23580
23581 * doc/bison.texinfo:
23582 Describe literal string tokens, %raw, %no_lines, %token_table.
23583
235841995-11-29 Daniel Hagerty <hag@gnu.org>
23585
23586 * doc/bison.texinfo: Fixed update date
23587
235881995-10-16 Richard Stallman <rms@gnu.org>
23589
23590 * src/version.c: Version 1.25.
23591
235921995-10-16 Richard Stallman <rms@gnu.org>
23593
23594 * NEWS: *** empty log message ***
23595
235961995-10-16 Richard Stallman <rms@gnu.org>
23597
23598 * doc/bison.1, doc/bison.rnh:
23599 Add new options.
23600
236011995-10-15 Richard Stallman <rms@gnu.org>
23602
23603 * src/vmsgetargs.c, src/getargs.c:
23604 Added -n, -k, and -raw switches.
23605 (noparserflag, toknumflag, rawtoknumflag): New variables.
23606
23607 * src/symtab.h (SALIAS):
23608 New #define for adding aliases to %token.
23609 (struct bucket): Added `alias' field.
23610
23611 * src/reduce.c (reduce_grammar):
23612 Revise error message.
23613 (print_notices): Remove final `.' from error message.
23614
23615 * src/reader.c (reader_output_yylsp):
23616 New function.
23617 (readgram): Use `#if 0' around code that accepted %command
23618 inside grammar rules: The documentation doesn't allow it,
23619 and it will fail since the %command processors scan for the next %.
23620 (parse_token_decl): Extended the %token
23621 declaration to allow a multi-character symbol as an alias.
23622 (parse_thong_decl): New function.
23623 (read_declarations): Added %thong declarations.
23624 (read_declarations): Handle NOOP to deal with allowing
23625 % declarations as another means to specify the flags.
23626 (readgram): Allow %prec prior to semantics embedded in a rule.
23627 (skip_to_char, read_declarations, copy_definition)
23628 (parse_token_decl, parse_start_decl, parse_type_decl)
23629 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23630 (get_type_name, copy_guard, copy_action, readgram)
23631 (get_type, packsymbols): Revised most error messages.
23632 Changed `fatal' to `warnxxx' to avoid aborting for error.
23633 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23634 (read_declarations): Improve the error message for
23635 an invalid character. Do not abort.
23636 (read_declarations, copy_guard, copy_action): Use
23637 printable_version to avoid unprintable characters in printed output.
23638 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23639 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23640 Allow the type of a non-terminal can be given
23641 more than once, as long as all specifications give the same type.
23642
23643 * src/output.c:
23644 (output_headers, output_trailers, output, output_gram)
23645 (output_rule_data): Implement noparserflag variable.
23646 Implement toknumflag variable.
23647 (output): Call reader_output_yylsp to output LTYPESTR.
23648
23649 * src/main.c (main):
23650 If reader sees an error, don't process the grammar.
23651 (fatals): Updated to not use VARARGS1.
23652 (printable_version, int_to_string, warn, warni, warns, warnss)
23653 (warnsss): New error reporting functions. Avoid abort for error.
23654
23655 * src/lex.h:
23656 Added THONG and NOOP for alias processing.
23657 Added SETOPT for the new code that allows setting options with %flags.
23658
23659 * src/lex.c:
23660 Include getopt.h. Add some extern decls.
23661 (safegetc): New function to deal with EOF gracefully.
23662 (literalchar); new function to deal with reading \ escapes.
23663 (lex): Use literalchar.
23664 (lex): Implemented "..." tokens.
23665 (literalchar, lex, parse_percent_token): Made tokenbuffer
23666 always contain the token. This includes growing the token
23667 buffer while reading an integer.
23668 (parse_percent_token): Replaced if-else statement with percent_table.
23669 (parse_percent_token): Added % declarations as another
23670 way to specify the flags -n, -l, and -r. Also added hooks for
23671 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23672 major changes to files.c.
23673 (lex) Retain in the incoming stream a character following
23674 an incorrect '/'.
23675 (skip_white_space, lex): Revised most error messages
23676 and changed fatal to warn to avoid aborting.
23677 (percent_table): Added %thong declarations.
23678
23679 * src/gram.h: Comment changes.
23680
23681 * src/files.c (openfiles, open_extra_files, done):
23682 Add faction flag
23683 and actfile file. Handle noparserflag. Both for -n switch.
23684
23685 * src/conflicts.c (resolve_sr_conflict):
23686 Remove use of alloca.
23687
236881995-06-01 Jim Meyering <meyering@gnu.org>
23689
23690 * doc/bison.texinfo: *** empty log message ***
23691
236921995-05-06 Richard Stallman <rms@gnu.org>
23693
23694 * src/bison.s1: Comment change.
23695
236961995-05-06 Richard Stallman <rms@gnu.org>
23697
23698 * bison.simple: Comment change.
23699
237001995-05-03 Richard Stallman <rms@gnu.org>
23701
23702 * src/version.c: Version now 1.24.
23703
23704 * src/bison.s1: Change distribution terms.
23705
23706 * src/version.c: Version now 1.23.
23707
237081995-05-03 Richard Stallman <rms@gnu.org>
23709
23710 * doc/bison.texinfo:
23711 Rewrite "Conditions for Using Bison".
23712 Update version to 1.24.
23713
237141995-05-03 Richard Stallman <rms@gnu.org>
23715
23716 * bison.simple: Change distribution terms.
23717
237181995-02-23 Richard Stallman <rms@gnu.org>
23719
23720 * src/files.c: Test __VMS_POSIX as well as VMS.
23721
237221995-02-14 Jim Meyering <meyering@gnu.org>
23723
23724 * src/bison.s1 (__yy_memcpy):
23725 Renamed from __yy_bcopy to avoid
23726 confusion. Reverse FROM and TO arguments to be consistent with
23727 those of memcpy.
23728
237291995-02-14 Jim Meyering <meyering@gnu.org>
23730
23731 * bison.simple (__yy_memcpy):
23732 Renamed from __yy_bcopy to avoid
23733 confusion. Reverse FROM and TO arguments to be consistent with
23734 those of memcpy.
23735
237361994-11-10 David J. MacKenzie <djm@gnu.org>
23737
23738 * NEWS: reformat
23739
23740 * NEWS: New file.
23741
23742 * Makefile.in (DISTFILES): Include NEWS.
23743
23744 * Makefile.in (DISTFILES):
23745 Include install-sh, not install.sh.
23746
23747 * configure.in: Update to Autoconf v2 macro names.
23748
237491994-10-05 David J. MacKenzie <djm@gnu.org>
23750
23751 * Makefile.in: fix typo
23752
23753 * Makefile.in (prefix, exec_prefix):
23754 Let configure set them.
23755
237561994-09-28 David J. MacKenzie <djm@gnu.org>
23757
23758 * Makefile.in: Set datadir to $(prefix)/share.
23759
237601994-09-15 Richard Stallman <rms@gnu.org>
23761
23762 * src/bison.s1:
23763 Update copyright notice and GPL version.
23764
237651994-09-15 Richard Stallman <rms@gnu.org>
23766
23767 * bison.simple:
23768 Update copyright notice and GPL version.
23769
237701994-07-12 Richard Stallman <rms@gnu.org>
23771
23772 * src/reduce.c, src/reader.c:
23773 entered into RCS
23774
237751994-05-05 David J. MacKenzie <djm@gnu.org>
23776
23777 * Makefile.in: entered into RCS
23778
237791994-03-26 Richard Stallman <rms@gnu.org>
23780
23781 * src/bison.s1: entered into RCS
23782
237831994-03-26 Richard Stallman <rms@gnu.org>
23784
23785 * bison.simple: entered into RCS
23786
237871994-03-25 Richard Stallman <rms@gnu.org>
23788
23789 * src/main.c: entered into RCS
23790
237911994-03-24 Richard Stallman <rms@gnu.org>
23792
23793 * src/conflicts.c: entered into RCS
23794
237951994-01-02 Richard Stallman <rms@gnu.org>
23796
23797 * Makefile.in: *** empty log message ***
23798
237991993-11-21 Richard Stallman <rms@gnu.org>
23800
23801 * src/bison.s1: *** empty log message ***
23802
238031993-11-21 Richard Stallman <rms@gnu.org>
23804
23805 * doc/bison.texinfo: entered into RCS
23806
23807 * doc/bison.texinfo: *** empty log message ***
23808
238091993-11-21 Richard Stallman <rms@gnu.org>
23810
23811 * bison.simple: *** empty log message ***
23812
238131993-10-25 David J. MacKenzie <djm@gnu.org>
23814
23815 * doc/bison.texinfo: *** empty log message ***
23816
238171993-10-19 Richard Stallman <rms@gnu.org>
23818
23819 * src/bison.s1: *** empty log message ***
23820
238211993-10-19 Richard Stallman <rms@gnu.org>
23822
23823 * bison.simple: *** empty log message ***
23824
238251993-10-14 Richard Stallman <rms@gnu.org>
23826
23827 * src/bison.s1: *** empty log message ***
23828
238291993-10-14 Richard Stallman <rms@gnu.org>
23830
23831 * bison.simple: *** empty log message ***
23832
238331993-09-14 David J. MacKenzie <djm@gnu.org>
23834
23835 * doc/bison.texinfo: *** empty log message ***
23836
238371993-09-13 Noah Friedman <friedman@gnu.org>
23838
23839 * Makefile.in: *** empty log message ***
23840
238411993-09-10 Richard Stallman <rms@gnu.org>
23842
23843 * src/conflicts.c: *** empty log message ***
23844
23845 * src/system.h: entered into RCS
23846
238471993-09-10 Richard Stallman <rms@gnu.org>
23848
23849 * doc/bison.1: entered into RCS
23850
238511993-09-06 Noah Friedman <friedman@gnu.org>
23852
23853 * src/version.c: entered into RCS
23854
238551993-09-06 Noah Friedman <friedman@gnu.org>
23856
23857 * Makefile.in: *** empty log message ***
23858
238591993-07-30 David J. MacKenzie <djm@gnu.org>
23860
23861 * Makefile.in: *** empty log message ***
23862
238631993-07-24 Richard Stallman <rms@gnu.org>
23864
23865 * src/bison.s1: *** empty log message ***
23866
238671993-07-24 Richard Stallman <rms@gnu.org>
23868
23869 * bison.simple: *** empty log message ***
23870
238711993-07-08 David J. MacKenzie <djm@gnu.org>
23872
23873 * Makefile.in: *** empty log message ***
23874
238751993-07-04 Richard Stallman <rms@gnu.org>
23876
23877 * src/bison.s1: *** empty log message ***
23878
238791993-07-04 Richard Stallman <rms@gnu.org>
23880
23881 * bison.simple: *** empty log message ***
23882
238831993-06-26 David J. MacKenzie <djm@gnu.org>
23884
23885 * src/getargs.c: entered into RCS
23886
238871993-06-26 David J. MacKenzie <djm@gnu.org>
23888
23889 * doc/bison.texinfo: *** empty log message ***
23890
23891 * doc/bison.1: New file.
23892
238931993-06-25 Richard Stallman <rms@gnu.org>
23894
23895 * src/getargs.c: New file.
23896
238971993-06-16 Richard Stallman <rms@gnu.org>
23898
23899 * src/bison.s1: *** empty log message ***
23900
239011993-06-16 Richard Stallman <rms@gnu.org>
23902
23903 * bison.simple: *** empty log message ***
23904
239051993-06-03 Richard Stallman <rms@gnu.org>
23906
23907 * src/bison.s1: New file.
23908
239091993-06-03 Richard Stallman <rms@gnu.org>
23910
23911 * doc/bison.texinfo: *** empty log message ***
23912
239131993-06-03 Richard Stallman <rms@gnu.org>
23914
23915 * bison.simple: New file.
23916
239171993-05-19 Richard Stallman <rms@gnu.org>
23918
23919 * doc/bison.texinfo: New file.
23920
239211993-05-07 Noah Friedman <friedman@gnu.org>
23922
23923 * Makefile.in: *** empty log message ***
23924
239251993-04-28 Noah Friedman <friedman@gnu.org>
23926
23927 * src/reader.c: *** empty log message ***
23928
239291993-04-23 Noah Friedman <friedman@gnu.org>
23930
23931 * src/alloc.h: entered into RCS
23932
239331993-04-20 David J. MacKenzie <djm@gnu.org>
23934
23935 * src/version.c: *** empty log message ***
23936
23937 * src/files.c, src/allocate.c:
23938 entered into RCS
23939
23940 * src/reader.c: *** empty log message ***
23941
23942 * src/lex.c: entered into RCS
23943
23944 * src/conflicts.c: New file.
23945
23946 * src/symtab.c: entered into RCS
23947
23948 * src/alloc.h: New file.
23949
23950 * src/LR0.c: entered into RCS
23951
239521993-04-18 Noah Friedman <friedman@gnu.org>
23953
23954 * src/reader.c: New file.
23955
23956 * src/version.c: *** empty log message ***
23957
239581993-04-18 Noah Friedman <friedman@gnu.org>
23959
23960 * Makefile.in: *** empty log message ***
23961
239621993-04-17 Noah Friedman <friedman@gnu.org>
23963
23964 * Makefile.in: *** empty log message ***
23965
239661993-04-15 Richard Stallman <rms@gnu.org>
23967
23968 * src/main.c, src/files.c:
23969 New file.
23970
239711993-04-15 Noah Friedman <friedman@gnu.org>
23972
23973 * configure.in: entered into RCS
23974
23975 * configure.in: *** empty log message ***
23976
23977 * configure.in: New file.
23978
239791993-04-14 Richard Stallman <rms@gnu.org>
23980
23981 * Makefile.in: New file.
23982
239831993-04-13 Richard Stallman <rms@gnu.org>
23984
23985 * src/version.c: New file.
23986
239871993-03-25 Richard Stallman <rms@gnu.org>
23988
23989 * src/output.c: entered into RCS
23990
239911992-09-25 Richard Stallman <rms@gnu.org>
23992
23993 * configure.bat: entered into RCS
23994
239951992-06-22 Richard Stallman <rms@gnu.org>
23996
23997 * src/vmsgetargs.c: entered into RCS
23998
239991992-06-22 Richard Stallman <rms@gnu.org>
24000
24001 * doc/bison.rnh: entered into RCS
24002
240031992-04-20 David J. MacKenzie <djm@gnu.org>
24004
24005 * README: entered into RCS
24006
240071992-01-22 Richard Stallman <rms@gnu.org>
24008
24009 * src/machine.h: entered into RCS
24010
240111991-12-21 Richard Stallman <rms@gnu.org>
24012
24013 * src/lalr.c, src/closure.c:
24014 entered into RCS
24015
240161991-12-20 Richard Stallman <rms@gnu.org>
24017
24018 * src/state.h: entered into RCS
24019
240201991-12-18 Richard Stallman <rms@gnu.org>
24021
24022 * src/print.c, src/nullable.c, src/derives.c:
24023 entered into RCS
24024
240251991-11-03 David J. MacKenzie <djm@gnu.org>
24026
24027 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
24028 entered into RCS
24029
240301988-09-09 Richard Stallman <rms@gnu.org>
24031
24032 * src/bison.hairy: entered into RCS
24033
240341987-12-16 Richard Stallman <rms@gnu.org>
24035
24036 * REFERENCES: entered into RCS
dc546b0f 24037
f294a2c2 24038
04098407 24039 -----
f294a2c2 24040
04098407 24041 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e021191b
JD
24042 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
24043 2008, 2009 Free Software Foundation, Inc.
f294a2c2 24044
04098407
PE
24045 Copying and distribution of this file, with or without
24046 modification, are permitted provided the copyright notice and this
24047 notice are preserved.